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 AA56EA04AD; Wed, 6 Nov 2019 19:13:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06F631C2EC; Wed, 6 Nov 2019 19:13:18 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C500A1C2BF for ; Wed, 6 Nov 2019 19:13:16 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA6IAHjB012479; Wed, 6 Nov 2019 10:13:16 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=OFoUflDndd1lxgXg5JW8hNWvvahIfJtviPwvHQ98kXA=; b=oubq9a3R2TTy69R82IpH28aHmAMdaJUlYfplqMpeIiViasUNJv7JTyFD6YdFNGU7vGlP njA0x8AZU9MqmMJnvaTNxP23IqFMJkD6c9/tuoAfzSwCuP4vxN5Q0ax2AIyX9gY0xzjA TNZX1fLpxT75H4DnXzWMoRfXCX3OJ6p6+oDRSc4AMWnAgLj+Bi328EMppUOsIiJNP5z+ PNeYjaNkrgYUy/2QoXxCa7P96BSxrIC0FpshYpnb+LlT83yBgs1YFu+p+JCW6bbvg2MP Oadiz2LWV8F+OlEJEd+sB8YxEGqtU5bRCRfDrEecs/9jqCwCOssKNSkajMr5CyBinBge ow== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2w41uwrd1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 06 Nov 2019 10:13:15 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 6 Nov 2019 10:13:14 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.51) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 6 Nov 2019 10:13:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jfrif9L/b/1uc3EMJNR7AGV0HESCZx8KN46QqlsQa34oxIJr5/2ESdFW3rW8LfRAXwJWr8jNghaeV4EAPqGTVYqgChKzPHnX04F7J89FrxB+kTxiWKfrek4bFyhe/azNZWePbAKXTJQkkGC+AFELRJp490TidOObMQmoWPMFlT0It93GIZi1g0u62CwqSkljvJCuTHsGdE4HU58qp07Jod25O3sBIRR0Y9BtP7UA5rl9dZS626kJcs1sGMZEmUyupavEHNsXyTL8jEn/RTvdQYJ6ihRlp5d86gIzlcBMInvQkE4M3lXyCZVpSqUXBlfDNcM71DbQsaBDpuXBKIj9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OFoUflDndd1lxgXg5JW8hNWvvahIfJtviPwvHQ98kXA=; b=HD6Jw6472SjnbXkvooIl+UBwmFLVEzDI6Igw2298RmIL1fE90KJbKEK7GVBMEKjlG5XQDgZ6ZPWVpGD9ny8znGmovkOdhQj3ECGUVuDKqS3epaj6on1RW9c9BhxE/9JZcBXHxtYl7GjqMC1cl1fR5Vwd0onSF60+LylKXanbClgCQ0v4E1oWpcpEaU07aQNxfdEfKVmLRpyUgxUzfCxls8hf/bn1xyTBoe+S43sScH6rSPG3G/7TpcildJ0dZ5WdTGG/zB506t8fHG1ot6Iylnyk3P3erg421uaheRpj0/FzXxoka4m7wXg6vG0uyzMTj53nsvFX7uLt3k8vSDZKcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OFoUflDndd1lxgXg5JW8hNWvvahIfJtviPwvHQ98kXA=; b=VjLsUhCafiJAtzitODZVrk+QjPH3NTPmkuBbrlbpHa1juynzPd8X7H3CEErCy+cS0RG4AevOPl1qK7E++sMi8V212iU5ZZ5wPE7XQUcEf8PzgxmXXpQr+P57mlODEZp3NlJAhz+VmXhRLlNzERMMI/zWvZMWQ4YHA5DwU2rd7qg= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.160) by CY4PR1801MB1991.namprd18.prod.outlook.com (10.171.255.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.20; Wed, 6 Nov 2019 18:13:12 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::d918:c54e:c3b1:3167]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::d918:c54e:c3b1:3167%7]) with mapi id 15.20.2408.025; Wed, 6 Nov 2019 18:13:12 +0000 From: Pavan Nikhilesh Bhagavatula To: "Iremonger, Bernard" , "Yigit, Ferruh" , "arybchenko@solarflare.com" , Jerin Jacob Kollanukkaran , "Lu, Wenzhuo" , "Wu, Jingjing" , "Mcnamara, John" , "Kovacevic, Marko" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask Thread-Index: AQHVjm7Z/gsMKetwtkuFplgsU3x6D6d0kHyAgAntrQA= Date: Wed, 6 Nov 2019 18:13:12 +0000 Message-ID: References: <20191029050312.2715-1-pbhagavatula@marvell.com> <20191029153722.4547-1-pbhagavatula@marvell.com> <20191029153722.4547-8-pbhagavatula@marvell.com> <8CEF83825BEC744B83065625E567D7C260E15483@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C260E15483@IRSMSX108.ger.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.172.86.227] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a600ea7-86ce-4838-d8a2-08d762e4fc95 x-ms-traffictypediagnostic: CY4PR1801MB1991: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:348; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(376002)(366004)(39860400002)(136003)(189003)(199004)(13464003)(229853002)(86362001)(446003)(476003)(74316002)(81156014)(9686003)(11346002)(55016002)(81166006)(8676002)(6436002)(33656002)(14444005)(66066001)(2501003)(256004)(110136005)(14454004)(8936002)(486006)(2906002)(6246003)(316002)(4326008)(76116006)(6506007)(99286004)(53546011)(7696005)(64756008)(66946007)(66556008)(66476007)(76176011)(186003)(102836004)(25786009)(7736002)(71200400001)(71190400001)(52536014)(6116002)(305945005)(3846002)(5660300002)(66446008)(478600001)(26005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1991; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jsBmCNZHAcroHAtn3nI9JzdXJbv4ncAunJ8X3hK6cwcYwgRRGIohtva6VZtCTXDcY2cyg48f1Xd5UY/40BQ2R9wjCmJT7tXv9S1VzJPpMxDBionHXDg1ICvhZURjUSTqFRf7Ll6uFfztlXR+3f6xdFX96kM66mLP6oCKw2xoasEga/5h58esnNFisSCsOsZuzvObOqOPzlVpj2NTTnXc4I0YmGZ/gl+7i045xWQSrQJNGdN33acm/zeD34dYiKGf4TvkNAVco9xobcTcpHZAscKp/EO+6qHE3rKOrz685t0vMYN8l34tFXnNSFY3bAeDYMLDyL4UJY/umSo87g7/+7IAm59XKmDTb+XHHkhBqw6g+T0dIm5ivtAzEdA7v6NAW2HJBAD8gfszoay3df4uM6d0bBxFL01lvAgOkoAzVuDsmTiNG3MgYXQCKsrVuJS6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1a600ea7-86ce-4838-d8a2-08d762e4fc95 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2019 18:13:12.5229 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4d2KkUyVjNxRZJywxO+ev6BUwJvMKgpSNsFbEzvUz/VQbhHf7Z5g91eVad++XmHVb2/2C+N2IOWHvk0Jg9iEMZl4/MMd2QCCF4kBSal6YJA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1991 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-06_06:2019-11-06,2019-11-06 signatures=0 Subject: Re: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask 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" Hi Bernard, >Hi Pavan, > >> -----Original Message----- >> From: pbhagavatula@marvell.com >> Sent: Tuesday, October 29, 2019 3:37 PM >> To: Yigit, Ferruh ; >arybchenko@solarflare.com; >> jerinj@marvell.com; Lu, Wenzhuo ; Wu, >Jingjing >> ; Iremonger, Bernard >> ; Mcnamara, John >> ; Kovacevic, Marko >> >> Cc: dev@dpdk.org; Pavan Nikhilesh >> Subject: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to >set >> supported ptype mask >> >> From: Pavan Nikhilesh >> >> Add command to set supported ptype mask. >> Usage: >> set port ptype_mask >> >> Disable ptype parsing by default. >> >> Signed-off-by: Pavan Nikhilesh >> --- >> app/test-pmd/cmdline.c | 80 +++++++++++++++++++++ >> app/test-pmd/testpmd.c | 6 ++ >> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 ++ >> 3 files changed, 93 insertions(+) >> >> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index >> 447806991..9f0356b50 100644 >> --- a/app/test-pmd/cmdline.c >> +++ b/app/test-pmd/cmdline.c > >The help text should be updated to describe the new command at line >240 in cmdline.c > Will add in v16. >> @@ -18915,6 +18915,85 @@ cmdline_parse_inst_t >> cmd_show_port_supported_ptypes =3D { >> }, >> }; >> >> +/* Common result structure for set port ptypes */ struct >> +cmd_set_port_supported_ptypes_result { >> + cmdline_fixed_string_t set; >> + cmdline_fixed_string_t port; >> + portid_t port_id; >> + cmdline_fixed_string_t ptype_mask; >> + uint32_t mask; >> +}; >> + >> +/* Common CLI fields for set port ptypes */ >> +cmdline_parse_token_string_t >cmd_set_port_supported_ptypes_set =3D >> + TOKEN_STRING_INITIALIZER >> + (struct cmd_set_port_supported_ptypes_result, >> + set, "set"); >> +cmdline_parse_token_string_t >cmd_set_port_supported_ptypes_port =3D >> + TOKEN_STRING_INITIALIZER >> + (struct cmd_set_port_supported_ptypes_result, >> + port, "port"); >> +cmdline_parse_token_num_t >cmd_set_port_supported_ptypes_port_id =3D >> + TOKEN_NUM_INITIALIZER >> + (struct cmd_set_port_supported_ptypes_result, >> + port_id, UINT16); >> +cmdline_parse_token_string_t >> cmd_set_port_supported_ptypes_mask_str =3D >> + TOKEN_STRING_INITIALIZER >> + (struct cmd_set_port_supported_ptypes_result, >> + ptype_mask, "ptype_mask"); >> +cmdline_parse_token_num_t >> cmd_set_port_supported_ptypes_mask_u32 =3D >> + TOKEN_NUM_INITIALIZER >> + (struct cmd_set_port_supported_ptypes_result, >> + mask, UINT32); >> + >> +static void >> +cmd_set_port_supported_ptypes_parsed( >> + void *parsed_result, >> + __attribute__((unused)) struct cmdline *cl, >> + __attribute__((unused)) void *data) >> +{ >> + struct cmd_set_port_supported_ptypes_result *res =3D >> parsed_result; >> +#define PTYPE_NAMESIZE 256 >> + char ptype_name[PTYPE_NAMESIZE]; >> + uint16_t port_id =3D res->port_id; >> + uint32_t ptype_mask =3D res->mask; >> + int ret, i; >> + >> + ret =3D rte_eth_dev_get_supported_ptypes(port_id, >ptype_mask, >> NULL, 0); >> + if (ret <=3D 0) { >> + printf("Port %d doesn't support any ptypes.\n", >port_id); >> + return; >> + } >> + >> + uint32_t ptypes[ret]; > >Might be better to move above variable declaration to top of function >with the other declarations. I intentionally placed it here as the array size depends on ret and there i= s=20 no readily available macro for max number of packet types.=20 > >> + ret =3D rte_eth_dev_set_supported_ptypes(port_id, >ptype_mask, >> ptypes, >> + ret); >> + if (ret <=3D 0) { >> + printf("Unable to set requested ptypes for Port %d\n", >> port_id); >> + return; >> + } >> + >> + printf("Successfully set following ptypes for Port %d\n", >port_id); >> + for (i =3D 0; i < ret && ptypes[i] !=3D RTE_PTYPE_UNKNOWN; i++) { >> + rte_get_ptype_name(ptypes[i], ptype_name, >> sizeof(ptype_name)); >> + printf("%s\n", ptype_name); >> + } >> +} >> + >> +cmdline_parse_inst_t cmd_set_port_supported_ptypes =3D { >> + .f =3D cmd_set_port_supported_ptypes_parsed, >> + .data =3D NULL, >> + .help_str =3D "set port ptype_mask ", >> + .tokens =3D { >> + (void *)&cmd_set_port_supported_ptypes_set, >> + (void *)&cmd_set_port_supported_ptypes_port, >> + (void *)&cmd_set_port_supported_ptypes_port_id, >> + (void *)&cmd_set_port_supported_ptypes_mask_str, >> + (void *)&cmd_set_port_supported_ptypes_mask_u32, >> + NULL, >> + }, >> +}; >> + >> /* >> >****************************************************** >**** >> ********************** */ >> >> /* list of instructions */ >> @@ -19154,6 +19233,7 @@ cmdline_parse_ctx_t main_ctx[] =3D { >> (cmdline_parse_inst_t *)&cmd_show_vf_stats, >> (cmdline_parse_inst_t *)&cmd_clear_vf_stats, >> (cmdline_parse_inst_t >*)&cmd_show_port_supported_ptypes, >> + (cmdline_parse_inst_t *)&cmd_set_port_supported_ptypes, >> (cmdline_parse_inst_t *)&cmd_ptype_mapping_get, >> (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace, >> (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset, diff -- >git >> a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index >> 38acbc58a..fd2c04d64 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -2028,6 +2028,7 @@ start_port(portid_t pid) >> queueid_t qi; >> struct rte_port *port; >> struct rte_ether_addr mac_addr; >> + static uint8_t clr_ptypes =3D 1; >> >> if (port_id_is_invalid(pid, ENABLED_WARN)) >> return 0; >> @@ -2157,6 +2158,11 @@ start_port(portid_t pid) >> } >> } >> configure_rxtx_dump_callbacks(verbose_level); >> + if (clr_ptypes) { >> + clr_ptypes =3D 0; >> + rte_eth_dev_set_supported_ptypes(pi, >> RTE_PTYPE_UNKNOWN, >> + NULL, 0); >> + } >> /* start port */ >> if (rte_eth_dev_start(pi) < 0) { >> printf("Fail to start port %d\n", pi); diff --git >> a/doc/guides/testpmd_app_ug/testpmd_funcs.rst >> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst >> index c68a742eb..9c4dc92aa 100644 >> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst >> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst >> @@ -472,6 +472,13 @@ Show ptypes supported for a specific port:: >> >> testpmd> show port (port_id) ptypes >> >> +set port supported ptypes >> +~~~~~~~~~~~~~~~~~~~~~~~~~ >> + >> +Inform packet types classification interested in for a specific port:: > >The description of the command is not very clear. >Perhaps something like the following would be better: > >"set packet types classification for a specific port::" Sure will update in v16 > >> + >> + testpmd> set port (port_id) ptypes_mask (mask) >> + >> show device info >> ~~~~~~~~~~~~~~~~ >> >> -- >> 2.17.1 > >Regards, > >Bernard. Thanks,=20 Pavan.