[v10,3/7] ethdev: add flow action type update as an offload

Message ID 20191009153357.926-4-pbhagavatula@marvell.com
State Superseded
Headers show
Series
  • ethdev: add new Rx offload flags
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Bhagavatula Oct. 9, 2019, 3:33 p.m.
From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

Patch

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@  Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 55b334a6d..b319a4339 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -94,6 +94,15 @@  New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 096e6a13c..71d915213 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@  static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 6110c1772..db32f5589 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@  struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@  enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@  enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */