From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>,
Igor Russkikh <igor.russkikh@aquantia.com>,
Pavel Belous <pavel.belous@aquantia.com>,
Somalapuram Amaranath <asomalap@amd.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@oss.nxp.com>,
"Guo, Jia" <jia.guo@intel.com>,
"Wang, Haiyue" <haiyue.wang@intel.com>,
"Daley, John" <johndale@cisco.com>,
Hyong Youb Kim <hyonkim@cisco.com>,
"Min Hu (Connor)" <humin29@huawei.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
Lijun Ou <oulijun@huawei.com>,
"Yang, Qiming" <qiming.yang@intel.com>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>,
Andrew Boyer <aboyer@pensando.io>,
Jerin Jacob <jerinj@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
"Rasesh Mody" <rmody@marvell.com>,
Devendra Singh Rawat <dsinghrawat@marvell.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Jian Wang <jianwang@trustnetic.com>,
"Thomas Monjalon" <thomas@monjalon.net>,
Selwin Sebastian <selwin.sebastian@amd.com>,
Remy Horton <remy.horton@intel.com>,
Chunsong Feng <fengchunsong@huawei.com>,
Huisong Li <lihuisong@huawei.com>,
Hao Chen <chenhao164@huawei.com>,
"Wei Hu (Xavier)" <xavier.huwei@huawei.com>,
"Wu, Jingjing" <jingjing.wu@intel.com>,
"Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
"Li, Xiaoyun" <xiaoyun.li@intel.com>,
"Zhang, AlvinX" <alvinx.zhang@intel.com>,
Shannon Nelson <snelson@pensando.io>,
Alfredo Cardigliano <cardigliano@ntop.org>,
"Vamsi Attunuru" <vattunuru@marvell.com>,
Yash Sharma <ysharma@marvell.com>,
"Ivan Malov" <ivan.malov@oktetlabs.ru>,
Andrew Lee <alee@solarflare.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] drivers/net: fix FW version get
Date: Fri, 23 Apr 2021 02:00:27 +0000 [thread overview]
Message-ID: <MN2PR11MB38071D5B2D29676AB55BCDDFF7459@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210421162058.1352960-1-ferruh.yigit@intel.com>
> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Thursday, April 22, 2021 12:21 AM
> To: Igor Russkikh <igor.russkikh@aquantia.com>; Pavel Belous
> <pavel.belous@aquantia.com>; Somalapuram Amaranath
> <asomalap@amd.com>; Ajit Khaparde <ajit.khaparde@broadcom.com>;
> Somnath Kotur <somnath.kotur@broadcom.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@oss.nxp.com>;
> Guo, Jia <jia.guo@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>;
> Daley, John <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>;
> Min Hu (Connor) <humin29@huawei.com>; Yisen Zhuang
> <yisen.zhuang@huawei.com>; Lijun Ou <oulijun@huawei.com>; Xing, Beilei
> <beilei.xing@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Andrew Boyer <aboyer@pensando.io>; Jerin Jacob
> <jerinj@marvell.com>; Nithin Dabilpuram <ndabilpuram@marvell.com>;
> Kiran Kumar K <kirankumark@marvell.com>; Rasesh Mody
> <rmody@marvell.com>; Devendra Singh Rawat <dsinghrawat@marvell.com>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Jiawen Wu
> <jiawenwu@trustnetic.com>; Jian Wang <jianwang@trustnetic.com>;
> Thomas Monjalon <thomas@monjalon.net>; Selwin Sebastian
> <selwin.sebastian@amd.com>; Remy Horton <remy.horton@intel.com>;
> Chunsong Feng <fengchunsong@huawei.com>; Huisong Li
> <lihuisong@huawei.com>; Hao Chen <chenhao164@huawei.com>; Wei Hu
> (Xavier) <xavier.huwei@huawei.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Lu, Wenzhuo <wenzhuo.lu@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>;
> Zhang, AlvinX <alvinx.zhang@intel.com>; Shannon Nelson
> <snelson@pensando.io>; Alfredo Cardigliano <cardigliano@ntop.org>;
> Vamsi Attunuru <vattunuru@marvell.com>; Yash Sharma
> <ysharma@marvell.com>; Ivan Malov <ivan.malov@oktetlabs.ru>; Andrew
> Lee <alee@solarflare.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] drivers/net: fix FW version get
>
> 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'
>
> 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
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
<...>
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index e6206a7e5100..66d23d698ea0 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -3687,9 +3687,11 @@ i40e_fw_version_get(struct rte_eth_dev *dev,
> char *fw_version, size_t fw_size)
> ((hw->nvm.version >> 4) & 0xff),
> (hw->nvm.version & 0xf), hw->nvm.eetrack,
> ver, build, patch);
> + if (ret < 0)
> + return -EINVAL;
>
> ret += 1; /* add the size of '\0' */
> - if (fw_size < (u32)ret)
> + if (fw_size < (size_t)ret)
> return ret;
> else
> return 0;
For i40e,
Acked-by: Beilei Xing <beilei.xing@intel.com>
next prev parent reply other threads:[~2021-04-23 2:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 16:20 Ferruh Yigit
2021-04-21 16:30 ` Ajit Khaparde
2021-04-22 8:53 ` Andrew Rybchenko
2021-04-22 11:44 ` Wang, Haiyue
2021-04-22 17:01 ` [dpdk-dev] [EXT] " Rasesh Mody
2021-04-23 1:49 ` [dpdk-dev] " Jiawen Wu
2021-04-23 2:00 ` Xing, Beilei [this message]
2021-04-23 2:19 ` Jiawen Wu
2021-04-26 12:02 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2021-04-23 3:22 ` [dpdk-dev] " Hemant Agrawal
2021-04-28 8:12 ` Yang, Qiming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN2PR11MB38071D5B2D29676AB55BCDDFF7459@MN2PR11MB3807.namprd11.prod.outlook.com \
--to=beilei.xing@intel.com \
--cc=aboyer@pensando.io \
--cc=ajit.khaparde@broadcom.com \
--cc=alee@solarflare.com \
--cc=alvinx.zhang@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=asomalap@amd.com \
--cc=cardigliano@ntop.org \
--cc=chenhao164@huawei.com \
--cc=dev@dpdk.org \
--cc=dsinghrawat@marvell.com \
--cc=fengchunsong@huawei.com \
--cc=ferruh.yigit@intel.com \
--cc=haiyue.wang@intel.com \
--cc=hemant.agrawal@nxp.com \
--cc=humin29@huawei.com \
--cc=hyonkim@cisco.com \
--cc=igor.russkikh@aquantia.com \
--cc=ivan.malov@oktetlabs.ru \
--cc=jerinj@marvell.com \
--cc=jia.guo@intel.com \
--cc=jianwang@trustnetic.com \
--cc=jiawenwu@trustnetic.com \
--cc=jingjing.wu@intel.com \
--cc=johndale@cisco.com \
--cc=kirankumark@marvell.com \
--cc=lihuisong@huawei.com \
--cc=ndabilpuram@marvell.com \
--cc=oulijun@huawei.com \
--cc=pavel.belous@aquantia.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=remy.horton@intel.com \
--cc=rmody@marvell.com \
--cc=sachin.saxena@oss.nxp.com \
--cc=selwin.sebastian@amd.com \
--cc=snelson@pensando.io \
--cc=somnath.kotur@broadcom.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
--cc=vattunuru@marvell.com \
--cc=wenzhuo.lu@intel.com \
--cc=xavier.huwei@huawei.com \
--cc=xiaoyun.li@intel.com \
--cc=yisen.zhuang@huawei.com \
--cc=ysharma@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).