From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 1C00B10C87 for ; Wed, 21 Dec 2016 15:52:45 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id g23so150573808wme.1 for ; Wed, 21 Dec 2016 06:52:45 -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=0dJf9ik8V+1YRNEL96+WXtwHeM2yvcjLz4uIo3ET9js=; b=mSPrep301T+5H2c3RBC76jB4M0NSHJV/W4bKacQhxHfkuWggFsorSzrBE4LxNZNZC2 bbF0ITzTcniC54odlK2iuOS6dyswfLX7abbX98W/p4dGYhbUwB+24XQ6mETjjDhezHWn g70ge6Y5rLEU0G3xuPxzbVtrpEcczvZA3Q/J5w7fxBIaHiro5dM8Mnpa8xYLY3OGL/Kd 7Nr4Kg3r6CRZALyf4aADWE32JDasJK1Fsg7HxbY0mlQ7pwF+kiaaihB/PxqXCYUc1eLr 00W9hTdJhEGMOgkszKR8jX2i748GsucoRwQYhh8Y9NVI406JKk0uii67um/yu+qXI4mF +Hlg== 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=0dJf9ik8V+1YRNEL96+WXtwHeM2yvcjLz4uIo3ET9js=; b=EE294lN/0Eqhw44+NtUenDxNpZUxDrQ6+yHxNifDmSxDoQdNB411Gh2iCSx3ssnSwV 4WfGyfEapJXvLJuvrGIPXWuHNKGsgmMdidDf21qNeidFgPK1spaTW0QB+YdcdDWQRXKL 5Ij8ROvfb5Mco0gjdJRraSee76ntGQhNWZU7Y83LJRxTUfetzrJlnPYH1YhcF2OoYLPo tBL7phlXVcu+y88LyJa4dqX6Zujxem6ZCa/JILdqjY3P3A8veBj3Tcjiv73YvLWFBJgd MCnEJwEz/f/x9vBYQgAtJMO1hW2gXklYJnjUYC8Gurn4pAOhvOww07jksD0qzznS6bOC Dg/w== X-Gm-Message-State: AIkVDXIX3smF2kL85s/1MXLyVDW2yQc3Bbl/X38m8Po/PesG52M24FjSv6XPP1/fOD+Z1hB2 X-Received: by 10.28.23.16 with SMTP id 16mr7540819wmx.134.1482331964681; Wed, 21 Dec 2016 06:52:44 -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 i10sm31012747wjd.15.2016.12.21.06.52.43 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 21 Dec 2016 06:52:43 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Wed, 21 Dec 2016 15:51:33 +0100 Message-Id: <4686ce9461a9eb81d329a0c43c5613d8d3d54779.1482331076.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v5 17/26] 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: Wed, 21 Dec 2016 14:52:45 -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 fc4d824..7504fc7 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