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 2D776426BC; Thu, 5 Oct 2023 06:32:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01F17402B3; Thu, 5 Oct 2023 06:32:06 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 98072402A9 for ; Thu, 5 Oct 2023 06:32:04 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1c77449a6daso4391845ad.0 for ; Wed, 04 Oct 2023 21:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1696480323; x=1697085123; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=xrFytklmM8bYt3wxDmIQtyQeVPebzKhaN9mhXb4WOrg=; b=KkLy/sc67h9DmngOlsZUhG4dP2okyxefBetZnTVrYA528ui0b/u6YsxINGdDMPCtt4 sVv/mKGrWt4TqIv3hHoheytnnooFiC4o9H9i2XOZ/vD8SV8/PSxkFiMQfK9AInmrYqwn TTq1ltvNyEnruwZcgVqR2+/8kTjNblAz7kmInRvCg/kJzRjFxTbhwRefPVHkZnI5rfl4 jGyJt7HcQjc4nOChUU+MQjsI4Uhu0xqVKHFzs60EhVHx1EtWTxLseLGPr8YEdpQP83u1 ZecILBcYZhwugYJJorgeHkQL2symPxmYhjU2Wjb4JO8BcFUCRWdDWzKNY/eo7CNcB1Jc Bj5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696480323; x=1697085123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xrFytklmM8bYt3wxDmIQtyQeVPebzKhaN9mhXb4WOrg=; b=scq7y1dNJZzbGVcuhfSqJeOKwnYix4naNXl7n4LCFt9qSetkWh+ls8fBOO2sgFznnY s+otUEbo4jbod0EJCFrHWJ9v2jjmHp9qOjxTd6vBQfLfuZ/6dw2c3SN6vX8WN6kDgKmx eyz7bTHEj7/WIcnbUZXbeJxo353kUlLzGmdWZ3U07QhRfviN9cmSrneaGuepWpQsdkeq DyXGMD/dO6VMsXtT/xfLYNNuIIvlbot09OwFzDPx1iA3CDWYM25SZa3iu9WPyp8ExA5V ydjYVhNDo2L4mr2kzkUMHk4bUdsCkeGyThtaECJ0ayZjetoNTW7WQve5D07Q3+y7WJKd 8urQ== X-Gm-Message-State: AOJu0Yx3Unhgbn9GCJaeOrO/bEWRWBBZPLcXtp5OIDSPtwbbHqJ5oC5f pU+/kl4U6loAAFGUh9k56qayWg== X-Google-Smtp-Source: AGHT+IHzPGl2NfVOqSbw734PAOtAeM1Jfpb2D/fzlzeIrRQXAymW0qcr0wBrIeQ0Tkrjyj87KXi/cg== X-Received: by 2002:a17:902:8b8c:b0:1c3:2532:ac71 with SMTP id ay12-20020a1709028b8c00b001c32532ac71mr3847801plb.31.1696480323546; Wed, 04 Oct 2023 21:32:03 -0700 (PDT) Received: from hermes.local (204-195-126-68.wavecable.com. [204.195.126.68]) by smtp.gmail.com with ESMTPSA id s20-20020a170902989400b001c5b8087fe5sm454313plp.94.2023.10.04.21.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 21:32:03 -0700 (PDT) Date: Wed, 4 Oct 2023 21:32:01 -0700 From: Stephen Hemminger To: Qi Zhang Cc: aman.deep.singh@intel.com, yuying.zhang@intel.com, dev@dpdk.org, cristian.dumitrescu@intel.com, orika@nvidia.com, ferruh.yigit@amd.com Subject: Re: [PATCH v2] app/testpmd: enable cli for programmable action Message-ID: <20231004213201.20c1de85@hermes.local> In-Reply-To: <20231005114238.243388-1-qi.z.zhang@intel.com> References: <20231005100246.242970-1-qi.z.zhang@intel.com> <20231005114238.243388-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 5 Oct 2023 07:42:38 -0400 Qi Zhang wrote: > + 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]; > +}; > + IMHO if you have this many array elements the data structure makes more sense as. 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]; }; Or better yet get rid of PROG_ARG_NUM_MAX and use a flex array. Somebody will want more than 8 args.