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 A7BF8FA67 for ; Mon, 19 Dec 2016 18:50:05 +0100 (CET) Received: by mail-wj0-f181.google.com with SMTP id xy5so155496317wjc.0 for ; Mon, 19 Dec 2016 09:50:05 -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=jhV1ferGS76wkVB3LVw/v7K3ceAMUv51abbp3uJfUPk=; b=d/2/2+OL/vua+sGXyJD/u5R0PKcanNk83tF+nEOZTjZy1lCpltmpuwLLgQ8FvdrH40 +QJLx6mZLwpqgsdoaYx6x7bShRXxvzUJQ36GM9q23REscY8YM6Tq8N8KlSReyRMTGAml ufRqRoWOkIYDag18zV1N0YhXDIJpTK1L8PFLuobPF9WpqizBxHLQG/+xIFpGNqmygcdB +LXSsjWQUypbDcMvskh3gNZ3SxGQcrlpABSkLSmIGM6qhlzjHuHdMTzzNUCfyHMJsFaj HZTThAUgkDk5oO1PWcxluK8Mu8IuDfRdxtujgmmfULrx/2XC+X0IZhnNjfvyzHCePrZN TyRA== 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=jhV1ferGS76wkVB3LVw/v7K3ceAMUv51abbp3uJfUPk=; b=qRU7QlKuhaYAcUtaJXT3okd+OT+ZLlyTOsMYESI8DXHBgv7sm7ndam11lfUzttSQbr Z0gjRPDT68Q1KN72Ot7Ocxyox57lsn1AG3VJgxz+Fkj/JGEfG/w8dHPdnfGQUM4UB8EN n1ECTod0nENmAzjEYEFgUnAWpC6Bw/HYyvY2lfS3rGV2lNSrybCSAKoqliuT40LEraXi IR9iyNaVdYI2aB2aIFtZ9GcPbkmKaOgnul3W//BtPWsmZ/inoy2C47vnZ6hpMft+gF+w xWp22U8N2e9lVtcGwarlcbN4JKAYjwJ1uHoE/VwosePUEsVCjrSxB0xBvagTldPG5qFH sAdA== X-Gm-Message-State: AKaTC02x7COx9BeQLCDZsA2n1xUYPQunVImw9AVV76GsvOfP+Xz2D7leTbrKivWKrONSnVup X-Received: by 10.194.18.196 with SMTP id y4mr15706783wjd.73.1482169805234; Mon, 19 Dec 2016 09:50:05 -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 l2sm21669651wji.7.2016.12.19.09.50.04 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 19 Dec 2016 09:50:04 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 19 Dec 2016 18:49:07 +0100 Message-Id: <4ef168433f1b7572bd2fb9c32badf87f3cb17909.1482168851.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 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: Mon, 19 Dec 2016 17:50:05 -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 69887fc..1736954 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