patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <matan@nvidia.com>, <rasland@nvidia.com>,
	<ferruh.yigit@intel.com>, <stable@dpdk.org>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>
Subject: [dpdk-stable] [PATCH v2 2/2] app/testpmd: fix tunnel offload private items location
Date: Sun, 25 Apr 2021 18:57:22 +0300
Message-ID: <20210425155722.32477-2-getelson@nvidia.com> (raw)
In-Reply-To: <20210425155722.32477-1-getelson@nvidia.com>

Tunnel offload API requires application to query PMD for specific flow
items and actions. Application uses these PMD specific elements to
build flow rules according to the tunnel offload model.
The model does not restrict private elements location in a flow rule,
but the current MLX5 PMD implementation expected that tunnel offload
rule will begin with PMD specific elements.
The patch places tunnel offload private PMD flow elements between
general RTE flow elements in a rule.

Cc: stable@dpdk.org
Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 app/test-pmd/config.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 40b2b29725..1520b8193f 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1664,7 +1664,7 @@ port_flow_tunnel_offload_cmd_prep(portid_t port_id,
 		     aptr->type != RTE_FLOW_ACTION_TYPE_END;
 		     aptr++, num_actions++);
 		pft->actions = malloc(
-				(num_actions +  pft->num_pmd_actions) *
+				(num_actions +  pft->num_pmd_actions + 1) *
 				sizeof(actions[0]));
 		if (!pft->actions) {
 			rte_flow_tunnel_action_decap_release(
@@ -1672,9 +1672,10 @@ port_flow_tunnel_offload_cmd_prep(portid_t port_id,
 					pft->num_pmd_actions, &error);
 			return NULL;
 		}
-		rte_memcpy(pft->actions, pft->pmd_actions,
+		pft->actions[0].type = RTE_FLOW_ACTION_TYPE_VOID;
+		rte_memcpy(pft->actions + 1, pft->pmd_actions,
 			   pft->num_pmd_actions * sizeof(actions[0]));
-		rte_memcpy(pft->actions + pft->num_pmd_actions, actions,
+		rte_memcpy(pft->actions + pft->num_pmd_actions + 1, actions,
 			   num_actions * sizeof(actions[0]));
 	}
 	if (tunnel_ops->items) {
@@ -1692,7 +1693,7 @@ port_flow_tunnel_offload_cmd_prep(portid_t port_id,
 		for (iptr = pattern, num_items = 1;
 		     iptr->type != RTE_FLOW_ITEM_TYPE_END;
 		     iptr++, num_items++);
-		pft->items = malloc((num_items + pft->num_pmd_items) *
+		pft->items = malloc((num_items + pft->num_pmd_items + 1) *
 				    sizeof(pattern[0]));
 		if (!pft->items) {
 			rte_flow_tunnel_item_release(
@@ -1700,9 +1701,10 @@ port_flow_tunnel_offload_cmd_prep(portid_t port_id,
 					pft->num_pmd_items, &error);
 			return NULL;
 		}
-		rte_memcpy(pft->items, pft->pmd_items,
+		pft->items[0].type = RTE_FLOW_ITEM_TYPE_VOID;
+		rte_memcpy(pft->items + 1, pft->pmd_items,
 			   pft->num_pmd_items * sizeof(pattern[0]));
-		rte_memcpy(pft->items + pft->num_pmd_items, pattern,
+		rte_memcpy(pft->items + pft->num_pmd_items + 1, pattern,
 			   num_items * sizeof(pattern[0]));
 	}
 
-- 
2.31.1


  reply	other threads:[~2021-04-25 15:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 13:02 [dpdk-stable] [PATCH 1/2] net/mlx5: " Gregory Etelson
2021-04-19 13:02 ` [dpdk-stable] [PATCH 2/2] app/testpmd: " Gregory Etelson
2021-04-23  8:50   ` Ferruh Yigit
2021-04-25 15:57 ` [dpdk-stable] [PATCH v2 1/2] net/mlx5: " Gregory Etelson
2021-04-25 15:57   ` Gregory Etelson [this message]
2021-04-30 13:49     ` [dpdk-stable] [PATCH v2 2/2] app/testpmd: " Ferruh Yigit
2021-04-25 16:28   ` [dpdk-stable] [dpdk-dev] [PATCH v2 1/2] net/mlx5: " Thomas Monjalon
2021-04-25 17:01     ` Gregory Etelson
2021-04-25 17:07       ` Thomas Monjalon
2021-04-26  7:54         ` Ferruh Yigit
2021-04-27  9:27           ` Gregory Etelson
2021-04-29  7:44             ` Gregory Etelson
2021-04-30 13:37               ` Ferruh Yigit
2021-05-04  9:20           ` Gregory Etelson
2021-05-02  8:08 ` [dpdk-stable] [PATCH v3] " Gregory Etelson
2021-05-04  8:10   ` Raslan Darawsheh
2021-05-04  8:20   ` Ferruh Yigit
2021-05-04  9:12     ` Gregory Etelson
2021-05-05 17:45       ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2021-05-06  6:08         ` Gregory Etelson
2021-05-06  7:40           ` Gregory Etelson
2021-05-06  7:59             ` [dpdk-stable] [dpdk-dev] net/mlx5: mellanox cx5/cx6-dx increment "rx_phy_discard_packets" with DPDK rte_flow actions COUNT & DROP Arthas
2021-05-06  9:57 ` [dpdk-stable] [PATCH v4] net/mlx5: fix tunnel offload private items location Gregory Etelson
2021-05-11 22: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=20210425155722.32477-2-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    --cc=xiaoyun.li@intel.com \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/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 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

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


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