From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dvora Fuxbrumer Date: Thu, 8 Apr 2021 13:13:36 +0300 Subject: [Intel-wired-lan] [PATCH v5 9/9] igc: Enable TX via AF_XDP zero-copy In-Reply-To: <20210226002308.2348-10-jithu.joseph@intel.com> References: <20210226002308.2348-1-jithu.joseph@intel.com> <20210226002308.2348-10-jithu.joseph@intel.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: On 26/02/2021 02:23, Jithu Joseph wrote: > From: Andre Guedes > > 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 > Signed-off-by: Vedang Patel > Signed-off-by: Jithu Joseph > Reviewed-by: Maciej Fijalkowski > --- > 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