From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 9D0E95687 for ; Wed, 16 Nov 2016 17:24:43 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id f82so83952952wmf.1 for ; Wed, 16 Nov 2016 08:24:43 -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=mhpHMjLEB6Kl4bgGtljsj78wGJqSXJZI5f0IoxxkFDc=; b=cfPvHfTwNT5VKNi/lgYk0pNj3AtqU4HdHeFjl0jjD0nZgPFKcX2WNmrkknxF6QUqUj zWLkfpnMUAL6amzrZZH4ykdTlnAz/Hk+khP4rsMWV2TDk5b5d4aemKoG0bD7JRXsY7jv 8vkCnjLtDchCOCggzjqs1b8nykkjASMlIVEf9FFftaA5yz0DzmaU1s1IhL1sy1Kr4Xkl fuqZSs6MTvFPM/zeASnFYI6S3kQtcu1jzQ5oBxId8jGUAj5dFJB9W7rR0R4CBtK4s/bQ CTD+Zos293GBFF5xkYrb22KNE6agKenrEt2Ua37XqaFWwxqzQ7LHM07bA1gKvZNbQA0t KT/A== 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=mhpHMjLEB6Kl4bgGtljsj78wGJqSXJZI5f0IoxxkFDc=; b=NgwRATcnRHrRo3sb6RmYwPJj2dCCS72IMnoJ8JaC+JH3SNTzcGSR2q1JJ20L4Xjt/F NQhd1vOiA//exDg153TLg6jaoknZREZdawBeFA0kpwxbj3Ywhknxxt5vdaAPZC2luuzh 2Y0kG2nmcDdyw7RdVrlKtTj6FVnzOvDou8cNKuMDb4GdXryz3iBWkV4pbUFZHNN4Awmv 9bLbcW0DjAJax/lwVOCONKXHPJ0MNjef+m61bEzjc+jZAjMreEXy9NrFWasxO+Ejn6h3 en+VzSmlHZdGq7ZyHRkmoSzGfzOCAJehHbs404eW+UGazA5gIHvY3dKFWLU7qc87CjDT bypg== X-Gm-Message-State: ABUngvc1IVD63cwgH79UiQ3WdRylBlHmG1iOr2W9UtXu0NDkQRg0KH/VtDmBDiyqQ5EaxXtd X-Received: by 10.195.18.71 with SMTP id gk7mr2996438wjd.175.1479313483288; Wed, 16 Nov 2016 08:24:43 -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 f76sm10942009wmd.15.2016.11.16.08.24.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 16 Nov 2016 08:24:42 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Cc: Thomas Monjalon , Pablo de Lara , Olivier Matz Date: Wed, 16 Nov 2016 17:23:42 +0100 Message-Id: <8f98cb872704684541510255c15358262ca89194.1479309720.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 16/22] app/testpmd: add various items 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:43 -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 --- 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 5816be4..c61e31e 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -102,6 +102,11 @@ enum index { ITEM_ANY, ITEM_ANY_MIN, ITEM_ANY_MAX, + ITEM_PF, + ITEM_VF, + ITEM_VF_ID, + ITEM_PORT, + ITEM_PORT_INDEX, /* Validate/create actions. */ ACTIONS, @@ -299,6 +304,9 @@ static const enum index next_item[] = { ITEM_VOID, ITEM_INVERT, ITEM_ANY, + ITEM_PF, + ITEM_VF, + ITEM_PORT, 0, }; @@ -309,6 +317,18 @@ static const enum index item_any[] = { 0, }; +static const enum index item_vf[] = { + ITEM_VF_ID, + ITEM_NEXT, + 0, +}; + +static const enum index item_port[] = { + ITEM_PORT_INDEX, + ITEM_NEXT, + 0, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -609,6 +629,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, max)), }, + [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