From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CB8A3A0A0E; Wed, 28 Apr 2021 10:12:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A552E41277; Wed, 28 Apr 2021 10:12:49 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 04AC54014E; Wed, 28 Apr 2021 10:12:47 +0200 (CEST) IronPort-SDR: SmxAgBCxE/ua1eWX1Ots7bvJlGytXnSQoGfQ/6fm3BMU5GSUDCG13Lcvu/Qipc4oV7whjv8WAy Ux16X1nwhk3g== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="196241146" X-IronPort-AV: E=Sophos;i="5.82,257,1613462400"; d="scan'208";a="196241146" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2021 01:12:46 -0700 IronPort-SDR: OB01eKWk1oK2wTDiQz3+LvznyD87QOSDsRdQfS3ig3nHeC3Y0N+N4ppaoAi78AagIcIx4Fn0pO GdgZ2/Zg/LIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,257,1613462400"; d="scan'208";a="387628635" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga006.jf.intel.com with ESMTP; 28 Apr 2021 01:12:45 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 28 Apr 2021 01:12:45 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 28 Apr 2021 01:12:45 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.55) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 28 Apr 2021 01:12:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q8IWAmQIWvD4l/GGcqrAp1UJha10nbSQXaSE/3rH0Vmx+grzeJP1tLr9Z9DBAtGm069V0yhzpTY9HtiiteM/4sKDdU3C0ke4cT04HD//rTfgld20VCNBynH0BUjMOH7qrQff6gL/QhnIaqCKqR8rS2rpk8bqIXyYrMqhMuXjRxQfcGkAbFP6XfbS+pnLDgQe5H/gx2J3I/arCfZI+YXXOsLwRzs+oPEX9yyN8mR+VTLm9xDN2DNntSQy3D3KNHUhF8PtkaFWlwVz98Q2uBmnpxzsODsIDESezs+3j9UuKZcqw2vnGXtPI67Qb+mh2DZuaegOKnmpB+vUjCJUoPI4qg== 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=F4JAyq0JhD1p/NZepJ9kCihxqalENtt7f7Gox6M4M5I=; b=fQI3Q6eiCV/OPNWVnlj65IaG2cTA4K6imlp58wBpJwgJHqk8PAl2a4U/4YoVGvRtKwyxwUpI0VObnVUcb/WxIO+typYp01OkaQ1+rbs7su3tvu1c8KzKGqCWuDLZzzOpgQo8RTgGR5r0CDVgr5nRiucnq9ZsLza78L/rHS8Ac3ZsUAfrIRpqUrD/dQzPl5puBA/Kzu/Q9+0ieqA5uBQw1H5NI+L06zG2lw1YoGnz/ZTxEfH5NCPFwbcwpQJSeFnvWS0OHwwk1o+NwMf9myy8OQXICRZUyHXNtYFXjll/6s/nUSgBQrkPZIX5gPkdwe5HtEgUJ5iGHuYC2TOlByRX4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F4JAyq0JhD1p/NZepJ9kCihxqalENtt7f7Gox6M4M5I=; b=zLPqSjVyKekyHjskkfUe/4jnxUtg+ZDZXzsFSpHMAkUWOChFLxWh3GObSP3Z4M56/mFluWMbScTEJxLWRPHqMtEjqG3+Q4LYMP8byv9zuQStPCqyduhr/ewlyS4LgtdD2V/hY/utkdfkf/m0VhZHFP3wuSSDw7OsEqTZQZvqRl8= Received: from BN6PR11MB0017.namprd11.prod.outlook.com (2603:10b6:405:6c::34) by BN6PR1101MB2195.namprd11.prod.outlook.com (2603:10b6:405:5a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Wed, 28 Apr 2021 08:12:40 +0000 Received: from BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::31fc:8a3:8229:1619]) by BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::31fc:8a3:8229:1619%4]) with mapi id 15.20.4065.027; Wed, 28 Apr 2021 08:12:40 +0000 From: "Yang, Qiming" To: "Yigit, Ferruh" , Igor Russkikh , Pavel Belous , Somalapuram Amaranath , Ajit Khaparde , Somnath Kotur , Hemant Agrawal , Sachin Saxena , "Guo, Jia" , "Wang, Haiyue" , "Daley, John" , Hyong Youb Kim , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou , "Xing, Beilei" , "Zhang, Qi Z" , Andrew Boyer , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , "Rasesh Mody" , Devendra Singh Rawat , Andrew Rybchenko , Jiawen Wu , Jian Wang , "Thomas Monjalon" , Selwin Sebastian , Remy Horton , Chunsong Feng , Huisong Li , Hao Chen , "Wei Hu (Xavier)" , "Wu, Jingjing" , "Lu, Wenzhuo" , "Li, Xiaoyun" , "Zhang, AlvinX" , Shannon Nelson , Alfredo Cardigliano , "Vamsi Attunuru" , Yash Sharma , "Ivan Malov" , Andrew Lee CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] drivers/net: fix FW version get Thread-Index: AQHXNspk03A/rm3O50SRge/PeNxsWqrJnqwQ Date: Wed, 28 Apr 2021 08:12:40 +0000 Message-ID: References: <20210421162058.1352960-1-ferruh.yigit@intel.com> In-Reply-To: <20210421162058.1352960-1-ferruh.yigit@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.53] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 88361f48-5a2d-4cc5-dcd2-08d90a1d647a x-ms-traffictypediagnostic: BN6PR1101MB2195: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: q8AMiHcDCE5WievGClTXagnbHH88beKT2ITUaJ6qkyOJAXpvaIwTB4sbU18tlDaomkoE877rg5B3IT0MUfj9LK+EoTA1UOIadIbw3V6O7M1x6F+v8h+uaELm9WQqCOB0lOvqQ/GY2G/Id5XTaeKz3OfeQWI4tDfI5fSHyn3ySK33Vpop3DGbb60u8izN79Y3sDY8O9adS22cZVKRNoOf1ZIAewG9HIg2hlxxQUDdNCyzNb1jlUO/v/pmoaPp8rv0Yf2ErwTqQgTi3tN+UgDaMoLGokn9iM6KiPUA0nrV05C/H85RsJumnxmIn4yuJJSX2cSlUhDco5AW74hep+8Ujbquwx/pwAwmlX2KxNXMdZueRfHQH7agozD/4nsrEXQF0LQY3XCpTn7QuS18HlEZuxxZdiZUGJQAG02uSF71wnM+EzVyDNkNalkjbLp+mx+m5oWWkJBtUiaQOZLzGnLAe9Xd7N/+DHFApb3yTjIrVgwHxBprsrFNvhyDvuLgaIIVJnSGSBIz9JeHyDUKbGhjvByBvLgM/E2nYkc9isfAKZ47OOZ2MiyszpGuEf/rr7wrH9lGzx0GuJGIloR/YWISb2bocuIoLUsxWa8jWJ6XmOzWYc9sIlK6sDeQLtI67hA4iEP9rNdrmhnn34DWb2sJKA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB0017.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(396003)(376002)(366004)(39850400004)(136003)(316002)(38100700002)(83380400001)(54906003)(71200400001)(2906002)(110136005)(8676002)(86362001)(26005)(66946007)(7406005)(4326008)(921005)(7416002)(122000001)(9686003)(76116006)(52536014)(5660300002)(33656002)(8936002)(186003)(6506007)(64756008)(53546011)(1191002)(478600001)(66556008)(55016002)(66476007)(66446008)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?nmpCOTT4SlpGfuR4tepDzRoEEKNzcT9v3iEOtGzR0QbKRHr+2smYL4A55jNq?= =?us-ascii?Q?4HZ9NJV5MdrpeOZwInWwnucjTpuQpLfuJKgdOrqfSaZaMTWgBX4tvEliglep?= =?us-ascii?Q?iLZV4JgyNF/gNB0QX1TyOCnJw0w3i6/dt4YFmOktN0DTFr27hRunoj/4QpcY?= =?us-ascii?Q?hymRtwzMTaZ41cwOBCDHprTjKS6ajLu8iGNf8H+N1GMKeBa7XQnAEEF/h6XE?= =?us-ascii?Q?MFHhzkDGVBy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VWR4XM?= =?us-ascii?Q?iclTRIkDAQusaFQzDeaVrH9HP2v19bQ/4p0vnCtMJyp4OqvV6M9sYlXwcGG7?= =?us-ascii?Q?I8aN0jwAjS6IfiFQtJG8KxZak9J9VxPatmLZEmqIrV9BzZfDc8WeIrxEtBst?= =?us-ascii?Q?AbrQFD+ByEoIPGy52M/mSGHAIRrnvybvwYS+NMSDmTdeWpBcAB8aI2LBQrj+?= =?us-ascii?Q?bWVh7PjTcEeMJHXZtEy91490?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0017.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88361f48-5a2d-4cc5-dcd2-08d90a1d647a X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2021 08:12:40.5169 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Rc1inK0V3Jinh6GdH40Li2AnWVXHVyCjXQQ8cVChX6J0zDn7op/EP/QGDJXotEcq4XaeyXkuEx5EHJImCR7Tfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2195 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] drivers/net: fix FW version get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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,=20 > -----Original Message----- > From: Yigit, Ferruh > Sent: Thursday, April 22, 2021 00:21 > To: Igor Russkikh ; Pavel Belous > ; Somalapuram Amaranath > ; Ajit Khaparde ; > Somnath Kotur ; Hemant Agrawal > ; Sachin Saxena > ; Guo, Jia ; Wang, Haiyue > ; Daley, John ; Hyong Youb > Kim ; Min Hu (Connor) ; > Yisen Zhuang ; Lijun Ou > ; Xing, Beilei ; Yang, Qiming > ; Zhang, Qi Z ; Andrew > Boyer ; Jerin Jacob ; Nithin > Dabilpuram ; Kiran Kumar K > ; Rasesh Mody ; > Devendra Singh Rawat ; Andrew Rybchenko > ; Jiawen Wu > ; Jian Wang ; > Thomas Monjalon ; Selwin Sebastian > ; Remy Horton ; > Chunsong Feng ; Huisong Li > ; Hao Chen ; Wei Hu > (Xavier) ; Wu, Jingjing > ; Lu, Wenzhuo ; Li, > Xiaoyun ; Zhang, AlvinX ; > Shannon Nelson ; Alfredo Cardigliano > ; Vamsi Attunuru ; Yash > Sharma ; Ivan Malov ; > Andrew Lee > Cc: Yigit, Ferruh ; dev@dpdk.org; stable@dpdk.org > Subject: [PATCH] drivers/net: fix FW version get >=20 > Fixes a few different things: > * Remove 'fw_version' NULL checks, it is allowed if the 'fw_size' is > zero, 'fw_version' being NULL but 'fw_size' not zero condition checked > in ethdev layer > * Be sure required buffer size is returned if provided one is not big > enough, instead of returning success (0) > * Document in doxygen comment the '-EINVAL' is a valid return type > * Take into account that 'snprintf' can return negative value > * Cast length to 'size_t' to compare it with 'fw_size' >=20 > Fixes: bb42aa9ffe4e ("net/atlantic: configure device start/stop") > Fixes: ff70acdf4299 ("net/axgbe: support reading FW version") > Fixes: e2652b0a20a0 ("net/bnxt: support get FW version") > Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") > Fixes: 748eccb97cdc ("net/dpaa2: add support for firmware version get") > Fixes: b883c0644a24 ("net/e1000: add firmware version get") > Fixes: 293430677e9c ("net/enic: add handler to return firmware version") > Fixes: 1f5ca0b460cd ("net/hns3: support some device operations") > Fixes: bd5b86732bc7 ("net/hns3: modify format for firmware version") > Fixes: ed0dfdd0e976 ("net/i40e: add firmware version get") > Fixes: e31cb9a36298 ("net/ice: support FW version getting") > Fixes: 4f09bc55ac3d ("net/igc: implement device base operations") > Fixes: eec10fb0ce6b ("net/ionic: support FW version") > Fixes: 8b0b56574269 ("net/ixgbe: add firmware version get") > Fixes: 4d9f5b8adc02 ("net/octeontx2: add FW version get operation") > Fixes: f97b56f9f12e ("net/qede: support FW version query") > Fixes: 83fef46a22b2 ("net/sfc: add callback to retrieve FW version") > Fixes: bc84ac0fadef ("net/txgbe: support getting FW version") > Fixes: 21913471202f ("ethdev: add firmware version get") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ferruh Yigit > --- > Cc: pavel.belous@aquantia.com > Cc: selwin.sebastian@amd.com > Cc: hemant.agrawal@nxp.com > Cc: qiming.yang@intel.com > Cc: hyonkim@cisco.com > Cc: xavier.huwei@huawei.com > Cc: wenzhuo.lu@intel.com > Cc: alvinx.zhang@intel.com > Cc: cardigliano@ntop.org > Cc: vattunuru@marvell.com > Cc: rmody@marvell.com > Cc: ivan.malov@oktetlabs.ru > Cc: jiawenwu@trustnetic.com > --- > drivers/net/atlantic/atl_ethdev.c | 7 ++++--- > drivers/net/axgbe/axgbe_rxtx.c | 4 ---- > drivers/net/bnxt/bnxt_ethdev.c | 4 +++- > drivers/net/dpaa/dpaa_ethdev.c | 6 ++++-- > drivers/net/dpaa2/dpaa2_ethdev.c | 4 +++- > drivers/net/e1000/igb_ethdev.c | 4 +++- > drivers/net/enic/enic_ethdev.c | 15 ++++++++++----- > drivers/net/hns3/hns3_ethdev.c | 5 ++++- > drivers/net/hns3/hns3_ethdev_vf.c | 5 ++++- > drivers/net/i40e/i40e_ethdev.c | 4 +++- > drivers/net/ice/ice_ethdev.c | 4 +++- > drivers/net/igc/igc_ethdev.c | 4 +++- > drivers/net/ionic/ionic_ethdev.c | 15 +++++++++------ > drivers/net/ixgbe/ixgbe_ethdev.c | 4 +++- > drivers/net/octeontx2/otx2_ethdev_ops.c | 2 +- > drivers/net/qede/qede_ethdev.c | 3 --- > drivers/net/sfc/sfc_ethdev.c | 8 -------- > drivers/net/txgbe/txgbe_ethdev.c | 4 +++- > lib/librte_ethdev/rte_ethdev.h | 1 + > 19 files changed, 61 insertions(+), 42 deletions(-) >=20 For ice driver, Acked-by: Qiming Yang