From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org,
jakub.kicinski@netronome.com, jiri@resnulli.us,
saeedm@mellanox.com, vishal@chelsio.com, vladbu@mellanox.com
Subject: [PATCH net-next,v2 0/4] flow_offload: update mangle action representation
Date: Tue, 3 Sep 2019 18:45:09 +0200 [thread overview]
Message-ID: <20190903164513.15462-1-pablo@netfilter.org> (raw)
This patch updates the mangle action representation:
Patch 1) Undo bitwise NOT operation on the mangle mask (coming from tc
pedit userspace).
Patch 2) mangle value &= mask from the front-end side.
Patch 3) adjust offset, length and coalesce consecutive pedit keys into
one single action.
Patch 4) add support for payload mangling for netfilter.
After this patchset:
* Offset to payload does not need to be on the 32-bits boundaries anymore.
This patchset adds front-end code to adjust the offset and length coming
from the tc pedit representation, so drivers get an exact header field
offset and length.
* This new front-end code coalesces consecutive pedit actions into one
single action, so drivers can mangle IPv6 and ethernet address fields
in one go, instead once for each 32-bit word.
On the driver side, diffstat -t shows that drivers code to deal with
payload mangling gets simplified:
INSERTED,DELETED,MODIFIED,FILENAME
46,116,0,drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c (-70 LOC)
12,28,0,drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h (-16 LOC)
30,60,0,drivers/net/ethernet/mellanox/mlx5/core/en_tc.c (-30 LOC)
89,111,0,drivers/net/ethernet/netronome/nfp/flower/action.c (-17 LOC)
While, on the front-end side the balance is the following:
123,22,0,net/sched/cls_api.c (+101 LOC)
Changes since v1:
* Fix missing flow_action->num_entries adjustment from tc_setup_flow_action()
reported by Vlad Buslov.
* Action entry ID in netfilter payload mangling action was not properly set.
* Fix incorrect p_exact[] assignment logic in nfp_fl_set_helper().
Please, apply.
Pablo Neira Ayuso (4):
net: flow_offload: flip mangle action mask
net: flow_offload: bitwise AND on mangle action value field
net: flow_offload: mangle action at byte level
netfilter: nft_payload: packet mangling offload support
.../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 163 +++++-----------
.../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h | 40 ++--
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 90 +++------
drivers/net/ethernet/netronome/nfp/flower/action.c | 204 ++++++++++-----------
include/net/flow_offload.h | 7 +-
net/netfilter/nft_payload.c | 73 ++++++++
net/sched/cls_api.c | 144 ++++++++++++---
7 files changed, 382 insertions(+), 339 deletions(-)
--
2.11.0
next reply other threads:[~2019-09-03 16:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 16:45 Pablo Neira Ayuso [this message]
2019-09-03 16:45 ` [PATCH net-next,v2 1/4] net: flow_offload: flip mangle action mask Pablo Neira Ayuso
2019-09-03 16:45 ` [PATCH net-next,v2 2/4] net: flow_offload: bitwise AND on mangle action value field Pablo Neira Ayuso
2019-09-03 16:45 ` [PATCH net-next,v2 3/4] net: flow_offload: mangle action at byte level Pablo Neira Ayuso
2019-09-04 12:48 ` Vlad Buslov
2019-09-03 16:45 ` [PATCH net-next,v2 4/4] netfilter: nft_payload: packet mangling offload support Pablo Neira Ayuso
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=20190903164513.15462-1-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=vishal@chelsio.com \
--cc=vladbu@mellanox.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).