From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f169.google.com (mail-wj0-f169.google.com [209.85.210.169]) by dpdk.org (Postfix) with ESMTP id 3ECDBFA67 for ; Mon, 19 Dec 2016 18:50:07 +0100 (CET) Received: by mail-wj0-f169.google.com with SMTP id tk12so157017090wjb.3 for ; Mon, 19 Dec 2016 09:50:07 -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=SlMNWUsvcrauyH82xME83nk88WQ7LFWRoYg+EJZ0iF4=; b=K6G2l4JvUyPVfvTBXTJLzvOas//WusCphwyLDtC3jQ8rHT7BzRT9ukPM4ELU8OjU+2 SV/W82PPwGsVrOQ1qqAVUvmbtVYKufeMN1s1g+6wBnB3OLrJJM9DPx7ov+vwO5pRBHTQ jnAwU6Im04l09CjbHZiViI3Ve18heYr8Ul713w/pWEOsWvWak9uDTFN1VPKgKqgafOiw No0R9S0owyY/vbJDrEq4qOfOpKRkya0uvMqVccnDWosEAf68rafaP0CrjUk/lTHv9yCT hNM3oQwfWx4UvUZ0cFU9mp0SheaKL+P7vSJiz4MnjdzLu3xRlmUagoNqRQu+DA3xq47A 0Ubg== 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=SlMNWUsvcrauyH82xME83nk88WQ7LFWRoYg+EJZ0iF4=; b=ELlIP3OVd+1LX5Iq1zdcK5XtSTaMS6K87o7OglqQB3jZ44TrJPXECS4mpMHA1I/y5d 5BldWmSA64g4O+lRYOnfuARlo6X8HnpLv4yyMl1PhpWRBsQtzRMGHdy/9MRIYku7X14O 5lcEgZMNis8ox0GgoU1VgcA8W6tSfZDbRqMJrJj2VJoTRptp7tQFben/4Yb2YF2d00Xj syudw4Wn46PnL7vOQ3LO5RRPCJ5CAO1R+3LriOa0zztpwK6nKU5+kUN8Zcb5SGt429i5 gKK1ZPrIE6cll0eZhcGgBcF3i+8RZaOCxuy8pEGIMcrTzWb8Muns+gXtrM3YFADOoOQS AsdA== X-Gm-Message-State: AKaTC01Ikh4pPiXbAvkYJDMpTsxhneG6T8ndi/o4j+rMArTUni+5Hirf4K0OjF3bndQugOP7 X-Received: by 10.194.79.5 with SMTP id f5mr17813582wjx.13.1482169806810; Mon, 19 Dec 2016 09:50:06 -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 i15sm21645935wjs.16.2016.12.19.09.50.05 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 19 Dec 2016 09:50:06 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 19 Dec 2016 18:49:08 +0100 Message-Id: <5cb8dd8f337c4ef95f98fcd2f5ec7c611a6a1367.1482168851.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 18/25] app/testpmd: add various items 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:07 -0000 - PF: match packets addressed to the physical function. - VF: match packets addressed to a virtual function ID. - PORT: device-specific physical port index to use. Signed-off-by: Adrien Mazarguil Acked-by: Olga Shern --- app/test-pmd/cmdline_flow.c | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 1736954..ac93679 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -101,6 +101,11 @@ enum index { ITEM_INVERT, ITEM_ANY, ITEM_ANY_NUM, + ITEM_PF, + ITEM_VF, + ITEM_VF_ID, + ITEM_PORT, + ITEM_PORT_INDEX, /* Validate/create actions. */ ACTIONS, @@ -298,6 +303,9 @@ static const enum index next_item[] = { ITEM_VOID, ITEM_INVERT, ITEM_ANY, + ITEM_PF, + ITEM_VF, + ITEM_PORT, ZERO, }; @@ -307,6 +315,18 @@ static const enum index item_any[] = { ZERO, }; +static const enum index item_vf[] = { + ITEM_VF_ID, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_port[] = { + ITEM_PORT_INDEX, + ITEM_NEXT, + ZERO, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -601,6 +621,39 @@ static const struct token token_list[] = { .next = NEXT(item_any, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY(struct rte_flow_item_any, num)), }, + [ITEM_PF] = { + .name = "pf", + .help = "match packets addressed to the physical function", + .priv = PRIV_ITEM(PF, 0), + .next = NEXT(NEXT_ENTRY(ITEM_NEXT)), + .call = parse_vc, + }, + [ITEM_VF] = { + .name = "vf", + .help = "match packets addressed to a virtual function ID", + .priv = PRIV_ITEM(VF, sizeof(struct rte_flow_item_vf)), + .next = NEXT(item_vf), + .call = parse_vc, + }, + [ITEM_VF_ID] = { + .name = "id", + .help = "destination VF ID", + .next = NEXT(item_vf, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_vf, id)), + }, + [ITEM_PORT] = { + .name = "port", + .help = "device-specific physical port index to use", + .priv = PRIV_ITEM(PORT, sizeof(struct rte_flow_item_port)), + .next = NEXT(item_port), + .call = parse_vc, + }, + [ITEM_PORT_INDEX] = { + .name = "index", + .help = "physical port index", + .next = NEXT(item_port, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port, index)), + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", -- 2.1.4