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 1DBD1A0093; Tue, 19 May 2020 13:10:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B12131D5C9; Tue, 19 May 2020 13:10:36 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20064.outbound.protection.outlook.com [40.107.2.64]) by dpdk.org (Postfix) with ESMTP id 9146D1D5B6 for ; Tue, 19 May 2020 13:10:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Suz9ZcfskzkifLYEIxLVoKesPDr64/TbvN3/UGwvojND+Xdej6lDffkKjucRo+QVpsE9QeT2q6tdcOl6WH6iku44eIpZCkQvJGaMylXLczLWH4JFNnRkkhVOaMNDIeT5NnNNEw7Se0j+KeLaSLQuuwZVdF/bipRHSPXlG89ytI4tkTkRn4FivlxptqSERv6OgtZXTbEh0XZWK2OhUncqzF2WC3zZP2phE+JU4Xuhvs7LNDhZcgtdzJaZrBo1pfBjPcp+O+FKYB1w0NF4QZxK5Xh8kQvHzHcJF0WBmDwvvIwjsL2Ozp+V3Gj4sYBCNdaVp0Zy1rM0ym2HkGVTtD9mNQ== 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=unZKgfBS7LBSKIGSA8+SR8yqqmdznUsuBHyncNa46cg=; b=L52+KCznKO0sHs9EXDEHoAjIVRfC8e0161uYgVKxInxzKUOMthCyKQjpOl2trZvIXGfSPQG7a9OzB3wyZ+0FZNzicqY60+0cyM90SWtLhddxO8i1zYEtUPMW4SGcbohgrGRwglwR9NSh+hjBfVjYEvUzS0gcE8lnwmedSXc8Ww5eZYaITI1VsZyfrviRCD8rOPiSkIGVdmwR+oTX600IkE7bj/BQdEZhgyIm47zfV6cwe2yIAmasgbInzASs47RKo74f/BcY6Zk4nQnMxRxJ7f/3K1wb9bI21nwPANR5KeadVSxjMvx8SRlwjeeVqqVG2SNc14xxukxg8AMZOr45AA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=unZKgfBS7LBSKIGSA8+SR8yqqmdznUsuBHyncNa46cg=; b=IQ+md8eLRg/MYrTGkwfn5ADKXhQqwyFARGx3NMRPe57ea6cY3bjpgV7S87+IAaDMmvWRrnKojrKQbatguUbW+SY+QW5ZI+FwrGcWdUISlIDsOmObb8uxjb8t/oc0KMKsBs+0ygXhE7ob4uJuJy5G9g8zE9QbWA68QPT0Rlj8zo8= Received: from AM0PR05MB4289.eurprd05.prod.outlook.com (2603:10a6:208:66::15) by AM0PR05MB6084.eurprd05.prod.outlook.com (2603:10a6:208:134::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.27; Tue, 19 May 2020 11:10:34 +0000 Received: from AM0PR05MB4289.eurprd05.prod.outlook.com ([fe80::e844:6ef:8ae7:4d05]) by AM0PR05MB4289.eurprd05.prod.outlook.com ([fe80::e844:6ef:8ae7:4d05%5]) with mapi id 15.20.3000.034; Tue, 19 May 2020 11:10:34 +0000 From: Asaf Penso To: Shy Shyman , "dev@dpdk.org" , Ferruh Yigit , Matan Azrad CC: Wenzhuo Lu , Beilei Xing , Bernard Iremonger , "xavier.huwei@huawei.com" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix error detection in MTU command Thread-Index: AQHWLPaWTb7o1d87s06K8FRmwczObqivQh0Q Date: Tue, 19 May 2020 11:10:34 +0000 Message-ID: References: <20200518092704.188832-1-shys@mellanox.com> In-Reply-To: <20200518092704.188832-1-shys@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [87.68.146.228] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5aa1c85a-cccb-443c-15c4-08d7fbe54061 x-ms-traffictypediagnostic: AM0PR05MB6084: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 040866B734 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JCsIy+g1xD6KOYs2dPCFSU5n+jRr+Sy1wJ/TwdT+zF7RYQARuh6SQjjwP79TmmrgSV8SlMoDqCEsNg2LmxtVQB8auSE2xTVdM6ypwkzi18cS/qWHzjJp8EQrCPFCXgVHpWGv/m1UUz3qaW0WHNCiIA4wCgMM+87RdLPPzmJQf6kZdJBlJvrNMxkfi7kSysaizB3lv0eprX7YKH0zFJQy55iKUwA2a266Q1z+QJrE+eiOvzMJUEublCYgbHnliPReooYUYj+aJviIVK3+RzLQ8CKooQXOFGLIgH2FYYlhgxxlShMUL8j8iNJkK99ac00RpZBK2COe/5/wZ9nYBY7tFbzCJ8BNXj7lAVgsTXMUKynKP6o/HKTtBUpVq8MleRTxiu21DZcohsW4L57vTLkW7LRGJxUI6/ycPSWF0yMFXrrBIeS9mzlFnMklpieEPkI9 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4289.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(396003)(346002)(376002)(366004)(4326008)(186003)(26005)(71200400001)(6506007)(53546011)(2906002)(6636002)(8936002)(5660300002)(86362001)(8676002)(7696005)(9686003)(316002)(66476007)(55016002)(64756008)(66446008)(478600001)(66946007)(54906003)(110136005)(66556008)(76116006)(33656002)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: OjafFvKPMJZTEpH1vb6I1W/K+F536hod9u7sFM5vkitnJ1Urh73bVpm3DKcIoYluQ8soE9Z341k6SOMJVDH5gB4+byhc1nXnO4trFnt/308oN9knhBEis2+oEyZHiZU96akAK4Pfwt52Ljn22UGqLPNOPbeEjckwYk1QQVJ7mgMxX0IBD6Wq0HFH+bVUgY1psmLQEkpb4MKwdZLQb/87jUmLyK8F/Xdubn3SbOK1SDm8fsGi4+5ACrUvIFabsoEWxGuYtGxmBoSWSkTUzWrjYOTE1SKA/+2OEW3jVfwRCoTbjg/kdskhnjFyker9WlHuYai3xeWHt5970wvIX+tmGUtklDUasJ48M8FBENt2fGjZoIzY2vEOs+MR3xzi2y4YqrD+sHcHwdvZkL/Bl/sSlqbgAKilKY3Ovjxvf/fRnq3wIVTCjZ2k72LH4OGCGniFyYR0oPTr19ago5A6T/No7qNZcJU9uojM8fTXFdEnX9vCHuImtIjDNTBfXjRtbXyd Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5aa1c85a-cccb-443c-15c4-08d7fbe54061 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2020 11:10:34.1042 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: y1B9rowjLSsH1O2xHBRm+Hgh46rZ1I0SRncjIF4mgEqOFziZwpXscWOPve2zZTisjxSQBu5F3RxQ9qZs73xWCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6084 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix error detection in MTU 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Regards, Asaf Penso > -----Original Message----- > From: dev On Behalf Of Shy Shyman > Sent: Monday, May 18, 2020 12:27 PM > To: dev@dpdk.org > Cc: Wenzhuo Lu ; Beilei Xing > ; Bernard Iremonger > ; xavier.huwei@huawei.com > Subject: [dpdk-dev] [PATCH] app/testpmd: fix error detection in MTU > command >=20 > MTU is used in testpmd to set the maximum payload size for packets. > According to testpmd, the setting influnce RX only. > In rte_ethdev there's no relation between MTU setting and JUMBO offload > or > rx_max_pkt_len. >=20 > The previous fix in patch referenced below was meant to update the > correlated variables of max_pkt_len and JUMBO offload, but by doing > so it assumes that MTU setting can only exist when JUMBO offload > supported in the device. For example fail-safe device does supports set M= TU > and doesn't support JUMBO offload, and in this case, though set MTU > succeed > an error mesage still printed since the JUMBO packet offload is disabled= . >=20 > The fix separates the two conditions to make sure the error > triggers only in case the set_mtu action actually failed. > A warning message is provided in this special case to alert the user. >=20 > Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU") > Cc: xavier.huwei@huawei.com >=20 > Signed-off-by: Shy Shyman Reviewed-by: Asaf Penso > --- > app/test-pmd/config.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index 5381207cc..73b53c50b 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -1277,8 +1277,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu) > return; > } > diag =3D rte_eth_dev_set_mtu(port_id, mtu); > - if (diag =3D=3D 0 && > - dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) { > + if (diag) > + printf("Set MTU failed. diag=3D%d\n", diag); > + else if (dev_info.rx_offload_capa & > DEV_RX_OFFLOAD_JUMBO_FRAME) { > /* > * Ether overhead in driver is equal to the difference of > * max_rx_pktlen and max_mtu in rte_eth_dev_info when > the > @@ -1293,10 +1294,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu) > } else > rte_port->dev_conf.rxmode.offloads &=3D >=20 > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > - return; > - } > - printf("Set MTU failed. diag=3D%d\n", diag); > + } else > + printf("WARNING: MTU was set while jumbo frame offload > is" > + " not supported by the device\n"); > } >=20 > /* Generic flow management functions. */ > -- > 2.21.0