BPF List
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	virtualization@lists.linux.dev, bpf@vger.kernel.org
Subject: Re: [PATCH net-next v5 08/15] virtio_net: sq support premapped mode
Date: Tue, 18 Jun 2024 09:31:25 +0800	[thread overview]
Message-ID: <1718674285.282276-1-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <CACGkMEuWCYdvYkxPBodw4cuxDhkszJkA0h9rwDOKVLJFjaxyEw@mail.gmail.com>

On Tue, 18 Jun 2024 09:00:56 +0800, Jason Wang <jasowang@redhat.com> wrote:
> On Mon, Jun 17, 2024 at 3:41 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> >
> > On Mon, 17 Jun 2024 14:28:05 +0800, Jason Wang <jasowang@redhat.com> wrote:
> > > On Mon, Jun 17, 2024 at 1:00 PM Jason Wang <jasowang@redhat.com> wrote:
> > > >
> > > > On Fri, Jun 14, 2024 at 2:39 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > > > >
> > > > > If the xsk is enabling, the xsk tx will share the send queue.
> > > > > But the xsk requires that the send queue use the premapped mode.
> > > > > So the send queue must support premapped mode when it is bound to
> > > > > af-xdp.
> > > > >
> > > > > * virtnet_sq_set_premapped(sq, true) is used to enable premapped mode.
> > > > >
> > > > >     In this mode, the driver will record the dma info when skb or xdp
> > > > >     frame is sent.
> > > > >
> > > > >     Currently, the SQ premapped mode is operational only with af-xdp. In
> > > > >     this mode, af-xdp, the kernel stack, and xdp tx/redirect will share
> > > > >     the same SQ. Af-xdp independently manages its DMA. The kernel stack
> > > > >     and xdp tx/redirect utilize this DMA metadata to manage the DMA
> > > > >     info.
> > > > >
> > >
> > > Note that there's indeed a mode when we have exclusive XDP TX queue:
> > >
> > >         /* XDP requires extra queues for XDP_TX */
> > >         if (curr_qp + xdp_qp > vi->max_queue_pairs) {
> > >                 netdev_warn_once(dev, "XDP request %i queues but max
> > > is %i. XDP_TX and XDP_REDIRECT will operate in a slower locked tx
> > > mode.\n",
> > >                                  curr_qp + xdp_qp, vi->max_queue_pairs);
> > >                 xdp_qp = 0;
> > >         }
> > >
> > > So we need to mention how the code works in this patch.
> >
> > Sorry, I do not get it.
> >
> > Could you say more?
>
> I meant in the commit log, you said:
>
> """
> In this mode, af-xdp, the kernel stack, and xdp tx/redirect will share
> the same SQ.
> """
>
> is not correct if we have sufficient queue pairs.
>
> We need to tweak it and explain if the code can still work if we have
> exclusive XDP TX queues.


YES, it can work.

I will explain in next version.

Thanks.


>
> Thanks
>
> >
> > Thanks.
> >
> >
> > >
> > > Thanks
> > >
> >
>

  reply	other threads:[~2024-06-18  1:32 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14  6:39 [PATCH net-next v5 00/15] virtio-net: support AF_XDP zero copy Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 01/15] virtio_ring: introduce dma map api for page Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 02/15] virtio_ring: introduce vring_need_unmap_buffer Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 03/15] virtio_ring: virtqueue_set_dma_premapped() support to disable Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 04/15] virtio_net: separate virtnet_rx_resize() Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 05/15] virtio_net: separate virtnet_tx_resize() Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 06/15] virtio_net: separate receive_buf Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 07/15] virtio_net: refactor the xmit type Xuan Zhuo
2024-06-17  5:00   ` Jason Wang
2024-06-17  7:21     ` Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 08/15] virtio_net: sq support premapped mode Xuan Zhuo
2024-06-17  5:00   ` Jason Wang
2024-06-17  6:28     ` Jason Wang
2024-06-17  7:40       ` Xuan Zhuo
2024-06-18  1:00         ` Jason Wang
2024-06-18  1:31           ` Xuan Zhuo [this message]
2024-06-17  7:23     ` Xuan Zhuo
2024-06-18  0:57       ` Jason Wang
2024-06-18  0:59         ` Jason Wang
2024-06-18  1:34         ` Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 09/15] virtio_net: xsk: bind/unbind xsk Xuan Zhuo
2024-06-17  6:19   ` Jason Wang
2024-06-17  7:43     ` Xuan Zhuo
2024-06-18  1:04       ` Jason Wang
2024-06-18  1:36         ` Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 10/15] virtio_net: xsk: prevent disable tx napi Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 11/15] virtio_net: xsk: tx: support xmit xsk buffer Xuan Zhuo
2024-06-17  6:30   ` Jason Wang
2024-06-17  7:51     ` Xuan Zhuo
2024-06-18  1:06       ` Jason Wang
2024-06-18  1:40         ` Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 12/15] virtio_net: xsk: tx: support wakeup Xuan Zhuo
2024-06-17  6:31   ` Jason Wang
2024-06-14  6:39 ` [PATCH net-next v5 13/15] virtio_net: xsk: tx: handle the transmitted xsk buffer Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 14/15] virtio_net: xsk: rx: support fill with " Xuan Zhuo
2024-06-14  6:39 ` [PATCH net-next v5 15/15] virtio_net: xsk: rx: support recv small mode Xuan Zhuo
2024-06-17  7:10   ` Jason Wang
2024-06-17  7:55     ` Xuan Zhuo

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=1718674285.282276-1-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /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