All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lobakin <alexandr.lobakin@intel.com>
To: Jesper Dangaard Brouer <jbrouer@redhat.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	brouer@redhat.com, netdev@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, bjorn@kernel.org,
	Jakub Kicinski <kuba@kernel.org>,
	bpf@vger.kernel.org, Daniel Borkmann <borkmann@iogearbox.net>,
	"David S. Miller" <davem@davemloft.net>,
	magnus.karlsson@intel.com
Subject: Re: [Intel-wired-lan] [PATCH net-next 1/2] igc: AF_XDP zero-copy metadata adjust breaks SKBs on XDP_PASS
Date: Fri, 26 Nov 2021 16:54:08 +0100	[thread overview]
Message-ID: <20211126155408.147211-1-alexandr.lobakin@intel.com> (raw)
In-Reply-To: <66f62ef7-f4c6-08df-a8e1-dbbe34b9b125@redhat.com>

From: Jesper Dangaard Brouer <jbrouer@redhat.com>
Date: Fri, 26 Nov 2021 16:32:47 +0100

> On 26/11/2021 16.25, Maciej Fijalkowski wrote:
> > On Mon, Nov 15, 2021 at 09:36:25PM +0100, Jesper Dangaard Brouer wrote:
> >> Driver already implicitly supports XDP metadata access in AF_XDP
> >> zero-copy mode, as xsk_buff_pool's xp_alloc() naturally set xdp_buff
> >> data_meta equal data.
> >>
> >> This works fine for XDP and AF_XDP, but if a BPF-prog adjust via
> >> bpf_xdp_adjust_meta() and choose to call XDP_PASS, then igc function
> >> igc_construct_skb_zc() will construct an invalid SKB packet. The
> >> function correctly include the xdp->data_meta area in the memcpy, but
> >> forgot to pull header to take metasize into account.
> >>
> >> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
> >> Signed-off-by: Jesper Dangaard Brouer<brouer@redhat.com>
> > Acked-by: Maciej Fijalkowski<maciej.fijalkowski@intel.com>
> > 
> > Great catch. Will take a look at other ZC enabled Intel drivers if they
> > are affected as well.

They are. We'll cover them in a separate series, much thanks for
revealing that (:

> Thanks a lot for taking this task!!! :-)
> --Jesper

Al

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Lobakin <alexandr.lobakin@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next 1/2] igc: AF_XDP zero-copy metadata adjust breaks SKBs on XDP_PASS
Date: Fri, 26 Nov 2021 16:54:08 +0100	[thread overview]
Message-ID: <20211126155408.147211-1-alexandr.lobakin@intel.com> (raw)
In-Reply-To: <66f62ef7-f4c6-08df-a8e1-dbbe34b9b125@redhat.com>

From: Jesper Dangaard Brouer <jbrouer@redhat.com>
Date: Fri, 26 Nov 2021 16:32:47 +0100

> On 26/11/2021 16.25, Maciej Fijalkowski wrote:
> > On Mon, Nov 15, 2021 at 09:36:25PM +0100, Jesper Dangaard Brouer wrote:
> >> Driver already implicitly supports XDP metadata access in AF_XDP
> >> zero-copy mode, as xsk_buff_pool's xp_alloc() naturally set xdp_buff
> >> data_meta equal data.
> >>
> >> This works fine for XDP and AF_XDP, but if a BPF-prog adjust via
> >> bpf_xdp_adjust_meta() and choose to call XDP_PASS, then igc function
> >> igc_construct_skb_zc() will construct an invalid SKB packet. The
> >> function correctly include the xdp->data_meta area in the memcpy, but
> >> forgot to pull header to take metasize into account.
> >>
> >> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
> >> Signed-off-by: Jesper Dangaard Brouer<brouer@redhat.com>
> > Acked-by: Maciej Fijalkowski<maciej.fijalkowski@intel.com>
> > 
> > Great catch. Will take a look at other ZC enabled Intel drivers if they
> > are affected as well.

They are. We'll cover them in a separate series, much thanks for
revealing that (:

> Thanks a lot for taking this task!!! :-)
> --Jesper

Al

  reply	other threads:[~2021-11-26 16:01 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 20:36 [PATCH net-next 0/2] igc: driver change to support XDP metadata Jesper Dangaard Brouer
2021-11-15 20:36 ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-11-15 20:36 ` [PATCH net-next 1/2] igc: AF_XDP zero-copy metadata adjust breaks SKBs on XDP_PASS Jesper Dangaard Brouer
2021-11-15 20:36   ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-11-21 10:32   ` Kraus, NechamaX
2021-11-21 10:32     ` Kraus, NechamaX
2021-11-26 15:25   ` Maciej Fijalkowski
2021-11-26 15:25     ` Maciej Fijalkowski
2021-11-26 15:32     ` Jesper Dangaard Brouer
2021-11-26 15:32       ` Jesper Dangaard Brouer
2021-11-26 15:54       ` Alexander Lobakin [this message]
2021-11-26 15:54         ` Alexander Lobakin
2021-11-15 20:36 ` [PATCH net-next 2/2] igc: enable XDP metadata in driver Jesper Dangaard Brouer
2021-11-15 20:36   ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-11-21 10:33   ` Kraus, NechamaX
2021-11-21 10:33     ` Kraus, NechamaX
2021-11-26 16:16   ` Alexander Lobakin
2021-11-26 16:16     ` [Intel-wired-lan] " Alexander Lobakin
2021-11-29 14:39     ` Jesper Dangaard Brouer
2021-11-29 14:39       ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-11-29 14:53       ` Alexander Lobakin
2021-11-29 14:53         ` [Intel-wired-lan] " Alexander Lobakin
2021-11-29 18:13         ` Alexander Lobakin
2021-11-29 18:13           ` [Intel-wired-lan] " Alexander Lobakin
2021-11-29 19:03           ` Nguyen, Anthony L
2021-11-29 19:03             ` [Intel-wired-lan] " Nguyen, Anthony L
2021-11-30 11:25             ` Jesper Dangaard Brouer
2021-11-30 11:25               ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-11-29 14:10 ` [PATCH net-next 0/2] igc: driver change to support XDP metadata Alexander Lobakin
2021-11-29 14:10   ` [Intel-wired-lan] " Alexander Lobakin
2021-11-29 14:29   ` Jesper Dangaard Brouer
2021-11-29 14:29     ` [Intel-wired-lan] " Jesper Dangaard Brouer
2021-11-29 14:41     ` Alexander Lobakin
2021-11-29 14:41       ` [Intel-wired-lan] " Alexander Lobakin

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=20211126155408.147211-1-alexandr.lobakin@intel.com \
    --to=alexandr.lobakin@intel.com \
    --cc=bjorn@kernel.org \
    --cc=borkmann@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jbrouer@redhat.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.