From: Wei Zhao Date: Fri, 3 Apr 2020 04:46:00 +0000 (+0800) Subject: net/ice: support MAC VLAN rule X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=187e7244ad1e427ff345a12ea545044d1c8f2d02;p=dpdk.git net/ice: support MAC VLAN rule 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 Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 4edaea3f50..ed02d9805c 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -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,