[Intel-wired-lan] [PATCH v5 9/9] igc: Enable TX via AF_XDP zero-copy
dvorax.fuxbrumer at linux.intel.com
Thu Apr 8 10:13:36 UTC 2021
On 26/02/2021 02:23, Jithu Joseph wrote:
> From: Andre Guedes <andre.guedes at intel.com>
> Add support for transmitting packets via AF_XDP zero-copy mechanism.
> The packet transmission itself is implemented by igc_xdp_xmit_zc() which
> is called from igc_clean_tx_irq() when the ring has AF_XDP zero-copy
> enabled. Likewise i40e and ice drivers, the transmission budget used is
> the number of descriptors available on the ring.
> A new tx buffer type is introduced to 'enum igc_tx_buffer_type' to
> indicate the tx buffer uses memory from xsk pool so it can be properly
> cleaned after transmission or when the ring is cleaned.
> The I225 controller has only 4 Tx hardware queues so the main difference
> between igc and other Intel drivers that support AF_XDP zero-copy is
> that there is no tx ring dedicated exclusively to XDP. Instead, tx
> rings are shared between the network stack and XDP, and netdev queue
> lock is used to ensure mutual exclusion. This is the same approach
> implemented to support XDP_TX and XDP_REDIRECT actions.
> Signed-off-by: Andre Guedes <andre.guedes at intel.com>
> Signed-off-by: Vedang Patel <vedang.patel at intel.com>
> Signed-off-by: Jithu Joseph <jithu.joseph at intel.com>
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski at intel.com>
> drivers/net/ethernet/intel/igc/igc.h | 3 +
> drivers/net/ethernet/intel/igc/igc_base.h | 1 +
> drivers/net/ethernet/intel/igc/igc_main.c | 113 +++++++++++++++++++++-
> drivers/net/ethernet/intel/igc/igc_xdp.c | 20 +++-
> 4 files changed, 129 insertions(+), 8 deletions(-)
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer at linux.intel.com>
More information about the Intel-wired-lan