From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f181.google.com (mail-wj0-f181.google.com [209.85.210.181]) by dpdk.org (Postfix) with ESMTP id 7CBA4FBE0 for ; Tue, 20 Dec 2016 19:43:30 +0100 (CET) Received: by mail-wj0-f181.google.com with SMTP id v7so184141082wjy.2 for ; Tue, 20 Dec 2016 10:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=WxEXemlm5hzBuPPnPjlb9AyaqHTESU50TKLZHhVeWso=; b=l5bkD5JYahOEKXWwOhcCa6AKCca9AzbsLRMI5qJKJHgsTsPW2lPETjls80hzE6UTRC MjAtp9iFeYOvODhK37NCAEu56tSbZDkmKFN8tnVy66SMBibXVfvoJawFbADnf+bJNSwn WYyvJK1IBTh4WX8f/JxA3Svy6xLUFFIKPhTxmQd6CjioNR1LsBhfmukpAv6qjnT+REx0 caNlrvFiE83daUA2ptJZc/pylUz1HcVdggIEfwolESCN1FIjKT/C13rXfv4t8UwXsIXj RqGjIjos/TxG+nhTW+YiAyf0FOjC+Yicngzuc5KTN7q2vmz/gz/bHxynvFiu73i4ELvI 8KXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=WxEXemlm5hzBuPPnPjlb9AyaqHTESU50TKLZHhVeWso=; b=B6CifKE5moSG9iFvHKEWdgr10b2KIzJDKmT9wHavnFGBDVpGPdV7M2vrBgw0ncyESU lRdcgMFFpGYBiGrdBKMPtbTkSEcwpKSjRbJpOzL2BfjKqN7u7dJfaLGI6khTrNs3esCa B8cHiZ83KJ6ZQJSBSzLGmo1WjtkqntybVqzoTjjzJfQyKln33r8V1BCh80owMuF+/fZU puH3/4+Ls1KBjY5CTt/mpqV8A9vKXhaDANp1ZVMd+3Z4Y5B5HeCBcuhvBIeSgOGNmXSY +H1GIZ9So0AcrM48fJW2rSPsWbwl5M8XEqcgErrMpfX8aB0s5nDpMyo2AlIOrUrW4BxO bs5Q== X-Gm-Message-State: AIkVDXKG8X7cF89iHjrGzr/G9f3dg/m3JHWMT4aPdmFvoSlxOYna2MaC4bMqcYjTNzgPvwBG X-Received: by 10.194.209.169 with SMTP id mn9mr644662wjc.114.1482259409924; Tue, 20 Dec 2016 10:43:29 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id y22sm474528wmh.9.2016.12.20.10.43.29 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 20 Dec 2016 10:43:29 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 20 Dec 2016 19:42:34 +0100 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 17/25] app/testpmd: add item any to flow command 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, 20 Dec 2016 18:43:30 -0000 This pattern item matches any protocol in place of the current layer and has two properties: - min: minimum number of layers covered (0 or more). - max: maximum number of layers covered (0 means infinity). Signed-off-by: Adrien Mazarguil Acked-by: Olga Shern --- app/test-pmd/cmdline_flow.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 72b5297..09e9177 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -99,6 +99,8 @@ enum index { ITEM_END, ITEM_VOID, ITEM_INVERT, + ITEM_ANY, + ITEM_ANY_NUM, /* Validate/create actions. */ ACTIONS, @@ -282,7 +284,6 @@ static const enum index next_list_attr[] = { ZERO, }; -__rte_unused static const enum index item_param[] = { ITEM_PARAM_IS, ITEM_PARAM_SPEC, @@ -296,6 +297,13 @@ static const enum index next_item[] = { ITEM_END, ITEM_VOID, ITEM_INVERT, + ITEM_ANY, + ZERO, +}; + +static const enum index item_any[] = { + ITEM_ANY_NUM, + ITEM_NEXT, ZERO, }; @@ -580,6 +588,19 @@ static const struct token token_list[] = { .next = NEXT(NEXT_ENTRY(ITEM_NEXT)), .call = parse_vc, }, + [ITEM_ANY] = { + .name = "any", + .help = "match any protocol for the current layer", + .priv = PRIV_ITEM(ANY, sizeof(struct rte_flow_item_any)), + .next = NEXT(item_any), + .call = parse_vc, + }, + [ITEM_ANY_NUM] = { + .name = "num", + .help = "number of layers covered", + .next = NEXT(item_any, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_any, num)), + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", -- 2.1.4