DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC] ethdev: add IPv6 fragment extension header item
       [not found] <AM4PR05MB34601FD61A89BE0A2CD8B6BEB6F70@AM4PR05MB3460.eurprd05.prod.outlook.com>
@ 2020-03-18 16:46 ` Dekel Peled
  0 siblings, 0 replies; only message in thread
From: Dekel Peled @ 2020-03-18 16:46 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, Ori Kam, john.mcnamara, Kovacevic, Marko
  Cc: Asaf Penso, Matan Azrad, Eli Britstein, dev

Applications handling fragmented IPv6 packets need to match on IPv6 fragment extension header,
in order to identify the fragments order and location in the packet.
This RFC introduced the IPv6 fragment extension header item.


Signed-off-by: Dekel Peled <dekelp@mellanox.com<mailto:dekelp@mellanox.com>>

---
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 41c1479..fd8d5b7 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1170,6 +1170,19 @@ Normally preceded by any of:
 - `Item: IPV6`_
 - `Item: IPV6_EXT`_

+Item: ``IPV6_FRAG_EXT``
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Matches the presence of IPv6 fragment extension header.
+
+- ``hdr``: IPv6 fragment extension header definition (``rte_ip_frag.h``).
+- Default ``mask`` matches next_header and frag_data fields only.
+
+Preceded by any of:
+
+- `Item: IPV6`_
+- `Item: IPV6_EXT`_
+
 Item: ``ICMP6``
 ^^^^^^^^^^^^^^^

diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index b43238b..7f30a09 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -30,6 +30,7 @@
 #include <rte_higig.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
+#include <rte_ip_frag.h>

 #ifdef __cplusplus
 extern "C" {
@@ -367,6 +368,13 @@ enum rte_flow_item_type {
        RTE_FLOW_ITEM_TYPE_IPV6_EXT,

        /**
+        * Matches the presence of IPv6 fragment extension header.
+        *
+        * See struct rte_flow_item_ipv6_frag_ext.
+        */
+       RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT,
+
+       /**
         * Matches any ICMPv6 header.
         *
         * See struct rte_flow_item_icmp6.
@@ -1149,6 +1157,31 @@ struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask = {
#endif

/**
+ * RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT
+ *
+ * Matches the presence of IPv6 fragment extension header.
+ *
+ * Preceded by any of:
+ *
+ * - RTE_FLOW_ITEM_TYPE_IPV6
+ * - RTE_FLOW_ITEM_TYPE_IPV6_EXT
+ */
+struct rte_flow_item_ipv6_frag_ext {
+       struct ipv6_extension_fragment hdr;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT. */
+#ifndef __cplusplus
+static const
+struct rte_flow_item_ipv6_frag_ext rte_flow_item_ipv6_frag_ext_mask = {
+       .hdr = {
+               .next_header = 0xff,
+               .frag_data = RTE_BE16(0xffff),
+       },
+};
+#endif
+
+/**
  * RTE_FLOW_ITEM_TYPE_ICMP6
  *
  * Matches any ICMPv6 header.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-18 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AM4PR05MB34601FD61A89BE0A2CD8B6BEB6F70@AM4PR05MB3460.eurprd05.prod.outlook.com>
2020-03-18 16:46 ` [dpdk-dev] [RFC] ethdev: add IPv6 fragment extension header item Dekel Peled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).