diff options
author | Jan Sokolowski <jan.sokolowski@intel.com> | 2019-03-22 14:16:37 -0700 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-06-05 13:04:29 -0700 |
commit | d49e286d354e75710cc9d100197de1161a8b809e (patch) | |
tree | 9e8c1a118518ffee1ec0ffc514d9e9df0c585d3e /drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | |
parent | 11694b03616b2a03cd7e3f0897d4d086c7fbc4b5 (diff) |
ixgbe: add tracking of AF_XDP zero-copy state for each queue pair
Here, we add a bitmap to the ixgbe_adapter that tracks if a
certain queue pair has been "zero-copy enabled" via the ndo_bpf.
The bitmap is used in ixgbe_xsk_umem, and enables zero-copy if
and only if XDP is enabled, the corresponding qid in the bitmap
is set, and the umem is non-NULL;
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c index bfe95ce0bd7f..b9f05fbdbf67 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -15,7 +15,8 @@ struct xdp_umem *ixgbe_xsk_umem(struct ixgbe_adapter *adapter, int qid = ring->ring_idx; if (!adapter->xsk_umems || !adapter->xsk_umems[qid] || - qid >= adapter->num_xsk_umems || !xdp_on) + qid >= adapter->num_xsk_umems || !xdp_on || + !test_bit(qid, adapter->af_xdp_zc_qps)) return NULL; return adapter->xsk_umems[qid]; @@ -143,6 +144,7 @@ static int ixgbe_xsk_umem_enable(struct ixgbe_adapter *adapter, if (if_running) ixgbe_txrx_ring_disable(adapter, qid); + set_bit(qid, adapter->af_xdp_zc_qps); err = ixgbe_add_xsk_umem(adapter, umem, qid); if (err) return err; @@ -173,6 +175,7 @@ static int ixgbe_xsk_umem_disable(struct ixgbe_adapter *adapter, u16 qid) if (if_running) ixgbe_txrx_ring_disable(adapter, qid); + clear_bit(qid, adapter->af_xdp_zc_qps); ixgbe_xsk_umem_dma_unmap(adapter, adapter->xsk_umems[qid]); ixgbe_remove_xsk_umem(adapter, qid); |