From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 82CA1A0548; Fri, 23 Apr 2021 10:50:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D93F4067E; Fri, 23 Apr 2021 10:50:27 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 76A904014F; Fri, 23 Apr 2021 10:50:25 +0200 (CEST) IronPort-SDR: Nf5ie0XEAQES8ea4ICSCAxbNpLNn9pujBr2LXAxQsN64npY5VAf0Fq+Qm0MpHOrNhjHX5mLtNy ns9vSolAYgsA== X-IronPort-AV: E=McAfee;i="6200,9189,9962"; a="195594867" X-IronPort-AV: E=Sophos;i="5.82,245,1613462400"; d="scan'208";a="195594867" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 01:50:23 -0700 IronPort-SDR: jUT4fHHpRB8UQMJInCGrF4LMf8MWRe1K7JvCWbTWuBVQ09jDv/FNauRYQ/ByYU8RJRNZD65U0u 79f+J0qC/0TA== X-IronPort-AV: E=Sophos;i="5.82,245,1613462400"; d="scan'208";a="464256749" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.255.228]) ([10.213.255.228]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 01:50:21 -0700 To: Gregory Etelson , dev@dpdk.org Cc: matan@nvidia.com, rasland@nvidia.com, stable@dpdk.org, Viacheslav Ovsiienko , Xiaoyun Li References: <20210419130204.24348-1-getelson@nvidia.com> <20210419130204.24348-2-getelson@nvidia.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Fri, 23 Apr 2021 09:50:17 +0100 MIME-Version: 1.0 In-Reply-To: <20210419130204.24348-2-getelson@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 2/2] app/testpmd: fix tunnel offload private items location X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/19/2021 2:02 PM, Gregory Etelson wrote: > Flow rules used in tunnel offload model require application to query > PMD for private flow elements and explicitly add these elements to > flow rule. Hi Gregory, What is "private flow element"? And can you please detail what is fixed with this patch, what was not working and now working? > Tunnel offload model does not restrict private elements location in > a flow rule. > The patch places tunnel offload private PMD flow elements between > general RTE flow elements in a rule. > > Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload") > > Cc: stable@dpdk.org > > Signed-off-by: Gregory Etelson > Acked-by: Viacheslav Ovsiienko > --- > 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 ef0b9784d..da5e843fd 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -1663,7 +1663,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( > @@ -1671,9 +1671,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) { > @@ -1691,7 +1692,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( > @@ -1699,9 +1700,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])); > } > >