From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 1088F1C704 for ; Wed, 4 Apr 2018 16:58:12 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id t67so22247672wmt.0 for ; Wed, 04 Apr 2018 07:58: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=eb/7AXisvGSFa+a8kVlxHErkl0arni+/Vbc1tg32RaY=; b=UL0SPORo7s2UaRURBhxZAzUuUmyOMCdiX2PDf4cIQK1Va2VSB4bAbgYGS+D/5xrBeL XMGrW02MhmfG7nZiDu/F4gkVjC9DVhgUCDUEzHYdZeYW1uRBBYbB+6O8nPnCuLxxiXJR 8g/Un5nPYjcAZ11ltrxsKClmrXUz0d6HebwzRp5g1PHVbfaorWSYLgp4Dm2haY1NaHJn 8C40HoIyN8B6BB3+nXA6Jad/MVMzcQgd4S1/AEzgT6cwdJItCxN997IFobps5gB9O6JS /eE5gozX9e54GD56Mcq5K1+VWg1YjMo9g/e0DtUqjwsrU5fcOGjOAUI6hcjCI83AV8a0 E2kA== 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=eb/7AXisvGSFa+a8kVlxHErkl0arni+/Vbc1tg32RaY=; b=GeQOyxMuG5jHEqK1hFW9XkuIjzA4mh/sNf0tnimziFoJvSyBwtvuk2WNyCQHDTb85y GswzNCwoSjnNJ/aevr+wvxkSBeXJRaopOQUKA8V89dhyqeH3YVGtgCF7JPw259KZaSlL Vj8zvh4eSaUjG3PIAAQY6/fq/wgQRov05UlPgKV90o3+jdiSsAEdoID5Sczth03e3neD IaoxvDq4RB507ng/epEQknGHaUUNVNU0uz25LoMxcgT41dWnRtqWc+zbvdxm699nCMCt N57QKjWRuZBUW3slJKAd6joWDSkcz/qQXdSCta1rJQ4G/sXLnGTYj5zc5euvqi1/sQO4 ubaw== X-Gm-Message-State: ALQs6tA1WgGsgFM5MDjWiOfhVWX8Xw9kfejIXhTbAvKoJ5oXP7a1PoLC hq7PbFoC4Mh+LnPHfdwrGKyO+7L6 X-Google-Smtp-Source: AIpwx4+CiiCuwXyU1cu2l4dGUMfZMRGhZrhEG8N7EcGGT6kaDunrA2JCPvtwNjhWVcegbNle5KES5w== X-Received: by 10.28.213.12 with SMTP id m12mr7396040wmg.98.1522853891638; Wed, 04 Apr 2018 07:58: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 n143sm5349354wmd.29.2018.04.04.07.58.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 07:58:11 -0700 (PDT) Date: Wed, 4 Apr 2018 16:57:58 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180404144805.11966-8-adrien.mazarguil@6wind.com> References: <20180323124725.15806-1-adrien.mazarguil@6wind.com> <20180404144805.11966-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180404144805.11966-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v2 07/13] 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: Wed, 04 Apr 2018 14:58: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 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