* [patch net-next] spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW
@ 2017-02-09 13:42 Jiri Pirko
2017-02-10 18:43 ` David Miller
2017-02-10 19:42 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2017-02-09 13:42 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, petrm, mlxsw
From: Jiri Pirko <jiri@mellanox.com>
HW does not understand ETH_P_ALL. So treat this special case differently
and translate to 0/0 key/mask. That will allow HW to match all ethertypes.
Fixes: 7aa0f5aa9030 ("mlxsw: spectrum: Implement TC flower offload")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
index 35b147a..22ab429 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
@@ -197,11 +197,18 @@ static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp,
skb_flow_dissector_target(f->dissector,
FLOW_DISSECTOR_KEY_BASIC,
f->mask);
- ip_proto = key->ip_proto;
+ u16 n_proto_key = ntohs(key->n_proto);
+ u16 n_proto_mask = ntohs(mask->n_proto);
+
+ if (n_proto_key == ETH_P_ALL) {
+ n_proto_key = 0;
+ n_proto_mask = 0;
+ }
mlxsw_sp_acl_rulei_keymask_u32(rulei,
MLXSW_AFK_ELEMENT_ETHERTYPE,
- ntohs(key->n_proto),
- ntohs(mask->n_proto));
+ n_proto_key, n_proto_mask);
+
+ ip_proto = key->ip_proto;
mlxsw_sp_acl_rulei_keymask_u32(rulei,
MLXSW_AFK_ELEMENT_IP_PROTO,
key->ip_proto, mask->ip_proto);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch net-next] spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW
2017-02-09 13:42 [patch net-next] spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW Jiri Pirko
@ 2017-02-10 18:43 ` David Miller
2017-02-10 19:42 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-02-10 18:43 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, petrm, mlxsw
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 9 Feb 2017 14:42:03 +0100
> From: Jiri Pirko <jiri@mellanox.com>
>
> HW does not understand ETH_P_ALL. So treat this special case differently
> and translate to 0/0 key/mask. That will allow HW to match all ethertypes.
>
> Fixes: 7aa0f5aa9030 ("mlxsw: spectrum: Implement TC flower offload")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch net-next] spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW
2017-02-09 13:42 [patch net-next] spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW Jiri Pirko
2017-02-10 18:43 ` David Miller
@ 2017-02-10 19:42 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-02-10 19:42 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, petrm, mlxsw
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 9 Feb 2017 14:42:03 +0100
> From: Jiri Pirko <jiri@mellanox.com>
>
> HW does not understand ETH_P_ALL. So treat this special case differently
> and translate to 0/0 key/mask. That will allow HW to match all ethertypes.
>
> Fixes: 7aa0f5aa9030 ("mlxsw: spectrum: Implement TC flower offload")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-10 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 13:42 [patch net-next] spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW Jiri Pirko
2017-02-10 18:43 ` David Miller
2017-02-10 19:42 ` David Miller
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).