From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id A858B1BAB9 for ; Tue, 10 Apr 2018 18:34:27 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id x82so24518360wmg.1 for ; Tue, 10 Apr 2018 09:34:27 -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=0m2OAQTatrlqEpojkpWZ941BhzAlQSBgGLgD0v/dkyFGiQ6zU2t8F6eMXn7pG94R/K wdv3h6bfQREX+rdipNSj1K6QWxm5kmInspM0+Uuvh7XvRc2VxNjjnEsgzHszGsUlwre2 KxphgqB23xidBCwLUj2LA/obP9vjBy/PoYEJEyY3mHCAPyy2yZeBjkjTaF2J78j4Udlr 7N82MQIYNTxdja58Ixx3eub3zBNz8yvN1otTs06OBrD3Ihc5ckvFLPMHTZmcf4HHW9ye ntjeSyyBUlSrakPY7IcegfL+Z07kQqybzVhyqJnSZlWlSPed06e3pg4iFYLYfey/kdtf f6kw== 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=awpZB56gj89Zt848JaFy9VvRp2xdqtaNQ7+tqVsiIrxFW5zsspuINu6a0qG9wz+FtC Oj/uNwJ8u71dofgD2qNDg6Y75LTmK4gvN/ix6a03XhPpww0seGBBN3QobEmTx1CeH4K4 7T0H5k5x5apMES47Gi0SoNHHeGa+dv5I8aM86GnDAd+JpFee6D1THSN+PZuSu1qGobFd c8Ph62CudMxhkoqAjNKmuUWol48Q7qH0EkjukYHXQWRpOeo972ypncA+eeKBy43NZbSY Qmc6Fd0GpjAtngX59hijVLh7mAhC85x8ebrsousMw8o0jE2V4S3fX7KrO3erTa39gD8i VkOQ== X-Gm-Message-State: ALQs6tC/INjFfVlrHGM0ksF+r14SihSZ/3puxmL+lYdNSLHlIK+BiRvT ANsQt+n181zr20smsSzhmSzK5QWN X-Google-Smtp-Source: AIpwx48SBu4e5CfDDUmUOGEy2ZBHR33nTjifZgE9fDqZeFmSov3rJ/d8IXCxZzDLYiIfMS6SpfpKgw== X-Received: by 10.28.190.1 with SMTP id o1mr133094wmf.21.1523378067355; Tue, 10 Apr 2018 09:34:27 -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 t76sm3063417wme.17.2018.04.10.09.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 09:34:26 -0700 (PDT) Date: Tue, 10 Apr 2018 18:34:13 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180410161132.8776-7-adrien.mazarguil@6wind.com> References: <20180406131243.19037-1-adrien.mazarguil@6wind.com> <20180410161132.8776-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410161132.8776-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v4 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: Tue, 10 Apr 2018 16:34:28 -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