netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: David Miller <davem@davemloft.net>, Yuval.Mintz@cavium.com
Cc: netdev@vger.kernel.org
Subject: Re: XDP question - how much can BPF change in xdp_buff?
Date: Mon, 31 Oct 2016 12:22:33 -0700	[thread overview]
Message-ID: <581799F9.6060704@gmail.com> (raw)
In-Reply-To: <20161031.145734.1243544464767231445.davem@davemloft.net>

On 16-10-31 11:57 AM, David Miller wrote:
> From: "Mintz, Yuval" <Yuval.Mintz@cavium.com>
> Date: Mon, 31 Oct 2016 18:31:30 +0000
> 
>> So I've [finally] started looking into implementing XDP
>> for qede, and there's one thing I feel like I'm missing in
>> regard to XDP_TX - what's the guarantee/requirement
>> that the bpf program isn't going to transmute some fields
>> of the rx packet in a way that would prevent the forwarding?
>>
>> E.g., can a BPF change the TCP payload of an incoming packet
>> without correcting its TCP checksum, and then expect the
>> driver to transmit it [via XDP_TX]? If not, how is this enforced [if at all]?
>>
>> [Looked at samples/bpf/xdp2_kern.c which manipulates the
>> UDP header; so I'm not certain what prevents it from doing
>> the same when checksum modifications would be required]
> 
> My understanding is that the eBPF program would be responsible
> for updating the checksum if it mangles the packet in such a
> way that such a fixup would be required.
> 

For XDP we will probably need to add support for at minimum the
following helpers,

	bpf_l3_csum_replace
	bpf_l4_csum_replace

Thanks,
John

  reply	other threads:[~2016-10-31 19:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31 18:31 XDP question - how much can BPF change in xdp_buff? Mintz, Yuval
2016-10-31 18:57 ` David Miller
2016-10-31 19:22   ` John Fastabend [this message]
2016-10-31 21:18     ` Thomas Graf
2016-10-31 20:29 ` Tom Herbert
2016-11-01  6:45   ` Mintz, Yuval
2016-11-01  7:06     ` Mintz, Yuval

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=581799F9.6060704@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=Yuval.Mintz@cavium.com \
    --cc=davem@davemloft.net \
    --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 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).