[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200228133054.47cc4d71@carbon>
Date: Fri, 28 Feb 2020 13:30:54 +0100
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Luigi Rizzo <lrizzo@...gle.com>
Cc: brouer@...hat.com, netdev@...r.kernel.org, toke@...hat.com,
davem@...emloft.net, sameehj@...zon.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] netdev attribute to control xdpgeneric skb
linearization
On Fri, 28 Feb 2020 02:54:35 -0800
Luigi Rizzo <lrizzo@...gle.com> wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index dbbfff123196..c539489d3166 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4520,9 +4520,12 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
> /* XDP packets must be linear and must have sufficient headroom
> * of XDP_PACKET_HEADROOM bytes. This is the guarantee that also
> * native XDP provides, thus we need to do it here as well.
> + * For non shared skbs, xdpgeneric_linearize controls linearization.
> */
> - if (skb_cloned(skb) || skb_is_nonlinear(skb) ||
> - skb_headroom(skb) < XDP_PACKET_HEADROOM) {
> + if (skb_cloned(skb) ||
> + (skb->dev->xdpgeneric_linearize &&
> + (skb_is_nonlinear(skb) ||
> + skb_headroom(skb) < XDP_PACKET_HEADROOM))) {
> int hroom = XDP_PACKET_HEADROOM - skb_headroom(skb);
> int troom = skb->tail + skb->data_len - skb->end;
Have you checked that calling bpf_xdp_adjust_tail() is not breaking anything?
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists