From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 40BE25687 for ; Wed, 16 Nov 2016 17:24:41 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id a197so249933883wmd.0 for ; Wed, 16 Nov 2016 08:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=em1k36cPoDd8dNpnQkXG1gBA+JSPQLp9L8I1EDKBajQ=; b=sb7tvalLF9GnzQhEFX+09N5Ll5/i31O2m436BpBD4bjH9n0yMQVFmH+a0JzDVGpeWv L8bJYZRF56k0L/Y6HelX/xrq5z1xKL68dPKAwL04DFuI8lOMKRMV57UwyM6lbSaWm66g HG8tkid3H0zKZ5gTMouxANzWhQV8ejdSQfQDji8mHH7kaO8YMzvbd9tbTY37A5n1t3lI rs1Un2whHP1lrEgLvAbYqjmb4nsWXM6MZPQSCExe6nznuZKrFg6yaK1fwk56NiMvwe7J AVgXqzFvcBADtfj44tEpajGCDkVV/JopmqAKDAXHKX2pFMKm+a+O20+MOSDc0NmDIAOf TK0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=em1k36cPoDd8dNpnQkXG1gBA+JSPQLp9L8I1EDKBajQ=; b=im43app2hN+B58d1hYTwe8zmNj+Zy1JCk8arfAb3h6d0bK0HXJfojKgKYx0D8+J7Ld DAkV3tBE2dH2tbTg4eJyvP1P4+FRSkU142iCurfnaLfeYshsVlopnkQdn7MmNWv5ClDN fuNQKUyKesUHzG7mYIA66XGpX7I7I+Z2o9VRcg4IvgMBBK3ziVfhBR5H47qE9A8HW4k4 Lrgtr3zUuUrCYAi7jwVaGeTHuleKjN41tKoYKowoeTrws2JAfgF/RAi6+9A/A0WApN4t SRNodyG6VwHiVrr6PA7k6cxKfhfbERFA8dU9BFqb/GTBeetNISlxWhe3PVi86pPdpE8Q L6jw== X-Gm-Message-State: ABUngvfO/aa3Hiw10vtx1rmujdyp5FcOqKHMmGAd2R+NicFjHBJGpSnWzDjma3M4ZgzlFl6V X-Received: by 10.194.173.73 with SMTP id bi9mr2503958wjc.120.1479313480672; Wed, 16 Nov 2016 08:24:40 -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 e5sm10945965wma.12.2016.11.16.08.24.39 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 16 Nov 2016 08:24:40 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Cc: Thomas Monjalon , Pablo de Lara , Olivier Matz Date: Wed, 16 Nov 2016 17:23:41 +0100 Message-Id: <78afc1a702b7ecfea743d73c09209af5e04782c4.1479309720.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 15/22] app/testpmd: add item any to flow command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 16:24:41 -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 --- app/test-pmd/cmdline_flow.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 81930e1..5816be4 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -99,6 +99,9 @@ enum index { ITEM_END, ITEM_VOID, ITEM_INVERT, + ITEM_ANY, + ITEM_ANY_MIN, + ITEM_ANY_MAX, /* Validate/create actions. */ ACTIONS, @@ -295,6 +298,14 @@ static const enum index next_item[] = { ITEM_END, ITEM_VOID, ITEM_INVERT, + ITEM_ANY, + 0, +}; + +static const enum index item_any[] = { + ITEM_ANY_MIN, + ITEM_ANY_MAX, + ITEM_NEXT, 0, }; @@ -579,6 +590,25 @@ 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_MIN] = { + .name = "min", + .help = "minimum number of layers covered", + .next = NEXT(item_any, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_any, min)), + }, + [ITEM_ANY_MAX] = { + .name = "max", + .help = "maximum number of layers covered, 0 for infinity", + .next = NEXT(item_any, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_any, max)), + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", -- 2.1.4