netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH net-next 11/11] net: enetc: add TX support for zero-copy XDP sockets
Date: Wed, 8 Feb 2023 18:17:52 +0100	[thread overview]
Message-ID: <Y+PZQBWRqyNf9GlS@boxer> (raw)
In-Reply-To: <20230208170815.nsq77mpkpf7aamhg@skbuf>

On Wed, Feb 08, 2023 at 07:08:15PM +0200, Vladimir Oltean wrote:
> Hi Maciej,
> 
> On Wed, Feb 08, 2023 at 05:37:35PM +0100, Maciej Fijalkowski wrote:
> > On Mon, Feb 06, 2023 at 12:08:37PM +0200, Vladimir Oltean wrote:
> > 
> > Hey Vladimir,
> > 
> > > Schedule NAPI by hand from enetc_xsk_wakeup(), and send frames from the
> > > XSK TX queue from NAPI context. Add them to the completion queue from
> > > the enetc_clean_tx_ring() procedure which is common for all kinds of
> > > traffic.
> > > 
> > > We reuse one of the TX rings for XDP (XDP_TX/XDP_REDIRECT) for XSK as
> > > well. They are already cropped from the TX rings that the network stack
> > > can use when XDP is enabled (with or without AF_XDP).
> > > 
> > > As for XDP_REDIRECT calling enetc's ndo_xdp_xmit, I'm not sure if that
> > > can run simultaneously with enetc_poll() (on different CPUs, but towards
> > > the same TXQ). I guess it probably can, but idk what to do about it.
> > > The problem is that enetc_xdp_xmit() sends to
> > > priv->xdp_tx_ring[smp_processor_id()], while enetc_xsk_xmit() and XDP_TX
> > > send to priv->xdp_tx_ring[NAPI instance]. So when the NAPI instance runs
> > 
> > Why not use cpu id on the latter then?
> 
> Hmm, because I want the sendto() syscall to trigger wakeup of the NAPI
> that sends traffic to the proper queue_id, rather than to the queue_id
> affine to the CPU that the sendto() syscall was made?

Ok i was referring to the thing that using cpu id on both sides would
address concurrency. Regarding your need, what i did for ice was that i
assign xdp_ring to the rx_ring and within ndo_xsk_wakeup() i pick the
rx_ring based on queue_id that comes as an arg:

https://lore.kernel.org/bpf/20220822163257.2382487-3-anthony.l.nguyen@intel.com/

  reply	other threads:[~2023-02-08 17:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 10:08 [RFC PATCH net-next 00/11] NXP ENETC AF_XDP zero-copy sockets Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 01/11] net: enetc: optimize struct enetc_rx_swbd layout Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 02/11] net: enetc: perform XDP RX queue registration at enetc_setup_bpf() time Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 03/11] net: enetc: rename "cleaned_cnt" to "buffs_missing" Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 04/11] net: enetc: continue NAPI processing on frames with RX errors Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 05/11] net: enetc: add support for ethtool --show-channels Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 06/11] net: enetc: consolidate rx_swbd freeing Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 07/11] net: enetc: rename enetc_free_tx_frame() to enetc_free_tx_swbd() Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 08/11] net: enetc: increment rx_byte_cnt for XDP data path Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 09/11] net: enetc: move setting of ENETC_TXBD_FLAGS_F flag to enetc_xdp_map_tx_buff() Vladimir Oltean
2023-02-06 10:08 ` [RFC PATCH net-next 10/11] net: enetc: add RX support for zero-copy XDP sockets Vladimir Oltean
2023-02-08 16:36   ` Maciej Fijalkowski
2023-02-06 10:08 ` [RFC PATCH net-next 11/11] net: enetc: add TX " Vladimir Oltean
2023-02-06 10:19   ` Vladimir Oltean
2023-02-08 16:38     ` Maciej Fijalkowski
2023-02-08 16:37   ` Maciej Fijalkowski
2023-02-08 17:08     ` Vladimir Oltean
2023-02-08 17:17       ` Maciej Fijalkowski [this message]
2023-03-20 16:30         ` Vladimir Oltean
2023-02-08 16:41 ` [RFC PATCH net-next 00/11] NXP ENETC AF_XDP zero-copy sockets Maciej Fijalkowski

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=Y+PZQBWRqyNf9GlS@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=claudiu.manoil@nxp.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.com \
    /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;
as well as URLs for NNTP newsgroup(s).