bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Karlsson <magnus.karlsson@gmail.com>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: "Network Development" <netdev@vger.kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Jonathan Lemon" <jonathan.lemon@gmail.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-foundation.org,
	bpf <bpf@vger.kernel.org>,
	"dust . li" <dust.li@linux.alibaba.com>
Subject: Re: [PATCH net-next v4 05/10] xsk: XDP_SETUP_XSK_POOL support option IFF_NOT_USE_DMA_ADDR
Date: Wed, 14 Apr 2021 09:00:18 +0200	[thread overview]
Message-ID: <CAJ8uoz1_hjUCK5zXheCaxmU6bTSu-saaamcZVeMRJpx2McJx4w@mail.gmail.com> (raw)
In-Reply-To: <20210413031523.73507-6-xuanzhuo@linux.alibaba.com>

On Tue, Apr 13, 2021 at 9:58 AM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
>
> Some devices, such as virtio-net, do not directly use dma addr. These
> devices do not initialize dma after completing the xsk setup, so the dma
> check is skipped here.
>
> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Reviewed-by: Dust Li <dust.li@linux.alibaba.com>

Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>

> ---
>  net/xdp/xsk_buff_pool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
> index 8de01aaac4a0..a7e434de0308 100644
> --- a/net/xdp/xsk_buff_pool.c
> +++ b/net/xdp/xsk_buff_pool.c
> @@ -171,7 +171,7 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
>         if (err)
>                 goto err_unreg_pool;
>
> -       if (!pool->dma_pages) {
> +       if (!(netdev->priv_flags & IFF_NOT_USE_DMA_ADDR) && !pool->dma_pages) {
>                 WARN(1, "Driver did not DMA map zero-copy buffers");
>                 err = -EINVAL;
>                 goto err_unreg_xsk;
> --
> 2.31.0
>

  reply	other threads:[~2021-04-14  7:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  3:15 [PATCH net-next v4 00/10] virtio-net support xdp socket zero copy xmit Xuan Zhuo
2021-04-13  3:15 ` [PATCH net-next v4 01/10] netdevice: priv_flags extend to 64bit Xuan Zhuo
2021-04-13 18:26   ` Jakub Kicinski
2021-04-13  3:15 ` [PATCH net-next v4 02/10] netdevice: add priv_flags IFF_NOT_USE_DMA_ADDR Xuan Zhuo
2021-04-13  3:15 ` [PATCH net-next v4 03/10] virtio-net: " Xuan Zhuo
2021-04-13  3:15 ` [PATCH net-next v4 04/10] xsk: support get page by addr Xuan Zhuo
2021-04-14  6:59   ` Magnus Karlsson
2021-04-13  3:15 ` [PATCH net-next v4 05/10] xsk: XDP_SETUP_XSK_POOL support option IFF_NOT_USE_DMA_ADDR Xuan Zhuo
2021-04-14  7:00   ` Magnus Karlsson [this message]
2021-04-13  3:15 ` [PATCH net-next v4 06/10] virtio-net: unify the code for recycling the xmit ptr Xuan Zhuo
2021-04-14  3:32   ` Jason Wang
2021-04-13  3:15 ` [PATCH net-next v4 07/10] virtio-net: virtnet_poll_tx support budget check Xuan Zhuo
2021-04-14  3:34   ` Jason Wang
2021-04-13  3:15 ` [PATCH net-next v4 08/10] virtio-net: xsk zero copy xmit setup Xuan Zhuo
2021-04-14  4:01   ` Jason Wang
2021-04-14  7:36   ` Magnus Karlsson
2021-04-14  7:51     ` Jason Wang
2021-04-13  3:15 ` [PATCH net-next v4 09/10] virtio-net: xsk zero copy xmit implement wakeup and xmit Xuan Zhuo
2021-04-14  5:46   ` Jason Wang
2021-04-13  3:15 ` [PATCH net-next v4 10/10] virtio-net: xsk zero copy xmit kick by threshold Xuan Zhuo
2021-04-14  5:51   ` Jason Wang

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=CAJ8uoz1_hjUCK5zXheCaxmU6bTSu-saaamcZVeMRJpx2McJx4w@mail.gmail.com \
    --to=magnus.karlsson@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xuanzhuo@linux.alibaba.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).