From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E0681A04DD; Thu, 19 Nov 2020 12:10:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 76DFD2AB; Thu, 19 Nov 2020 12:10:47 +0100 (CET) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by dpdk.org (Postfix) with ESMTP id 9A57023D for ; Thu, 19 Nov 2020 12:10:44 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 19 Nov 2020 03:10:46 -0800 Received: from nvidia.com (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 19 Nov 2020 11:10:38 +0000 From: Gregory Etelson To: CC: , , , , Ori Kam , Wenzhuo Lu , Beilei Xing , "Bernard Iremonger" Date: Thu, 19 Nov 2020 13:10:24 +0200 Message-ID: <20201119111024.7989-1-getelson@nvidia.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201115112341.30617-1-getelson@nvidia.com> References: <20201115112341.30617-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1605784246; bh=ZhBZpoXotTxRKfmr9BIMiV3l4DaAJiYzMFLTDGpNb+c=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=krQh6vwerQeIKYBLIRQYgcYATctt2nzQuBh4JBADlxDh3ASSZvrg4eBKeICKxYM1/ 7RK6webIqM17ByosjihwOXWh++oYe+a80T2YGFepAGMQTF3mn06HjQHJwaa7eRHW5j 8IrwEArJxIgY6bx4UhKLV6aUqGyaO6zBCmAhYF0X2p46aH5sKKT3bO2INLVBFkRhcO vZDdIGDPPFXcw8VgtxQY4K1xRhMlKa7+Q0KyYvbTGdFlPJ7D/7zAy4Rvhyw81jJb7v ecmj1tIftMeCcYc9c6+AgbgEjCfClfEqhcY2wrKc9T2vC53o0zDzT9YLVS9jh27/R3 rPYRaglo8tAJw== Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix flow tunnel commands 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" testpmd provides commands to test tunnel offload rte_flow capabilities. Testpmd tunnel commands allow to configure new ofloaded tunnel types, list existing offloaded tunnels and destroy existing offloaded tunnels. Tunnel offload commands allowed parameters repetition. For example, the following commands were accepted: testpmd> flow tunnel create 0 create 1 type vxlan or testpmd> flow tunnel list 0 list 1 Current patch fixed that fault. Correct tunnel commands syntax is: testpmd> flow tunnel create type testpmd> flow tunnel list testpmd> flow tunnel destroy id Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload") Signed-off-by: Gregory Etelson --- app/test-pmd/cmdline_flow.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 457f74078d..585cab98b4 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -812,26 +812,6 @@ static const enum index next_vc_attr[] =3D { ZERO, }; =20 -static const enum index tunnel_create_attr[] =3D { - TUNNEL_CREATE, - TUNNEL_CREATE_TYPE, - END, - ZERO, -}; - -static const enum index tunnel_destroy_attr[] =3D { - TUNNEL_DESTROY, - TUNNEL_DESTROY_ID, - END, - ZERO, -}; - -static const enum index tunnel_list_attr[] =3D { - TUNNEL_LIST, - END, - ZERO, -}; - static const enum index next_destroy_attr[] =3D { DESTROY_RULE, END, @@ -2009,35 +1989,37 @@ static const struct token token_list[] =3D { [TUNNEL_CREATE] =3D { .name =3D "create", .help =3D "create new tunnel object", - .next =3D NEXT(tunnel_create_attr, NEXT_ENTRY(PORT_ID)), + .next =3D NEXT(NEXT_ENTRY(TUNNEL_CREATE_TYPE), + NEXT_ENTRY(PORT_ID)), .args =3D ARGS(ARGS_ENTRY(struct buffer, port)), .call =3D parse_tunnel, }, [TUNNEL_CREATE_TYPE] =3D { .name =3D "type", .help =3D "create new tunnel", - .next =3D NEXT(tunnel_create_attr, NEXT_ENTRY(FILE_PATH)), + .next =3D NEXT(NEXT_ENTRY(FILE_PATH)), .args =3D ARGS(ARGS_ENTRY(struct tunnel_ops, type)), .call =3D parse_tunnel, }, [TUNNEL_DESTROY] =3D { .name =3D "destroy", .help =3D "destroy tunel", - .next =3D NEXT(tunnel_destroy_attr, NEXT_ENTRY(PORT_ID)), + .next =3D NEXT(NEXT_ENTRY(TUNNEL_DESTROY_ID), + NEXT_ENTRY(PORT_ID)), .args =3D ARGS(ARGS_ENTRY(struct buffer, port)), .call =3D parse_tunnel, }, [TUNNEL_DESTROY_ID] =3D { .name =3D "id", .help =3D "tunnel identifier to testroy", - .next =3D NEXT(tunnel_destroy_attr, NEXT_ENTRY(UNSIGNED)), + .next =3D NEXT(NEXT_ENTRY(UNSIGNED)), .args =3D ARGS(ARGS_ENTRY(struct tunnel_ops, id)), .call =3D parse_tunnel, }, [TUNNEL_LIST] =3D { .name =3D "list", .help =3D "list existing tunnels", - .next =3D NEXT(tunnel_list_attr, NEXT_ENTRY(PORT_ID)), + .next =3D NEXT(NEXT_ENTRY(PORT_ID)), .args =3D ARGS(ARGS_ENTRY(struct buffer, port)), .call =3D parse_tunnel, }, --=20 2.29.2