[PATCH net-next,v5 11/12] qede: place ethtool_rx_flow_spec after code after TC flower codebase

2018-12-06 Thread Pablo Neira Ayuso
Neira Ayuso --- v5: rebase on top of net-next head. drivers/net/ethernet/qlogic/qede/qede_filter.c | 264 - 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index

[PATCH net-next,v5 01/12] flow_offload: add flow_rule and flow_match structures and use them

2018-12-06 Thread Pablo Neira Ayuso
container structure, to retrieve the key and the mask with one single call. Signed-off-by: Pablo Neira Ayuso --- v5: fix double kfree in cls_flower error path, reported by kbuild robot via Julia Lawal. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 174 - .../net/ethernet/chelsio

[PATCH net-next,v5 10/12] dsa: bcm_sf2: use flow_rule infrastructure

2018-12-06 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence we can use the same code to populate hardware IR from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. drivers/net/dsa/bcm_sf2_cfp.c | 102

[PATCH net-next,v5 04/12] cls_api: add translator to flow_action representation

2018-12-06 Thread Pablo Neira Ayuso
This patch implements a new function to translate from native TC action to the new flow_action representation. Moreover, this patch also updates cls_flower to use this new function. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. include/net/pkt_cls.h | 3 ++ net

[PATCH net-next,v5 07/12] cls_flower: don't expose TC actions to drivers anymore

2018-12-06 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6

[PATCH net-next,v5 05/12] flow_offload: add statistics retrieval infrastructure and use it

2018-12-06 Thread Pablo Neira Ayuso
This patch provides the flow_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers anymore. Signed-off-by: Pablo Neira Ayuso --- v5: Fix bytes and packet

[PATCH net-next,v5 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-12-06 Thread Pablo Neira Ayuso
this infrastructure to save even more redundant codebase. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. drivers/net/ethernet/qlogic/qede/qede_filter.c | 279 +++-- 1 file changed, 76 insertions(+), 203 deletions(-) diff --git a/drivers/net/ethernet

[PATCH net-next,v5 09/12] ethtool: add ethtool_rx_flow_spec to flow_rule structure translator

2018-12-06 Thread Pablo Neira Ayuso
flags FLOW_EXT, FLOW_MAC_EXT and FLOW_RSS. The ethtool_rx_flow_spec_input wrapper structure is used to convey the rss_context field, that is away from the ethtool_rx_flow_spec structure, and the ethtool_rx_flow_spec structure. Signed-off-by: Pablo Neira Ayuso --- v5: support for FLOW_RSS flowtype

[PATCH net-next,v5 06/12] drivers: net: use flow action infrastructure

2018-12-06 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 74 +++--- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 250 +-- drivers

[PATCH net-next,v5 08/12] flow_offload: add wake-up-on-lan and queue to flow_action

2018-12-06 Thread Pablo Neira Ayuso
is non-zero, therefore, queue.ctx == 0 means that FLOW_RSS was not set. Signed-off-by: Pablo Neira Ayuso --- v5: add queue structure and context field, per Michal Kubecek. include/net/flow_offload.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/net/flow_offload.h b/include/net

[PATCH net-next,v5 02/12] net/mlx5e: support for two independent packet edit actions

2018-12-06 Thread Pablo Neira Ayuso
infrastructure, where each packet mangling comes in an separated action, ie. not packed as in tc pedit. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 81 ++--- 1 file changed, 59 insertions(+), 22 deletions

[PATCH net-next,v5 03/12] flow_offload: add flow action infrastructure

2018-12-06 Thread Pablo Neira Ayuso
This new infrastructure defines the nic actions that you can perform from existing network drivers. This infrastructure allows us to avoid a direct dependency with the native software TC action representation. Signed-off-by: Pablo Neira Ayuso --- v5: rebase on top of net-next head. include/net

[PATCH net-next,v5 00/12] add flow_rule infrastructure

2018-12-06 Thread Pablo Neira Ayuso
Fix double kfree in error path from cls_flower, via Julian Lawal. - Fix enum type mismatch in nfp driver reported by sparse checks. Please apply, thanks. Pablo Neira Ayuso (12): flow_offload: add flow_rule and flow_match structures and use them net/mlx5e: support for two independ

Re: [PATCH net-next,v4 05/12] flow_offload: add statistics retrieval infrastructure and use it

2018-12-01 Thread Pablo Neira Ayuso
Hi Jakub, On Thu, Nov 29, 2018 at 12:48:22PM -0800, Jakub Kicinski wrote: > On Thu, 29 Nov 2018 03:22:24 +0100, Pablo Neira Ayuso wrote: > > This patch provides the flow_stats structure that acts as container for > > tc_cls_flower_offload, then we can use to restore

[PATCH net-next,v4 06/12] drivers: net: use flow action infrastructure

2018-11-28 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- v4: rebase. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 74 +++--- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 250 +-- drivers/net/ethernet/mellanox

[PATCH net-next,v4 01/12] flow_offload: add flow_rule and flow_match structures and use them

2018-11-28 Thread Pablo Neira Ayuso
container structure, to retrieve the key and the mask with one single call. Signed-off-by: Pablo Neira Ayuso --- v4: rebase. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 174 - .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 194 -- drivers/net/ethernet/intel/i40e

[PATCH net-next,v4 10/12] dsa: bcm_sf2: use flow_rule infrastructure

2018-11-28 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence we can use the same code to populate hardware IR from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- v4: comestic changes requested by Florian Fainelli. drivers/net/dsa/bcm_sf2_cfp.c | 98

[PATCH net-next,v4 07/12] cls_flower: don't expose TC actions to drivers anymore

2018-11-28 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- v4: rebase. include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6 deletions(-) diff --git

[PATCH net-next,v4 05/12] flow_offload: add statistics retrieval infrastructure and use it

2018-11-28 Thread Pablo Neira Ayuso
This patch provides the flow_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers anymore. Signed-off-by: Pablo Neira Ayuso --- v4: rebase. drivers/net

[PATCH net-next,v4 11/12] qede: place ethtool_rx_flow_spec after code after TC flower codebase

2018-11-28 Thread Pablo Neira Ayuso
Neira Ayuso --- v4: no changes. drivers/net/ethernet/qlogic/qede/qede_filter.c | 264 - 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index 833c9ec58a6e

[PATCH net-next,v4 08/12] flow_offload: add wake-up-on-lan and queue to flow_action

2018-11-28 Thread Pablo Neira Ayuso
These actions need to be added to support bcm sf2 features available through the ethtool_rx_flow interface. Reviewed-by: Florian Fainelli Signed-off-by: Pablo Neira Ayuso --- v4: rebase. include/net/flow_offload.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/net

[PATCH net-next,v4 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-11-28 Thread Pablo Neira Ayuso
this infrastructure to save even more redundant codebase. Signed-off-by: Pablo Neira Ayuso --- v4: Rename qede_parse_flower_attr() to qede_parse_flow_attr() and remove _tc_ infix in parser, requested by Marcelo Ricardo Leitner. drivers/net/ethernet/qlogic/qede/qede_filter.c | 277

[PATCH net-next,v4 00/12] add flow_rule infrastructure

2018-11-28 Thread Pablo Neira Ayuso
sic() from bcm_sf2. Thanks. [1] https://lwn.net/Articles/766695/ [2] https://marc.info/?l=linux-netdev=154233253114506=2 [3] https://marc.info/?l=linux-netdev=154258780717036=2 Pablo Neira Ayuso (12): flow_offload: add flow_rule and flow_match structures and use them net/mlx5e: support for two i

[PATCH net-next,v4 04/12] cls_api: add translator to flow_action representation

2018-11-28 Thread Pablo Neira Ayuso
This patch implements a new function to translate from native TC action to the new flow_action representation. Moreover, this patch also updates cls_flower to use this new function. Signed-off-by: Pablo Neira Ayuso --- v4: s/key/entry variable name for struct flow_action_entry

[PATCH net-next,v4 09/12] ethtool: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-28 Thread Pablo Neira Ayuso
and FLOW_MAC_EXT. Signed-off-by: Pablo Neira Ayuso --- v4: Rename to ethtool_rx_flow_rule_create() and ethtool_rx_flow_rule_destroy(), requested by Jiri Pirko. Add support for FLOW_EXT and FLOW_MAC_EXT, by Florian Fainelli. Use BIT() to set .use_keys, also by Florian Fainelli. Double-check

[PATCH net-next,v4 02/12] net/mlx5e: support for two independent packet edit actions

2018-11-28 Thread Pablo Neira Ayuso
infrastructure, where each packet mangling comes in an separated action, ie. not packed as in tc pedit. Signed-off-by: Pablo Neira Ayuso --- v4: rebase. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 81 ++--- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/drivers/net

[PATCH net-next,v4 03/12] flow_offload: add flow action infrastructure

2018-11-28 Thread Pablo Neira Ayuso
This new infrastructure defines the nic actions that you can perform from existing network drivers. This infrastructure allows us to avoid a direct dependency with the native software TC action representation. Signed-off-by: Pablo Neira Ayuso --- v4: Use post-increment in flow_action_for_each

Re: [PATCH net-next,v3 00/12] add flow_rule infrastructure

2018-11-26 Thread Pablo Neira Ayuso
Hi Marcelo, On Thu, Nov 22, 2018 at 07:08:32PM -0200, Marcelo Ricardo Leitner wrote: > On Thu, Nov 22, 2018 at 02:22:20PM -0200, Marcelo Ricardo Leitner wrote: > > On Wed, Nov 21, 2018 at 03:51:20AM +0100, Pablo Neira Ayuso wrote: > > > Hi, > > > > > > This pa

Re: [PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-21 Thread Pablo Neira Ayuso
On Wed, Nov 21, 2018 at 07:15:41PM -0200, Marcelo Ricardo Leitner wrote: > On Wed, Nov 21, 2018 at 03:51:24AM +0100, Pablo Neira Ayuso wrote: [...] > > diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c > > index d2971fbfc3d9..8898943b8ee6 100644 > > --- a/n

[PATCH net-next,v3 01/12] flow_dissector: add flow_rule and flow_match structures and use them

2018-11-20 Thread Pablo Neira Ayuso
container structure, to retrieve the key and the mask with one single call. Signed-off-by: Pablo Neira Ayuso --- v3: Proposed by Jiri Pirko: - Place this new API in net/core/flow_offload.c and include/net/flow_offload.h. - Add flow_rule_alloc() helper function. drivers/net

[PATCH net-next,v3 05/12] cls_flower: add statistics retrieval infrastructure and use it

2018-11-20 Thread Pablo Neira Ayuso
This patch provides the flow_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested by Jiri Pirko

[PATCH net-next,v3 07/12] cls_flower: don't expose TC actions to drivers anymore

2018-11-20 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- v3: no changes. include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6 deletions(-) diff

[PATCH net-next,v3 06/12] drivers: net: use flow action infrastructure

2018-11-20 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- v3: rebase on top of previous patches. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 74 +++--- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 250

[PATCH net-next,v3 11/12] qede: place ethtool_rx_flow_spec after code after TC flower codebase

2018-11-20 Thread Pablo Neira Ayuso
Neira Ayuso --- v3: no changes. drivers/net/ethernet/qlogic/qede/qede_filter.c | 264 - 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index 833c9ec58a6e

[PATCH net-next,v3 02/12] net/mlx5e: support for two independent packet edit actions

2018-11-20 Thread Pablo Neira Ayuso
infrastructure, where each packet mangling comes in an separated action, ie. not packed as in tc pedit. Signed-off-by: Pablo Neira Ayuso --- v3: no changes. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 81 ++--- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/drivers

[PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-20 Thread Pablo Neira Ayuso
This patch adds a function to translate the ethtool_rx_flow_spec structure to the flow_rule representation. This allows us to reuse code from the driver side given that both flower and ethtool_rx_flow interfaces use the same representation. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested

[PATCH net-next,v3 08/12] flow_dissector: add wake-up-on-lan and queue to flow_action

2018-11-20 Thread Pablo Neira Ayuso
These actions need to be added to support bcm sf2 features available through the ethtool_rx_flow interface. Reviewed-by: Florian Fainelli Signed-off-by: Pablo Neira Ayuso --- v3: no changes. include/net/flow_offload.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/net

[PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-20 Thread Pablo Neira Ayuso
This patch implements a new function to translate from native TC action to the new flow_action representation. Moreover, this patch also updates cls_flower to use this new function. Signed-off-by: Pablo Neira Ayuso --- v3: add tcf_exts_num_actions() and pass it to flow_rule_alloc() to calculate

[PATCH net-next,v3 10/12] dsa: bcm_sf2: use flow_rule infrastructure

2018-11-20 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence we can use the same code to populate hardware IR from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- v3: adapt it to use new ethtool_rx_flow_rule_alloc() drivers/net/dsa/bcm_sf2_cfp.c | 109

[PATCH net-next,v3 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-11-20 Thread Pablo Neira Ayuso
this infrastructure to save even more redundant codebase. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested by Jiri Pirko: - Pass struct flow_rule *rule to all parser functions. Moreover, do not remove qede_flow_spec_validate_unused(). drivers/net/ethernet/qlogic/qede/qede_filter.c | 271

[PATCH net-next,v3 03/12] flow_dissector: add flow action infrastructure

2018-11-20 Thread Pablo Neira Ayuso
This new infrastructure defines the nic actions that you can perform from existing network drivers. This infrastructure allows us to avoid a direct dependency with the native software TC action representation. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested by Jiri Pirko: - Remove

[PATCH net-next,v3 00/12] add flow_rule infrastructure

2018-11-20 Thread Pablo Neira Ayuso
-netdev=154258780717036=2 Pablo Neira Ayuso (12): flow_dissector: add flow_rule and flow_match structures and use them net/mlx5e: support for two independent packet edit actions flow_dissector: add flow action infrastructure cls_api: add translator to flow_action representation cls_flower: add

Re: [PATCH net-next,v2 03/12] flow_dissector: add flow action infrastructure

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 03:03:22PM +0100, Jiri Pirko wrote: [...] > Maybe you can push this and related stuff into new files include/net/flow.h > and net/core/flow.c. Quick notice: These files already exist. Since you refer to _new_ files, not the existing one, I propose to use

Re: [PATCH net-next,v2 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-19 Thread Pablo Neira Ayuso
e code from the driver side given that both flower > >and ethtool_rx_flow interfaces use the same representation. > > > >Signed-off-by: Pablo Neira Ayuso > >--- > >v2: no changes. > > > > include/net/flow_dissector.h | 5 ++ > > net/core/flow_dissec

Re: [PATCH net-next,v2 05/12] cls_flower: add statistics retrieval infrastructure and use it

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 04:04:16PM +0100, Jiri Pirko wrote: > Mon, Nov 19, 2018 at 03:48:50PM CET, pa...@netfilter.org wrote: > >On Mon, Nov 19, 2018 at 02:57:05PM +0100, Jiri Pirko wrote: > >> Mon, Nov 19, 2018 at 01:15:12AM CET, pa...@netfilter.org wrote: > >[...] > >> >diff --git

Re: [PATCH net-next 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 05:00:13PM +0100, Jiri Pirko wrote: > Mon, Nov 19, 2018 at 01:15:19AM CET, pa...@netfilter.org wrote: [...] > >-static int qede_flow_spec_to_tuple(struct qede_dev *edev, > >- struct qede_arfs_tuple *t, > >- struct

Re: [PATCH net-next,v2 05/12] cls_flower: add statistics retrieval infrastructure and use it

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 02:57:05PM +0100, Jiri Pirko wrote: > Mon, Nov 19, 2018 at 01:15:12AM CET, pa...@netfilter.org wrote: [...] > >diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h > >index 7d7aefa5fcd2..7f9a8d5ca945 100644 > >--- a/include/net/pkt_cls.h > >+++ b/include/net/pkt_cls.h

Re: [PATCH net-next,v2 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 03:17:43PM +0100, Jiri Pirko wrote: > Mon, Nov 19, 2018 at 01:15:16AM CET, pa...@netfilter.org wrote: [...] > >diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h > >index 7a4683646d5a..ec9036232538 100644 > >--- a/include/net/flow_dissector.h > >+++

Re: [PATCH net-next,v2 03/12] flow_dissector: add flow action infrastructure

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 03:03:22PM +0100, Jiri Pirko wrote: [...] > >+struct flow_action { > > Hmm, thinking about it a bit more, none of this is is related to flow > dissector so it is misleading to put the code in flow_dissector.[hc]. > > Maybe you can push this and related stuff into new

Re: [PATCH net-next,v2 04/12] cls_api: add translator to flow_action representation

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 01:12:51PM +0100, Jiri Pirko wrote: > Mon, Nov 19, 2018 at 01:15:11AM CET, pa...@netfilter.org wrote: > >@@ -2567,6 +2575,111 @@ int tc_setup_cb_call(struct tcf_block *block, struct > >tcf_exts *exts, > > } > > EXPORT_SYMBOL(tc_setup_cb_call); > > > >+int

Re: [PATCH net-next,v2 04/12] cls_api: add translator to flow_action representation

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 01:16:30PM +0100, Jiri Pirko wrote: > >@@ -391,18 +392,27 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, > > cls_flower.exts = >exts; > > cls_flower.classid = f->res.classid; > > > >+if (tc_setup_flow_action(>action, >exts) < 0) > >+return

Re: [PATCH net-next,v2 03/12] flow_dissector: add flow action infrastructure

2018-11-19 Thread Pablo Neira Ayuso
>direct dependency with the native software TC action representation. > > > >Signed-off-by: Pablo Neira Ayuso > >--- > >v2: no changes. > > > > include/net/flow_dissector.h | 70 > > > > net/core/flo

Re: [PATCH 00/12 net-next,v2] add flow_rule infrastructure

2018-11-19 Thread Pablo Neira Ayuso
On Mon, Nov 19, 2018 at 09:20:43AM +, Jose Abreu wrote: [...] > Although I was cc'ed in the thread I'm not seeing stmmac driver > in this conversion. My intention was to attract the attention of driver maintainers that are using tc offloads in some way in their infrastructure. That's why

[PATCH net-next 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-11-18 Thread Pablo Neira Ayuso
this infrastructure to save even more redundant codebase. Signed-off-by: Pablo Neira Ayuso --- Note that, after this patch, qede_add_cls_rule() and qede_add_tc_flower_fltr() can be also consolidated since their code is redundant. drivers/net/ethernet/qlogic/qede/qede_filter.c | 246

[PATCH net-next,v2 06/12] drivers: net: use flow action infrastructure

2018-11-18 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- v2: no changes. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 74 +++--- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 250 +-- drivers/net/ethernet

[PATCH net-next,v2 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-18 Thread Pablo Neira Ayuso
This patch adds a function to translate the ethtool_rx_flow_spec structure to the flow_rule representation. This allows us to reuse code from the driver side given that both flower and ethtool_rx_flow interfaces use the same representation. Signed-off-by: Pablo Neira Ayuso --- v2: no changes

[PATCH net-next 11/12] qede: place ethtool_rx_flow_spec after code after TC flower codebase

2018-11-18 Thread Pablo Neira Ayuso
Neira Ayuso --- drivers/net/ethernet/qlogic/qede/qede_filter.c | 264 - 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index e71e0ff13452..aca302c3261b 100644

[PATCH net-next,v2 10/12] dsa: bcm_sf2: use flow_rule infrastructure

2018-11-18 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence we can use the same code to populate hardware IR from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- v2: remove unused variables, requested by David S. Miller. drivers/net/dsa/bcm_sf2_cfp.c | 108

[PATCH net-next,v2 07/12] cls_flower: don't expose TC actions to drivers anymore

2018-11-18 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- v2: no changes. include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6 deletions(-) diff

[PATCH net-next,v2 08/12] flow_dissector: add wake-up-on-lan and queue to flow_action

2018-11-18 Thread Pablo Neira Ayuso
These actions need to be added to support bcm sf2 features available through the ethtool_rx_flow interface. Reviewed-by: Florian Fainelli Signed-off-by: Pablo Neira Ayuso --- v2: no changes. include/net/flow_dissector.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/net

[PATCH net-next,v2 05/12] cls_flower: add statistics retrieval infrastructure and use it

2018-11-18 Thread Pablo Neira Ayuso
This patch provides a tc_cls_flower_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers. Signed-off-by: Pablo Neira Ayuso --- v2: no changes. drivers/net

[PATCH net-next,v2 04/12] cls_api: add translator to flow_action representation

2018-11-18 Thread Pablo Neira Ayuso
This patch implements a new function to translate from native TC action to the new flow_action representation. Moreover, this patch also updates cls_flower to use this new function. Signed-off-by: Pablo Neira Ayuso --- v2: no changes. include/net/pkt_cls.h | 3 ++ net/sched/cls_api.c

[PATCH net-next,v2 01/12] flow_dissector: add flow_rule and flow_match structures and use them

2018-11-18 Thread Pablo Neira Ayuso
container structure, to retrieve the key and the mask with one single call. Signed-off-by: Pablo Neira Ayuso --- v2: Use reverse xmas tree for variable definition, requested by David S. Miller. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 174 - .../net/ethernet/chelsio/cxgb4

[PATCH net-next,v2 03/12] flow_dissector: add flow action infrastructure

2018-11-18 Thread Pablo Neira Ayuso
This new infrastructure defines the nic actions that you can perform from existing network drivers. This infrastructure allows us to avoid a direct dependency with the native software TC action representation. Signed-off-by: Pablo Neira Ayuso --- v2: no changes. include/net/flow_dissector.h

[PATCH net-next,v2 02/12] net/mlx5e: support for two independent packet edit actions

2018-11-18 Thread Pablo Neira Ayuso
infrastructure, where each packet mangling comes in an separated action, ie. not packed as in tc pedit. Signed-off-by: Pablo Neira Ayuso --- v2: no changes. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 81 ++--- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/drivers

[PATCH 00/12 net-next,v2] add flow_rule infrastructure

2018-11-18 Thread Pablo Neira Ayuso
late HW IR. Thanks. [1] https://lwn.net/Articles/766695/ [2] https://marc.info/?l=linux-netdev=154233253114506=2 Pablo Neira Ayuso (12): flow_dissector: add flow_rule and flow_match structures and use them net/mlx5e: support for two independent packet edit actions flow_dissector: add fl

[PATCH 09/10] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-15 Thread Pablo Neira Ayuso
This patch adds a function to translate the ethtool_rx_flow_spec structure to the flow_rule representation. This allows us to reuse code from the driver side given that both flower and ethtool_rx_flow interfaces use the same representation. Signed-off-by: Pablo Neira Ayuso --- include/net

[PATCH 04/10] cls_api: add translator to flow_action representation

2018-11-15 Thread Pablo Neira Ayuso
This patch implements a new function to translate from native TC action to the new flow_action representation. Moreover, this patch also updates cls_flower to use this new function. Signed-off-by: Pablo Neira Ayuso --- include/net/pkt_cls.h | 3 ++ net/sched/cls_api.c| 113

[PATCH 02/10] net/mlx5e: support for two independent packet edit actions

2018-11-15 Thread Pablo Neira Ayuso
infrastructure, where each packet mangling comes in an separated action, ie. not packed as in tc pedit. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 81 ++--- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet

[PATCH 01/10] flow_dissector: add flow_rule and flow_match structures and use them

2018-11-15 Thread Pablo Neira Ayuso
container structure, to retrieve the key and the mask with one single call. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 174 - .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 194 -- drivers/net/ethernet/intel/i40e/i40e_main.c

[PATCH 05/10] cls_flower: add statistics retrieval infrastructure and use it

2018-11-15 Thread Pablo Neira Ayuso
This patch provides a tc_cls_flower_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/broadcom

[PATCH 07/10] cls_flower: don't expose TC actions to drivers anymore

2018-11-15 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6 deletions(-) diff --git a/include/net

[PATCH 00/10] add flow_rule infrastructure

2018-11-15 Thread Pablo Neira Ayuso
the driver. This patchset has passed here functional tests of the codepath that generates the flow_rule structure and the functions to implement the parsers that populate the hardware IR. Thanks. Pablo Neira Ayuso (10): flow_dissector: add flow_rule and flow_match structures and use them net/mlx5e

[PATCH 08/10] flow_dissector: add wake-up-on-lan and queue to flow_action

2018-11-15 Thread Pablo Neira Ayuso
These actions need to be added to support bcm sf2 features available through the ethtool_rx_flow interface. Reviewed-by: Florian Fainelli Signed-off-by: Pablo Neira Ayuso --- include/net/flow_dissector.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/net/flow_dissector.h b

[PATCH 06/10] drivers: net: use flow action infrastructure

2018-11-15 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 74 +++--- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 250 +-- drivers/net/ethernet/mellanox/mlx5/core

[PATCH 03/10] flow_dissector: add flow action infrastructure

2018-11-15 Thread Pablo Neira Ayuso
This new infrastructure defines the nic actions that you can perform from existing network drivers. This infrastructure allows us to avoid a direct dependency with the native software TC action representation. Signed-off-by: Pablo Neira Ayuso --- include/net/flow_dissector.h | 70

[PATCH 10/10] dsa: bcm_sf2: use flow_rule infrastructure

2018-11-15 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence we can use the same code to populate hardware IR from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- drivers/net/dsa/bcm_sf2_cfp.c | 103 -- 1 file changed

Re: [PATCH net-next] netfilter: xt_quota: fix the behavior of xt_quota module

2018-10-02 Thread Pablo Neira Ayuso
On Tue, Oct 02, 2018 at 11:28:21AM -0700, Chenbo Feng wrote: > On Tue, Oct 2, 2018 at 11:15 AM Pablo Neira Ayuso wrote: > > > > Hi Chenbo, > > > > On Tue, Oct 02, 2018 at 10:45:58AM -0700, Chenbo Feng wrote: > > > On Tue, Oct 2, 2018 at 3:51 AM Pablo Neira Ayu

[PATCH RFC,net-next 01/10] flow_dissector: add flow_rule and flow_match structures and use them

2018-09-25 Thread Pablo Neira Ayuso
container structure, to retrieve the key and the mask with one single call. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 174 - .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 194 -- drivers/net/ethernet/intel/i40e/i40e_main.c

[PATCH RFC,net-next 06/10] drivers: net: use flow action infrastructure

2018-09-25 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 78 +++ .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 251 ++-- drivers/net/ethernet/mellanox/mlx5/core

[PATCH RFC,net-next 10/10] dsa: bcm_sf2: use flow_rule infrastructure

2018-09-25 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence the same code to populate hardware IR can be used from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- drivers/net/dsa/bcm_sf2_cfp.c | 311 ++ 1 file changed

[PATCH RFC,net-next 03/10] flow_dissector: add flow action infrastructure

2018-09-25 Thread Pablo Neira Ayuso
This patch adds new infrastructure that defines actions that you can perform in existing network drivers. This infrastructure allows us to avoid the direct dependency with the software TC action infrastructure. Signed-off-by: Pablo Neira Ayuso --- include/net/flow_dissector.h | 70

[PATCH RFC,net-next 09/10] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-09-25 Thread Pablo Neira Ayuso
This patch adds a function to translate the ethtool_rx_flow_spec structure to the flow_rule representation. This allows us to reuse code from the driver side given the flower and the ethtool_rx_flow interface use the same representation. Signed-off-by: Pablo Neira Ayuso --- include/net

[PATCH RFC,net-next 07/10] cls_flower: don't expose TC actions to drivers anymore

2018-09-25 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6 deletions(-) diff --git a/include/net

[PATCH RFC,net-next 05/10] cls_flower: add statistics retrieval infrastructure and use it

2018-09-25 Thread Pablo Neira Ayuso
Provide a tc_cls_flower_stats structure that acts as container for tc_cls_flower_offload, then restore stats on the TC actions. Hence tcf_exts_stats_update() is not used from drivers. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 4 ++-- drivers

[PATCH RFC,net-next 08/10] flow_dissector: add wake-up-on-lan and queue to flow_action

2018-09-25 Thread Pablo Neira Ayuso
These actions need to be added to support bcm sf2 features available through the ethtool_rx_flow interface. Signed-off-by: Pablo Neira Ayuso --- include/net/flow_dissector.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h index

[PATCH RFC,net-next 04/10] cls_flower: add translator to flow_action representation

2018-09-25 Thread Pablo Neira Ayuso
This implements TC action to flow_action translation from cls_flower. Signed-off-by: Pablo Neira Ayuso --- net/sched/cls_flower.c | 124 - 1 file changed, 123 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_flower.c b/net/sched

[PATCH RFC,net-next 00/10] add flow_rule infrastructure

2018-09-25 Thread Pablo Neira Ayuso
eeded still. That would happen in a later stage if feedback is positive. Comments welcome as usual, thanks. Pablo Neira Ayuso (10): flow_dissector: add flow_rule and flow_match structures and use them net/mlx5e: allow two independent packet edit actions flow_dissector: add flow action infrastructur

[PATCH RFC,net-next 02/10] net/mlx5e: allow two independent packet edit actions

2018-09-25 Thread Pablo Neira Ayuso
pedit_headers_action struct that annotates the headers mangling configuration that is used to configure hardware. Then, alloc_tc_pedit_action() is called to populate the mlx5e hardware intermediate representation once all actions have been parsed. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet

Re: [PATCH net] netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev

2018-09-17 Thread Pablo Neira Ayuso
On Sun, Sep 16, 2018 at 09:14:42PM -0700, David Ahern wrote: > Pablo: > > DaveM has this marked as waiting for upstream. Any comment on this patch? Please, resend a Cc netfilter-de...@vger.kernel.org Thanks David.

Re: [PATCH net-next,v2] net: rename ndo_setup_tc to ndo_setup_offload

2018-07-20 Thread Pablo Neira Ayuso
On Thu, Jul 19, 2018 at 02:04:16PM -0700, Alexander Duyck wrote: > On Thu, Jul 19, 2018 at 1:52 PM, Pablo Neira Ayuso > wrote: > > On Thu, Jul 19, 2018 at 08:18:20AM -0700, Alexander Duyck wrote: > >> On Wed, Jul 18, 2018 at 5:11 PM, Pablo Neira Ayuso > >> wrot

Re: [PATCH net-next,v2] net: rename ndo_setup_tc to ndo_setup_offload

2018-07-19 Thread Pablo Neira Ayuso
On Thu, Jul 19, 2018 at 08:18:20AM -0700, Alexander Duyck wrote: > On Wed, Jul 18, 2018 at 5:11 PM, Pablo Neira Ayuso > wrote: > > One of the recurring complaints is that we do not have, as a driver > > writer, a central location from which we would be fed offloading ru

[PATCH net-next,v2] net: rename ndo_setup_tc to ndo_setup_offload

2018-07-18 Thread Pablo Neira Ayuso
to prepare for follow up patch that discuss unified flow representation for the existing offload programming APIs. Signed-off-by: Pablo Neira Ayuso Acked-by: Jiri Pirko Acked-by: Jakub Kicinski --- v2: Missing function definition update in drivers/net/ethernet/sfc/falcon/tx.c apparently I forgot

Re: [PATCH net-next] net: rename ndo_setup_tc to ndo_setup_offload

2018-07-18 Thread Pablo Neira Ayuso
rogramming APIs: > >ethtool_rxnfc, cls_flower, cls_u32 and (probably, not yet upstream) > >conntrack. > > > >Signed-off-by: Pablo Neira Ayuso > > Acked-by: Jiri Pirko > > It would make sense to also rename following enum: > enum tc_setup_type { >

[PATCH net-next] net: rename ndo_setup_tc to ndo_setup_offload

2018-07-18 Thread Pablo Neira Ayuso
to prepare for follow up patches that discuss/propose unified flow representation for the existing offload programming APIs: ethtool_rxnfc, cls_flower, cls_u32 and (probably, not yet upstream) conntrack. Signed-off-by: Pablo Neira Ayuso --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c| 6

Re: [PATCH v4 net-next 7/9] net: ipv4: listified version of ip_rcv

2018-07-03 Thread Pablo Neira Ayuso
On Mon, Jul 02, 2018 at 04:14:12PM +0100, Edward Cree wrote: > Also involved adding a way to run a netfilter hook over a list of packets. > Rather than attempting to make netfilter know about lists (which would be > a major project in itself) we just let it call the regular okfn (in this > case

[PATCH 04/15] netfilter: nft_reject_bridge: fix skb allocation size in nft_reject_br_send_v6_unreach

2018-06-11 Thread Pablo Neira Ayuso
From: Taehee Yoo In order to allocate icmpv6 skb, sizeof(struct ipv6hdr) should be used. Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso --- net/bridge/netfilter/nft_reject_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/netfilter

[PATCH 01/15] netfilter: xt_CT: Reject the non-null terminated string from user space

2018-06-11 Thread Pablo Neira Ayuso
n", helper_name); Signed-off-by: Gao Feng Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- net/netfilter/xt_CT.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c index 8790190c6feb..03b9a50ec93b 100644 --- a/net/net

[PATCH 02/15] netfilter: nf_tables: check msg_type before nft_trans_set(trans)

2018-06-11 Thread Pablo Neira Ayuso
06e6fafc0 000c000c 881bf180f400 [75522.615601] page dumped because: kasan: bad access detected Fixes: 37a9cc525525 ("netfilter: nf_tables: add generation mask to sets") Signed-off-by: Alexey Kodanev Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso ---

[PATCH 08/15] netfilter: ipset: List timing out entries with "timeout 1" instead of zero

2018-06-11 Thread Pablo Neira Ayuso
From: Jozsef Kadlecsik When listing sets with timeout support, there's a probability that just timing out entries with "0" timeout value is listed/saved. However when restoring the saved list, the zero timeout value means permanent elelements. The new behaviour is that timing out entries are

  1   2   3   4   5   6   7   8   9   10   >