DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/8] add flow action map
@ 2020-06-03 14:20 Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action Bernard Iremonger
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

Add map action to rte_flow API to map a Packet Classification type (pctype)
to a flowtype for the i40e PMD.

This feature requires changes to be made to the rte_flow code in librte_ethdev,
testpmd and the i40e PMD.


Bernard Iremonger (8):
  librte_ethdev: add new flow types and action
  librte_ethdev: add map filter type
  librte_ethdev: add map action
  app/testpmd: parse map actions
  net/i40e: add map filter
  net/i40e: add map functions
  net/i40e: parse map pattern and action
  doc: release note

 app/test-pmd/cmdline_flow.c                 |  85 ++++++++++++
 doc/guides/prog_guide/rte_flow.rst          |  55 ++++++++
 doc/guides/rel_notes/release_20_08.rst      |  18 +++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  27 ++++
 drivers/net/i40e/i40e_ethdev.c              |  56 ++++++++
 drivers/net/i40e/i40e_ethdev.h              |  24 ++++
 drivers/net/i40e/i40e_flow.c                | 196 ++++++++++++++++++++++++++++
 lib/librte_ethdev/rte_eth_ctrl.h            |   1 +
 lib/librte_ethdev/rte_flow.c                |  14 ++
 lib/librte_ethdev/rte_flow.h                |  78 +++++++++++
 10 files changed, 554 insertions(+)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 2/8] librte_ethdev: add map filter type Bernard Iremonger
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

In rte_flow.h:
add RTE_FLOW_ITEM_TYPE_PCTYPE
add RTE_FLOW_ITEM_TYPE_FLOWTYPE
add RTE_FLOW_ACTION_TYPE_MAP
add structs and masks for new flow types

In rte_flow.rst:
add items for pctype and flowtype
add action for map

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/prog_guide/rte_flow.rst | 55 +++++++++++++++++++++++++++
 lib/librte_ethdev/rte_flow.h       | 78 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 133 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index d5dd18c..9b54154 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1362,6 +1362,44 @@ Matches a PFCP Header.
 - ``seid``: session endpoint identifier.
 - Default ``mask`` matches s_field and seid.
 
+Item: ``PCTYPE``
+^^^^^^^^^^^^^^^^
+
+Matches a PCTYPE
+
+.. _table_rte_flow_item_pctype:
+
+.. table:: PCTYPE
+
+   +----------+----------+---------------------------------------+
+   | Field    | Subfield | Value                                 |
+   +==========+==========+=======================================+
+   | ``spec`` | ``data`` | 64 bit pctype value                   |
+   +----------+----------+---------------------------------------+
+   | ``last`` | ``data`` | upper range value                     |
+   +----------+----------+---------------------------------------+
+   | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" |
+   +----------+----------+---------------------------------------+
+
+Item: ``FLOWTYPE``
+^^^^^^^^^^^^^^^^^^
+
+Matches a FLOWTYPE
+
+.. _table_rte_flow_item_flowtype:
+
+.. table:: FLOWTYPE
+
+   +----------+----------+---------------------------------------+
+   | Field    | Subfield | Value                                 |
+   +==========+==========+=======================================+
+   | ``spec`` | ``data`` | 16 bit flowtype value                 |
+   +----------+----------+---------------------------------------+
+   | ``last`` | ``data`` | upper range value                     |
+   +----------+----------+---------------------------------------+
+   | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" |
+   +----------+----------+---------------------------------------+
+
 Actions
 ~~~~~~~
 
@@ -2645,6 +2683,23 @@ timeout passed without any matching on the flow.
    | ``context``  | user input flow context         |
    +--------------+---------------------------------+
 
+Action: ``MAP``
+^^^^^^^^^^^^^^^
+
+Map pctype to flowtype.
+
+.. _table_rte_flow_action_map:
+
+.. table:: MAP
+
+   +--------------+---------------------------------+
+   | Field        | Value                           |
+   +==============+=================================+
+   | ``pctype``   | 64 bit pctype value             |
+   +--------------+---------------------------------+
+   | ``flowtype`` | 16 bit flowtype value           |
+   +--------------+---------------------------------+
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index b0e4199..dcae7b9 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -527,6 +527,20 @@ enum rte_flow_item_type {
 	 */
 	RTE_FLOW_ITEM_TYPE_PFCP,
 
+	/**
+	 * Matches Packet Classification type (PCTYPE).
+	 * See struct rte_flow_item_pctype.
+	 *
+	 */
+	RTE_FLOW_ITEM_TYPE_PCTYPE,
+
+	/**
+	 * Matches flow type.
+	 * See struct rte_flow_item_flowtype.
+	 *
+	 */
+	RTE_FLOW_ITEM_TYPE_FLOWTYPE,
+
 };
 
 /**
@@ -1547,6 +1561,46 @@ static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask = {
 #endif
 
 /**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_PCTYPE
+ *
+ * Match Packet Classification type (PCTYPE)
+ *
+ */
+struct rte_flow_item_pctype {
+	uint64_t pctype;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_PCTYPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_pctype rte_flow_item_pctype_mask = {
+	.pctype = 0xffffffffffffffff,
+};
+#endif
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_FLOWTYPE
+ *
+ * Match flow type
+ *
+ */
+struct rte_flow_item_flowtype {
+	uint16_t flowtype;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_FLOWTYPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_flowtype rte_flow_item_flowtype_mask = {
+	.flowtype = 0xffff,
+};
+#endif
+
+/**
  * Matching pattern item definition.
  *
  * A pattern is formed by stacking items starting from the lowest protocol
@@ -2099,6 +2153,17 @@ enum rte_flow_action_type {
 	 * see enum RTE_ETH_EVENT_FLOW_AGED
 	 */
 	RTE_FLOW_ACTION_TYPE_AGE,
+
+	/**
+	 * Map Packet Classification type to flow type.
+	 *
+	 * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_PCTYPE,
+	 * and a valid RTE_FLOW_ITEM_FLOWTYPE the PMD should return a
+	 * RTE_FLOW_ERROR_TYPE_ACTION error.
+	 *
+	 * See struct rte_flow_action_map.
+	 */
+	RTE_FLOW_ACTION_TYPE_MAP,
 };
 
 /**
@@ -2660,6 +2725,19 @@ struct rte_flow_action_set_dscp {
 	uint8_t dscp;
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_MAP
+ *
+ * Map a packet classification type to a flow type.
+ */
+struct rte_flow_action_map {
+	uint16_t flowtype;
+	uint64_t pctype;
+};
+
 /* Mbuf dynamic field offset for metadata. */
 extern int32_t rte_flow_dynf_metadata_offs;
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 2/8] librte_ethdev: add map filter type
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action Bernard Iremonger
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

add RTE_ETH_FILTER_MAP in rte_eth_ctrl.h

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_eth_ctrl.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h
index 1416c37..c9c0ea4 100644
--- a/lib/librte_ethdev/rte_eth_ctrl.h
+++ b/lib/librte_ethdev/rte_eth_ctrl.h
@@ -37,6 +37,7 @@ enum rte_filter_type {
 	RTE_ETH_FILTER_HASH,
 	RTE_ETH_FILTER_L2_TUNNEL,
 	RTE_ETH_FILTER_GENERIC,
+	RTE_ETH_FILTER_MAP,
 	RTE_ETH_FILTER_MAX
 };
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 2/8] librte_ethdev: add map filter type Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 4/8] app/testpmd: parse map actions Bernard Iremonger
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

add MK_FLOW_ACTION(MAP, sizeof(struct rte_flow_action_map))
add case RTE_FLOW_ACTION_TYPE_MAP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_flow.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index 1685be5..b963d9f 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -173,6 +173,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
 	MK_FLOW_ACTION(SET_IPV4_DSCP, sizeof(struct rte_flow_action_set_dscp)),
 	MK_FLOW_ACTION(SET_IPV6_DSCP, sizeof(struct rte_flow_action_set_dscp)),
 	MK_FLOW_ACTION(AGE, sizeof(struct rte_flow_action_age)),
+	MK_FLOW_ACTION(MAP, sizeof(struct rte_flow_action_map)),
 };
 
 int
@@ -596,11 +597,13 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
 			const struct rte_flow_action_rss *rss;
 			const struct rte_flow_action_vxlan_encap *vxlan_encap;
 			const struct rte_flow_action_nvgre_encap *nvgre_encap;
+			const struct rte_flow_action_map *map;
 		} src;
 		union {
 			struct rte_flow_action_rss *rss;
 			struct rte_flow_action_vxlan_encap *vxlan_encap;
 			struct rte_flow_action_nvgre_encap *nvgre_encap;
+			struct rte_flow_action_map *map;
 		} dst;
 		size_t tmp;
 		int ret;
@@ -665,6 +668,17 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
 			off += ret;
 		}
 		break;
+	case RTE_FLOW_ACTION_TYPE_MAP:
+		src.map = action->conf;
+		dst.map = buf;
+		rte_memcpy(dst.map,
+			   (&(struct rte_flow_action_map){
+				.pctype = src.map->pctype,
+				.flowtype = src.map->flowtype,
+			   }),
+			   size > sizeof(*dst.map) ? sizeof(*dst.map) : size);
+		off = sizeof(*dst.map);
+		break;
 	default:
 		off = rte_flow_desc_action[action->type].size;
 		rte_memcpy(buf, action->conf, (size > off ? off : size));
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 4/8] app/testpmd: parse map actions
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
                   ` (2 preceding siblings ...)
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 5/8] net/i40e: add map filter Bernard Iremonger
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

Parse map, pctype and flowtype on testpmd command line.

In cmdline_flow.c add the following:

ACTION_MAP
ACTION_MAP_PCTYPE
ACTION_MAP_FLOWTYPE
add parse_vc_action_map()

Update testpmd user guide with map action and
sample map action rules.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline_flow.c                 | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 27 +++++++++
 2 files changed, 112 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4e2006c..3b7f775 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -349,6 +349,9 @@ enum index {
 	ACTION_SET_IPV6_DSCP_VALUE,
 	ACTION_AGE,
 	ACTION_AGE_TIMEOUT,
+	ACTION_MAP,
+	ACTION_MAP_PCTYPE,
+	ACTION_MAP_FLOWTYPE,
 };
 
 /** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -368,6 +371,11 @@ struct action_rss_data {
 	uint16_t queue[ACTION_RSS_QUEUE_NUM];
 };
 
+/** Storage for struct rte_flow_action_map including external data. */
+struct action_map_data {
+	struct rte_flow_action_map conf;
+};
+
 /** Maximum data size in struct rte_flow_action_raw_encap. */
 #define ACTION_RAW_ENCAP_MAX_DATA 128
 #define RAW_ENCAP_CONFS_MAX_NUM 8
@@ -1161,6 +1169,7 @@ static const enum index next_action[] = {
 	ACTION_SET_IPV4_DSCP,
 	ACTION_SET_IPV6_DSCP,
 	ACTION_AGE,
+	ACTION_MAP,
 	ZERO,
 };
 
@@ -1194,6 +1203,13 @@ static const enum index action_rss[] = {
 	ZERO,
 };
 
+static const enum index action_map[] = {
+	ACTION_MAP_PCTYPE,
+	ACTION_MAP_FLOWTYPE,
+	ACTION_NEXT,
+	ZERO,
+};
+
 static const enum index action_vf[] = {
 	ACTION_VF_ORIGINAL,
 	ACTION_VF_ID,
@@ -1421,6 +1437,9 @@ static int parse_vc_action_rss_type(struct context *, const struct token *,
 static int parse_vc_action_rss_queue(struct context *, const struct token *,
 				     const char *, unsigned int, void *,
 				     unsigned int);
+static int parse_vc_action_map(struct context *, const struct token *,
+			       const char *, unsigned int, void *,
+			       unsigned int);
 static int parse_vc_action_vxlan_encap(struct context *, const struct token *,
 				       const char *, unsigned int, void *,
 				       unsigned int);
@@ -3609,6 +3628,36 @@ static const struct token token_list[] = {
 		.call = parse_vc_action_raw_decap_index,
 		.comp = comp_set_raw_index,
 	},
+	[ACTION_MAP] = {
+		.name = "map",
+		.help = "map Packet Classification type to flow type",
+		.priv = PRIV_ACTION(MAP, sizeof(struct action_map_data)),
+		.next = NEXT(action_map),
+		.args = ARGS(ARGS_ENTRY(struct rte_flow_action_map, pctype),
+			     ARGS_ENTRY(struct rte_flow_action_map,
+						flowtype)),
+		.call = parse_vc_action_map,
+	},
+	[ACTION_MAP_PCTYPE] = {
+		.name = "pctype",
+		.help = "Packet Classification type ",
+		.next = NEXT(action_map, NEXT_ENTRY(UNSIGNED)),
+		.args = ARGS(ARGS_ENTRY_ARB
+			     (offsetof(struct action_map_data, conf) +
+			      offsetof(struct rte_flow_action_map, pctype),
+			      sizeof(((struct rte_flow_action_map *)0)->
+				     pctype))),
+	},
+	[ACTION_MAP_FLOWTYPE] = {
+		.name = "flowtype",
+		.help = "flow type ",
+		.next = NEXT(action_map, NEXT_ENTRY(UNSIGNED)),
+		.args = ARGS(ARGS_ENTRY_ARB
+			     (offsetof(struct action_map_data, conf) +
+			      offsetof(struct rte_flow_action_map, flowtype),
+			      sizeof(((struct rte_flow_action_map *)0)->
+				     flowtype))),
+	},
 	/* Top level command. */
 	[SET] = {
 		.name = "set",
@@ -5207,6 +5256,42 @@ parse_vc_action_set_meta(struct context *ctx, const struct token *token,
 	return len;
 }
 
+/** Parse MAP action. */
+static int
+parse_vc_action_map(struct context *ctx, const struct token *token,
+		    const char *str, unsigned int len,
+		    void *buf, unsigned int size)
+{
+	struct buffer *out = buf;
+	struct rte_flow_action *action;
+	struct action_map_data *action_map_data;
+	int ret;
+
+	ret = parse_vc(ctx, token, str, len, buf, size);
+	if (ret < 0)
+		return ret;
+	/* Nothing else to do if there is no buffer. */
+	if (!out)
+		return ret;
+	if (!out->args.vc.actions_n)
+		return -1;
+	action = &out->args.vc.actions[out->args.vc.actions_n - 1];
+	/* Point to selected object. */
+	ctx->object = out->args.vc.data;
+	ctx->objmask = NULL;
+	/* Set up default configuration. */
+	action_map_data = ctx->object;
+	*action_map_data = (struct action_map_data){
+		.conf = (struct rte_flow_action_map){
+			.flowtype = 0,
+			.pctype = 0
+		},
+	};
+
+	action->conf = &action_map_data->conf;
+	return ret;
+}
+
 /** Parse tokens for destroy command. */
 static int
 parse_destroy(struct context *ctx, const struct token *token,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index a808b6a..d0c0b09 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -4281,6 +4281,8 @@ This section lists supported actions and their attributes, if any.
 
   - ``dscp_value {unsigned}``: The new DSCP value to be set
 
+- ``map``: map Packet Classification (PC) type to flow type.
+
 Destroying flow rules
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -4936,6 +4938,31 @@ if seid is set)::
  testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 1
         seid is 1 / end actions queue index 3 / end
 
+Sample PCTYPE mapping rules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following sequence of commands is required for pctype mapping::
+
+ testpmd> port stop 0
+ testpmd> flow create 0 ingress pattern end actions map pctype 15 flowtype 27 /
+        end
+ testpmd> show port 0 pctype mapping
+ pctype: 15  ->  flowtype: 27
+
+ testpmd> port start 0
+ testpmd> flow create 0 ingress pattern end actions rss types end queues 0 1 2
+        3 end / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / esp / end actions rss
+        types esp end queues end / end
+
+ testpmd> flow list 0
+ ID Group   Prio    Attr Rule
+ 0  0       0       i--  => MAP
+ 1  0       0       i--  => RSS
+ 2  0       0       i--  ETH IPV4 ESP => RSS
+ testpmd> set verbose 1
+ testpmd> start
+
 BPF Functions
 --------------
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 5/8] net/i40e: add map filter
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
                   ` (3 preceding siblings ...)
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 4/8] app/testpmd: parse map actions Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 6/8] net/i40e: add map functions Bernard Iremonger
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

In i40e_ethdev.h add the following:

struct i40e_map_filter
struct i40e_rte_flow_map_conf

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index e5d0ce5..2426e29 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -762,6 +762,10 @@ struct i40e_rss_pattern_info {
 	uint64_t types;
 };
 
+struct i40e_map_pattern_info {
+	uint8_t action_flag;
+};
+
 /* Tunnel filter number HW supports */
 #define I40E_MAX_TUNNEL_FILTER_NUM 400
 
@@ -992,6 +996,19 @@ struct i40e_rss_filter {
 	struct i40e_rte_flow_rss_conf rss_filter_info;
 };
 
+struct i40e_rte_flow_map_conf {
+	struct rte_flow_action_map conf; /**< MAP parameters. */
+	bool valid; /* Check if it's valid */
+};
+
+TAILQ_HEAD(i40e_map_conf_list, i40e_map_filter);
+
+/* MAP filter list structure */
+struct i40e_map_filter {
+	TAILQ_ENTRY(i40e_map_filter) next;
+	struct i40e_rte_flow_map_conf map_filter_info;
+};
+
 struct i40e_vf_msg_cfg {
 	/* maximal VF message during a statistic period */
 	uint32_t max_msg;
@@ -1085,6 +1102,8 @@ struct i40e_pf {
 	uint16_t switch_domain_id;
 
 	struct i40e_vf_msg_cfg vf_msg_cfg;
+	struct i40e_rte_flow_map_conf map_info; /* MAP info */
+	struct i40e_map_conf_list map_config_list; /* MAP rule list */
 };
 
 enum pending_msg {
@@ -1219,6 +1238,7 @@ union i40e_filter_t {
 	struct rte_eth_tunnel_filter_conf tunnel_filter;
 	struct i40e_tunnel_filter_conf consistent_tunnel_filter;
 	struct i40e_rte_flow_rss_conf rss_conf;
+	struct i40e_rte_flow_map_conf map_conf;
 };
 
 typedef int (*parse_filter_t)(struct rte_eth_dev *dev,
@@ -1365,6 +1385,10 @@ int i40e_config_rss_filter(struct i40e_pf *pf,
 		struct i40e_rte_flow_rss_conf *conf, bool add);
 int i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params);
 int i40e_vf_representor_uninit(struct rte_eth_dev *ethdev);
+int i40e_map_conf_init(struct i40e_rte_flow_map_conf *out,
+		       const struct rte_flow_action_map *in);
+int i40e_config_map_filter(struct i40e_pf *pf,
+		struct i40e_rte_flow_map_conf *conf, bool add);
 
 #define I40E_DEV_TO_PCI(eth_dev) \
 	RTE_DEV_TO_PCI((eth_dev)->device)
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 6/8] net/i40e: add map functions
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
                   ` (4 preceding siblings ...)
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 5/8] net/i40e: add map filter Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 7/8] net/i40e: parse map pattern and action Bernard Iremonger
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

add i40e_map_conf_init()
add i40e_config_map_filter()
initialize  map_config_list in pf
call rte_pmd_i40e_flow_type_mapping_update()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 56 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 970a31c..c7f0eec 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1660,6 +1660,9 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	/* initialize RSS rule list */
 	TAILQ_INIT(&pf->rss_config_list);
 
+	/* initialize MAP rule list */
+	TAILQ_INIT(&pf->map_config_list);
+
 	/* initialize Traffic Manager configuration */
 	i40e_tm_conf_init(dev);
 
@@ -13411,6 +13414,59 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 	return 0;
 }
 
+int
+i40e_map_conf_init(struct i40e_rte_flow_map_conf *out,
+		   const struct rte_flow_action_map *in)
+{
+	int ret = 0;
+
+	if ((in->pctype >= I40E_FILTER_PCTYPE_MAX) ||
+		(in->flowtype >= I40E_FLOW_TYPE_MAX))
+		ret = EINVAL;
+	else
+		out->conf = (struct rte_flow_action_map){
+			.pctype = in->pctype,
+			.flowtype = in->flowtype,
+		};
+	return ret;
+}
+
+int
+i40e_config_map_filter(struct i40e_pf *pf,
+		struct i40e_rte_flow_map_conf *map_conf, bool add)
+{
+	struct i40e_rte_flow_map_conf *map_info = &pf->map_info;
+	struct rte_flow_action_map update_conf = map_info->conf;
+	struct rte_pmd_i40e_flow_type_mapping type_map;
+	int ret;
+
+	if (add) {
+		update_conf.flowtype = map_conf->conf.flowtype;
+		update_conf.pctype = map_conf->conf.pctype;
+
+		type_map.flow_type = map_conf->conf.flowtype;
+		type_map.pctype = (1ULL << map_conf->conf.pctype);
+		ret = rte_pmd_i40e_flow_type_mapping_update(
+				pf->dev_data->port_id, &type_map, 1, 0);
+		if (ret)
+			return ret;
+
+		/* Update MAP info in pf */
+		if (i40e_map_conf_init(map_info, &update_conf))
+			return -EINVAL;
+
+	} else {
+		if (!map_conf->valid)
+			return 0;
+
+		map_info->conf.flowtype = 0;
+		map_info->conf.pctype = 0;
+		map_info->valid = false;
+	}
+
+	return 0;
+}
+
 RTE_INIT(i40e_init_log)
 {
 	i40e_logtype_init = rte_log_register("pmd.net.i40e.init");
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 7/8] net/i40e: parse map pattern and action
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
                   ` (5 preceding siblings ...)
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 6/8] net/i40e: add map functions Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 8/8] doc: release note Bernard Iremonger
  2020-06-04  6:05 ` [dpdk-dev] [PATCH 0/8] add flow action map Ori Kam
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

Parse the map pattern and action in i40e_flow.c

Add the following functions:
i40e_flow_parse_map_pattern()
i40e_flow_parse_map_action()
i40e_parse_map_filter()
i40e_config_map_filter_set()
i40e_config_map_filter_del()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 196 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 196 insertions(+)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 8f8df6f..9616a87 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4996,6 +4996,185 @@ i40e_config_rss_filter_del(struct rte_eth_dev *dev,
 }
 
 static int
+i40e_flow_parse_map_pattern(__rte_unused struct rte_eth_dev *dev,
+			     const struct rte_flow_item *pattern,
+			     struct i40e_map_pattern_info *p_info,
+			     struct rte_flow_error *error)
+{
+	const struct rte_flow_item *item = pattern;
+	enum rte_flow_item_type item_type;
+	struct rte_flow_item *items;
+	uint32_t item_num = 0; /* non-void item number of pattern*/
+	uint32_t i = 0;
+
+	if (item->type == RTE_FLOW_ITEM_TYPE_END) {
+		p_info->action_flag = 1;
+		return 0;
+	}
+
+	/* Convert pattern to item types */
+	while ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_END) {
+		if ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_VOID)
+			item_num++;
+		i++;
+	}
+	item_num++;
+
+	items = rte_zmalloc("i40e_pattern",
+			    item_num * sizeof(struct rte_flow_item), 0);
+	if (!items) {
+		rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ITEM_NUM,
+				   NULL, "No memory for PMD internal items.");
+		return -ENOMEM;
+	}
+
+	i40e_pattern_skip_void_item(items, pattern);
+
+	rte_free(items);
+
+	for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
+		if (item->last) {
+			rte_flow_error_set(error, EINVAL,
+					   RTE_FLOW_ERROR_TYPE_ITEM,
+					   item,
+					   "Not supported");
+			return -rte_errno;
+		}
+		item_type = item->type;
+		switch (item_type) {
+		case RTE_FLOW_ITEM_TYPE_ETH:
+			p_info->action_flag = 1;
+			break;
+
+		default:
+			rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ITEM,
+					item,
+					"item not supported");
+			return -rte_errno;
+		}
+	}
+
+	return 0;
+}
+
+static int
+i40e_flow_parse_map_action(__rte_unused struct rte_eth_dev *dev,
+			    const struct rte_flow_action *actions,
+			    struct i40e_map_pattern_info *p_info,
+			    struct rte_flow_error *error,
+			    union i40e_filter_t *filter)
+{
+	const struct rte_flow_action *act;
+	const struct rte_flow_action_map *map;
+	struct i40e_rte_flow_map_conf *map_conf = &filter->map_conf;
+	uint32_t index = 0;
+
+	NEXT_ITEM_OF_ACTION(act, actions, index);
+
+	/**
+	 * check if the first not void action is MAP.
+	 */
+	if ((act->type != RTE_FLOW_ACTION_TYPE_MAP) ||
+		(p_info->action_flag == 0)) {
+		memset(map_conf, 0, sizeof(struct i40e_rte_flow_map_conf));
+		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
+			act, "Not supported action.");
+		return -rte_errno;
+	}
+
+	map = act->conf;
+
+	if (i40e_map_conf_init(map_conf, map))
+		return rte_flow_error_set
+			(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act,
+			 "MAP context initialization failure");
+
+	map_conf->valid = true;
+
+	return 0;
+}
+
+static int
+i40e_parse_map_filter(struct rte_eth_dev *dev,
+			const struct rte_flow_attr *attr,
+			const struct rte_flow_item pattern[],
+			const struct rte_flow_action actions[],
+			union i40e_filter_t *filter,
+			struct rte_flow_error *error)
+{
+	struct i40e_map_pattern_info p_info;
+	int ret;
+
+	memset(&p_info, 0, sizeof(struct i40e_map_pattern_info));
+
+	ret = i40e_flow_parse_map_pattern(dev, pattern, &p_info, error);
+	if (ret)
+		return ret;
+
+	ret = i40e_flow_parse_map_action(dev, actions, &p_info, error, filter);
+	if (ret)
+		return ret;
+
+	ret = i40e_flow_parse_attr(attr, error);
+	if (ret)
+		return ret;
+
+	cons_filter_type = RTE_ETH_FILTER_MAP;
+
+	return 0;
+}
+
+static int
+i40e_config_map_filter_set(struct rte_eth_dev *dev,
+		struct i40e_rte_flow_map_conf *conf)
+{
+	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_map_filter *map_filter;
+	int ret;
+
+	ret = i40e_config_map_filter(pf, conf, 1);
+	if (ret)
+		return ret;
+
+	map_filter = rte_zmalloc("i40e_map_filter", sizeof(*map_filter), 0);
+	if (map_filter == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to alloc memory.");
+		return -ENOMEM;
+	}
+	map_filter->map_filter_info = *conf;
+
+	/* the rule newly created is always valid
+	 * the existing rule covered by new rule will be set invalid
+	 */
+	map_filter->map_filter_info.valid = true;
+
+	TAILQ_INSERT_TAIL(&pf->map_config_list, map_filter, next);
+
+	return 0;
+}
+
+static int
+i40e_config_map_filter_del(struct rte_eth_dev *dev,
+		struct i40e_rte_flow_map_conf *conf)
+{
+	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_map_filter *map_filter;
+	void *temp;
+
+	i40e_config_map_filter(pf, conf, 0);
+
+	TAILQ_FOREACH_SAFE(map_filter, &pf->map_config_list, next, temp) {
+		if (!memcmp(&map_filter->map_filter_info, conf,
+			sizeof(struct rte_flow_action_map))) {
+			TAILQ_REMOVE(&pf->map_config_list, map_filter, next);
+			rte_free(map_filter);
+		}
+	}
+	return 0;
+}
+
+static int
 i40e_flow_validate(struct rte_eth_dev *dev,
 		   const struct rte_flow_attr *attr,
 		   const struct rte_flow_item pattern[],
@@ -5041,6 +5220,12 @@ i40e_flow_validate(struct rte_eth_dev *dev,
 		return ret;
 	}
 
+	if ((actions + i)->type == RTE_FLOW_ACTION_TYPE_MAP) {
+		ret = i40e_parse_map_filter(dev, attr, pattern,
+					actions, &cons_filter, error);
+		return ret;
+	}
+
 	i = 0;
 	/* Get the non-void item number of pattern */
 	while ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_END) {
@@ -5137,6 +5322,13 @@ i40e_flow_create(struct rte_eth_dev *dev,
 		flow->rule = TAILQ_LAST(&pf->rss_config_list,
 				i40e_rss_conf_list);
 		break;
+	case RTE_ETH_FILTER_MAP:
+		ret = i40e_config_map_filter_set(dev, &cons_filter.map_conf);
+		if (ret)
+			goto free_flow;
+		flow->rule = TAILQ_LAST(&pf->map_config_list,
+			i40e_map_conf_list);
+		break;
 	default:
 		goto free_flow;
 	}
@@ -5184,6 +5376,10 @@ i40e_flow_destroy(struct rte_eth_dev *dev,
 		ret = i40e_config_rss_filter_del(dev,
 			&((struct i40e_rss_filter *)flow->rule)->rss_filter_info);
 		break;
+	case RTE_ETH_FILTER_MAP:
+		ret = i40e_config_map_filter_del(dev,
+		&((struct i40e_map_filter *)flow->rule)->map_filter_info);
+		break;
 	default:
 		PMD_DRV_LOG(WARNING, "Filter type (%d) not supported",
 			    filter_type);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [dpdk-dev] [PATCH 8/8] doc: release note
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
                   ` (6 preceding siblings ...)
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 7/8] net/i40e: parse map pattern and action Bernard Iremonger
@ 2020-06-03 14:20 ` Bernard Iremonger
  2020-06-04  6:05 ` [dpdk-dev] [PATCH 0/8] add flow action map Ori Kam
  8 siblings, 0 replies; 12+ messages in thread
From: Bernard Iremonger @ 2020-06-03 14:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty, orika; +Cc: Bernard Iremonger

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_08.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
index 39064af..55eb32b 100644
--- a/doc/guides/rel_notes/release_20_08.rst
+++ b/doc/guides/rel_notes/release_20_08.rst
@@ -56,6 +56,24 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added a map action to the rte_flow API.**
+
+  Added a map action to map Packet Classification (PC) types to flow types
+
+  * Added new action: ``RTE_FLOW_ACTION_MAP``
+  * Added new type: ``RTE_FLOW_ITEM_TYPE_PCTYPE``
+  * Added new type: ``RTE_FLOW_ITEM_TYPE_FLOWTYPE``
+
+* **Updated Intel i40e driver.**
+
+  Updated i40e PMD with new features and improvements, including:
+
+  * added support for the rte_flow map action
+
+* **Updated the testpmd application.**
+
+  Added support for the rte_flow map action to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] add flow action map
  2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
                   ` (7 preceding siblings ...)
  2020-06-03 14:20 ` [dpdk-dev] [PATCH 8/8] doc: release note Bernard Iremonger
@ 2020-06-04  6:05 ` Ori Kam
  2020-06-04 11:21   ` Iremonger, Bernard
  8 siblings, 1 reply; 12+ messages in thread
From: Ori Kam @ 2020-06-04  6:05 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty

Hi Bernard,

Can you please explain more what is the pctype, the flow type,
What is the general idea beyond this patch set?
How will the application uses it? 
is it only for i40?

Thanks,
Ori

> -----Original Message-----
> From: Bernard Iremonger <bernard.iremonger@intel.com>
> Sent: Wednesday, June 3, 2020 5:20 PM
> To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> declan.doherty@intel.com; Ori Kam <orika@mellanox.com>
> Cc: Bernard Iremonger <bernard.iremonger@intel.com>
> Subject: [PATCH 0/8] add flow action map
> 
> Add map action to rte_flow API to map a Packet Classification type (pctype)
> to a flowtype for the i40e PMD.
> 
> This feature requires changes to be made to the rte_flow code in librte_ethdev,
> testpmd and the i40e PMD.
> 
> 
> Bernard Iremonger (8):
>   librte_ethdev: add new flow types and action
>   librte_ethdev: add map filter type
>   librte_ethdev: add map action
>   app/testpmd: parse map actions
>   net/i40e: add map filter
>   net/i40e: add map functions
>   net/i40e: parse map pattern and action
>   doc: release note
> 
>  app/test-pmd/cmdline_flow.c                 |  85 ++++++++++++
>  doc/guides/prog_guide/rte_flow.rst          |  55 ++++++++
>  doc/guides/rel_notes/release_20_08.rst      |  18 +++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  27 ++++
>  drivers/net/i40e/i40e_ethdev.c              |  56 ++++++++
>  drivers/net/i40e/i40e_ethdev.h              |  24 ++++
>  drivers/net/i40e/i40e_flow.c                | 196 ++++++++++++++++++++++++++++
>  lib/librte_ethdev/rte_eth_ctrl.h            |   1 +
>  lib/librte_ethdev/rte_flow.c                |  14 ++
>  lib/librte_ethdev/rte_flow.h                |  78 +++++++++++
>  10 files changed, 554 insertions(+)
> 
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] add flow action map
  2020-06-04  6:05 ` [dpdk-dev] [PATCH 0/8] add flow action map Ori Kam
@ 2020-06-04 11:21   ` Iremonger, Bernard
  2020-06-04 13:12     ` Thomas Monjalon
  0 siblings, 1 reply; 12+ messages in thread
From: Iremonger, Bernard @ 2020-06-04 11:21 UTC (permalink / raw)
  To: Ori Kam, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan

Hi Ori,

This patchset is intended to add support in the rte_flow API for the Dynamic Device Personalization (DDP) feature on the Intel i40e PMD by adding a map action.

https://software.intel.com/content/www/us/en/develop/articles/dynamic-device-personalization-for-intel-ethernet-700-series.html

pctype means Packet Classification type.
flowtype is the index into the pctype table on the i40e.

The map action is intended to insert the specified pctype into the pctype table at index specified by the flowtype. 
 
At present the DDP feature uses the following commands in testpmd:
/* map pctype 15 to flowtype 27 */
# testpmd> port config 0 pctype mapping update 15 27
# testpmd> show  port 0 pctype mapping
pctype: 15  ->  flowtype: 27 


In future the application will create the following rule:
# testpmd> flow create 0 ingress pattern end actions map pctype 15 flowtype 27 / end
# testpmd> show port 0 pctype mapping
 pctype: 15  ->  flowtype: 27

Regards,

Bernard.

> -----Original Message-----
> From: Ori Kam <orika@mellanox.com>
> Sent: Thursday, June 4, 2020 7:06 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Subject: RE: [PATCH 0/8] add flow action map
> 
> Hi Bernard,
> 
> Can you please explain more what is the pctype, the flow type, What is the
> general idea beyond this patch set?
> How will the application uses it?
> is it only for i40?
> 
> Thanks,
> Ori
> 
> > -----Original Message-----
> > From: Bernard Iremonger <bernard.iremonger@intel.com>
> > Sent: Wednesday, June 3, 2020 5:20 PM
> > To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> > declan.doherty@intel.com; Ori Kam <orika@mellanox.com>
> > Cc: Bernard Iremonger <bernard.iremonger@intel.com>
> > Subject: [PATCH 0/8] add flow action map
> >
> > Add map action to rte_flow API to map a Packet Classification type
> > (pctype) to a flowtype for the i40e PMD.
> >
> > This feature requires changes to be made to the rte_flow code in
> > librte_ethdev, testpmd and the i40e PMD.
> >
> >
> > Bernard Iremonger (8):
> >   librte_ethdev: add new flow types and action
> >   librte_ethdev: add map filter type
> >   librte_ethdev: add map action
> >   app/testpmd: parse map actions
> >   net/i40e: add map filter
> >   net/i40e: add map functions
> >   net/i40e: parse map pattern and action
> >   doc: release note
> >
> >  app/test-pmd/cmdline_flow.c                 |  85 ++++++++++++
> >  doc/guides/prog_guide/rte_flow.rst          |  55 ++++++++
> >  doc/guides/rel_notes/release_20_08.rst      |  18 +++
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  27 ++++
> >  drivers/net/i40e/i40e_ethdev.c              |  56 ++++++++
> >  drivers/net/i40e/i40e_ethdev.h              |  24 ++++
> >  drivers/net/i40e/i40e_flow.c                | 196
> ++++++++++++++++++++++++++++
> >  lib/librte_ethdev/rte_eth_ctrl.h            |   1 +
> >  lib/librte_ethdev/rte_flow.c                |  14 ++
> >  lib/librte_ethdev/rte_flow.h                |  78 +++++++++++
> >  10 files changed, 554 insertions(+)
> >
> > --
> > 2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] add flow action map
  2020-06-04 11:21   ` Iremonger, Bernard
@ 2020-06-04 13:12     ` Thomas Monjalon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2020-06-04 13:12 UTC (permalink / raw)
  To: Iremonger, Bernard
  Cc: Ori Kam, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan

(reordered replies to avoid top-post)

04/06/2020 13:21, Iremonger, Bernard:
> From: Ori Kam <orika@mellanox.com>
> > From: Bernard Iremonger <bernard.iremonger@intel.com>
> > >
> > > Add map action to rte_flow API to map a Packet Classification type
> > > (pctype) to a flowtype for the i40e PMD.
> > >
> > > This feature requires changes to be made to the rte_flow code in
> > > librte_ethdev, testpmd and the i40e PMD.
> > >
> > > Bernard Iremonger (8):
> > >   librte_ethdev: add new flow types and action
> > >   librte_ethdev: add map filter type
> > >   librte_ethdev: add map action
> > >   app/testpmd: parse map actions
> > >   net/i40e: add map filter
> > >   net/i40e: add map functions
> > >   net/i40e: parse map pattern and action
> > >   doc: release note
> > 
> > Can you please explain more what is the pctype, the flow type, What is the
> > general idea beyond this patch set?
> > How will the application uses it?
> > is it only for i40?
> 
> This patchset is intended to add support in the rte_flow API for the Dynamic Device Personalization (DDP) feature on the Intel i40e PMD by adding a map action.
> 
> https://software.intel.com/content/www/us/en/develop/articles/dynamic-device-personalization-for-intel-ethernet-700-series.html
> 
> pctype means Packet Classification type.
> flowtype is the index into the pctype table on the i40e.
> 
> The map action is intended to insert the specified pctype into the pctype table at index specified by the flowtype. 
>  
> At present the DDP feature uses the following commands in testpmd:
> /* map pctype 15 to flowtype 27 */
> # testpmd> port config 0 pctype mapping update 15 27
> # testpmd> show  port 0 pctype mapping
> pctype: 15  ->  flowtype: 27 
> 
> 
> In future the application will create the following rule:
> # testpmd> flow create 0 ingress pattern end actions map pctype 15 flowtype 27 / end
> # testpmd> show port 0 pctype mapping
>  pctype: 15  ->  flowtype: 27

This usage looks really Intel-specific.
If the application has to consider the Intel-specific ids,
then it is not generic.
Having some HW specific API makes no sense in the generic ethdev API.
Sorry I must say NACK.

Could this code be in drivers/net/i40e/rte_pmd_i40e.h ?



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-06-04 13:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 2/8] librte_ethdev: add map filter type Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 4/8] app/testpmd: parse map actions Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 5/8] net/i40e: add map filter Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 6/8] net/i40e: add map functions Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 7/8] net/i40e: parse map pattern and action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 8/8] doc: release note Bernard Iremonger
2020-06-04  6:05 ` [dpdk-dev] [PATCH 0/8] add flow action map Ori Kam
2020-06-04 11:21   ` Iremonger, Bernard
2020-06-04 13:12     ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git