mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-06 03:10:56 +00:00
spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW
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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
201dacbb1d
commit
dc371700d4
@ -197,11 +197,18 @@ static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp,
|
|||||||
skb_flow_dissector_target(f->dissector,
|
skb_flow_dissector_target(f->dissector,
|
||||||
FLOW_DISSECTOR_KEY_BASIC,
|
FLOW_DISSECTOR_KEY_BASIC,
|
||||||
f->mask);
|
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_sp_acl_rulei_keymask_u32(rulei,
|
||||||
MLXSW_AFK_ELEMENT_ETHERTYPE,
|
MLXSW_AFK_ELEMENT_ETHERTYPE,
|
||||||
ntohs(key->n_proto),
|
n_proto_key, n_proto_mask);
|
||||||
ntohs(mask->n_proto));
|
|
||||||
|
ip_proto = key->ip_proto;
|
||||||
mlxsw_sp_acl_rulei_keymask_u32(rulei,
|
mlxsw_sp_acl_rulei_keymask_u32(rulei,
|
||||||
MLXSW_AFK_ELEMENT_IP_PROTO,
|
MLXSW_AFK_ELEMENT_IP_PROTO,
|
||||||
key->ip_proto, mask->ip_proto);
|
key->ip_proto, mask->ip_proto);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user