DPDK patches and discussions
 help / color / mirror / Atom feed
From: <kirankumark@marvell.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>
Cc: <dev@dpdk.org>, Kiran Kumar K <kirankumark@marvell.com>
Subject: [dpdk-dev]  [PATCH v3 2/3] ethdev: add IGMP key field to flow API
Date: Thu, 25 Jul 2019 14:33:44 +0530	[thread overview]
Message-ID: <20190725090345.31814-2-kirankumark@marvell.com> (raw)
In-Reply-To: <20190725090345.31814-1-kirankumark@marvell.com>

From: Kiran Kumar K <kirankumark@marvell.com>

Add new rte_flow_item_igmp in order to match the Internet Group
Management Protocol based on RFC 2236.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
V3 changes:
* Fixed checkpatch issue

V2 changes:
* updated supported items in doc

 doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
 lib/librte_ethdev/rte_flow.c       |  1 +
 lib/librte_ethdev/rte_flow.h       | 31 ++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 4109f199a..f786fa3c2 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1237,6 +1237,18 @@ Matches a network service header (RFC 8300).
 - Default ``mask`` matches mdtype, next_proto, spi, sindex.


+Item: ``IGMP``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a Internet Group Management Protocol (RFC 2236).
+
+- ``type``: IGMP message type (Query/Report).
+- ``max_resp_time``: max time allowed before sending report.
+- ``checksum``: checksum, 1s complement of whole IGMP message.
+- ``group_addr``: group address, for Query value will be 0.
+- Default ``mask`` matches group_addr.
+
+
 Actions
 ~~~~~~~

diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index 39646167c..4dee4f9c2 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -76,6 +76,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
 	MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)),
 	MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)),
 	MK_FLOW_ITEM(NSH, sizeof(struct rte_flow_item_nsh)),
+	MK_FLOW_ITEM(IGMP, sizeof(struct rte_flow_item_igmp)),
 };

 /** Generate flow_action[] entry. */
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index f0e99fa3e..ce8072613 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -441,6 +441,14 @@ enum rte_flow_item_type {
 	 *
 	 */
 	RTE_FLOW_ITEM_TYPE_NSH,
+
+	/**
+	 * Matches Internet Group Management Protocol (IGMP).
+	 * See struct rte_flow_item_igmp.
+	 *
+	 */
+	RTE_FLOW_ITEM_TYPE_IGMP,
+
 };

 /**
@@ -1253,6 +1261,29 @@ static const struct rte_flow_item_nsh rte_flow_item_nsh_mask = {
 };
 #endif

+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_IGMP
+ *
+ * Match Internet Group Management Protocol (IGMP), RFC 2236
+ *
+ */
+struct rte_flow_item_igmp {
+	uint32_t type:8;
+	uint32_t max_resp_time:8;
+	uint32_t checksum:16;
+	uint32_t group_addr;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_IGMP. */
+#ifndef __cplusplus
+static const struct rte_flow_item_igmp rte_flow_item_igmp_mask = {
+	.group_addr = 0xffffffff,
+};
+#endif
+
 /**
  * Matching pattern item definition.
  *
--
2.17.1


  reply	other threads:[~2019-07-25  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  9:03 [dpdk-dev] [PATCH v3 1/3] ethdev: add NSH " kirankumark
2019-07-25  9:03 ` kirankumark [this message]
2019-07-25  9:03 ` [dpdk-dev] [PATCH v3 3/3] ethdev: add AH " kirankumark
2019-09-30 15:45 ` [dpdk-dev] [PATCH v3 1/3] ethdev: add NSH " Yigit, Ferruh
2019-10-08 14:16   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190725090345.31814-2-kirankumark@marvell.com \
    --to=kirankumark@marvell.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).