Netdev List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] AF_XDP patches for zero-copy in igc driver
@ 2022-04-20  1:26 jeff.evanson
  2022-04-20  1:26 ` [PATCH v2 1/2] igc: Fix race in igc_xdp_xmit_zc jeff.evanson
  2022-04-20  1:26 ` [PATCH v2 2/2] igc: Trigger proper interrupts in igc_xsk_wakeup jeff.evanson
  0 siblings, 2 replies; 4+ messages in thread
From: jeff.evanson @ 2022-04-20  1:26 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
	open list:XDP (eXpress Data Path),
	open list:XDP (eXpress Data Path)
  Cc: Jeff Evanson

From: Jeff Evanson <jeff.evanson@qsc.com>

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(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-21 20:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-20  1:26 [PATCH v2 0/2] AF_XDP patches for zero-copy in igc driver jeff.evanson
2022-04-20  1:26 ` [PATCH v2 1/2] igc: Fix race in igc_xdp_xmit_zc jeff.evanson
2022-04-20  1:26 ` [PATCH v2 2/2] igc: Trigger proper interrupts in igc_xsk_wakeup jeff.evanson
2022-04-21 20:23   ` Tony Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox