net/ice: support MAC VLAN rule
authorWei Zhao <wei.zhao1@intel.com>
Fri, 3 Apr 2020 04:46:00 +0000 (12:46 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:06 +0000 (13:57 +0200)
This patch add support for MAC VLAN rule,
it enable switch filter to direct packet base on
mac address and VLAN id.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_switch_filter.c

index 4edaea3..ed02d98 100644 (file)
@@ -29,6 +29,9 @@
 
 #define ICE_SW_INSET_ETHER ( \
        ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)
+#define ICE_SW_INSET_MAC_VLAN ( \
+               ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE | \
+               ICE_INSET_VLAN_OUTER)
 #define ICE_SW_INSET_MAC_IPV4 ( \
        ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \
        ICE_INSET_IPV4_PROTO | ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS)
@@ -107,6 +110,8 @@ static struct
 ice_pattern_match_item ice_switch_pattern_dist_comms[] = {
        {pattern_ethertype,
                        ICE_SW_INSET_ETHER, ICE_INSET_NONE},
+       {pattern_ethertype_vlan,
+                       ICE_SW_INSET_MAC_VLAN, ICE_INSET_NONE},
        {pattern_eth_ipv4,
                        ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},
        {pattern_eth_ipv4_udp,
@@ -149,6 +154,8 @@ static struct
 ice_pattern_match_item ice_switch_pattern_dist_os[] = {
        {pattern_ethertype,
                        ICE_SW_INSET_ETHER, ICE_INSET_NONE},
+       {pattern_ethertype_vlan,
+                       ICE_SW_INSET_MAC_VLAN, ICE_INSET_NONE},
        {pattern_eth_arp,
                        ICE_INSET_NONE, ICE_INSET_NONE},
        {pattern_eth_ipv4,
@@ -179,6 +186,8 @@ ice_pattern_match_item ice_switch_pattern_dist_os[] = {
 
 static struct
 ice_pattern_match_item ice_switch_pattern_perm[] = {
+       {pattern_ethertype_vlan,
+                       ICE_SW_INSET_MAC_VLAN, ICE_INSET_NONE},
        {pattern_eth_ipv4,
                        ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},
        {pattern_eth_ipv4_udp,