From: jeff.evanson@gmail.com
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
netdev@vger.kernel.org (open list:XDP (eXpress Data Path)),
bpf@vger.kernel.org (open list:XDP (eXpress Data Path))
Cc: Jeff Evanson <jeff.evanson@qsc.com>
Subject: [PATCH v2 0/2] AF_XDP patches for zero-copy in igc driver
Date: Tue, 19 Apr 2022 19:26:33 -0600 [thread overview]
Message-ID: <20220420012635.13733-1-jeff.evanson@qsc.com> (raw)
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
next reply other threads:[~2022-04-20 1:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 1:26 jeff.evanson [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220420012635.13733-1-jeff.evanson@qsc.com \
--to=jeff.evanson@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=jeff.evanson@qsc.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox