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 2AC32A0546; Wed, 7 Apr 2021 10:36:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10F9B1410AB; Wed, 7 Apr 2021 10:36:03 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2056.outbound.protection.outlook.com [40.107.243.56]) by mails.dpdk.org (Postfix) with ESMTP id 0AD98407FF for ; Wed, 7 Apr 2021 10:36:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kR7EWmfmn7u2AC39JUXrBBOk0m3DHeVv415hHiX7GIMroiE+LwKxFwfX57JDkX+kOG4xPs0Nkdx7q77qypTMx3Alt7HkPxtCj2PZPkJjwFaO/uWj+1wXqpmxbIWeEWpEuFDSxwJ/K0r0imNJU9YfXGLFz1U/0tj0xhe/Rb2rB2QHis2vBCju4P34LmqIRiGVm6abAGl477cOKsyYt+Ur0npBvsRwq1/Qi7fZz8WTgXxCZ3uGQHOm9IPF89FgYmv4zm9lcwJ6OZQ8JnXwq7zsa0qXDpr/5r2zSHZmHRGE/UiWy49qec5bXUQhpAUcAi6e1mVnbDTLOeHmpd7Df402nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LvA4YF/yRoJERArlRVbxl6crGyuDpE5EwnDhhE92CwM=; b=FP82uU+2M6oT1gOElfW31oWyqaCeUhJmEomgcf9fAs4zS6InLHIOszqCAlLLliWry/2MJDaHVXQPDfDI6+ygHU+0GkTc0qiIBPs0cD8PwHatOMsH2L+aE9nrtgZoq6PojuRttVpl4Nn3+OAUYIvK1FxlcV4wJ6Sivx93uqOZzbiKZnGEsyeQXOVvvur/9LzT47/5K9ypEawbcqMe60dvbU6W0PVFLwGVDh45Jh3/cjOvz4yD5UrF8qeKB2WZ+t2U4qDHiBrhogbAyZ7q24rZ8zaSvmI5LE1+BozVIfhFqnUB66wVoN6/byIOVcazh3FjJgvoHnvWHrpcq6URuolO0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LvA4YF/yRoJERArlRVbxl6crGyuDpE5EwnDhhE92CwM=; b=pbdhBLuoVt6Rs+PZImC5RNRVtuwhUT35wBuUCDpXs9y8znLjdSmJBgDwEMKEKVsuYWrkEiagiX2xySJLCoDdxuDwueoJ6UeGuDfbrYmncdtsjTryGx59xfP3pMZBd9RM1aiB+m8lP8PhXxmJEw/fPDHBYfncmYI9ZnN0Cofgub6heZOBiadNAtb7hg+C4cyd2QB/jOVUkxChMqSF9VItM/piS83Uvdk3yhzLImjjk1tqHlOjS0/ffDDExelKI8qSLVu3i3rM8D64Cywff/o2V7nmYfY+YQW7A2aluyXgHquv7R+nEXa9BK8J7lE0fwydNv6wn7rmzaiSqLw1rpj40g== Received: from CY4PR1201MB0246.namprd12.prod.outlook.com (2603:10b6:910:23::16) by CY4PR12MB1447.namprd12.prod.outlook.com (2603:10b6:910:e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Wed, 7 Apr 2021 08:35:59 +0000 Received: from CY4PR1201MB0246.namprd12.prod.outlook.com ([fe80::dc58:db5:9cfb:3d49]) by CY4PR1201MB0246.namprd12.prod.outlook.com ([fe80::dc58:db5:9cfb:3d49%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 08:35:59 +0000 From: Salem Sol To: Ferruh Yigit , "Jiawei(Jonny) Wang" , "dev@dpdk.org" CC: Ori Kam , Xiaoyun Li Thread-Topic: [dpdk-dev] [PATCH v3 1/8] app/testpmd: store VXLAN/NVGRE encap data globally Thread-Index: AQHXGw+f95YwoxfQEEuebcEEtwgsHqqeFswAgAEN1ICACIvWgIABJhRwgAACCgCAAALJkA== Date: Wed, 7 Apr 2021 08:35:59 +0000 Message-ID: References: <20210317092610.71000-1-salems@nvidia.com> <20210317092610.71000-2-salems@nvidia.com> <5eff804f-baf3-7dce-7cb8-6189454f0665@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [2a10:8004:6b6b:0:1021:e464:3d50:c6aa] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bb8c72af-3267-4943-93a7-08d8f9a02b7c x-ms-traffictypediagnostic: CY4PR12MB1447: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zgol7y5M7UwjkE5t5p1aOKsthWF7ro6wzRDO3J2yRWnFadFVcUuWH8tWSkYoegMT0iNwfwuf64h7SXJBh+KoohecYOc1SKTpQvktC1HpvPKPv/onE5FAEZjTFE56IH9vB7XyFb93U2S8qc9v9LPFAWfcFxt8vmKvDHGuXuFc++CN4lp/OC5cROrOGrdLlP6BMnwH5dq5U8aXTzRDVq3J17QEWB4UNS1Ok3oRB5OwI7ZqFECk2QbHNxpVipEOXpWvc80L05ygYVD48+ktqGnNnVo89N/V3AnPYMYlhpL77QtsP6gk4zbnn7K0n5UFG7C26ZOXPeynZNScErCGGjAOjr0JZzIvFKD1B4jY2PcX+fHxAvzBOQXyqI7sBTTfgWEvaHaG6qxlqDndq+r+3VKbazobDSh1hJ/O/LM3Ow7a+inssuKXHEKEu4jDTghfx7oJJ0FDYv1aKpbRUfiJ4aXu2o6K4ksCKbWDsbgpyyqBEB4hL6Om0LhZ16msl1BCqN9dJ4gIbgL6mpa6O/HojDU/NjKYki9w4i1fp8v8sSOjJB8yINosOGoF2+pVFBAndltEfqAuqzXBto1xPbL0su77jCEF+YQUpsHLg3h/8IpZIjZapII+0kU6+U7JWgkPdroIRXQOjolVSmhyHWJw8IeXIsjvMTbEALOA5TOQSw2f6FQ2ioTEeQEysdXyVoUEu2edxuWmThT5Cq16oiuRN/zfv5qkatalJCWWmUJXqWA/fqRX2cgH2FbEED9vMQploiXw x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1201MB0246.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(136003)(376002)(346002)(366004)(66446008)(66556008)(66946007)(66476007)(186003)(5660300002)(64756008)(52536014)(76116006)(54906003)(110136005)(316002)(6506007)(53546011)(7696005)(83380400001)(33656002)(8936002)(45080400002)(8676002)(966005)(478600001)(4326008)(2906002)(38100700001)(86362001)(55016002)(9686003)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?4VVmdxjXtE6rm8yNu5gszfpc/1I+UQYptDCz9vRfDFNzV7515jIs9t4cWMSY?= =?us-ascii?Q?TA1EHb4UDpVAX/0X4Xe4wexoEoROEJmG3ErnIYvDB6eTFAYTuHR2mhA9h8XD?= =?us-ascii?Q?7uCit94HzeV66sKcbPNnlsLFpxUJ3890TMzyci7wWcZqKxoSzPXxydEDeIgb?= =?us-ascii?Q?9dJ55ZVWdeUShJGZ+AFNfnvHSvRDm2Kkhw7g5nxYJDmVrKWurADr46Yu6suy?= =?us-ascii?Q?nbUWJGvjd00+h5W0eE7ZdkLwzzu7XVGOVZVXfmssZP7LvHzPaQ3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mR0LuOpLyx4tzYSYrgdvRAr+?= =?us-ascii?Q?UHLX5iXzA4lyrMwksN8T0rLndJEnbNAn8/+RvPUImGQBhKZ9tssknZqkFWO7?= =?us-ascii?Q?J5OuAclJivStycq0oYGGMHGNWN4zPbAzD0rwtiI86Ck5BECyOmEa5UnVJEZ7?= =?us-ascii?Q?jGY/5x4YVxxAL7NXMfMecREQnxKPC9W7192dAfViLr25iyNIhMxzc/zmHHRc?= =?us-ascii?Q?VwyNoh8=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR1201MB0246.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb8c72af-3267-4943-93a7-08d8f9a02b7c X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2021 08:35:59.0794 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IUmrdFzbGSinflVnimeRftsrhvZj4neh8xytMaV9suqvKsBD8DVHdWTQLWMoTqel/R87IeMFm90PywsBJ/DwkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1447 Subject: Re: [dpdk-dev] [PATCH v3 1/8] app/testpmd: store VXLAN/NVGRE encap data globally 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" -----Original Message----- From: Ferruh Yigit =20 Sent: Wednesday, April 7, 2021 11:24 AM To: Salem Sol ; Jiawei(Jonny) Wang ;= dev@dpdk.org Cc: Ori Kam ; Xiaoyun Li Subject: Re: [dpdk-dev] [PATCH v3 1/8] app/testpmd: store VXLAN/NVGRE encap= data globally External email: Use caution opening links or attachments On 4/7/2021 9:19 AM, Salem Sol wrote: > Hi Ferruh, > > -----Original Message----- > From: Ferruh Yigit > Sent: Tuesday, April 6, 2021 5:44 PM > To: Jiawei(Jonny) Wang ; Salem Sol=20 > ; dev@dpdk.org > Cc: Ori Kam ; Xiaoyun Li > Subject: Re: [dpdk-dev] [PATCH v3 1/8] app/testpmd: store VXLAN/NVGRE=20 > encap data globally > > External email: Use caution opening links or attachments > > > On 4/1/2021 5:13 AM, Jiawei(Jonny) Wang wrote: >> Hello Ferruh, >> >>> -----Original Message----- >>> From: Ferruh Yigit >>> Sent: Wednesday, March 31, 2021 8:08 PM >>> To: Salem Sol ; dev@dpdk.org >>> Cc: Jiawei(Jonny) Wang ; Ori Kam=20 >>> ; Xiaoyun Li >>> Subject: Re: [dpdk-dev] [PATCH v3 1/8] app/testpmd: store=20 >>> VXLAN/NVGRE encap data globally >>> >>> On 3/17/2021 9:26 AM, Salem Sol wrote: >>>> From: Jiawei Wang >>>> >>>> With the current code the VXLAN/NVGRE parsing routine stored the=20 >>>> configuration of the header on stack, this might lead to=20 >>>> overwriting the data on the stack. >>>> >>>> This patch stores the external data of vxlan and nvgre encap into=20 >>>> global data as a pre-step to supporting vxlan and nvgre encap as a=20 >>>> sample actions. >>>> >>> >>> I didn't get what was on stack and moved in to the global data, can=20 >>> you please elaborate. >>> >> >> This patch split the function and saved input data into input parameter: >> So it mentioned here "pre-step" for next store the data of vxlan/nvgre i= nto global. >> >> The global var for sample action is defined in: >> (https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpa >> t=20 >> ches.dpdk.org%2Fproject%2Fdpdk%2Fpatch%2F20210317092610.71000-5-salem >> s=20 >> %40nvidia.com%2F&data=3D04%7C01%7Csalems%40nvidia.com%7Cd9baadbc48f >> c >> 44caf4fc08d8f90a7553%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637 >> 5=20 >> 33170601193210%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2 >> l=20 >> uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3DolwLyRnHnM7TyKDF >> I >> xVH3Dj6KhWtUzdXgAyGgON4M9M%3D&reserved=3D0) >> struct action_vxlan_encap_data >> sample_vxlan_encap[RAW_SAMPLE_CONFS_MAX_NUM]; >> > > Commit log says: > > " > This patch stores the external data of vxlan and nvgre encap into global = data as a pre-step to supporting vxlan and nvgre encap as a sample actions. > " > > It says this patch does storing into the global data, but as far as I can= see from code and above description, this patch is just preparation for it= . > I can see there is a new version which has same commit log, can you pleas= e update it in new version? > > I will update in the next series. > >>> For example for nvgre, 'action_nvgre_encap_data' is pointer in stack=20 >>> but the actual object is 'ctx->object', so it is not really in the stac= k. >>> >> >> After call 'set sample 0 nvgre .. ', the data be stored into=20 >> 'ctx->object', the 'ctx->object' will be reused for the following CLI=20 >> command, After that, while we try to use previous 'sample action' to fet= ch nvgre data, these data may be lost. >> >> For sample action, use global data can save the previous nvgre configura= tions data. >> > > Got it, the target is to use "set sample_actions ..." testpmd command to = store vxlan/nvgre encap sample actions. > For record, can you please document what was the way to the same before t= his support, can you please document the old testpmd command. > > Can you please elaborate regarding where did you want this documentation? > Prior to this support it is already documented, in=20 > http://patches.dpdk.org/project/dpdk/patch/1617244796-358287-1-git-sen > d-email-jiaweiw@nvidia.com/ > With the "raw_encap" > > I was just thinking putting it in the commit log, for reference. To recor= d how it was previously done. Does this seem acceptable?=20 " app/testpmd: prepare storing VXLAN/NVGRE encap data globally =20 With the current code the VXLAN/NVGRE parsing routine stored the configuration of the header on stack, this might lead to overwriting the data on the stack. =20 Currently having VXLAN/NVGRE encap as sample actions is done using RAW_ENCAP, for example: 1. set raw_encap 1 eth src.../ vxlan vni.../ ipv4.../ ... set sample_actions 0 raw_encap / port_id id 0 / end flow create 0 ... pattern eth / end actions sample ration 1 index 0 / jump group 1 / end =20 The goal is to utilize the rte_flow_action_vxlan_encap and rte_flow_action_nvgre_encap for sample actions. =20 This patch prepares storing the external data of vxlan and=20 nvgre encap into global data as a pre-step to supporting=20 vxlan and nvgre encap as a sample actions." >>> Tough, OK to refactor and split the function as preparation to=20 >>> support the sample action. >>> >>>> Signed-off-by: Jiawei Wang >>> >>> <...> >>> >>>> -/** Parse VXLAN encap action. */ >>>> +/** Setup VXLAN encap configuration. */ >>>> static int >>>> -parse_vc_action_vxlan_encap(struct context *ctx, const struct=20 >>>> token >>> *token, >>>> - const char *str, unsigned int len, >>>> - void *buf, unsigned int size) >>>> +parse_setup_vxlan_encap_data >>>> + (struct action_vxlan_encap_data >>>> +*action_vxlan_encap_data) >>> >>> Can you please fix the syntax, I guess this is done to keep within=20 >>> in >>> 80 column limit, but from readability perspective I think better to=20 >>> go over the 80 column a little instead of breaking the line like this. >>> >> >> Ok, will change into one line. >> >>> <...> >>> >>>> +/** Setup NVGRE encap configuration. */ static int=20 >>>> +parse_setup_nvgre_encap_data >>>> + (struct action_nvgre_encap_data >>>> +*action_nvgre_encap_data) >>> { >>>> + if (!action_nvgre_encap_data) >>>> + return -1; >>> >>> This is a static function, and the input of it is in our control, so=20 >>> not sure if we should verify the input here. >>> But if we need to, can you please check the return value of this=20 >>> function where it is called. >> >> I agree with you that can remove this checking inside, since we make sur= e it's valid before call. >> >> Thanks. >> >