DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@mellanox.com>
To: Jason Wang <jasowang@redhat.com>, "dev@dpdk.org" <dev@dpdk.org>,
	"Pascal Mazon" <pascal.mazon@6wind.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, Olga Shern <olgas@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v3 0/2] TAP RSS eBPF cover letter
Date: Wed, 10 Jan 2018 15:34:21 +0000	[thread overview]
Message-ID: <AM0PR0502MB3875284121FC06ACAD37AEB3D1110@AM0PR0502MB3875.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <a9d36808-e482-f234-76a0-ec4cf0a16ab5@redhat.com>

Hi Jason,
Thanks for your inputs.
Please see inline

> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Wednesday, January 10, 2018 12:11 PM
> To: Ophir Munk <ophirmu@mellanox.com>; dev@dpdk.org; Pascal Mazon
> <pascal.mazon@6wind.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; Olga Shern
> <olgas@mellanox.com>
> Subject: Re: [dpdk-dev] [PATCH v3 0/2] TAP RSS eBPF cover letter
> 
> 
> 
> On 2018年01月10日 15:06, Ophir Munk wrote:
> > The patches of TAP RSS eBPF follow the RFC on this issue
> >
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdpd
> >
> k.org%2Fdev%2Fpatchwork%2Fpatch%2F31781%2F&data=02%7C01%7Coph
> irmu%40me
> >
> llanox.com%7C8edca4ebac3440cf465c08d55812768b%7Ca652971c7d2e4d9
> ba6a4d1
> >
> 49256f461b%7C0%7C0%7C636511758701461920&sdata=2WBaV4iU9kE5ub
> o2lgL0adDH
> > %2BcTxce6SP4KBevyRcsI%3D&reserved=0
> >
> > v3 changes with respect to v2
> > =============================
> > * Add support for IPv6 RSS in BPF program
> > * Bug fixes
> > * Updated compatibility to kernel versions:
> >    eBPF requires Linux version 4.9 configured with BPF
> > * New license header (SPDX) for newly added files
> >
> > v2 changes with respect to v1
> > =============================
> > * v2 has new commits organization (3 --> 2)
> > * BPF program was revised. It is successfully tested on
> >    IPv4 L3 L4 layers (compatible to mlx4 device)
> > * Licensing: no comments received for using "Dual BSD/GPL"
> >    string during BPF program loading to the kernel.
> >    (v1 and v2 are using the same license strings)
> >    Any comments are welcome.
> > * Compatibility to kernel versions:
> >    eBPF requires Linux version 4.2 configured with BPF. TAP PMD will
> >    successfully compile on systems with old or non-BPF configured kernels.
> >    During compilation time the required Linux headers are searched for.
> >    If they are not present missing definitions are locally added
> >    (tap_autoconf.h).
> >    If the kernel cannot support a BPF operation - at runtime it will
> >    gracefully reject the netlink message (with BPF) sent to it.
> >
> > Commit #1:
> > net/tap: add eBPF instructions to TAP device
> > ===========================================
> >    This commit introduces BPF program (tap_bpf_program.c)
> >    with a classifier and an action sections.
> >    The current implementation calculates RSS hash
> >    over L3 addresses and L4 ports.
> >    BPF program compilation is not part of dpdk compilation.
> >    This commit includes the eBPF machine instructions
> >    in the format of C arrays (tap_bpf_insns.c).
> >
> >    The option to update the BPF program and download new machine
> >    instructions will be described in another commit.
> >
> > Commit #2:
> > net/tap: implement RSS with eBPF classifier and action
> > ======================================================
> > This commit builds and sends netlink messages to the kernel that
> > include BPF programs.
> > There is a single BPF classifier for each TAP queue. Packets marked
> > with an RSS queue will be directed to this queue using a traffic
> > control with "skbedit" action otherwise they will be pipelined to the
> > following rules.
> > There is a single BPF action for each RSS rule (may add more to
> > support IPv6).
> > The action is to calculate Toeplitz hash based on L3 addresses and L4
> > ports, mark the packet with the RSS queue according the resulting
> > hash, then reclassify the packet.
> > Ophir Munk (2):
> >    net/tap: add eBPF instructions to TAP device
> >    net/tap: implement RSS with eBPF classifier and action
> >
> >   drivers/net/tap/Makefile          |   31 +
> >   drivers/net/tap/rte_eth_tap.h     |    9 +-
> >   drivers/net/tap/tap_bpf.h         |   92 ++
> >   drivers/net/tap/tap_bpf_insns.c   | 1905
> +++++++++++++++++++++++++++++++++++++
> >   drivers/net/tap/tap_bpf_program.c |  221 +++++
> >   drivers/net/tap/tap_flow.c        |  635 +++++++++++--
> >   drivers/net/tap/tap_flow.h        |   15 +
> >   drivers/net/tap/tap_rss.h         |   32 +
> >   drivers/net/tap/tap_tcmsgs.h      |    4 +
> >   9 files changed, 2848 insertions(+), 96 deletions(-)
> >   create mode 100644 drivers/net/tap/tap_bpf.h
> >   create mode 100644 drivers/net/tap/tap_bpf_insns.c
> >   create mode 100644 drivers/net/tap/tap_bpf_program.c
> >   create mode 100644 drivers/net/tap/tap_rss.h
> >
> 
> TAP will support eBPF classification directly [1] through eBPF socket filter.
> Compare to tc-bpf, it was more portable for other backends (e.g macvtap).
> 

I agree that classifying directly through eBPF using socket filter is easier than building a set of rules in TC, however there are more concerns that justify using eBPF with TC. 
1. An RSS rule can come in the middle of non-RSS rules. It seems natural to have it as part of TC. How do I know if a packet needs to be treated with RSS or not? (there may be a higher priority rule that sends the packet to a specific queue regardless of RSS).
2. BPF complexity comes mainly in writing BPF programs, compiling them and sending BPF instructions to the kernel. In both mechanisms (socket filter or TC) this complexity is the same.

Please let me have your feedback.

> [1]
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.
> kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fdavem%2Fnet-
> next.git%2Fcommit%2Fdrivers%2Fnet%2Ftun.c%3Fid%3D96f84061620c6325
> a2ca9a9a05b410e6461d03c3&data=02%7C01%7Cophirmu%40mellanox.co
> m%7C8edca4ebac3440cf465c08d55812768b%7Ca652971c7d2e4d9ba6a4d1
> 49256f461b%7C0%7C0%7C636511758701461920&sdata=8zPaZlAHYSsFCQw
> XcDLtro5QcrIN5pwKsj%2FUwFJ9q8s%3D&reserved=0
> 
> Thanks

  reply	other threads:[~2018-01-10 15:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-17 12:21 [dpdk-dev] [PATCH v1 0/3] " Ophir Munk
2017-12-17 12:21 ` [dpdk-dev] [PATCH v1 1/3] net/tap: add BPF sections for TAP device Ophir Munk
2017-12-17 12:21 ` [dpdk-dev] [PATCH v1 2/3] net/tap: add eBPF instructions Ophir Munk
2017-12-17 12:21 ` [dpdk-dev] [PATCH v1 3/3] net/tap: add eBPF classifiers map and actions Ophir Munk
2017-12-28 10:09 ` [dpdk-dev] [PATCH v2 0/2] TAP RSS eBPF cover letter Ophir Munk
2017-12-28 10:09   ` [dpdk-dev] [PATCH v2 1/2] net/tap: add eBPF instructions to TAP device Ophir Munk
2017-12-28 10:09   ` [dpdk-dev] [PATCH v2 2/2] net/tap: implement RSS with eBPF classifier and action Ophir Munk
2018-01-10  7:06   ` [dpdk-dev] [PATCH v3 0/2] TAP RSS eBPF cover letter Ophir Munk
2018-01-10  7:06     ` [dpdk-dev] [PATCH v3 1/2] net/tap: add eBPF instructions to TAP device Ophir Munk
2018-01-10  9:34       ` Pascal Mazon
2018-01-10 10:12         ` Ophir Munk
2018-01-10  7:06     ` [dpdk-dev] [PATCH v3 2/2] net/tap: implement RSS with eBPF classifier and action Ophir Munk
2018-01-10 10:19       ` Pascal Mazon
2018-01-11 17:20         ` Ophir Munk
2018-01-10 10:10     ` [dpdk-dev] [PATCH v3 0/2] TAP RSS eBPF cover letter Jason Wang
2018-01-10 15:34       ` Ophir Munk [this message]
2018-01-11  2:45         ` Jason Wang
2018-01-11 17:45     ` [dpdk-dev] [PATCH v4 0/5] " Ophir Munk
2018-01-11 17:45       ` [dpdk-dev] [PATCH v4 1/5] net/tap: support actions for different classifiers Ophir Munk
2018-01-11 17:45       ` [dpdk-dev] [PATCH v4 2/5] net/tap: add eBPF bytes code Ophir Munk
2018-01-11 17:45       ` [dpdk-dev] [PATCH v4 3/5] net/tap: add eBPF program file Ophir Munk
2018-01-11 17:45       ` [dpdk-dev] [PATCH v4 4/5] net/tap: add eBPF API Ophir Munk
2018-01-11 17:45       ` [dpdk-dev] [PATCH v4 5/5] net/tap: implement TAP RSS using eBPF Ophir Munk
2018-01-18 13:38       ` [dpdk-dev] [PATCH v5 0/6] TAP RSS eBPF cover letter Ophir Munk
2018-01-18 13:38         ` [dpdk-dev] [PATCH v5 1/6] net/tap: support actions for different classifiers Ophir Munk
2018-01-18 13:38         ` [dpdk-dev] [PATCH v5 2/6] net/tap: add eBPF bytes code Ophir Munk
2018-01-18 13:38         ` [dpdk-dev] [PATCH v5 3/6] net/tap: add eBPF program file Ophir Munk
2018-01-18 13:38         ` [dpdk-dev] [PATCH v5 4/6] net/tap: add eBPF API Ophir Munk
2018-01-18 13:38         ` [dpdk-dev] [PATCH v5 5/6] net/tap: implement TAP RSS using eBPF Ophir Munk
2018-01-18 13:38         ` [dpdk-dev] [PATCH v5 6/6] doc: detail new tap RSS feature in guides Ophir Munk
2018-01-19  6:48         ` [dpdk-dev] [PATCH v5 0/6] TAP RSS eBPF cover letter Pascal Mazon
2018-01-20 16:15           ` Ferruh Yigit
2018-01-20 21:25             ` Ophir Munk
2018-01-21 14:20               ` Ferruh Yigit
2018-01-20 21:11         ` [dpdk-dev] [PATCH v6 " Ophir Munk
2018-01-20 21:11           ` [dpdk-dev] [PATCH v6 1/6] net/tap: support actions for different classifiers Ophir Munk
2018-01-20 21:11           ` [dpdk-dev] [PATCH v6 2/6] net/tap: add eBPF program file Ophir Munk
2018-01-20 21:11           ` [dpdk-dev] [PATCH v6 3/6] net/tap: add eBPF bytes code Ophir Munk
2018-01-20 21:11           ` [dpdk-dev] [PATCH v6 4/6] net/tap: add eBPF API Ophir Munk
2018-01-20 21:11           ` [dpdk-dev] [PATCH v6 5/6] net/tap: implement TAP RSS using eBPF Ophir Munk
2018-01-20 21:11           ` [dpdk-dev] [PATCH v6 6/6] doc: detail new tap RSS feature in guides Ophir Munk
2018-01-21 14:50           ` [dpdk-dev] [PATCH v6 0/6] TAP RSS eBPF cover letter Ferruh Yigit

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=AM0PR0502MB3875284121FC06ACAD37AEB3D1110@AM0PR0502MB3875.eurprd05.prod.outlook.com \
    --to=ophirmu@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=jasowang@redhat.com \
    --cc=olgas@mellanox.com \
    --cc=pascal.mazon@6wind.com \
    --cc=thomas@monjalon.net \
    /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).