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 76C0C426C9; Fri, 6 Oct 2023 04:37:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3206402AF; Fri, 6 Oct 2023 04:37:43 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id BCA89402A8 for ; Fri, 6 Oct 2023 04:37:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696559861; x=1728095861; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=x6Cq+hwuVCoCFaOkOmXY+HNFYyg33zYsvrPB/qNoxOE=; b=nykGNRkpPCJmrVYxIkhuHMrTMbZSs4tiscO9lffcENfdzpz2/0IWId2e 9CAnMCLrDm8TrMs/ilcZjDQYXoKMdxoiipGEOXoHAR8Zc+Z816oHsYmBj NtFFWYkFjv9iFV9mSyxGFwU9p1oefmaZZ9ypoarcLKNuon/Ag64bB1+og +IO6WE1CjeYlWnmud7jPVzM6RMZ7cpJ9P+CWj4hgF58eZzDW0JFPCVNI5 4biH1viaU3ldC/ee4Zk5iEUnRcJw7FFCFULD2dekw1Juzh4O5XHIWYezJ Y7JHGfA+alwA5DSA0FOR2UdgPKAXJtQJOTWq5ni4p1h3Qp8/hxIM8XLkC w==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="414649278" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="414649278" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 19:37:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="875788957" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="875788957" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Oct 2023 19:37:39 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 5 Oct 2023 19:37:39 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Thu, 5 Oct 2023 19:37:39 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.49) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Thu, 5 Oct 2023 19:37:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=COdzvju85owTaZHXBVvtquf42bS7G3pwE6YRCmHEPyb0avK6q5QykRqQuXCxg3dHfoandh4U6inRYB6gL6+f1dTEzL7bl7cT8g7cZZuOv/+A/0AwTjwGh9NSjNFyO94a8Rq37QXoy9Mfwfy2NkBisEuCjIKeGnuIbXXn0uPe+RfKXgKTkHZCnUOS38XaEKmIJoeEZMw8x4drp2Ff+lXme9cHZ2vpXZyNO11cRMQET6tqeb0JSTCLKTf5b7g/kjey6kkYjz0E59OYS/npomlUN2DwgdjJfwCSxh62lweDLQs3TWP2P7u6Ii/gdy83/+jqFmFd2MRx3e6F+NlIDpJjUw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A5GAdx1O6yFuXm6RfvIBihBs+tP2+y2yNJLxon/5hNk=; b=VXrWNtZAUMtATHm12OcV/lEyZF/T72q2q9wbsijuHJQ/Y7KFXkLUJsdoz9pKmQll8ZHLVPPBNScgVOLko2Ma5zddJRAEL9cyZdtrxnKU1MOaTKSg/i99yD64F1x1oDF2WCclp3nCNLIMNwx0pKsVsGkSulwn8dz4EogGlW9RxU45ZF/fTKrwljkUnrFTOS2NiwLWoI0FJZk0maskE9k43GhlDsWyKYlI8EEIuO6Wiywy50BOXNwBKTN0G5hCatFa84vxqJGuU+OCZyMQkdlHxm+dkt4Bh8bUVqFyG7zwdAgIj2E1mQwvK079ZHOnz82nmDQWeF9zKelbUOMVe/dR0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by SA3PR11MB7979.namprd11.prod.outlook.com (2603:10b6:806:2f9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.35; Fri, 6 Oct 2023 02:37:25 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::27ea:67e:2966:23e3]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::27ea:67e:2966:23e3%3]) with mapi id 15.20.6838.030; Fri, 6 Oct 2023 02:37:24 +0000 From: "Zhang, Qi Z" To: Stephen Hemminger CC: "Singh, Aman Deep" , "Zhang, Yuying" , "dev@dpdk.org" , "Dumitrescu, Cristian" , "orika@nvidia.com" , "ferruh.yigit@amd.com" Subject: RE: [PATCH v2] app/testpmd: enable cli for programmable action Thread-Topic: [PATCH v2] app/testpmd: enable cli for programmable action Thread-Index: AQHZ9zstB96HTmxH00q4c5auP2USDLA6m06AgAFThOA= Date: Fri, 6 Oct 2023 02:37:24 +0000 Message-ID: References: <20231005100246.242970-1-qi.z.zhang@intel.com> <20231005114238.243388-1-qi.z.zhang@intel.com> <20231004213201.20c1de85@hermes.local> In-Reply-To: <20231004213201.20c1de85@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|SA3PR11MB7979:EE_ x-ms-office365-filtering-correlation-id: 4c0bbfe5-c4a6-476e-df98-08dbc6152c4d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gevPc4Eya2y6LnDUUq8iZXcWQsrE1toyVIIHdb9Xl8M1qXPyIasmtB5Ah6ZckYMIz9PCbx3YN5OI82V5Amnt9jNsvcN9OmH92vhh3g8c6KwgW7ULi0+vPgbNfV4KqmHlirYrZDzkIncavS8plsxhEeMsGsT4XnDBQ+IU8VWbjYGrl5hUob0+4n/UtqQWGGx8zY8+lvSe21KisvuyxkOkKP0abl2VAHKZharTiVtmaf9XkmS8az/ik8INmR+Ua/XKX3rVLM7vrAeqP8vvbnzOTgOIEOhY/Wf81hwzPoQny+xC8ZxVt2awrzJ2dJDCSM94/qHSzkN9RbAXgTaplo0l8zD2mOkzPMxfTP31kpryGgy2E5nlLvW7Sm1FyHEK1ZOr9DFIdDp7l9siBgK3gTkJeAz5x15M8g6dms1W5Nz2HtGX03d7iosUPOAAjlANGxRfO9DIteKS9iQuTE9X8/urv8rSgYTg0fnERaJ8P0iLiRJF3PmDhyQOykMiZkzgV+HAUoBGhQEL9TYCou1hHpdGUjnJXp4QNdTxVbXCFA4Zq9MUHHdKsuuZq/k2haj+KUygVrZsWRYfmSp8Sasp2N7RWDPKZGqK7aowGMGnsKzaMe27XsOudv3IUJ1TnX6ZyFMI x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(230922051799003)(1800799009)(186009)(451199024)(38100700002)(38070700005)(86362001)(33656002)(82960400001)(122000001)(7696005)(55016003)(2906002)(53546011)(6506007)(9686003)(52536014)(4326008)(5660300002)(8936002)(8676002)(71200400001)(508600001)(83380400001)(66946007)(316002)(26005)(6916009)(66446008)(66476007)(66556008)(64756008)(76116006)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8b+CQppq6fyfoibPldmGxVM7t1h+8tkw0T2EA/0Yr3sHP3mGPO4787uXQcqM?= =?us-ascii?Q?Pt6CSf6wEtoeKXOvQgF2EjWA6THlDLOuXfKYU9MQZ8MEDMsJJpWv9BhHWaJ2?= =?us-ascii?Q?nXF2B55DFCuRGrPUKrHovV5NBLjuGnYOpK7GmIuYZIXT/5F2c/lb0TZ+Mx/P?= =?us-ascii?Q?sZH6815xiKPsBBo0PRgMwJ9kI7qa3cV4z9tThK9vpzQioWJJA4XLHnubNyOF?= =?us-ascii?Q?VgS75tn0EBSTbt04ZkgwLW7L4euQJJCe1O8LkY+V2D0R5QiJ8pWROQYWrvla?= =?us-ascii?Q?G2YWl+JOx57Dw3NYfLLWwCIuIhksrRAWpcDrgeoSahTp7gIM5CVAI4it31hY?= =?us-ascii?Q?IbIIs/AhE1Ls9pzHUJ9f5uQa/NnSV2EhtyUNZ5b2BynpJOdJmLr7Eg93xJfk?= =?us-ascii?Q?QCTw7xqyxXFJHA3tUEnAKLi3jGcwLXU/JAgwQRb+1i8cCdAAcNlYzTvypqpM?= =?us-ascii?Q?54TfjEW5wq8k4HeAWpouQCE7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q?TQ7hMSHSNZ3oOVF4ZRNMdJJYF8nK7sysPIeAT1+OKHtphBUaKQo7vAoojbZb?= =?us-ascii?Q?l0y0mzGBsHXPp4e8uUeXJkfIKa0ar1STz2rfD1vpgK1v8H/hJgjnxgxnyb63?= =?us-ascii?Q?IIk/H5ITjjXopUftSbdI2C5nl60OJiMjj3xdZ20//2gxx4UwaLHdz5f44Sjr?= =?us-ascii?Q?xvK+ZvH6QaaHRdG0VSjoEmMaH0V2kR1gkcenLBkR?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c0bbfe5-c4a6-476e-df98-08dbc6152c4d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Oct 2023 02:37:24.2820 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QBIliFSAQhuPImp1AFVRkn1WOOminafqVQJVkXTEyo+if3cvXXGOqWdcmsS8HKU3/PnoAnVZzHuUGFXaM50tJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB7979 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Stephen Hemminger > Sent: Thursday, October 5, 2023 12:32 PM > To: Zhang, Qi Z > Cc: Singh, Aman Deep ; Zhang, Yuying > ; dev@dpdk.org; Dumitrescu, Cristian > ; orika@nvidia.com; ferruh.yigit@amd.com > Subject: Re: [PATCH v2] app/testpmd: enable cli for programmable action >=20 > On Thu, 5 Oct 2023 07:42:38 -0400 > Qi Zhang wrote: >=20 > > + char name[ACTION_PROG_NAME_SIZE_MAX]; > > + struct rte_flow_action_prog_argument > args[ACTION_PROG_ARG_NUM_MAX]; > > + char > arg_names[ACTION_PROG_ARG_NUM_MAX][ACTION_PROG_NAME_SIZE_MAX > ]; > > + uint8_t > value[ACTION_PROG_ARG_NUM_MAX][ACTION_PROG_ARG_VALUE_SIZE_MAX > ]; > > +}; > > + >=20 > IMHO if you have this many array elements the data structure makes more > sense as. >=20 > struct flow_arg { > char name[ACTION_PROG_NAME_SIZE_MAX]; > struct { > struct rte_flow_prog_argument prog; > char names[ACTION_PROG_NAME_SIZE_MAX]; > uint8_t value[ACTION_PROG_ARG_VALUE_SIZE_MAX]; > } args[ACTION_PROG_ARG_NUM_MAX]; > }; >=20 The memory of rte_flow_action_prog_argument need to be continues due to the= definition of rte_flow_action_prog. But follow your idea, it still can be refined as below to get a better view= . struct action_prog_data { struct rte_flow_action_prog conf; struct { char name[ACTION_PROG_NAME_SIZE_MAX]; struct rte_flow_action_prog_argument args[ACTION_PROG_ARG_N= UM_MAX]; struct { char names[ACTION_PROG_NAME_SIZE_MAX]; uint8_t value[ACTION_PROG_ARG_VALUE_SIZE_MAX]; } arg_data[ACTION_PROG_ARG_NUM_MAX]; } data; }; > Or better yet get rid of PROG_ARG_NUM_MAX and use a flex array. My understanding is to make the array flex will introduce additional comple= xity, currently fixed size data structure is required to be allocated for p= arser buffer for all action commands Also to support variant size at runtime, we may introduce another testpmd p= arameter which seems a little bit overused to me. > Somebody will want more than 8 args. Sure, I can made it bigger.