netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tushar Dave <tushar.n.dave@oracle.com>
To: Daniel Borkmann <daniel@iogearbox.net>,
	netdev@vger.kernel.org, ast@kernel.org, davem@davemloft.net,
	john.fastabend@gmail.com, jakub.kicinski@netronome.com,
	kafai@fb.com, rdna@fb.com, quentin.monnet@netronome.com,
	brakmo@fb.com, acme@redhat.com
Subject: Re: [RFC PATCH 1/3] ebpf: add next_skb_frag bpf helper for sk filter
Date: Fri, 8 Jun 2018 15:24:12 -0700	[thread overview]
Message-ID: <f28447e6-c0cb-e27e-ce67-cd2c31c1f5c4@oracle.com> (raw)
In-Reply-To: <39186936-9af3-f609-7b2a-26c908558a5a@oracle.com>



On 06/08/2018 02:46 PM, Tushar Dave wrote:
> 
> 
> On 06/08/2018 02:27 PM, Daniel Borkmann wrote:
>> On 06/08/2018 11:00 PM, Tushar Dave wrote:
>>> Today socket filter only deals with linear skbs. This change allows
>>> ebpf programs to look into non-linear skb e.g. skb frags. This will be
>>> useful when users need to look into data which is not contained in the
>>> linear part of skb.
>>
>> Hmm, I don't think this statement is correct in its form here ... they
>> can handle non-linear skbs just fine.
> Thanks Daniel for your reply.
>>
>> Straight forward way is to use bpf_skb_load_bytes(). It's simple and uses
>> internally skb_header_pointer(), and that one of course walks everything
>> if it really has to via skb_copy_bits() (page frags _and_ frag list). And
>> if you need to look into mac/net headers that may otherwise not be 
>> accessible
>> anymore from socket layer, there's bpf_skb_load_bytes_relative() helper
>> which is effectively doing the negative offset trick from ld_abs/ind more
>> efficient for multi-byte loads.
> I'm looking into bpf_skb_load_bytes and friends.

Daniel,

While I am trying to see if I can use exiting bpf_skb_load helpers, I am
wondering socket filter based ebpf program are allowed to change packet
data? In other words, can we use them to build firewall?

Thanks.

-Tushar
> 
> Thanks.
> -Tushar
>>
>> Thanks,
>> Daniel
>>
> 

  reply	other threads:[~2018-06-08 22:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 21:00 [RFC PATCH 0/3] BPF socket filter to deal with skb frags Tushar Dave
2018-06-08 21:00 ` [RFC PATCH 1/3] ebpf: add next_skb_frag bpf helper for sk filter Tushar Dave
2018-06-08 21:27   ` Daniel Borkmann
2018-06-08 21:46     ` Tushar Dave
2018-06-08 22:24       ` Tushar Dave [this message]
2018-06-08 21:00 ` [RFC PATCH 2/3] samples/bpf: add sample RDS program Tushar Dave
2018-06-08 21:00 ` [RFC PATCH 3/3] rds: invoke sk filter attached to rds socket Tushar Dave

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=f28447e6-c0cb-e27e-ce67-cd2c31c1f5c4@oracle.com \
    --to=tushar.n.dave@oracle.com \
    --cc=acme@redhat.com \
    --cc=ast@kernel.org \
    --cc=brakmo@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.monnet@netronome.com \
    --cc=rdna@fb.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).