From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id 2297CD090 for ; Mon, 16 Apr 2018 18:22:12 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id s18so27685957wrg.9 for ; Mon, 16 Apr 2018 09:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wi25pcyh7V5szZoYjqEAhpEkgRasl54r85snaigFYK4=; b=VxLVyUz6bk1cpVd4cCdRT4OuFZp9UK/PdjlZHeXRx5MV0Zsjx75MnFsOLWIL5qVJaT E9XMlzjzgL7lKHWYKasgx1T/gyrFbhAbitFhVm0M806Y6Qmpla0RJp7sPWNeIyIeNPy8 Witgd+vgexEva/1saHacDJGvPTpIPVWkTHeN7pArdpBfFT8EasCvzJqVWVfmHKf2Y4fK oQhucyvObK7hOV0w2y4J1dC14/XRMR/hrprs4WT7tCPhFTtxzIuxY2PVgVSy0LSW4LW3 CMdmMfG49wXyioTxpXdP4dsMkZefIfCJEIRLbgUCr8yB7lIUpUMhjZmTIHbGwZcmmig0 M5Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wi25pcyh7V5szZoYjqEAhpEkgRasl54r85snaigFYK4=; b=cEKp4tnd0GVDA+wgA3jSZg6/hRDl9Fe8if7MP2KtVeZ2SBfL0fagKqGAjeFIR8imlV xxMlT8OsSI4iSASKxJW0w6VWOjOlpPWU4iNfGzvF+C16RClwKwg/MXiusjSL+85A7+CU +kDaZAfi5gTPGGmSPQ3mV4XPDdQ6DkfhxFdlpZ/jOhgAf74qGb4bJK9a49N2/L9wyJdh i+U0Pi3tUCrL/HJQHLgfMfXAhZ3WD6AE/iCwUF8y7bJLy8POykA1Bpat0C8XeExqwZ3W /2RjV7KWZWMH7WQwQwpGW24mwCD66+3T3Snr5JJr+L6aN4TvfTE15IG/T3pskl4RDVWu y2fg== X-Gm-Message-State: ALQs6tDovTA4BjwhzDddq9ZIL1JeBZ5VRvzcG9/gEVm5du0I9tsa9rFo NJsCTLYec/WUS5fWCz9IlmKNaxa2 X-Google-Smtp-Source: AIpwx4/gQxEUFAP7AgLqdQuXko9DYkNqzXLZHKcUbiCOSLU7zm5OKsHWr92AxabeZ7myASb11tNwlg== X-Received: by 10.223.160.162 with SMTP id m31mr10863199wrm.278.1523895731837; Mon, 16 Apr 2018 09:22:11 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id p6sm3696110wrg.54.2018.04.16.09.22.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 09:22:11 -0700 (PDT) Date: Mon, 16 Apr 2018 18:21:57 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180416150058.2620-7-adrien.mazarguil@6wind.com> References: <20180410161132.8776-1-adrien.mazarguil@6wind.com> <20180416150058.2620-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180416150058.2620-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v5 06/11] app/testpmd: fix lack of flow action configuration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 16:22:12 -0000 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 Acked-by: Nelio Laranjeiro 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 4640f18f7..a0e06db36 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