From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: [PATCH v1 4/9] app/testpmd: fix lack of flow action configuration Date: Fri, 23 Mar 2018 13:58:09 +0100 Message-ID: <20180323124725.15806-5-adrien.mazarguil@6wind.com> References: <20180323124725.15806-1-adrien.mazarguil@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu To: dev@dpdk.org Return-path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id E02895F5F for ; Fri, 23 Mar 2018 13:58:23 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id f125so3351693wme.4 for ; Fri, 23 Mar 2018 05:58:23 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180323124725.15806-1-adrien.mazarguil@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Configuration structure is not optional with flow rule actions that expect one; this pointer is not supposed to be NULL and PMDs should not have to verify it. Like pattern item spec/last/mask fields, it is currently set when at least one configuration parameter is provided on the command line. This patch sets it as soon as an action is created instead. Fixes: 7a91969ad35e ("app/testpmd: add various actions to flow command") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil Cc: Wenzhuo Lu Cc: Jingjing Wu --- app/test-pmd/cmdline_flow.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 9cac8e9bf..c2cf415ef 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -1909,6 +1909,7 @@ parse_vc(struct context *ctx, const struct token *token, return -1; *action = (struct rte_flow_action){ .type = priv->type, + .conf = data_size ? data : NULL, }; ++out->args.vc.actions_n; ctx->object = action; @@ -1989,7 +1990,6 @@ parse_vc_conf(struct context *ctx, const struct token *token, void *buf, unsigned int size) { struct buffer *out = buf; - struct rte_flow_action *action; (void)size; /* Token name must match. */ @@ -1998,14 +1998,9 @@ parse_vc_conf(struct context *ctx, const struct token *token, /* Nothing else to do if there is no buffer. */ if (!out) return len; - if (!out->args.vc.actions_n) - return -1; - action = &out->args.vc.actions[out->args.vc.actions_n - 1]; /* Point to selected object. */ ctx->object = out->args.vc.data; ctx->objmask = NULL; - /* Update configuration pointer. */ - action->conf = ctx->object; return len; } -- 2.11.0