public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Tushar Dave <tushar.n.dave@oracle.com>
Cc: ast@kernel.org, daniel@iogearbox.net, davem@davemloft.net,
	santosh.shilimkar@oracle.com, jakub.kicinski@netronome.com,
	quentin.monnet@netronome.com, jiong.wang@netronome.com,
	sandipan@linux.vnet.ibm.com, john.fastabend@gmail.com,
	kafai@fb.com, rdna@fb.com, yhs@fb.com, netdev@vger.kernel.org,
	rds-devel@oss.oracle.com, sowmini.varadhan@oracle.com
Subject: Re: [PATCH net-next 5/5] ebpf: Add sample ebpf program for SOCKET_SG_FILTER
Date: Tue, 11 Sep 2018 21:00:39 -0700	[thread overview]
Message-ID: <20180912040038.oobnr4yfzoaajk6k@ast-mbp> (raw)
In-Reply-To: <1536694684-3200-6-git-send-email-tushar.n.dave@oracle.com>

On Tue, Sep 11, 2018 at 09:38:04PM +0200, Tushar Dave wrote:
> Add a sample program that shows how socksg program is used and attached
> to socket filter. The kernel sample program deals with struct
> scatterlist that is passed as bpf context.
> 
> When run in server mode, the sample RDS program opens PF_RDS socket,
> attaches eBPF program to RDS socket which then uses bpf_msg_pull_data
> helper to inspect packet data contained in struct scatterlist and
> returns appropriate action code back to kernel.
> 
> To ease testing, RDS client functionality is also added so that users
> can generate RDS packet.
> 
> Server:
> [root@lab71 bpf]# ./rds_filter -s 192.168.3.71 -t tcp
> running server in a loop
> transport tcp
> server bound to address: 192.168.3.71 port 4000
> server listening on 192.168.3.71
> 
> Client:
> [root@lab70 bpf]# ./rds_filter -s 192.168.3.71 -c 192.168.3.70 -t tcp
> transport tcp
> client bound to address: 192.168.3.70 port 25278
> client sending 8192 byte message  from 192.168.3.70 to 192.168.3.71 on
> port 25278
> payload contains:30 31 32 33 34 35 36 37 38 39 ...
> 
> Server output:
> 192.168.3.71 received a packet from 192.168.3.71 of len 8192 cmsg len 0,
> on port 25278
> payload contains:30 31 32 33 34 35 36 37 38 39 ...
> server listening on 192.168.3.71
> 
> [root@lab71 tushar]# cat /sys/kernel/debug/tracing/trace_pipe
>           <idle>-0     [038] ..s.   146.947362: 0: 30 31 32
>           <idle>-0     [038] ..s.   146.947364: 0: 33 34 35
> 
> Similarly specifying '-t ib' will run this on IB link.
> 
> Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---
>  samples/bpf/Makefile          |   3 +
>  samples/bpf/rds_filter_kern.c |  42 ++++++
>  samples/bpf/rds_filter_user.c | 339 ++++++++++++++++++++++++++++++++++++++++++

please no samples.
Add this as proper test to tools/testing/selftests/bpf
that reports PASS/FAIL and can be run automatically.
samples/bpf is effectively dead code.

  reply	other threads:[~2018-09-12  9:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 19:37 [PATCH net-next 0/5] eBPF and struct scatterlist Tushar Dave
2018-09-11 19:38 ` [PATCH net-next 1/5] bpf: use __GFP_COMP while allocating page Tushar Dave
2018-09-12 16:21   ` Tushar Dave
2018-09-12 16:51     ` John Fastabend
2018-09-12 20:15       ` Tushar Dave
2018-09-11 19:38 ` [PATCH net-next 2/5] eBPF: Add new eBPF prog type BPF_PROG_TYPE_SOCKET_SG_FILTER Tushar Dave
2018-09-12  3:57   ` Alexei Starovoitov
2018-09-12 19:25     ` Tushar Dave
2018-09-11 19:38 ` [PATCH net-next 3/5] ebpf: Add sg_filter_run() Tushar Dave
2018-09-12  3:58   ` Alexei Starovoitov
2018-09-12 19:27     ` Tushar Dave
2018-09-11 19:38 ` [PATCH net-next 4/5] rds: invoke socket sg filter attached to rds socket Tushar Dave
2018-09-11 21:06   ` santosh.shilimkar
2018-09-11 19:38 ` [PATCH net-next 5/5] ebpf: Add sample ebpf program for SOCKET_SG_FILTER Tushar Dave
2018-09-12  4:00   ` Alexei Starovoitov [this message]
2018-09-12 19:32     ` Tushar Dave
2018-09-13  0:59       ` Sowmini Varadhan
2018-09-13  2:07         ` Alexei Starovoitov
2018-09-13 10:10           ` Sowmini Varadhan
2018-09-17 23:15             ` Alexei Starovoitov
2018-09-17 23:23               ` Sowmini Varadhan
2018-09-17 23:26                 ` Alexei Starovoitov

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=20180912040038.oobnr4yfzoaajk6k@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiong.wang@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 \
    --cc=rds-devel@oss.oracle.com \
    --cc=sandipan@linux.vnet.ibm.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=sowmini.varadhan@oracle.com \
    --cc=tushar.n.dave@oracle.com \
    --cc=yhs@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