@@ -310,6 +310,38 @@ add_meta_tag(struct rte_flow_item *items,
items[items_counter].mask = &tag_mask;
}
+static void
+add_icmpv4(struct rte_flow_item *items,
+ uint8_t items_counter,
+ __rte_unused struct additional_para para)
+{
+ static struct rte_flow_item_icmp icmpv4_spec;
+ static struct rte_flow_item_icmp icmpv4_mask;
+
+ memset(&icmpv4_spec, 0, sizeof(struct rte_flow_item_icmp));
+ memset(&icmpv4_mask, 0, sizeof(struct rte_flow_item_icmp));
+
+ items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP;
+ items[items_counter].spec = &icmpv4_spec;
+ items[items_counter].mask = &icmpv4_mask;
+}
+
+static void
+add_icmpv6(struct rte_flow_item *items,
+ uint8_t items_counter,
+ __rte_unused struct additional_para para)
+{
+ static struct rte_flow_item_icmp6 icmpv6_spec;
+ static struct rte_flow_item_icmp6 icmpv6_mask;
+
+ memset(&icmpv6_spec, 0, sizeof(struct rte_flow_item_icmp6));
+ memset(&icmpv6_mask, 0, sizeof(struct rte_flow_item_icmp6));
+
+ items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP6;
+ items[items_counter].spec = &icmpv6_spec;
+ items[items_counter].mask = &icmpv6_mask;
+}
+
void
fill_items(struct rte_flow_item *items,
uint64_t *flow_items, uint32_t outer_ip_src)
@@ -381,7 +413,14 @@ fill_items(struct rte_flow_item *items,
.mask = RTE_FLOW_ITEM_TYPE_GTP,
.funct = add_gtp,
},
-
+ {
+ .mask = RTE_FLOW_ITEM_TYPE_ICMP,
+ .funct = add_icmpv4,
+ },
+ {
+ .mask = RTE_FLOW_ITEM_TYPE_ICMP6,
+ .funct = add_icmpv6,
+ },
};
for (j = 0; j < MAX_ITEMS_NUM; j++) {
@@ -130,6 +130,8 @@ usage(char *progname)
printf(" --gtp: add gtp layer in flow items\n");
printf(" --meta: add meta layer in flow items\n");
printf(" --tag: add tag layer in flow items\n");
+ printf(" --icmpv4: add icmpv4 layer in flow items\n");
+ printf(" --icmpv6: add icmpv6 layer in flow items\n");
printf("To set flow actions:\n");
printf(" --port-id: add port-id action in flow actions\n");
@@ -284,6 +286,18 @@ args_parse(int argc, char **argv)
.map = &flow_items[0],
.map_idx = &items_idx
},
+ {
+ .str = "icmpv4",
+ .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ICMP),
+ .map = &flow_items[0],
+ .map_idx = &items_idx
+ },
+ {
+ .str = "icmpv6",
+ .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ICMP6),
+ .map = &flow_items[0],
+ .map_idx = &items_idx
+ },
{
.str = "ingress",
.mask = INGRESS,
@@ -538,6 +552,8 @@ args_parse(int argc, char **argv)
{ "gtp", 0, 0, 0 },
{ "meta", 0, 0, 0 },
{ "tag", 0, 0, 0 },
+ { "icmpv4", 0, 0, 0 },
+ { "icmpv6", 0, 0, 0 },
/* Actions */
{ "port-id", 0, 0, 0 },
{ "rss", 0, 0, 0 },
@@ -287,6 +287,8 @@ New Features
* Add new option to set portmask for insertion/deletion:
``--portmask=N`` Where N represent the hexadecimal
bitmask of ports used.
+ * Start supporting icmp and icmp6 matching items.
+
Removed Items
-------------
@@ -175,6 +175,12 @@ Items:
under ``TAG_INDEX`` with full mask, default value = 0.
Other fields are open mask.
+* ``--icmpv4``
+ Add icmpv4 item to all flows items, This item have open mask.
+
+* ``--icmpv6``
+ Add icmpv6 item to all flows items, This item have open mask.
+
Actions: