[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190906105638.hylw6quhk7t3wff2@salvia>
Date: Fri, 6 Sep 2019 12:56:38 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Edward Cree <ecree@...arflare.com>
Cc: netfilter-devel@...r.kernel.org, davem@...emloft.net,
netdev@...r.kernel.org, jakub.kicinski@...ronome.com,
jiri@...nulli.us, saeedm@...lanox.com, vishal@...lsio.com,
vladbu@...lanox.com
Subject: Re: [PATCH net-next,v3 0/4] flow_offload: update mangle action
representation
On Fri, Sep 06, 2019 at 11:02:18AM +0100, Edward Cree wrote:
> On 06/09/2019 01:03, Pablo Neira Ayuso wrote:
> > 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)
> > 26,54,0,drivers/net/ethernet/mellanox/mlx5/core/en_tc.c (-27 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 v2:
> >
> > * Fix is_action_keys_supported() breakage in mlx5 reported by Vlad Buslov.
>
> Still NAK for the same reasons as three versions ago (when it was called
> "netfilter: payload mangling offload support"), you've never managed to
> explain why this extra API complexity is useful. (Reducing LOC does not
> mean you've reduced complexity.)
Oh well...
Patch 1) Mask is inverted for no reason, just because tc pedit needs
this in this way. All drivers reverse this mask.
Patch 2) All drivers mask out meaningless fields in the value field.
Patch 3) Without this patchset, offsets are on the 32-bit boundary.
Drivers need to play with the 32-bit mask to infer what field they are
supposed to mangle... eg. with 32-bit offset alignment, checking if
the use want to alter the ttl/hop_limit need for helper structures to
check the 32-bit mask. Mangling a IPv6 address comes with one single
action...
Powered by blists - more mailing lists