From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=wY8xQEH4x/CzgkQdOLwsO/oFiT5w5y0AfnVk/zddbfQN/QSkmi0oX4nJ5F19ZmS4JH Pe1carorX1aWO9OvIOc9MFCX6Obe9H7ajZuxXxuFvtfbu4lrSJMfckPR+MCNduBXrcPx eOpWeIQ8CmCoA4g6RdT1Mie1syEAiIV3e3LDO2XROu9KhSOOSpp1Ol8N5v4X5qVM+MmY 6YvPqtrjTyssZ1wp1hi1CluRxdFCQSqiq1Pa62BH3E8/vXsLAQPmqTqmPjUc/YQB3VQt w30ytAisQEzi2LyHcscTl2tR9jYqhEbpUDJZPW/ruNy+KslhMh+jp7aZXVezJW3aTXhy jQYw== 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=ptwjqwXQUqZp1m5QKt68zMvHK3AbDs3W1pbNwQXYgHkNs/DfbrAS87tWXNXg5em7H9 AEyiVevY6Rd1NKsnHRQquT29IVnbENyM32PcPGHu2F24iGWNfjHFc4MxRiAzupRn5K+L 7kWd8aEzgN7QgoPDz8p0lalOZQAAVhoJXw50u2cShK/HjOnjbKGYzZkDoJ7pISZs3F0c KTuVedz4esEZsINM9zHyGeIPUWIiK3Xi1dAz80SHzAN4u/fBwf1xnVAdGHH3SzbOyyL8 NNIQnZ5rSjYQW9b9ulTzn1KxNBZ1G/PB4BkvqxU3lgcT/nF47lcNMdNbEMWNY6OyVVDw D4uA== X-Gm-Message-State: AElRT7H1EMaZgincgorIIjLSwFwxpKLsM6yaiQjx2uJCLR9WtIfvHJLz /zhmjp7O02jxhLNOmyOQO4k1oP1w X-Google-Smtp-Source: AG47ELtlEqbDD355vzOf9QeHb/Pxg27BqSW//pfhiwQDz0Swpb1ghRzZlBwea23ug6vvyfIuSrvYIQ== X-Received: by 10.28.176.132 with SMTP id z126mr7871806wme.122.1521809903524; Fri, 23 Mar 2018 05:58:23 -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 q21sm11046671wmd.40.2018.03.23.05.58.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 05:58:22 -0700 (PDT) Date: Fri, 23 Mar 2018 13:58:09 +0100 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu 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 Content-Disposition: inline In-Reply-To: <20180323124725.15806-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v1 4/9] 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: Fri, 23 Mar 2018 12:58:24 -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