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 CD42AA0546; Wed, 7 Apr 2021 10:19:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B30F6141096; Wed, 7 Apr 2021 10:19:43 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2063.outbound.protection.outlook.com [40.107.220.63]) by mails.dpdk.org (Postfix) with ESMTP id BED9C141088 for ; Wed, 7 Apr 2021 10:19:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c11xxgihoQsvhpXybN/vs3oiWbadAzu8dGw4CqHkUrfsgUGCZyJM7RxJYVyCxBc7NiFwOVRQdFjH05OyHEekscVeQbeNkaUE+5Sim9G17Lg0ERNYTM2khCzc0Znlv9vdUNbO+f2J0AJ9shK6cPY4eM3NLCHPV38VwFpAgt1ty8zgZrW7l0apn06VUnJpeGAO8t4ziAcVDUZdkJgOdkJ9c5zrN6xfYEG6LZ3yYxm1AibjrBr5EsuoPM9VdHLxq+3jPsmgAmNVKljO3GcB5+TA+Z9twAdvEGCim+PZjUq3tflmNglrT27tPMXzprvjVvIWaj98IBwqj9PYXkqSwMaXFQ== 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=GkBfVo40b+522Xq+sExqTIBkBj1Qf+pzQVvKH0FeBRs=; b=ZkUKc0DOpNF+TpqI3MnOK//0iyTEJOC7JWRTTfZsGA1+qVwDYG4S2hFdmDcVqzYLb+Z+4mnlRJxPu5KbE+LiON0yWUET2hvfnrco6f5O2qg4+QhV0lcKJFrJg4zyUfH4B6JeybEjciiixuzUg7hz13UvhLgAHWQ7cDAAG6TO5ll1vmVnmhS6lpLem8OdZ7G8bHyDTyqfuzDaLNd1DiJAF0bC+cAamePRrD1pjVg5I/nqCAKy7WAOugiVdPm3B+zvgjTD9gKTT76PpkMotsDvhAK/sAwKOYdUIjk6UdDICscVEnfX/aUcYqTQr99aJfqxtTsqT8GCmPARSIdWLX4wJg== 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=GkBfVo40b+522Xq+sExqTIBkBj1Qf+pzQVvKH0FeBRs=; b=Wf4j6BzyWjgW6e0yD1+ckAFu0Bh0LrkAbbUTmwU06gy9ojAEQ2cmJl/svHjmDmxHsDP0JyySj7qe6vugG0xxZTHksYd7JO0CcVgcWTFDmId6beOt82Ou38i9KFzw2YUw1Puem5u2tjGg2pSlw5bcLDWO/Hm81G0SgUz8kI6VV6GTCZrOp4s1EeGIvrX0rMru3QmHjYm4uRNbQud31Q5jhT1lDxbOsk/iLVEImecdytzETrYWu24fNCC/8mAd0lzr0Y9pQP74xmxZz1/71NxjrMdmG7E15EKyyzbNwwT7qPc/k/8scbNuxZhYFdWNxN87i/dkwwNNqjtU7ldL34MSCQ== Received: from CY4PR1201MB0246.namprd12.prod.outlook.com (2603:10b6:910:23::16) by CY4PR1201MB0135.namprd12.prod.outlook.com (2603:10b6:910:17::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.32; Wed, 7 Apr 2021 08:19:41 +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:19:41 +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+f95YwoxfQEEuebcEEtwgsHqqeFswAgAEN1ICACIvWgIABJhRw Date: Wed, 7 Apr 2021 08:19:40 +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: a8fbee8f-ba2b-4008-2add-08d8f99de480 x-ms-traffictypediagnostic: CY4PR1201MB0135: 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: 8EXxX/I3lp3+XjI/aJFL6z+UiUr9hPuQpvwtL2mOI1QFRswe9sca25dUeVgxHu2BLeacRUCnzCCAXSY6wGAgMjyrWU+T89bxYfaxtmJvIMxno+mdiXOCLtbZJ6OqS+WmO0UFV/AMzAsq6WZybox+L6TNkecoDBKsk8ZKO5lHyWMd0WnZ+QmYfAedet4Px+QdN7YlqaFQjbL6wLfUHgSbvCUI98oDNY1VJnm/xAbgCw6PCufy4baj/87KxEA0g0A4eh1vG5sO4liboBzwdEKhmUFQAtWNGIN/zFFxlxSdt3mE1LwTq8o2fr2JaDONpVFza+v6i3miiSAZR5Dvb6YDXLsHM8xsUwmTvmTJ91gsQLQizSice1YqhKMcC5w8KqlmN0CAY4QV8T1EcgRkscgdPQ/EMnF6du/7PGtzfKtoXc6v4qPu69iFCeAAjuVDif8W+IlEXRm6sZ8LinsVaZSGZoVQsrbFbYMEtsbWes3aCPC7j1+QsE4D7ow820UvOeb37WKrOWgQWq2lulSs6Svqk4IvYmkXBHcfMGIhq15KBJ3Q04CSeHZ2rqNgTZpVCKxBFyet9Jtn8dVFZZhl4TNptK6262rrP9eNcNBYsOwgK6sIH7CrYLrDJ8IiKQRVrbVEhRWylF09qqBd/Z82cRCBsb4cj5GnQZefavJf5y45YsE7OATiSMdEz+BKuvs3qTWdzAL4kQMo3FRB4AuVMjfG/2EfSr4cyJ7p3TQBw7+D1yGytmA7bNTQVi/ByxCie0Fe 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)(346002)(39860400002)(366004)(376002)(136003)(396003)(5660300002)(966005)(38100700001)(76116006)(86362001)(83380400001)(66446008)(66476007)(8676002)(66946007)(54906003)(4326008)(55016002)(110136005)(7696005)(2906002)(52536014)(6506007)(53546011)(478600001)(33656002)(71200400001)(9686003)(45080400002)(66556008)(64756008)(186003)(8936002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?A5rhK1FKEFH4EA/yOtH+TZFTA366eCNJwBEESqgkDKfMX/7AHctwZXyzRkxd?= =?us-ascii?Q?BuqTxRAK9I4FHLrGy1nYbv+lXb7cXI7pbOuJKeUUDFq1XqpFuwOPMrl0VxE8?= =?us-ascii?Q?hVmOx3RCy5P8kKhVf8vqSQR0O4wrb92qf7XNK7dNn4vT499dTgxEQ1en0545?= =?us-ascii?Q?VlHeOzSN2zL3dRqx8pT/ZcuqiGXrLY1k6VyjR/TuLe2StFlsxuVW3xM166ac?= =?us-ascii?Q?fmhtigcN6tdlfcu5Ei50Px1Hvd/8jtQscTiEukKXR1zbtZfW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TaDhY2E+b1eE3BKmfbyhVo71c7V57XJNutOQ1kyRg94bY93DygQA7LtQ?= =?us-ascii?Q?MYpWJveNhzkJ5b4O7B/eFfe64/Yq4+JEM33ghURpHtNdMyGWsDGiI6H2NAwo?= =?us-ascii?Q?By5XIXWRG8AYF4AbeZsdMuyFkft/zjve1kUK3YfeI5AAf1m/sXUA9/lrX4Lv?= =?us-ascii?Q?6yoedRD4RBWYKp61TAzU4oHX9Uxb+JES8OdIdGpbtJiCuwYmxvqPrlWpDhTf?= =?us-ascii?Q?XXxeZuw=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: a8fbee8f-ba2b-4008-2add-08d8f99de480 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2021 08:19:40.9612 (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: htBFEEmqh7qR8LE49J9nDPKKS6LirfHdiDKxlKhVy5l3KPhLEWfjOnKSrdK5nJhGhkhNcpm7aEkeqwtCrVUR7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0135 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" Hi Ferruh, -----Original Message----- From: Ferruh Yigit =20 Sent: Tuesday, April 6, 2021 5:44 PM To: Jiawei(Jonny) Wang ; Salem Sol ;= 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/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 VXLAN/NVGRE=20 >> 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 overwriting=20 >>> 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 in= to global. > > The global var for sample action is defined in: > (https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpat > ches.dpdk.org%2Fproject%2Fdpdk%2Fpatch%2F20210317092610.71000-5-salems > %40nvidia.com%2F&data=3D04%7C01%7Csalems%40nvidia.com%7Cd9baadbc48fc > 44caf4fc08d8f90a7553%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6375 > 33170601193210%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l > uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3DolwLyRnHnM7TyKDFI > xVH3Dj6KhWtUzdXgAyGgON4M9M%3D&reserved=3D0) > struct action_vxlan_encap_data=20 > sample_vxlan_encap[RAW_SAMPLE_CONFS_MAX_NUM]; > Commit log says: " This patch stores the external data of vxlan and nvgre encap into global da= ta 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 s= ee 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 please = 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 stack= . >> > > 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 fetc= h nvgre data, these data may be lost. > > For sample action, use global data can save the previous nvgre configurat= ions data. > Got it, the target is to use "set sample_actions ..." testpmd command to st= ore vxlan/nvgre encap sample actions. For record, can you please document what was the way to the same before thi= s support, can you please document the old testpmd command. Can you please elaborate regarding where did you want this documentation?=20 Prior to this support it is already documented, in http://patches.dpdk.org/= project/dpdk/patch/1617244796-358287-1-git-send-email-jiaweiw@nvidia.com/ With the "raw_encap" >> 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 token >> *token, >>> - const char *str, unsigned int len, >>> - void *buf, unsigned int size) >>> +parse_setup_vxlan_encap_data >>> + (struct action_vxlan_encap_data=20 >>> +*action_vxlan_encap_data) >> >> Can you please fix the syntax, I guess this is done to keep within in=20 >> 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=20 >>> +*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 sure= it's valid before call. > > Thanks. >