mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Liang Chen <liangchen.linux@gmail.com>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, mst@redhat.com,
	hengqi@linux.alibaba.com
Subject: Re: [PATCH v2 2/3] virtio_net: Add missing virtio header in skb for XDP_PASS
Date: Thu, 25 Jan 2024 14:41:03 +0800	[thread overview]
Message-ID: <1706164863.507014-6-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <CACGkMEvQTXmyAeUeWxgxgMPJ3VQJWH1DRnt__Yb0ifnSyuZ7Cw@mail.gmail.com>

On Thu, 25 Jan 2024 11:48:18 +0800, Jason Wang <jasowang@redhat.com> wrote:
> On Wed, Jan 24, 2024 at 5:16 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> >
> > On Wed, 24 Jan 2024 16:57:20 +0800, Liang Chen <liangchen.linux@gmail.com> wrote:
> > > For the XDP_PASS scenario of the XDP path, the skb constructed with
> > > xdp_buff does not include the virtio header. Adding the virtio header
> > > information back when creating the skb.
> > >
> > > Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
> > > ---
> > >  drivers/net/virtio_net.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > > index b56828804e5f..2de46eb4c661 100644
> > > --- a/drivers/net/virtio_net.c
> > > +++ b/drivers/net/virtio_net.c
> > > @@ -1270,6 +1270,9 @@ static struct sk_buff *receive_small_xdp(struct net_device *dev,
> > >       if (unlikely(!skb))
> > >               goto err;
> > >
> > > +     /* Store the original virtio header for subsequent use by the driver. */
> > > +     memcpy(skb_vnet_common_hdr(skb), &virtnet_xdp.hdr, vi->hdr_len);
> >
> > About this, a spec is waiting for voting.
> >
>
> A pointer?

Sorry.

http://lore.kernel.org/all/1704263702-50528-1-git-send-email-hengqi@linux.alibaba.com


>
> > This may change the logic of the csum offset and so on.
>
>  Btw, doesn't it need a new feature bit?

Yes.

But this patch set should not include this.
We may do the similar thing, but the commit log will
include more info about the spec.

Thanks.


>
> Thanks
>
> >
> > Please not do this.
> >
> > Thanks.
> >
> >
> > > +
> > >       if (metasize)
> > >               skb_metadata_set(skb, metasize);
> > >
> > > @@ -1635,6 +1638,9 @@ static struct sk_buff *receive_mergeable_xdp(struct net_device *dev,
> > >               head_skb = build_skb_from_xdp_buff(dev, vi, xdp, xdp_frags_truesz);
> > >               if (unlikely(!head_skb))
> > >                       break;
> > > +             /* Store the original virtio header for subsequent use by the driver. */
> > > +             memcpy(skb_vnet_common_hdr(head_skb), &virtnet_xdp.hdr, vi->hdr_len);
> > > +
> > >               return head_skb;
> > >
> > >       case XDP_TX:
> > > --
> > > 2.40.1
> > >
> >
>

  reply	other threads:[~2024-01-25  6:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  8:57 [PATCH v2 0/3] virtio_net: Support the RX hash XDP hint Liang Chen
2024-01-24  8:57 ` [PATCH v2 1/3] virtio_net: Preserve virtio header before XDP program execution Liang Chen
2024-01-24  9:06   ` Xuan Zhuo
2024-01-25 10:17     ` Liang Chen
2024-01-24  8:57 ` [PATCH v2 2/3] virtio_net: Add missing virtio header in skb for XDP_PASS Liang Chen
2024-01-24  9:14   ` Xuan Zhuo
2024-01-25  3:48     ` Jason Wang
2024-01-25  6:41       ` Xuan Zhuo [this message]
2024-01-25  6:50     ` Liang Chen
2024-01-24 11:04   ` Heng Qi
2024-01-25  6:52     ` Liang Chen
2024-01-24  8:57 ` [PATCH v2 3/3] virtio_net: Support RX hash XDP hint Liang Chen

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=1706164863.507014-6-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=liangchen.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.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

all inboxes | Powered by JetHome®