All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Jakub Kicinski <kubakici@wp.pl>
Cc: Michael Chan <michael.chan@broadcom.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	Martin KaFai Lau <kafai@fb.com>
Subject: Re: [PATCH net-next v2 11/12] bnxt_en: Add basic XDP support.
Date: Thu, 2 Feb 2017 15:57:54 -0800	[thread overview]
Message-ID: <20170202235752.GA42563@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <20170202150813.4d94b306@cakuba.netronome.com>

On Thu, Feb 02, 2017 at 03:08:27PM -0800, Jakub Kicinski wrote:
> > +	rcu_read_lock();
> > +	act = bpf_prog_run_xdp(xdp_prog, &xdp);
> > +	rcu_read_unlock();
> > +
> > +	if (orig_data != xdp.data) {
> > +		offset = xdp.data - xdp.data_hard_start;
> > +		len = xdp.data_end - xdp.data;
> 
> If BPF changed the start of the packet and returned XDP_PASS you should
> make sure stack will see the modified packet.  I.e. with adjusted
> offset and len.

that is correct.
skb passed to the stack should see new packet start and len.
Though today it's only useful with tc+cls_bpf on top that can
take advantage of it. Certainly more work is needed in this area
for xdp overall. I don't think we should mix that discussion
with this patch set.

  reply	other threads:[~2017-02-02 23:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 16:55 [PATCH net-next v2 00/12] bnxt_en: Add XDP support Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 01/12] bnxt_en: Refactor rx SKB function Michael Chan
2017-02-02 22:56   ` Jakub Kicinski
2017-02-02 23:40     ` Michael Chan
2017-02-03  0:22       ` Jakub Kicinski
2017-02-03  0:34         ` Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 02/12] bnxt_en: Don't use DEFINE_DMA_UNMAP_ADDR to store DMA address in RX path Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 03/12] bnxt_en: Add bp->rx_dir field for rx buffer DMA direction Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 04/12] bnxt_en: Parameterize RX buffer offsets Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 05/12] bnxt_en: Add RX page mode support Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 06/12] bnxt_en: Use event bit map in RX path Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 07/12] bnxt_en: Centralize logic to reserve rings Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 08/12] bnxt_en: Add tx ring mapping logic Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 09/12] bnxt_en: Add a set of TX rings to support XDP Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 10/12] bnxt_en: Refactor tx completion path Michael Chan
2017-02-02 16:55 ` [PATCH net-next v2 11/12] bnxt_en: Add basic XDP support Michael Chan
2017-02-02 17:18   ` Mintz, Yuval
2017-02-02 21:30     ` Michael Chan
2017-02-02 23:08   ` Jakub Kicinski
2017-02-02 23:57     ` Alexei Starovoitov [this message]
2017-02-02 16:55 ` [PATCH net-next v2 12/12] bnxt_en: Add support for XDP_TX action Michael Chan
2017-02-03 20:49 ` [PATCH net-next v2 00/12] bnxt_en: Add XDP support David Miller
2017-02-03 21:13   ` Michael Chan
2017-02-03 21:50     ` David Miller
2017-02-03 21:58       ` Tom Herbert
2017-02-03 22:02         ` David Miller
2017-02-03 22:25           ` Tom Herbert
2017-02-03 22:29             ` David Miller
2017-02-04  0:33       ` Jakub Kicinski
2017-02-04  1:32         ` Michael Chan
2017-02-04  1:41           ` Jakub Kicinski

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=20170202235752.GA42563@ast-mbp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kafai@fb.com \
    --cc=kubakici@wp.pl \
    --cc=michael.chan@broadcom.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.