From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id C294AF942 for ; Fri, 16 Dec 2016 17:26:12 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id f82so40868256wmf.1 for ; Fri, 16 Dec 2016 08:26:12 -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=kRdDvdaa4bWRXM3j15HfwuViMtVsbB9RCOj0tWiruTs=; b=CQ5/G4CJWsNO8AghjjG53xuxsX8pzVzAc20VhyC9X3Ufq1cf9oq0OrQAU9/xNMjkgG mqHjjCYg/xK1fuBpvr5eYcpltuOissw6C0ETjOxCPk2fnWDbzbA7pERTxpuMfVjKr5A+ x8I9KrZSFWtm3JGc9o4C0OtcvJaP8xzRdttvNIhs4Hm4ks/ij4Nmd0I2/XzAVkDL+wm3 C/KJE/xeFjHSsT2jltrsCoHsDsh1JjAKXRe9i8wCuLWXOwuySlsYcgq5vk08/Lg/tKgT pjen2a5xC+ksq+FHk06lCo9yzEgLOGXHkKHdVTL4ijsPp7XIMQShnYdyPnirff16Nx0R tu3g== 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=kRdDvdaa4bWRXM3j15HfwuViMtVsbB9RCOj0tWiruTs=; b=UZjze5BlQ11WPoEXJS8ge5JeM0lyYJXH18Pd0k86ASUu1n4zbdq8VIkEk0/ShfwP4K 39BtDxqbH7qAk106zIvjt168pay4mOA1D0z7TqERB0RsqIECp4liYSGhIrHFthLWgzML cWAkh+viyFaUmqIZAyH+uKvvdefYEkG/5dvzVc2rVjyND8NUacSlDy7kTVC89a0rswnK uhXemhlxiazOTKTMEwji/K+rcZYojmuIEmVZXvq9pLUKbsZfuCd68PCyBGnQLVxI3D2Q uqqdm9Quwt/73Hl5gOVYVCAcJCjlvfCl7rFN7Vdp3WPizu7jZakTuGEpeIPWh0O3w/0T Tw4w== X-Gm-Message-State: AKaTC005i6I0dhNJpB1KbjJxA5DC4dj66jmsNnc6JlGyRBt0tnuZWHBvtIfpUaRQcuybCkn7 X-Received: by 10.194.107.97 with SMTP id hb1mr3395894wjb.134.1481905572143; Fri, 16 Dec 2016 08:26:12 -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 cl10sm7532531wjb.4.2016.12.16.08.26.10 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 16 Dec 2016 08:26:11 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 16 Dec 2016 17:25:15 +0100 Message-Id: <1fa21454c59500c635730984ad9d80939591cf64.1481903839.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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: Fri, 16 Dec 2016 16:26:13 -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 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