From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id A71F8F920 for ; Fri, 16 Dec 2016 17:26:10 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id c184so15448325wmd.0 for ; Fri, 16 Dec 2016 08:26:10 -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=3lczKcuXE2hxcBCvhi0r6ai2vcES0UAtbUSVFBJH7eQ=; b=GjOFH4m0OQrb/gn3dVn6Gt8GzPaRHVRqh+1Dmb0XQN0LMyx5aK6KhUNx+8MMQo8+Au 6RITif/OjQDC+lkqmu8oaASy+PJ2YlSbmbwJLatVoyjHJnqoj9J7ug/ly6xp12wjORYz z7PTvq0Ghlu8Ky4ZVjq6ocaDzomk2gI5vlV9mAlG64MfpBeGzOeAK4jFTU5adW++z8C/ dvfd/E/pBFw15Klbx3oVePbsaboL/Yd/UsddNinw2lLSwrRZ3YvVEmLfj/splYAu6QUz Hz30fCFTXm6ZnceL6XqQ9EOZAXIcPt81zZvhlxsWgK7zzkRzOma1ecysI9AsQBMH41qb +yrQ== 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=3lczKcuXE2hxcBCvhi0r6ai2vcES0UAtbUSVFBJH7eQ=; b=FSq92NEJMnDBHFvWk/H5+cnZ+bpuqXT258lqc0E+josxSMBwWJisJjD/AgKAyDA/mA nnkZXSw0CrE188M5Tw6/HTs3dXZ0QD7ORCTjKGGaR21VWJKZizNnqnJk+NGfJgZUJyBA RYVv4pRo3YpEjBPwARmNZhEWKhAfh/MMX+AeGRv/DZHbihoLx5a8JnT8+4fqggOFBmv9 sY84+8ua6ggvEUn284Oy9GrPDBCBdzNYUtQiOA0QIIFCOI36soHp5k8lQlrl7wDAZMo5 bHwY0u3sHhkImQG4YIVWTlwyw6IfZ9UGlyYFM56bfE71l13tgK7D9P9bYwb8x5PhLNML t6eA== X-Gm-Message-State: AIkVDXKK0yicZ008w/kX3yVZQ+yBik7/3ej+XrKIeTJfsdOD7wy5hPka9GrC8JFZ6mIo8ciZ X-Received: by 10.194.21.201 with SMTP id x9mr3301497wje.153.1481905570262; Fri, 16 Dec 2016 08:26:10 -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 a13sm4029632wma.18.2016.12.16.08.26.09 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 16 Dec 2016 08:26:09 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 16 Dec 2016 17:25:14 +0100 Message-Id: <3f12187a25b4d19269ed600b189dcf2c5300d4c0.1481903839.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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: Fri, 16 Dec 2016 16:26:11 -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 | 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