]> git.droids-corp.org - dpdk.git/commitdiff
net/ice: support drop any and steer all to queue
authorYuying Zhang <yuying.zhang@intel.com>
Wed, 26 Jan 2022 15:57:10 +0000 (15:57 +0000)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 9 Feb 2022 02:16:44 +0000 (03:16 +0100)
This patch supports drop any and steer all to queue in switch
filter. Support new rte_flow pattern any to handle all packets.
The usage is listed below.

1. drop any:
flow create 0 ingress pattern any / end actions drop / end
All packets received in port 0 will be dropped.

2. steer all to queue:
flow create 0 ingress pattern any / end actions queue index 3 / end
All packets received in port 0 will be steered to queue 3.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
doc/guides/nics/features/ice.ini
drivers/net/ice/ice_generic_flow.c
drivers/net/ice/ice_generic_flow.h
drivers/net/ice/ice_switch_filter.c

index a15f42f94c7b9697f1115310bfe0013ed114346e..7861790a51bc538b69f532ed4b9ef144d0b49854 100644 (file)
@@ -50,6 +50,7 @@ x86-64               = Y
 
 [rte_flow items]
 ah                   = Y
+any                  = Y
 arp_eth_ipv4         = Y
 esp                  = Y
 eth                  = Y
index 406a0a953f6ecdc153745db4819bd062e47edb4a..53b1c0b69a12494259e10450f500a58aa0f90cfb 100644 (file)
@@ -65,6 +65,11 @@ enum rte_flow_item_type pattern_empty[] = {
        RTE_FLOW_ITEM_TYPE_END,
 };
 
+enum rte_flow_item_type pattern_any[] = {
+       RTE_FLOW_ITEM_TYPE_ANY,
+       RTE_FLOW_ITEM_TYPE_END,
+};
+
 /* raw */
 enum rte_flow_item_type pattern_raw[] = {
        RTE_FLOW_ITEM_TYPE_RAW,
@@ -2111,6 +2116,7 @@ struct ice_ptype_match {
 
 static struct ice_ptype_match ice_ptype_map[] = {
        {pattern_raw,                                   ICE_PTYPE_IPV4_PAY},
+       {pattern_any,                                   ICE_PTYPE_IPV4_PAY},
        {pattern_eth_ipv4,                              ICE_PTYPE_IPV4_PAY},
        {pattern_eth_ipv4_udp,                          ICE_PTYPE_IPV4_UDP_PAY},
        {pattern_eth_ipv4_tcp,                          ICE_PTYPE_IPV4_TCP_PAY},
index 1b030c04669512b827065758434984e1a7219b3c..11f51a5c151f87793c1c82fa8de2a85f2b6d9cb1 100644 (file)
 /* empty pattern */
 extern enum rte_flow_item_type pattern_empty[];
 
+/* any pattern */
+extern enum rte_flow_item_type pattern_any[];
+
 /* raw pattern */
 extern enum rte_flow_item_type pattern_raw[];
 
index bd805d960612f87af75d0ec519ad3b447ba5a3a4..36c9bffb73509b47e09c26306a3217f68ac0f0e1 100644 (file)
@@ -206,6 +206,7 @@ static struct ice_flow_parser ice_switch_perm_parser;
 
 static struct
 ice_pattern_match_item ice_switch_pattern_dist_list[] = {
+       {pattern_any,                                   ICE_INSET_NONE,                         ICE_INSET_NONE,                         ICE_INSET_NONE},
        {pattern_ethertype,                             ICE_SW_INSET_ETHER,                     ICE_INSET_NONE,                         ICE_INSET_NONE},
        {pattern_ethertype_vlan,                        ICE_SW_INSET_MAC_VLAN,                  ICE_INSET_NONE,                         ICE_INSET_NONE},
        {pattern_ethertype_qinq,                        ICE_SW_INSET_MAC_QINQ,                  ICE_INSET_NONE,                         ICE_INSET_NONE},
@@ -289,6 +290,7 @@ ice_pattern_match_item ice_switch_pattern_dist_list[] = {
 
 static struct
 ice_pattern_match_item ice_switch_pattern_perm_list[] = {
+       {pattern_any,                                   ICE_INSET_NONE,                         ICE_INSET_NONE,                         ICE_INSET_NONE},
        {pattern_ethertype,                             ICE_SW_INSET_ETHER,                     ICE_INSET_NONE,                         ICE_INSET_NONE},
        {pattern_ethertype_vlan,                        ICE_SW_INSET_MAC_VLAN,                  ICE_INSET_NONE,                         ICE_INSET_NONE},
        {pattern_ethertype_qinq,                        ICE_SW_INSET_MAC_QINQ,                  ICE_INSET_NONE,                         ICE_INSET_NONE},
@@ -582,6 +584,10 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],
                item_type = item->type;
 
                switch (item_type) {
+               case RTE_FLOW_ITEM_TYPE_ANY:
+                       *tun_type = ICE_SW_TUN_AND_NON_TUN;
+                       break;
+
                case RTE_FLOW_ITEM_TYPE_ETH:
                        eth_spec = item->spec;
                        eth_mask = item->mask;