From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id A1C161D086 for ; Fri, 6 Apr 2018 15:22:57 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id l49so1769767wrl.4 for ; Fri, 06 Apr 2018 06:22:57 -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=ipGBtDCTMv90r3q00ud9ywFbwfy3zArpYdeW5Uj8GZU=; b=Yeo6rrjYIDfRRyGIc3Og257EvRqiyEMY4HyGpgN0ag2SJGwH2khZdNV4kelLZ0Fljy 6vMI+YZmSMOmpgXade/TZMAlCHNF15iXQIEgOqSQBMctbg9pvy2ftiFbTHalSzWtfkhS 3BYLmsQeFp62V61RBjF49ONjKxHpZcdrhZGvHmNit3sh6oL83ovh90zIwj4zDo6MgZiy thtIgeURRJWhPXsomnhjeRVVkbzQjGaHmkD/P+YUSdMptxkTngvlx2TO9UAI0WjK7/qK IKdSxmk4kTZx+wo1Yo59FzI7RFEYYuB9sKkVeXh4YsSR6P1avZV///sJL6tB/vOJfpsW Ll9A== 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=ipGBtDCTMv90r3q00ud9ywFbwfy3zArpYdeW5Uj8GZU=; b=lKzSdoU1KXHMlQH+WzJH+gNQmF98eeYdb5BJ5s6NILjcEIvfwWfUcYKqZQMea8uZxg VO4xjzK1SVujBazFP4/qYlF7S9fA2RBK4PkvmikX+dVZfLFCsm0ta/v0PaskM9G30eVc M5NtE4j+BnDhK1hPcPFEy6RwQ+pCXfX0Y3qSLycpJvbrGDzni2yjBsVT8y7ZuHPeOWtJ zpaqWDQakzYGkaaHIgfeo+sy4mgonShRFsppWmarhaAgVKzmRIhdsU7ldElYQO/DXrvk GwpEt1UOz0aFxvfzm/9IH6pAOY0+hLJycl1899co6uC7xc275qxwKe02Z40Hgld/LC1y 8vWg== X-Gm-Message-State: AElRT7G+t5dgIHUFfyIMzu2GXyb00w8sOzdBQxr4rDz8lN/rhu9GrL0+ 2PHpT2edXQ+MAf6Rz02jKUmni+Sz X-Google-Smtp-Source: AIpwx49bqjvXiF1B46mLvLg8Yl2I/BJk4XDUtVbHQQ7Rl76GwDKgakWhzlFhpIroXYLJ10a1lTbAXQ== X-Received: by 10.223.139.206 with SMTP id w14mr20104591wra.169.1523020977210; Fri, 06 Apr 2018 06:22:57 -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 59sm11531705wro.35.2018.04.06.06.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 06:22:56 -0700 (PDT) Date: Fri, 6 Apr 2018 15:22:43 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180406131243.19037-7-adrien.mazarguil@6wind.com> References: <20180404144805.11966-1-adrien.mazarguil@6wind.com> <20180406131243.19037-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180406131243.19037-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v3 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: Fri, 06 Apr 2018 13:22:57 -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 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