nfp: flower: fix mpls ether type detection
authorPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Tue, 26 Jun 2018 03:36:27 +0000 (20:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Jun 2018 01:46:43 +0000 (10:46 +0900)
commita64119415ff248efa61301783bc26551df5dabf6
tree16f1906342977867d9984a7a0f86c193b4cc6c66
parent7c8f4e6dc30996bff806285730a0bb4e714d3d52
nfp: flower: fix mpls ether type detection

Previously it was not possible to distinguish between mpls ether types and
other ether types. This leads to incorrect classification of offloaded
filters that match on mpls ether type. For example the following two
filters overlap:

 # tc filter add dev eth0 parent ffff: \
    protocol 0x8847 flower \
    action mirred egress redirect dev eth1

 # tc filter add dev eth0 parent ffff: \
    protocol 0x0800 flower \
    action mirred egress redirect dev eth2

The driver now correctly includes the mac_mpls layer where HW stores mpls
fields, when it detects an mpls ether type. It also sets the MPLS_Q bit to
indicate that the filter should match mpls packets.

Fixes: bb055c198d9b ("nfp: add mpls match offloading support")
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/match.c
drivers/net/ethernet/netronome/nfp/flower/offload.c