Skip to content

AF_XDP patches for zero-copy in igc driver

[email protected] bpf intel-wired-lan lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2igc: Fix race in igc_xdp_xmit_zcdrivers/net/ethernet/intel/igc/igc_main.c+3 -10 replies
2/2igc: Trigger proper interrupts in igc_xsk_wakeupdrivers/net/ethernet/intel/igc/igc_main.c+31 -91 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] AF_XDP patches for zero-copy in igc driver

From: Jeff Evanson <[email protected]>

Patch 1/2
In igc_xdp_xmit_zc, the local variable ntu is initialized from ring->next_to_use without holding the __netif_tx_lock. If another thread already held the lock, the ntu value is potentially incorrect. Various bad behaviors were observed ranging from transmit timeouts to an outright hard-lock of the host. The behavior is corrected by simply initializing ntu while __netif_tx_lock is held.

Patch 2/2
In igc_xsk_wakeup, only the q_vector interrupt for the passed queue_id was being triggered. This worked fine so long as both the tx and rx queues shared the same interrupt. If the tx and rx queues use separate interrupts, only the rx interrupt would be triggered, regardless of whether flags contained XDP_WAKEUP_TX. This patch changes the behavior so that q_vectors (rxq_vector and txq_vector) are looked up from the referenced tx and/or rx queues instead of from the adapter q_vector array. If only XDP_WAKEUP_RX is set, rxq_vector is triggered. If only XDP_WAKEUP_TX is set txq_vector is triggered. If both are set, rxq_vector is triggered and txq_vector is triggered only if it is not equal to rxq_vector.
The bad behavior here is apparent when packets are queued up to an AF_XDP socket and then sendmsg is called on the socket. The packets would not be sent until the q_vector was triggered via some other mechanism (IE igc_xmit_frame).

Jeff Evanson (2):
igc: Fix race in igc_xdp_xmit_zc
igc: Trigger proper interrupts in igc_xsk_wakeup

 drivers/net/ethernet/intel/igc/igc_main.c | 44 +++++++++++++++++------
 1 file changed, 34 insertions(+), 10 deletions(-)
Signature · 1 line
2.17.1