From patchwork Thu Apr 19 10:07:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 38494 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD6778D87; Thu, 19 Apr 2018 12:08:04 +0200 (CEST) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 533927ED4 for ; Thu, 19 Apr 2018 12:07:50 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id q13-v6so12446253wre.3 for ; Thu, 19 Apr 2018 03:07:50 -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=q2kUquUCpAJsN/N4zG5NsH4Y5+9HIRIlrItCqWgYaNkupJiQg8NCUGNdUJ5hpicrtv 9N/Nb5AGGq4QYWyy09lnm5eRdQzxfLvY8C6km4KrgfhtQpZe/UkKmganmsQXDE8agqs0 qqBWPwdHq26W/i3twMuqkhmo3wsFK5WoICr+inuqzN0vFUoE9QsEdwJ6NrONTitNQ9+Y 8XC9nDPmPbaijOVvcIp66U2nOuAtAI32c7y4ncMj8DdnZDVEMD/BXGnTG8Qr1ReY+QtV u3q5ito9auI+fe9ZUADqYZfsR/KtQhVDtdeWsK4w8eAGLnN8TixZO/D4TOWMXg50dIav rJXA== 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=HdCpGlLyV43/NEmSYsaQ5ebvhaUBDhXQQI+enkkUmh+e7K/A1nT7O17fTXSsEKdXCN eSx7EtEfJF8eP/MeR8qQ5NvKPb9Lefd6zfrvPVrexmNEz+GQNLq5gR1xJn+6fqomrMxT bBP5LywYbl8OYbzJL0NAPO1lqT3tPJBStmCouboQxXwczxDDE+170quZ8SKNz/cQDJhq XVZjOhs2uIc8xumMbSuuUOG0KKCBnqBpGiGOoXmeCorPYBdeR5tt8Pp2eKGXdrpLNKNY Km500DJT6D/9yQHZVMOVRgyEkLbXAFdDTsCdaHPc8EKrx4y3QQVfhJYxrK857zMmSyJE mEfg== X-Gm-Message-State: ALQs6tCBQ5NK3QG88cv58e469km4xblRcm1e5wbn+2oEe9bN4IbGK4lh YVHFq7e4h4x5bAN+O8cWt89Zman+ X-Google-Smtp-Source: AIpwx490Wii1zRmaff3qkvuGKfu2tawtfMwrr+rSmaQHTp73OsNx5uKKY8GSorFg4z47pZ/8DzVJpQ== X-Received: by 2002:adf:b64d:: with SMTP id i13-v6mr4231199wre.262.1524132469887; Thu, 19 Apr 2018 03:07:49 -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 a139sm4601481wma.43.2018.04.19.03.07.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 03:07:49 -0700 (PDT) Date: Thu, 19 Apr 2018 12:07:35 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180419100204.5728-7-adrien.mazarguil@6wind.com> References: <20180416150058.2620-1-adrien.mazarguil@6wind.com> <20180419100204.5728-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180419100204.5728-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v6 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: , 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 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; }