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 4128F42360; Wed, 11 Oct 2023 12:20:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30F4D402E8; Wed, 11 Oct 2023 12:20:56 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2083.outbound.protection.outlook.com [40.107.244.83]) by mails.dpdk.org (Postfix) with ESMTP id 3875540266 for ; Wed, 11 Oct 2023 12:20:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+rjTvmfYba+WixdDeFi+VVUjGDmDL0L0MF+f7gVmDdOMtAuMHM/ls0UHTMdGEpiVlJcTSOALOWSM/JQtFjU0yZBem6Y5+AZKNh/TnYLApZF6yEL0zh+bBXs77qiMVXRy6aB2W7AV8hK0nuuTlfsTd6t3C2iRli9/dXyniT2n87B/lxmNkN+8JYLuK8LMGJmLZt+64AZu7QNdVA5sIMIVClwlLv+2M+rsaEFBDd2s2fXEtuM2e65kipnNqIwfgpXLgeJJPTnvlQfCkN5X1CtyRLuj+xBTAUdT3xldKbMXyrZj6WvhCIqJO+eXNQLRqYiGkN4VR6TsRuCEg3brBhN2Q== 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=kWRYu5PEnXKmgheG/ddbnhtgGDfIWdZPPBU7c2E7SX4=; b=FeZZW9LwMDXTV+uRUW84T0/Rd5cO0MtIqX3wShvJWK0WLh+xRKIef0CwqAouLzzjv+o9/fMoaK7rN4jogxaY3Oko1OXBOb0jDcexRkCZ+WrW5kLZYLGaAUv9AX41B8GmY5rowsxawUMvU8li8r3PnS/yfudG2KTb89CGM0HXV1NGV5oN/ljyRBHzoeOElsof1MKeIbnXLR7AOy+Nrqz0s6dB9NyRGfy7KXRLvEEGRZ2rKMcFxeNh+0qqRd+1pQe9fo5f+TMrNEjX/bhQEtg9PhaFNj57k2f3uVl7wICtaBa6pVsqYlpIaHLhXTMg81t6bgkRjU03bnVib5nraUAW3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kWRYu5PEnXKmgheG/ddbnhtgGDfIWdZPPBU7c2E7SX4=; b=OU3ye1/H7bt7xqzHKwF/SBgcW04Ezj4b1tW0Qo79q/+pbZfkgSFyC62Uh2DBaKh74WoPJ8hzkHRwioGIUCaYLNMpQreaXTjQBlY/QW15SrBOvdguRhchVVu9pkQxKQ2T9bFNff9d5aFA7Siowddh2s8wcpqwDlIgkO0KGsziNs0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH7PR12MB6417.namprd12.prod.outlook.com (2603:10b6:510:1ff::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 10:20:51 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8%4]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 10:20:50 +0000 Message-ID: Date: Wed, 11 Oct 2023 11:20:46 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] app/testpmd: enable cli for programmable action Content-Language: en-US To: "Zhang, Qi Z" , "Singh, Aman Deep" , "Zhang, Yuying" Cc: "dev@dpdk.org" , "Dumitrescu, Cristian" , "orika@nvidia.com" References: <20231005100246.242970-1-qi.z.zhang@intel.com> <20231007104730.441719-1-qi.z.zhang@intel.com> <06ff4322-bc65-4092-af18-21bfedbb8daf@amd.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQI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qWTq29dihLYpzd6dqB708k7 4RBz9051oLaFVGkguFw/tXmA17nx+c2uR5jx8wb4j68umG2X++0dSta5eHAVhmtXvrqPW6Ku 3FQ= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PA7P264CA0029.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:2df::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB6417:EE_ X-MS-Office365-Filtering-Correlation-Id: 15050e53-53cd-4bd6-1795-08dbca43bdbb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dAZtWZXv8NAPY8XferE0FOOTHUGGhfdmoQygtY9gIUSAr8OMf/4sDwoq/1VZoIFPleDC26BQzEf8lXvFAyVB5pD6tGHQ53Uo4qouLuBdHTrxedxd/bNufOMCZZkARTkyPTWuCP5k/C9sS+EH9YfcBzvBWqD78oSzjWFuXucZ2UxRZlkGWXekXZ+Cpi1nCxWjIo9KlQ2HnxK1mvq3yxvbcOj0l8MmTkJT3P9am78/PWVALtMfFmI2hz5A3yzMAVQVlTa5LoNrkCmyculLOoHhZtSeTRYc581eb/5SKf9GXIj92MYQTRZRphehlS1jyqpTfgynHZX28FmnsQM1S44YTJodNKTmhb/tyVzqRlCI9+smO4l7/bxUyxcWwpJAVfOssxokGAr92PPXXuwc7wQm+3tp3ly9gNDADX1QquHQDrlBt7scWONnubs5L/U2Hun19+64HHMWeCWHoC8naaurfKbcqDj/5RVjTGGoBCOjqPGdDwokc47/xxqTdl1Odk9Bl/OLO+U1Ei8nuICirvYeInM/WI0iLB3BUqjm6dnoM9UDUEIB1fcr9Hj8GELvChE13y52/IOWmFb/k4mKTT0qgo+ObLoySCgBjxfZGjU0DKwxmZDHoBpBK19t+LaWrqSU5etQXTaYgihuwUx/m+ZsyfhYxsiu3lzEZd9ytWa5cFc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(366004)(39860400002)(136003)(376002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(6666004)(31686004)(2616005)(6506007)(53546011)(6512007)(36756003)(31696002)(38100700002)(86362001)(66476007)(44832011)(2906002)(478600001)(316002)(41300700001)(6486002)(66946007)(8936002)(26005)(83380400001)(4326008)(5660300002)(110136005)(8676002)(66556008)(54906003)(21314003)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NEIyVEdCalk4aVZlTytHaWVzV1NHWWMwOGR0TlBGb0xlVUllaGppZk5MTjlK?= =?utf-8?B?ekxTcitvUVN6aW1LYkNucUl4MlB5SzRXUUlxUm9PSjUyenBWS1R4amUzc0hp?= =?utf-8?B?YzlJUnd2OHc0eVN3ZWZPUVFWb1pGcEJWUXVUYmxNLytLVGlWTHF4K2NqNmRn?= =?utf-8?B?YjlCaCtDY1huUm11ZWE1NEMzd1pieFE2cUhRM0ZNa3ZPRnhHend5U1Jab1Fi?= =?utf-8?B?MnFVclEvWXNWdjdaejI1VHdZekFFOWNldnRmNlZOWnBVc3pSRERwYjZiL0lj?= =?utf-8?B?Qzh2WFB6RDAzK3BYcFlGZnlXRUpPYklaUUFhWXBOZ0lpOEt6cmRrUU52Vzc2?= =?utf-8?B?VkdKSU4za1JmZGVIbVVzeSt4N210ZUVwY2EvNmcwUmN3RkdWQVkwVTBkQi9O?= =?utf-8?B?MDdoeHNLY2Mzbm1IY1czWDRsOE9LTGlTNWhOa1ZxcUtvazNFZ2laR0l6Q2Z2?= =?utf-8?B?NTI2Z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8?B?cnN0Y0haUVpqeWZHMTZVaTVrTU1JTHBaOXFTUVduMWR1eXdaMjVQSXFVL0p6?= =?utf-8?B?aW9sQkNXSmJjQ0RzK0YxMHBXVXkyNlA1citmeWRySUVqRmJ6aFZ5Y2N5S2F3?= =?utf-8?B?YkNUNEV1QjhHcittaUw2VWVPRXRiNGZibldQRWdPKzhPMHJYemd1Mld0UThn?= =?utf-8?B?MWxoS0owMWovTE9GRXorK1I4eDNrY29tUVdIckpJblY1SExNcGs4NXUyMGdu?= =?utf-8?B?QzJFM0VBMjFGWDJocFY3WHBUYzVBKys0NHUwaFYvVG5FTTNXRFVIZlBhbWxV?= =?utf-8?B?RlBHWU5Cb2lpcFNDUFVRcXhsUFArOUV3Vi9tL0VIZDgzNzA4azFjOEp1c2Z1?= =?utf-8?B?a1hqY3Yrb2FURkw2Ry9PbTI4NXdxc3V0aVVWSm9RYzhJRllBMmFGTmw5ckdt?= =?utf-8?B?U2ltaFQxUUloSHhjc2dyVnhDdW1sN0x5bjNhczVZRlhsLzh6ZDl4TTZPWHlq?= =?utf-8?B?bVhQTm1jSVdtTUdIU1k2MVJoekZsdUlzQjhVOTJwZkNhTGV5SExrY0pyUHhx?= =?utf-8?B?SHlZM2tlZElwUWpabEJOU0J3MGpjbUdYdFVxY3hBQW9kS21XVHQ4enBaMlZr?= =?utf-8?B?MTl0YzdoRTJ5YkNUY2E0eWJ5V1JkUEwraFhFbkdTSS83VUVHSXZhUlgxa0Q4?= =?utf-8?B?OS92ajB5bkd1TlpoUTJ6VURyU0s0YVBMdFd2ODkwKytFK2diTzhoQkM4Y04x?= =?utf-8?Q?6NCaZzmwN+ls9bZAg95cDLT5C?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15050e53-53cd-4bd6-1795-08dbca43bdbb X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 10:20:50.0846 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8uwC50JmLrqIYL3xkJDe6gzY/4a3hrAkyZ2hT42/abhHTOUZ1eZuRUu3q2xMeQWP X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6417 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 10/11/2023 3:24 AM, Zhang, Qi Z wrote: > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Tuesday, October 10, 2023 6:49 PM >> To: Zhang, Qi Z ; Singh, Aman Deep >> ; Zhang, Yuying >> Cc: dev@dpdk.org; Dumitrescu, Cristian ; >> orika@nvidia.com >> Subject: Re: [PATCH v4] app/testpmd: enable cli for programmable action >> >> On 10/7/2023 11:47 AM, Qi Zhang wrote: >>> Parsing command line for rte_flow_action_prog. >>> >>> Syntax: >>> >>> "prog name [arguments \ >>> ... end]" >>> >> >> Can you please put full rte flow command in the commit log? Like what is the >> 'pattern' for above command? > > The pattern part should be independent of the action part, > > though for our P4 device, we will prefer use rte_flow_flex_item, something like: > > flow create 0 pattern flex item is xxx pattern is xxx / flex item is xxx pattern is / actions prog name ...... > > but it does not limit PMD to support flow like below > I think agreement was to use flex pattern, and my understand is "struct rte_flow_item_flex" will be used to present the table_id. Without not using flex, how driver will detect which table to update? > flow create 0 pattern eth / ipv4 src is 1.1.1.1 / actions prog name ...... > > So I think it may not be necessary to highlight the pattern format here. > Complete samples helps a lot to user, can you please include the full rte flow command, you can have flex pattern sample and if you want add more samples with other patterns but we need to clarify it first. >> >> >>> Use parse_string0 to parse name string. >>> Use parse_hex to parse hex string. >>> Use struct action_prog_data to store parsed result. >>> >>> Example: >>> >>> Action with 2 arguments: >>> >>> "prog name action0 arguments field0 03FF field1 55AA end" >>> >>> Action without argument: >>> >>> "prog name action1" >>> >>> Signed-off-by: Qi Zhang >>> >> >> Is there an existing driver implementation, checking it helps to understand >> feature implementation? > > This work is still ongoing, currently we target to upstream on DPDK 24.03 > If you won't have driver yet, do you have a way to test these commands? Or is this implementation just theoretical at this stage? >> >> >>> --- >>> >>> v4: >>> - be more generous on the max size of name and value. >>> >>> v3: >>> - refine struct action_prog_data >>> - enlarge the max size >>> >>> v2: >>> - fix title >>> - minor coding style refine. >>> >>> app/test-pmd/cmdline_flow.c | 232 >>> ++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 232 insertions(+) >>> >> >> Hi Qi, >> >> Can you please update documentation too, >> `doc/guides/testpmd_app_ug/testpmd_funcs.rst`, `Flow rules management` >> section. > > Sure. > >> >> >>> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c >>> index 21828c144c..ae5556e704 100644 >>> --- a/app/test-pmd/cmdline_flow.c >>> +++ b/app/test-pmd/cmdline_flow.c >>> @@ -719,6 +719,13 @@ enum index { >>> ACTION_IPV6_EXT_PUSH, >>> ACTION_IPV6_EXT_PUSH_INDEX, >>> ACTION_IPV6_EXT_PUSH_INDEX_VALUE, >>> + ACTION_PROG, >>> + ACTION_PROG_NAME, >>> + ACTION_PROG_NAME_STRING, >>> + ACTION_PROG_ARGUMENTS, >>> + ACTION_PROG_ARG_NAME, >>> + ACTION_PROG_ARG_VALUE, >>> + ACTION_PROG_ARG_END, >>> }; >>> >>> /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ >>> -749,6 +756,23 @@ struct action_rss_data { >>> uint16_t queue[ACTION_RSS_QUEUE_NUM]; }; >>> >>> +#define ACTION_PROG_NAME_SIZE_MAX 256 #define >> ACTION_PROG_ARG_NUM_MAX >>> +16 #define ACTION_PROG_ARG_VALUE_SIZE_MAX 64 >>> + >>> +/** Storage for struct rte_flow_action_prog including external data. >>> +*/ 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_NUM_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; >>> +}; >>> + >>> /** Maximum data size in struct rte_flow_action_raw_encap. */ >>> #define ACTION_RAW_ENCAP_MAX_DATA 512 #define >> RAW_ENCAP_CONFS_MAX_NUM >>> 8 @@ -2169,6 +2193,7 @@ static const enum index next_action[] = { >>> ACTION_QUOTA_QU, >>> ACTION_IPV6_EXT_REMOVE, >>> ACTION_IPV6_EXT_PUSH, >>> + ACTION_PROG, >>> ZERO, >>> }; >>> >>> @@ -2510,6 +2535,13 @@ static const enum index >> action_represented_port[] = { >>> ZERO, >>> }; >>> >>> +static const enum index action_prog[] = { >>> + ACTION_PROG_NAME, >>> + ACTION_PROG_ARGUMENTS, >>> + ACTION_NEXT, >>> + ZERO, >>> +}; >>> + >>> static int parse_set_raw_encap_decap(struct context *, const struct token *, >>> const char *, unsigned int, >>> void *, unsigned int); >>> @@ -2786,6 +2818,18 @@ static int >>> parse_qu_mode_name(struct context *ctx, const struct token *token, >>> const char *str, unsigned int len, void *buf, >>> unsigned int size); >>> +static int >>> +parse_vc_action_prog(struct context *, const struct token *, >>> + const char *, unsigned int, void *, >>> + unsigned int); >>> +static int >>> +parse_vc_action_prog_arg_name(struct context *, const struct token *, >>> + const char *, unsigned int, void *, >>> + unsigned int); >>> +static int >>> +parse_vc_action_prog_arg_value(struct context *, const struct token *, >>> + const char *, unsigned int, void *, >>> + unsigned int); >>> static int comp_none(struct context *, const struct token *, >>> unsigned int, char *, unsigned int); static int >>> comp_boolean(struct context *, const struct token *, @@ -7518,6 >>> +7562,48 @@ static const struct token token_list[] = { >>> .args = ARGS(ARGS_ENTRY(struct rte_flow_item_tx_queue, >>> tx_queue)), >>> }, >>> + [ACTION_PROG] = { >>> + .name = "prog", >>> + .help = "match a programmable action", >>> + .priv = PRIV_ACTION(PROG, sizeof(struct action_prog_data)), >>> + .next = NEXT(action_prog), >>> + .call = parse_vc_action_prog, >>> + }, >>> + [ACTION_PROG_NAME] = { >>> + .name = "name", >>> + .help = "programble action name", >>> >> >> Can you please remind me again what was the 'name' filed of "struct >> rte_flow_action_prog" was for? > > The 'name' field serves as a means for the driver to identify an action schema, enabling it to verify if the number of parameters and the size of each parameter value align with the P4 definition. > Subsequently, the driver translates these values into hardware-specific configurations. If there is a misalignment, the PMD will return a failure. > As I understand it is used for kind of unique action handler, but we have rte_flow handler already, I am still not clear why an action handler is required. Why driver is not using rte flow handler? Again driver implementation would clear more the intended usage. >> >> >>> + .next = NEXT(action_prog, >> NEXT_ENTRY(ACTION_PROG_NAME_STRING)), >>> + .args = ARGS(ARGS_ENTRY(struct action_prog_data, >> data.name)), >>> + }, >>> + [ACTION_PROG_NAME_STRING] = { >>> + .name = "{string}", >>> + .type = "STRING", >>> + .help = "programmable action name string", >>> + .call = parse_string0, >>> + }, >>> + [ACTION_PROG_ARGUMENTS] = { >>> + .name = "arguments", >>> + .help = "programmable action name", >>> + .next = NEXT(action_prog, >> NEXT_ENTRY(ACTION_PROG_ARG_NAME)), >>> + .call = parse_vc_conf, >>> + }, >>> + [ACTION_PROG_ARG_NAME] = { >>> + .name = "{string}", >>> + .help = "programmable action argument name", >>> + .next = NEXT(NEXT_ENTRY(ACTION_PROG_ARG_VALUE)), >>> + .call = parse_vc_action_prog_arg_name, >>> + }, >>> + [ACTION_PROG_ARG_VALUE] = { >>> + .name = "{hex}", >>> + .help = "programmable action argument value", >>> + .next = NEXT(NEXT_ENTRY(ACTION_PROG_ARG_END, >> ACTION_PROG_ARG_NAME)), >>> + .call = parse_vc_action_prog_arg_value, >>> + }, >>> + [ACTION_PROG_ARG_END] = { >>> + .name = "end", >>> + .help = "end of the programmable action arguments", >>> + }, >>> + >>> >> >> Does this means two 'end' required if multiple args provided, like: >> prog name "name" arguments field0 03FF field1 1 end / end >> I am aware there is variable length of key/value, and need a marker to stop, >> but this end specific for action is not used, > > Actually I borrowed the idea from the queue group in the RSS action: > > 'actions rss queues 0 1 2 3 end / end ..." > > The difference is that the 'end' check was previously hidden within the 'parse_vc_action_rss_queue' function, while in my implementation, I've defined it as a distinct state. > My concern is if ACTION_xxx_END tokens be confusing or redundant if we have more of them. Is there a benefit to have it as token, comparing to have it in the parser functions as RSS does?