netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Luigi Rizzo <lrizzo@google.com>
Cc: brouer@redhat.com, netdev@vger.kernel.org, toke@redhat.com,
	davem@davemloft.net, sameehj@amazon.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] netdev attribute to control xdpgeneric skb linearization
Date: Fri, 28 Feb 2020 13:30:54 +0100	[thread overview]
Message-ID: <20200228133054.47cc4d71@carbon> (raw)
In-Reply-To: <20200228105435.75298-1-lrizzo@google.com>

On Fri, 28 Feb 2020 02:54:35 -0800
Luigi Rizzo <lrizzo@google.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


  parent reply	other threads:[~2020-02-28 12:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 10:54 [PATCH v4] netdev attribute to control xdpgeneric skb linearization Luigi Rizzo
2020-02-28 11:20 ` Toke Høiland-Jørgensen
2020-02-28 12:12 ` Michal Kubecek
2020-02-28 12:29 ` Jesper Dangaard Brouer
2020-02-28 13:19   ` Luigi Rizzo
2020-02-28 12:30 ` Jesper Dangaard Brouer [this message]
2020-02-28 19:00 ` Jakub Kicinski
2020-02-28 23:53   ` Willem de Bruijn
2020-03-03 19:46     ` Daniel Borkmann
2020-03-03 20:50       ` Jakub Kicinski
2020-03-03 21:04         ` Daniel Borkmann
2020-03-03 21:10         ` Willem de Bruijn
2020-03-04  9:18           ` Jesper Dangaard Brouer
2020-03-04 10:06       ` Luigi Rizzo

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=20200228133054.47cc4d71@carbon \
    --to=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrizzo@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=sameehj@amazon.com \
    --cc=toke@redhat.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).