static struct ice_flow_parser ice_switch_dist_parser_os;
static struct ice_flow_parser ice_switch_dist_parser_comms;
-static struct ice_flow_parser ice_switch_perm_parser;
+static struct ice_flow_parser ice_switch_perm_parser_os;
+static struct ice_flow_parser ice_switch_perm_parser_comms;
+
+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,
+ ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},
+ {pattern_eth_ipv4_udp,
+ ICE_SW_INSET_MAC_IPV4_UDP, ICE_INSET_NONE},
+ {pattern_eth_ipv4_tcp,
+ ICE_SW_INSET_MAC_IPV4_TCP, ICE_INSET_NONE},
+ {pattern_eth_ipv6,
+ ICE_SW_INSET_MAC_IPV6, ICE_INSET_NONE},
+ {pattern_eth_ipv6_udp,
+ ICE_SW_INSET_MAC_IPV6_UDP, ICE_INSET_NONE},
+ {pattern_eth_ipv6_tcp,
+ ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE},
+ {pattern_eth_ipv4_udp_vxlan_eth_ipv4,
+ ICE_SW_INSET_DIST_VXLAN_IPV4, ICE_INSET_NONE},
+ {pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,
+ ICE_SW_INSET_DIST_VXLAN_IPV4_UDP, ICE_INSET_NONE},
+ {pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,
+ ICE_SW_INSET_DIST_VXLAN_IPV4_TCP, ICE_INSET_NONE},
+ {pattern_eth_ipv4_nvgre_eth_ipv4,
+ ICE_SW_INSET_DIST_NVGRE_IPV4, ICE_INSET_NONE},
+ {pattern_eth_ipv4_nvgre_eth_ipv4_udp,
+ ICE_SW_INSET_DIST_NVGRE_IPV4_UDP, ICE_INSET_NONE},
+ {pattern_eth_ipv4_nvgre_eth_ipv4_tcp,
+ ICE_SW_INSET_DIST_NVGRE_IPV4_TCP, ICE_INSET_NONE},
+};
static struct
ice_pattern_match_item ice_switch_pattern_dist_comms[] = {
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,
ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},
{pattern_eth_ipv4_udp,
};
static struct
-ice_pattern_match_item ice_switch_pattern_dist_os[] = {
+ice_pattern_match_item ice_switch_pattern_perm_os[] = {
{pattern_ethertype,
ICE_SW_INSET_ETHER, ICE_INSET_NONE},
{pattern_ethertype_vlan,
{pattern_eth_ipv6_tcp,
ICE_SW_INSET_MAC_IPV6_TCP, ICE_INSET_NONE},
{pattern_eth_ipv4_udp_vxlan_eth_ipv4,
- ICE_SW_INSET_DIST_VXLAN_IPV4, ICE_INSET_NONE},
+ ICE_SW_INSET_PERM_TUNNEL_IPV4, ICE_INSET_NONE},
{pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,
- ICE_SW_INSET_DIST_VXLAN_IPV4_UDP, ICE_INSET_NONE},
+ ICE_SW_INSET_PERM_TUNNEL_IPV4_UDP, ICE_INSET_NONE},
{pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,
- ICE_SW_INSET_DIST_VXLAN_IPV4_TCP, ICE_INSET_NONE},
+ ICE_SW_INSET_PERM_TUNNEL_IPV4_TCP, ICE_INSET_NONE},
{pattern_eth_ipv4_nvgre_eth_ipv4,
- ICE_SW_INSET_DIST_NVGRE_IPV4, ICE_INSET_NONE},
+ ICE_SW_INSET_PERM_TUNNEL_IPV4, ICE_INSET_NONE},
{pattern_eth_ipv4_nvgre_eth_ipv4_udp,
- ICE_SW_INSET_DIST_NVGRE_IPV4_UDP, ICE_INSET_NONE},
+ ICE_SW_INSET_PERM_TUNNEL_IPV4_UDP, ICE_INSET_NONE},
{pattern_eth_ipv4_nvgre_eth_ipv4_tcp,
- ICE_SW_INSET_DIST_NVGRE_IPV4_TCP, ICE_INSET_NONE},
+ ICE_SW_INSET_PERM_TUNNEL_IPV4_TCP, ICE_INSET_NONE},
};
static struct
-ice_pattern_match_item ice_switch_pattern_perm[] = {
+ice_pattern_match_item ice_switch_pattern_perm_comms[] = {
{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,
ICE_SW_INSET_MAC_IPV4, ICE_INSET_NONE},
{pattern_eth_ipv4_udp,
{
int ret = 0;
struct ice_flow_parser *dist_parser;
- struct ice_flow_parser *perm_parser = &ice_switch_perm_parser;
+ struct ice_flow_parser *perm_parser;
if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)
dist_parser = &ice_switch_dist_parser_comms;
else
return -EINVAL;
- if (ad->devargs.pipe_mode_support)
+ if (ad->devargs.pipe_mode_support) {
+ if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)
+ perm_parser = &ice_switch_perm_parser_comms;
+ else
+ perm_parser = &ice_switch_perm_parser_os;
+
ret = ice_register_parser(perm_parser, ad);
- else
+ } else {
ret = ice_register_parser(dist_parser, ad);
+ }
return ret;
}
ice_switch_uninit(struct ice_adapter *ad)
{
struct ice_flow_parser *dist_parser;
- struct ice_flow_parser *perm_parser = &ice_switch_perm_parser;
+ struct ice_flow_parser *perm_parser;
if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)
dist_parser = &ice_switch_dist_parser_comms;
- else
+ else if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)
dist_parser = &ice_switch_dist_parser_os;
+ else
+ return;
+
+ if (ad->devargs.pipe_mode_support) {
+ if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)
+ perm_parser = &ice_switch_perm_parser_comms;
+ else
+ perm_parser = &ice_switch_perm_parser_os;
- if (ad->devargs.pipe_mode_support)
ice_unregister_parser(perm_parser, ad);
- else
+ } else {
ice_unregister_parser(dist_parser, ad);
+ }
}
static struct
};
static struct
-ice_flow_parser ice_switch_perm_parser = {
+ice_flow_parser ice_switch_perm_parser_os = {
+ .engine = &ice_switch_engine,
+ .array = ice_switch_pattern_perm_os,
+ .array_len = RTE_DIM(ice_switch_pattern_perm_os),
+ .parse_pattern_action = ice_switch_parse_pattern_action,
+ .stage = ICE_FLOW_STAGE_PERMISSION,
+};
+
+static struct
+ice_flow_parser ice_switch_perm_parser_comms = {
.engine = &ice_switch_engine,
- .array = ice_switch_pattern_perm,
- .array_len = RTE_DIM(ice_switch_pattern_perm),
+ .array = ice_switch_pattern_perm_comms,
+ .array_len = RTE_DIM(ice_switch_pattern_perm_comms),
.parse_pattern_action = ice_switch_parse_pattern_action,
.stage = ICE_FLOW_STAGE_PERMISSION,
};