diff options
author | Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> | 2017-08-25 19:31:03 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-29 00:20:24 +0200 |
commit | 6afd33e4384060e692705912337b184c1e159aff (patch) | |
tree | 96f56a13c4ccbe37a3e073b5d5896ce9e7ea5ae5 | |
parent | nfp: fix supported key layers calculation (diff) | |
download | linux-6afd33e4384060e692705912337b184c1e159aff.tar.xz linux-6afd33e4384060e692705912337b184c1e159aff.zip |
nfp: remove incorrect mask check for vlan matching
Previously the vlan tci field was incorrectly exact matched. This patch
fixes this by using the flow dissector to populate the vlan tci field.
Fixes: 5571e8c9f241 ("nfp: extend flower matching capabilities")
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/flower/match.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/match.c b/drivers/net/ethernet/netronome/nfp/flower/match.c index b36511063a25..d25b5038c3a2 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/match.c +++ b/drivers/net/ethernet/netronome/nfp/flower/match.c @@ -42,6 +42,7 @@ nfp_flower_compile_meta_tci(struct nfp_flower_meta_two *frame, struct tc_cls_flower_offload *flow, u8 key_type, bool mask_version) { + struct fl_flow_key *target = mask_version ? flow->mask : flow->key; struct flow_dissector_key_vlan *flow_vlan; u16 tmp_tci; @@ -50,15 +51,10 @@ nfp_flower_compile_meta_tci(struct nfp_flower_meta_two *frame, frame->nfp_flow_key_layer = key_type; frame->mask_id = ~0; - if (mask_version) { - frame->tci = cpu_to_be16(~0); - return; - } - if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_VLAN)) { flow_vlan = skb_flow_dissector_target(flow->dissector, FLOW_DISSECTOR_KEY_VLAN, - flow->key); + target); /* Populate the tci field. */ if (flow_vlan->vlan_id) { tmp_tci = FIELD_PREP(NFP_FLOWER_MASK_VLAN_PRIO, |