diff mbox series

[ovs-dev,v2] netdev_offload_dpdk: Support icmpv6 offload.

Message ID 20241106021310.207-1-allen.chen@jaguarmicro.com
State Changes Requested
Delegated to: Simon Horman
Headers show
Series [ovs-dev,v2] netdev_offload_dpdk: Support icmpv6 offload. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Allen Chen Nov. 6, 2024, 2:13 a.m. UTC
Support icmpv6 offload

Signed-off-by: Allen Chen <allen.chen@jaguarmicro.com>
---
 lib/netdev-offload-dpdk.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 1a6e100ff..19da8f4d4 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -1684,6 +1684,22 @@  parse_flow_match(struct netdev *netdev,
         consumed_masks->tp_dst = 0;
 
         add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ICMP, spec, mask, NULL);
+    } else if (proto == IPPROTO_ICMPV6) {
+        struct rte_flow_item_icmp6 *spec, *mask;
+
+        spec = xzalloc(sizeof *spec);
+        mask = xzalloc(sizeof *mask);
+
+        spec->type = (uint8_t) ntohs(match->flow.tp_src);
+        spec->code = (uint8_t) ntohs(match->flow.tp_dst);
+
+        mask->type = (uint8_t) ntohs(match->wc.masks.tp_src);
+        mask->code = (uint8_t) ntohs(match->wc.masks.tp_dst);
+
+        consumed_masks->tp_src = 0;
+        consumed_masks->tp_dst = 0;
+
+        add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ICMP6, spec, mask, NULL);
     }
 
     add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_END, NULL, NULL, NULL);