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 B607BA2EDB for ; Fri, 6 Sep 2019 15:29:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8DAAA1F403; Fri, 6 Sep 2019 15:29:36 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E9A781F3C2 for ; Fri, 6 Sep 2019 15:29:34 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D7B918B3D84; Fri, 6 Sep 2019 13:29:33 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE3C11000321; Fri, 6 Sep 2019 13:29:18 +0000 (UTC) From: Aaron Conole To: Andrew Rybchenko Cc: "John W. Linville" , Xiaolong Ye , Qi Zhang , Shepard Siegel , Ed Czeck , "John Miller" , Igor Russkikh , Pavel Belous , Allain Legacy , Matt Peters , Ravi Kumar , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , Somnath Kotur , Chas Williams , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , Wenzhuo Lu , Marcin Wojtas , Michal Krawczyk , "Guy Tzalik" , Evgeny Schemeilin , Gagandeep Singh , John Daley , "Hyong Youb Kim" , Gaetan Rivet , "Xiao Wang" , Ziyang Xuan , "Xiaoyun Wang" , Guoyang Zhou , Beilei Xing , Jingjing Wu , Qiming Yang , Rosen Xu , Konstantin Ananyev , Ferruh Yigit , Shijith Thotton , Srisivasubramanian Srinivasan , Jakub Grajciar , Matan Azrad , Shahaf Shuler , Yongseok Koh , "Viacheslav Ovsiienko" , Zyta Szpak , "Liron Himi" , Tomasz Duszynski , "Stephen Hemminger" , "K. Y. Srinivasan" , Haiyang Zhang , Rastislav Cernay , Jan Remes , Alejandro Lucero , Tetsuya Mukawa , "Jerin Jacob" , Nithin Dabilpuram , Kiran Kumar K , Bruce Richardson , Jasvinder Singh , Cristian Dumitrescu , Keith Wiles , Maciej Czekaj , Maxime Coquelin , Tiwei Bie , Zhihong Wang , Yong Wang , Thomas Monjalon , , Ivan Ilchenko References: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> <1567755066-31389-1-git-send-email-arybchenko@solarflare.com> <1567755066-31389-18-git-send-email-arybchenko@solarflare.com> Date: Fri, 06 Sep 2019 09:29:17 -0400 In-Reply-To: <1567755066-31389-18-git-send-email-arybchenko@solarflare.com> (Andrew Rybchenko's message of "Fri, 6 Sep 2019 08:30:29 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 06 Sep 2019 13:29:34 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 17/54] ethdev: change device info get callback to return int 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" Andrew Rybchenko writes: > From: Ivan Ilchenko > > Change eth_dev_infos_get_t return value from void to int. > Make eth_dev_infos_get_t implementations across all drivers to return > negative errno values if case of error conditions. > > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > --- This patch needs a respin. ../drivers/net/atlantic/atl_ethdev.c ../drivers/net/atlantic/atl_ethdev.c:123:12: error: conflicting types fo= r =E2=80=98atl_dev_info_get=E2=80=99 static int atl_dev_info_get(struct rte_eth_dev *dev, ^ ../drivers/net/atlantic/atl_ethdev.c:48:13: note: previous declaration o= f =E2=80=98atl_dev_info_get=E2=80=99 was here static void atl_dev_info_get(struct rte_eth_dev *dev, Looks like the function prototype appears twice in the .c file - I suggest removing one of them. > v3: > - fix callback patch to take callback return value into account > > app/test/virtual_pmd.c | 4 ++- > drivers/net/af_packet/rte_eth_af_packet.c | 4 ++- > drivers/net/af_xdp/rte_eth_af_xdp.c | 4 ++- > drivers/net/ark/ark_ethdev.c | 8 +++--- > drivers/net/atlantic/atl_ethdev.c | 11 ++++++--- > drivers/net/avp/avp_ethdev.c | 8 +++--- > drivers/net/axgbe/axgbe_ethdev.c | 6 +++-- > drivers/net/bnx2x/bnx2x_ethdev.c | 4 ++- > drivers/net/bnxt/bnxt_ethdev.c | 12 ++++++--- > drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++-- > drivers/net/cxgbe/cxgbe_ethdev.c | 15 +++++++++--- > drivers/net/cxgbe/cxgbe_pfvf.h | 4 +-- > drivers/net/dpaa/dpaa_ethdev.c | 16 +++++++----- > drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++- > drivers/net/e1000/em_ethdev.c | 12 ++++++--- > drivers/net/e1000/igb_ethdev.c | 30 ++++++++++++++++------- > drivers/net/ena/ena_ethdev.c | 8 +++--- > drivers/net/enetc/enetc_ethdev.c | 4 ++- > drivers/net/enic/enic_ethdev.c | 4 ++- > drivers/net/failsafe/failsafe_ops.c | 6 +++-- > drivers/net/fm10k/fm10k_ethdev.c | 8 +++--- > drivers/net/hinic/hinic_pmd_ethdev.c | 4 ++- > drivers/net/i40e/i40e_ethdev.c | 8 +++--- > drivers/net/i40e/i40e_ethdev_vf.c | 8 +++--- > drivers/net/i40e/i40e_vf_representor.c | 4 ++- > drivers/net/iavf/iavf_ethdev.c | 6 +++-- > drivers/net/ice/ice_ethdev.c | 8 +++--- > drivers/net/ipn3ke/ipn3ke_representor.c | 4 ++- > drivers/net/ixgbe/ixgbe_ethdev.c | 21 ++++++++++------ > drivers/net/ixgbe/ixgbe_vf_representor.c | 4 ++- > drivers/net/kni/rte_eth_kni.c | 4 ++- > drivers/net/liquidio/lio_ethdev.c | 4 ++- > drivers/net/memif/rte_eth_memif.c | 4 ++- > drivers/net/mlx4/mlx4.h | 4 +-- > drivers/net/mlx4/mlx4_ethdev.c | 4 ++- > drivers/net/mlx5/mlx5.h | 2 +- > drivers/net/mlx5/mlx5_ethdev.c | 4 ++- > drivers/net/mvneta/mvneta_ethdev.c | 4 ++- > drivers/net/mvpp2/mrvl_ethdev.c | 4 ++- > drivers/net/netvsc/hn_ethdev.c | 16 +++++++++--- > drivers/net/nfb/nfb_ethdev.c | 4 ++- > drivers/net/nfp/nfp_net.c | 8 +++--- > drivers/net/null/rte_eth_null.c | 6 +++-- > drivers/net/octeontx/octeontx_ethdev.c | 4 ++- > drivers/net/octeontx2/otx2_ethdev.h | 4 +-- > drivers/net/octeontx2/otx2_ethdev_ops.c | 4 ++- > drivers/net/pcap/rte_eth_pcap.c | 4 ++- > drivers/net/qede/qede_ethdev.c | 10 ++++++-- > drivers/net/ring/rte_eth_ring.c | 4 ++- > drivers/net/sfc/sfc_ethdev.c | 4 ++- > drivers/net/softnic/rte_eth_softnic.c | 4 ++- > drivers/net/szedata2/rte_eth_szedata2.c | 4 ++- > drivers/net/tap/rte_eth_tap.c | 4 ++- > drivers/net/thunderx/nicvf_ethdev.c | 4 ++- > drivers/net/vhost/rte_eth_vhost.c | 6 +++-- > drivers/net/virtio/virtio_ethdev.c | 6 +++-- > drivers/net/vmxnet3/vmxnet3_ethdev.c | 8 +++--- > lib/librte_ethdev/rte_ethdev.c | 9 ++++++- > lib/librte_ethdev/rte_ethdev_core.h | 4 +-- > 59 files changed, 277 insertions(+), 119 deletions(-) > > diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c > index 55c2bdb982..e295891c06 100644 > --- a/app/test/virtual_pmd.c > +++ b/app/test/virtual_pmd.c > @@ -78,7 +78,7 @@ virtual_ethdev_configure_fail(struct rte_eth_dev *dev _= _rte_unused) > return -1; > } >=20=20 > -static void > +static int > virtual_ethdev_info_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *dev_info) > { > @@ -91,6 +91,8 @@ virtual_ethdev_info_get(struct rte_eth_dev *dev __rte_u= nused, > dev_info->max_tx_queues =3D (uint16_t)512; >=20=20 > dev_info->min_rx_bufsize =3D 0; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_p= acket/rte_eth_af_packet.c > index 6df09f2828..66131b53e7 100644 > --- a/drivers/net/af_packet/rte_eth_af_packet.c > +++ b/drivers/net/af_packet/rte_eth_af_packet.c > @@ -299,7 +299,7 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unuse= d) > return 0; > } >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > { > struct pmd_internals *internals =3D dev->data->dev_private; > @@ -310,6 +310,8 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_= dev_info *dev_info) > dev_info->max_rx_queues =3D (uint16_t)internals->nb_queues; > dev_info->max_tx_queues =3D (uint16_t)internals->nb_queues; > dev_info->min_rx_bufsize =3D 0; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte= _eth_af_xdp.c > index 41ed5b2af4..aa716f3195 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -403,7 +403,7 @@ eth_dev_configure(struct rte_eth_dev *dev) > return 0; > } >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > { > struct pmd_internals *internals =3D dev->data->dev_private; > @@ -421,6 +421,8 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_= dev_info *dev_info) > dev_info->default_txportconf.nb_queues =3D 1; > dev_info->default_rxportconf.ring_size =3D ETH_AF_XDP_DFLT_NUM_DESCS; > dev_info->default_txportconf.ring_size =3D ETH_AF_XDP_DFLT_NUM_DESCS; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c > index 4c807f8ddc..2b3f8e3bbf 100644 > --- a/drivers/net/ark/ark_ethdev.c > +++ b/drivers/net/ark/ark_ethdev.c > @@ -31,8 +31,8 @@ static int eth_ark_dev_configure(struct rte_eth_dev *de= v); > static int eth_ark_dev_start(struct rte_eth_dev *dev); > static void eth_ark_dev_stop(struct rte_eth_dev *dev); > static void eth_ark_dev_close(struct rte_eth_dev *dev); > -static void eth_ark_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int eth_ark_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int eth_ark_dev_link_update(struct rte_eth_dev *dev, > int wait_to_complete); > static int eth_ark_dev_set_link_up(struct rte_eth_dev *dev); > @@ -715,7 +715,7 @@ eth_ark_dev_close(struct rte_eth_dev *dev) > dev->data->mac_addrs =3D 0; > } >=20=20 > -static void > +static int > eth_ark_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -747,6 +747,8 @@ eth_ark_dev_info_get(struct rte_eth_dev *dev, > ETH_LINK_SPEED_40G | > ETH_LINK_SPEED_50G | > ETH_LINK_SPEED_100G); > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl= _ethdev.c > index 4a99699ad5..b056f8229a 100644 > --- a/drivers/net/atlantic/atl_ethdev.c > +++ b/drivers/net/atlantic/atl_ethdev.c > @@ -117,7 +117,7 @@ static int eth_atl_pci_probe(struct rte_pci_driver *p= ci_drv __rte_unused, > struct rte_pci_device *pci_dev); > static int eth_atl_pci_remove(struct rte_pci_device *pci_dev); >=20=20 > -static void atl_dev_info_get(struct rte_eth_dev *dev, > +static int atl_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); >=20=20 > int atl_logtype_init; > @@ -1074,7 +1074,7 @@ atl_fw_version_get(struct rte_eth_dev *dev, char *f= w_version, size_t fw_size) > return 0; > } >=20=20 > -static void > +static int > atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_i= nfo) > { > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > @@ -1115,6 +1115,8 @@ atl_dev_info_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > dev_info->speed_capa |=3D ETH_LINK_SPEED_100M; > dev_info->speed_capa |=3D ETH_LINK_SPEED_2_5G; > dev_info->speed_capa |=3D ETH_LINK_SPEED_5G; > + > + return 0; > } >=20=20 > static const uint32_t * > @@ -1600,9 +1602,12 @@ static int > atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > { > struct rte_eth_dev_info dev_info; > + int ret; > uint32_t frame_size =3D mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; >=20=20 > - atl_dev_info_get(dev, &dev_info); > + ret =3D atl_dev_info_get(dev, &dev_info); > + if (ret !=3D 0) > + return ret; >=20=20 > if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) > return -EINVAL; > diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c > index 504435edc2..c5801f319a 100644 > --- a/drivers/net/avp/avp_ethdev.c > +++ b/drivers/net/avp/avp_ethdev.c > @@ -41,8 +41,8 @@ static int avp_dev_configure(struct rte_eth_dev *dev); > static int avp_dev_start(struct rte_eth_dev *dev); > static void avp_dev_stop(struct rte_eth_dev *dev); > static void avp_dev_close(struct rte_eth_dev *dev); > -static void avp_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int avp_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int avp_vlan_offload_set(struct rte_eth_dev *dev, int mask); > static int avp_dev_link_update(struct rte_eth_dev *dev, int wait_to_comp= lete); > static void avp_dev_promiscuous_enable(struct rte_eth_dev *dev); > @@ -2185,7 +2185,7 @@ avp_dev_promiscuous_disable(struct rte_eth_dev *eth= _dev) > rte_spinlock_unlock(&avp->lock); > } >=20=20 > -static void > +static int > avp_dev_info_get(struct rte_eth_dev *eth_dev, > struct rte_eth_dev_info *dev_info) > { > @@ -2200,6 +2200,8 @@ avp_dev_info_get(struct rte_eth_dev *eth_dev, > dev_info->rx_offload_capa =3D DEV_RX_OFFLOAD_VLAN_STRIP; > dev_info->tx_offload_capa =3D DEV_TX_OFFLOAD_VLAN_INSERT; > } > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_e= thdev.c > index 4fcede889d..5a7da75126 100644 > --- a/drivers/net/axgbe/axgbe_ethdev.c > +++ b/drivers/net/axgbe/axgbe_ethdev.c > @@ -24,7 +24,7 @@ static int axgbe_dev_link_update(struct rte_eth_dev *de= v, > static int axgbe_dev_stats_get(struct rte_eth_dev *dev, > struct rte_eth_stats *stats); > static void axgbe_dev_stats_reset(struct rte_eth_dev *dev); > -static void axgbe_dev_info_get(struct rte_eth_dev *dev, > +static int axgbe_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); >=20=20 > /* The set of PCI devices this driver supports */ > @@ -354,7 +354,7 @@ axgbe_dev_stats_reset(struct rte_eth_dev *dev) > } > } >=20=20 > -static void > +static int > axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev= _info) > { > struct axgbe_port *pdata =3D dev->data->dev_private; > @@ -393,6 +393,8 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > dev_info->default_txconf =3D (struct rte_eth_txconf) { > .tx_free_thresh =3D AXGBE_TX_FREE_THRESH, > }; > + > + return 0; > } >=20=20 > static void axgbe_get_all_hw_features(struct axgbe_port *pdata) > diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_e= thdev.c > index cda29e64fc..b7359514e5 100644 > --- a/drivers/net/bnx2x/bnx2x_ethdev.c > +++ b/drivers/net/bnx2x/bnx2x_ethdev.c > @@ -478,7 +478,7 @@ bnx2x_dev_xstats_get(struct rte_eth_dev *dev, struct = rte_eth_xstat *xstats, > return num; > } >=20=20 > -static void > +static int > bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *de= v_info) > { > struct bnx2x_softc *sc =3D dev->data->dev_private; > @@ -494,6 +494,8 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *dev_info) > dev_info->rx_desc_lim.nb_max =3D MAX_RX_AVAIL; > dev_info->rx_desc_lim.nb_min =3D MIN_RX_SIZE_NONTPA; > dev_info->tx_desc_lim.nb_max =3D MAX_TX_AVAIL; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethde= v.c > index 6685ee7d90..b521a72963 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -494,8 +494,8 @@ static int bnxt_init_nic(struct bnxt *bp) > * Device configuration and status function > */ >=20=20 > -static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, > - struct rte_eth_dev_info *dev_info) > +static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, > + struct rte_eth_dev_info *dev_info) > { > struct bnxt *bp =3D eth_dev->data->dev_private; > uint16_t max_vnics, i, j, vpool, vrxq; > @@ -588,6 +588,8 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *= eth_dev, >=20=20 > dev_info->vmdq_pool_base =3D 0; > dev_info->vmdq_queue_base =3D 0; > + > + return 0; > } >=20=20 > /* Configure the device based on the configuration provided */ > @@ -1787,7 +1789,11 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth= _dev, uint16_t new_mtu) > new_pkt_size =3D new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + > VLAN_TAG_SIZE * BNXT_NUM_VLANS; >=20=20 > - bnxt_dev_info_get_op(eth_dev, &dev_info); > + rc =3D bnxt_dev_info_get_op(eth_dev, &dev_info); > + if (rc !=3D 0) { > + PMD_DRV_LOG(ERR, "Error during getting ethernet device info\n"); > + return rc; > + } >=20=20 > if (new_mtu < RTE_ETHER_MIN_MTU || new_mtu > BNXT_MAX_MTU) { > PMD_DRV_LOG(ERR, "MTU requested must be within (%d, %d)\n", > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding= /rte_eth_bond_pmd.c > index a1b50141f9..a994c9abd2 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2115,7 +2115,7 @@ bond_ethdev_close(struct rte_eth_dev *dev) > /* forward declaration */ > static int bond_ethdev_configure(struct rte_eth_dev *dev); >=20=20 > -static void > +static int > bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_i= nfo) > { > struct bond_dev_private *internals =3D dev->data->dev_private; > @@ -2151,7 +2151,7 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > slave.port_id, > strerror(-ret)); >=20=20 > - return; > + return ret; > } >=20=20 > if (slave_info.max_rx_queues < max_nb_rx_queues) > @@ -2198,6 +2198,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > dev_info->flow_type_rss_offloads =3D internals->flow_type_rss_offloads; >=20=20 > dev_info->reta_size =3D internals->reta_size; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_e= thdev.c > index efb458d470..19c2a3c4db 100644 > --- a/drivers/net/cxgbe/cxgbe_ethdev.c > +++ b/drivers/net/cxgbe/cxgbe_ethdev.c > @@ -111,7 +111,7 @@ uint16_t cxgbe_recv_pkts(void *rx_queue, struct rte_m= buf **rx_pkts, > return work_done; > } >=20=20 > -void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev, > +int cxgbe_dev_info_get(struct rte_eth_dev *eth_dev, > struct rte_eth_dev_info *device_info) > { > struct port_info *pi =3D eth_dev->data->dev_private; > @@ -146,6 +146,8 @@ void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev, > device_info->rx_desc_lim =3D cxgbe_desc_lim; > device_info->tx_desc_lim =3D cxgbe_desc_lim; > cxgbe_get_speed_caps(pi, &device_info->speed_capa); > + > + return 0; > } >=20=20 > void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev) > @@ -281,7 +283,9 @@ int cxgbe_dev_mtu_set(struct rte_eth_dev *eth_dev, ui= nt16_t mtu) > int err; > uint16_t new_mtu =3D mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; >=20=20 > - cxgbe_dev_info_get(eth_dev, &dev_info); > + err =3D cxgbe_dev_info_get(eth_dev, &dev_info); > + if (err !=3D 0) > + return err; >=20=20 > /* Must accommodate at least RTE_ETHER_MIN_MTU */ > if (new_mtu < RTE_ETHER_MIN_MTU || new_mtu > dev_info.max_rx_pktlen) > @@ -587,7 +591,12 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth= _dev, > __func__, eth_dev->data->nb_rx_queues, queue_idx, nb_desc, > socket_id, mp); >=20=20 > - cxgbe_dev_info_get(eth_dev, &dev_info); > + err =3D cxgbe_dev_info_get(eth_dev, &dev_info); > + if (err !=3D 0) { > + dev_err(adap, "%s: error during getting ethernet device info", > + __func__); > + return err; > + } >=20=20 > /* Must accommodate at least RTE_ETHER_MIN_MTU */ > if ((pkt_len < dev_info.min_rx_bufsize) || > diff --git a/drivers/net/cxgbe/cxgbe_pfvf.h b/drivers/net/cxgbe/cxgbe_pfv= f.h > index 03145cea6d..011ec13860 100644 > --- a/drivers/net/cxgbe/cxgbe_pfvf.h > +++ b/drivers/net/cxgbe/cxgbe_pfvf.h > @@ -10,8 +10,8 @@ void cxgbe_dev_rx_queue_release(void *q); > void cxgbe_dev_tx_queue_release(void *q); > void cxgbe_dev_stop(struct rte_eth_dev *eth_dev); > void cxgbe_dev_close(struct rte_eth_dev *eth_dev); > -void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev, > - struct rte_eth_dev_info *device_info); > +int cxgbe_dev_info_get(struct rte_eth_dev *eth_dev, > + struct rte_eth_dev_info *device_info); > void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev); > void cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev); > void cxgbe_dev_allmulticast_enable(struct rte_eth_dev *eth_dev); > diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethde= v.c > index 7154fb9b4c..25deadb949 100644 > --- a/drivers/net/dpaa/dpaa_ethdev.c > +++ b/drivers/net/dpaa/dpaa_ethdev.c > @@ -124,7 +124,7 @@ static const struct rte_dpaa_xstats_name_off dpaa_xst= ats_strings[] =3D { >=20=20 > static struct rte_dpaa_driver rte_dpaa_pmd; >=20=20 > -static void > +static int > dpaa_eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_= info); >=20=20 > static inline void > @@ -330,8 +330,8 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unu= sed, > return 0; > } >=20=20 > -static void dpaa_eth_dev_info(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info) > +static int dpaa_eth_dev_info(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info) > { > struct dpaa_if *dpaa_intf =3D dev->data->dev_private; >=20=20 > @@ -346,13 +346,15 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *d= ev, > dev_info->max_vmdq_pools =3D ETH_16_POOLS; > dev_info->flow_type_rss_offloads =3D DPAA_RSS_OFFLOAD_ALL; >=20=20 > - if (dpaa_intf->fif->mac_type =3D=3D fman_mac_1g) > + if (dpaa_intf->fif->mac_type =3D=3D fman_mac_1g) { > dev_info->speed_capa =3D ETH_LINK_SPEED_1G; > - else if (dpaa_intf->fif->mac_type =3D=3D fman_mac_10g) > + } else if (dpaa_intf->fif->mac_type =3D=3D fman_mac_10g) { > dev_info->speed_capa =3D (ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G); > - else > + } else { > DPAA_PMD_ERR("invalid link_speed: %s, %d", > dpaa_intf->name, dpaa_intf->fif->mac_type); > + return -EINVAL; > + } >=20=20 > dev_info->rx_offload_capa =3D dev_rx_offloads_sup | > dev_rx_offloads_nodis; > @@ -360,6 +362,8 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, > dev_tx_offloads_nodis; > dev_info->default_rxportconf.burst_size =3D DPAA_DEF_RX_BURST_SIZE; > dev_info->default_txportconf.burst_size =3D DPAA_DEF_TX_BURST_SIZE; > + > + return 0; > } >=20=20 > static int dpaa_eth_link_update(struct rte_eth_dev *dev, > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_e= thdev.c > index dd6a78f9fe..879bbc120d 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > @@ -243,7 +243,7 @@ dpaa2_fw_version_get(struct rte_eth_dev *dev, > return 0; > } >=20=20 > -static void > +static int > dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev= _info) > { > struct dpaa2_dev_priv *priv =3D dev->data->dev_private; > @@ -269,6 +269,8 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > dev_info->max_vfs =3D 0; > dev_info->max_vmdq_pools =3D ETH_16_POOLS; > dev_info->flow_type_rss_offloads =3D DPAA2_RSS_OFFLOAD_ALL; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c > index 20b5406237..305588f9b3 100644 > --- a/drivers/net/e1000/em_ethdev.c > +++ b/drivers/net/e1000/em_ethdev.c > @@ -44,7 +44,7 @@ static int eth_em_link_update(struct rte_eth_dev *dev, > static int eth_em_stats_get(struct rte_eth_dev *dev, > struct rte_eth_stats *rte_stats); > static void eth_em_stats_reset(struct rte_eth_dev *dev); > -static void eth_em_infos_get(struct rte_eth_dev *dev, > +static int eth_em_infos_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static int eth_em_flow_ctrl_get(struct rte_eth_dev *dev, > struct rte_eth_fc_conf *fc_conf); > @@ -1048,7 +1048,7 @@ em_get_max_pktlen(struct rte_eth_dev *dev) > } > } >=20=20 > -static void > +static int > eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_i= nfo) > { > struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > @@ -1107,6 +1107,8 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > dev_info->default_txportconf.nb_queues =3D 1; > dev_info->default_txportconf.ring_size =3D 256; > dev_info->default_rxportconf.ring_size =3D 256; > + > + return 0; > } >=20=20 > /* return 0 means link status changed, -1 means not changed */ > @@ -1776,8 +1778,12 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t m= tu) > struct e1000_hw *hw; > uint32_t frame_size; > uint32_t rctl; > + int ret; > + > + ret =3D eth_em_infos_get(dev, &dev_info); > + if (ret !=3D 0) > + return ret; >=20=20 > - eth_em_infos_get(dev, &dev_info); > frame_size =3D mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + > VLAN_TAG_SIZE; >=20=20 > diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethde= v.c > index fec2b4289a..6172f9ac64 100644 > --- a/drivers/net/e1000/igb_ethdev.c > +++ b/drivers/net/e1000/igb_ethdev.c > @@ -102,10 +102,10 @@ static void eth_igb_stats_reset(struct rte_eth_dev = *dev); > static void eth_igb_xstats_reset(struct rte_eth_dev *dev); > static int eth_igb_fw_version_get(struct rte_eth_dev *dev, > char *fw_version, size_t fw_size); > -static void eth_igb_infos_get(struct rte_eth_dev *dev, > +static int eth_igb_infos_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static const uint32_t *eth_igb_supported_ptypes_get(struct rte_eth_dev *= dev); > -static void eth_igbvf_infos_get(struct rte_eth_dev *dev, > +static int eth_igbvf_infos_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static int eth_igb_flow_ctrl_get(struct rte_eth_dev *dev, > struct rte_eth_fc_conf *fc_conf); > @@ -2193,7 +2193,7 @@ eth_igb_fw_version_get(struct rte_eth_dev *dev, cha= r *fw_version, > return 0; > } >=20=20 > -static void > +static int > eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_= info) > { > struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > @@ -2255,7 +2255,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *dev_info) >=20=20 > default: > /* Should not happen */ > - break; > + return -EINVAL; > } > dev_info->hash_key_size =3D IGB_HKEY_MAX_INDEX * sizeof(uint32_t); > dev_info->reta_size =3D ETH_RSS_RETA_SIZE_128; > @@ -2291,6 +2291,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *dev_info) > dev_info->max_mtu =3D dev_info->max_rx_pktlen - E1000_ETH_OVERHEAD; > dev_info->min_mtu =3D RTE_ETHER_MIN_MTU; >=20=20 > + return 0; > } >=20=20 > static const uint32_t * > @@ -2320,7 +2321,7 @@ eth_igb_supported_ptypes_get(struct rte_eth_dev *de= v) > return NULL; > } >=20=20 > -static void > +static int > eth_igbvf_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *de= v_info) > { > struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > @@ -2345,7 +2346,7 @@ eth_igbvf_infos_get(struct rte_eth_dev *dev, struct= rte_eth_dev_info *dev_info) > break; > default: > /* Should not happen */ > - break; > + return -EINVAL; > } >=20=20 > dev_info->rx_queue_offload_capa =3D igb_get_rx_queue_offloads_capa(dev); > @@ -2377,6 +2378,8 @@ eth_igbvf_infos_get(struct rte_eth_dev *dev, struct= rte_eth_dev_info *dev_info) >=20=20 > dev_info->rx_desc_lim =3D rx_desc_lim; > dev_info->tx_desc_lim =3D tx_desc_lim; > + > + return 0; > } >=20=20 > /* return 0 means link status changed, -1 means not changed */ > @@ -2794,6 +2797,7 @@ eth_igb_lsc_interrupt_setup(struct rte_eth_dev *dev= , uint8_t on) > static int eth_igb_rxq_interrupt_setup(struct rte_eth_dev *dev) > { > uint32_t mask, regval; > + int ret; > struct e1000_hw *hw =3D > E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > @@ -2802,7 +2806,9 @@ static int eth_igb_rxq_interrupt_setup(struct rte_e= th_dev *dev) > struct rte_eth_dev_info dev_info; >=20=20 > memset(&dev_info, 0, sizeof(dev_info)); > - eth_igb_infos_get(dev, &dev_info); > + ret =3D eth_igb_infos_get(dev, &dev_info); > + if (ret !=3D 0) > + return ret; >=20=20 > mask =3D (0xFFFFFFFF >> (32 - dev_info.max_rx_queues)) << misc_shift; > regval =3D E1000_READ_REG(hw, E1000_EIMS); > @@ -3176,9 +3182,12 @@ igbvf_stop_adapter(struct rte_eth_dev *dev) > u16 i; > struct rte_eth_dev_info dev_info; > struct e1000_hw *hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + int ret; >=20=20 > memset(&dev_info, 0, sizeof(dev_info)); > - eth_igbvf_infos_get(dev, &dev_info); > + ret =3D eth_igbvf_infos_get(dev, &dev_info); > + if (ret !=3D 0) > + return; >=20=20 > /* Clear interrupt mask to stop from interrupts being generated */ > igbvf_intr_disable(hw); > @@ -4475,6 +4484,7 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t m= tu) > struct e1000_hw *hw; > struct rte_eth_dev_info dev_info; > uint32_t frame_size =3D mtu + E1000_ETH_OVERHEAD; > + int ret; >=20=20 > hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); >=20=20 > @@ -4483,7 +4493,9 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t m= tu) > if (hw->mac.type =3D=3D e1000_82571) > return -ENOTSUP; > #endif > - eth_igb_infos_get(dev, &dev_info); > + ret =3D eth_igb_infos_get(dev, &dev_info); > + if (ret !=3D 0) > + return ret; >=20=20 > /* check that mtu is within the allowed range */ > if (mtu < RTE_ETHER_MIN_MTU || > diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c > index 7d4a3b225e..8fefacf45f 100644 > --- a/drivers/net/ena/ena_ethdev.c > +++ b/drivers/net/ena/ena_ethdev.c > @@ -227,8 +227,8 @@ static int ena_queue_start(struct ena_ring *ring); > static int ena_queue_start_all(struct rte_eth_dev *dev, > enum ena_ring_type ring_type); > static void ena_stats_restart(struct rte_eth_dev *dev); > -static void ena_infos_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int ena_infos_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int ena_rss_reta_update(struct rte_eth_dev *dev, > struct rte_eth_rss_reta_entry64 *reta_conf, > uint16_t reta_size); > @@ -1909,7 +1909,7 @@ static void ena_init_rings(struct ena_adapter *adap= ter) > } > } >=20=20 > -static void ena_infos_get(struct rte_eth_dev *dev, > +static int ena_infos_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > struct ena_adapter *adapter; > @@ -1982,6 +1982,8 @@ static void ena_infos_get(struct rte_eth_dev *dev, > adapter->max_tx_sgl_size); > dev_info->tx_desc_lim.nb_mtu_seg_max =3D RTE_MIN(ENA_PKT_MAX_BUFS, > adapter->max_tx_sgl_size); > + > + return 0; > } >=20=20 > static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_p= kts, > diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_e= thdev.c > index 6c5501acb3..dec42b9763 100644 > --- a/drivers/net/enetc/enetc_ethdev.c > +++ b/drivers/net/enetc/enetc_ethdev.c > @@ -144,7 +144,7 @@ enetc_hardware_init(struct enetc_eth_hw *hw) > return 0; > } >=20=20 > -static void > +static int > enetc_dev_infos_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *dev_info) > { > @@ -168,6 +168,8 @@ enetc_dev_infos_get(struct rte_eth_dev *dev __rte_unu= sed, > DEV_RX_OFFLOAD_TCP_CKSUM | > DEV_RX_OFFLOAD_KEEP_CRC | > DEV_RX_OFFLOAD_JUMBO_FRAME); > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethde= v.c > index 06dc67122c..90fdeda901 100644 > --- a/drivers/net/enic/enic_ethdev.c > +++ b/drivers/net/enic/enic_ethdev.c > @@ -500,7 +500,7 @@ static uint32_t speed_capa_from_pci_id(struct rte_eth= _dev *eth_dev) > return ETH_LINK_SPEED_10G; > } >=20=20 > -static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev, > +static int enicpmd_dev_info_get(struct rte_eth_dev *eth_dev, > struct rte_eth_dev_info *device_info) > { > struct enic *enic =3D pmd_priv(eth_dev); > @@ -555,6 +555,8 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *= eth_dev, > .nb_queues =3D ENIC_DEFAULT_TX_RINGS, > }; > device_info->speed_capa =3D speed_capa_from_pci_id(eth_dev); > + > + return 0; > } >=20=20 > static const uint32_t *enicpmd_dev_supported_ptypes_get(struct rte_eth_d= ev *dev) > diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/f= ailsafe_ops.c > index b3df626aaa..cc14bc2bcc 100644 > --- a/drivers/net/failsafe/failsafe_ops.c > +++ b/drivers/net/failsafe/failsafe_ops.c > @@ -860,7 +860,7 @@ fs_dev_merge_info(struct rte_eth_dev_info *info, > * all sub_devices and the default capabilities. > * > */ > -static void > +static int > fs_dev_infos_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *infos) > { > @@ -936,10 +936,12 @@ fs_dev_infos_get(struct rte_eth_dev *dev, >=20=20 > ret =3D rte_eth_dev_info_get(PORT_ID(sdev), &sub_info); > if (ret !=3D 0) > - return; > + return ret; >=20=20 > fs_dev_merge_info(infos, &sub_info); > } > + > + return 0; > } >=20=20 > static const uint32_t * > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_e= thdev.c > index db4d72129d..8cb7337ea5 100644 > --- a/drivers/net/fm10k/fm10k_ethdev.c > +++ b/drivers/net/fm10k/fm10k_ethdev.c > @@ -60,8 +60,8 @@ static void fm10k_set_tx_function(struct rte_eth_dev *d= ev); > static int fm10k_check_ftag(struct rte_devargs *devargs); > static int fm10k_link_update(struct rte_eth_dev *dev, int wait_to_comple= te); >=20=20 > -static void fm10k_dev_infos_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int fm10k_dev_infos_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static uint64_t fm10k_get_rx_queue_offloads_capa(struct rte_eth_dev *dev= ); > static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev); > static uint64_t fm10k_get_tx_queue_offloads_capa(struct rte_eth_dev *dev= ); > @@ -1360,7 +1360,7 @@ fm10k_stats_reset(struct rte_eth_dev *dev) > fm10k_rebind_hw_stats(hw, hw_stats); > } >=20=20 > -static void > +static int > fm10k_dev_infos_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -1438,6 +1438,8 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, > dev_info->speed_capa =3D ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G | > ETH_LINK_SPEED_10G | ETH_LINK_SPEED_25G | > ETH_LINK_SPEED_40G | ETH_LINK_SPEED_100G; > + > + return 0; > } >=20=20 > #ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE > diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hin= ic_pmd_ethdev.c > index 044af9053c..17a3625d63 100644 > --- a/drivers/net/hinic/hinic_pmd_ethdev.c > +++ b/drivers/net/hinic/hinic_pmd_ethdev.c > @@ -664,7 +664,7 @@ static void hinic_get_speed_capa(struct rte_eth_dev *= dev, uint32_t *speed_capa) > * @param info > * Pointer to Info structure output buffer. > */ > -static void > +static int > hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *in= fo) > { > struct hinic_nic_dev *nic_dev =3D HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); > @@ -697,6 +697,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *info) > info->flow_type_rss_offloads =3D HINIC_RSS_OFFLOAD_ALL; > info->rx_desc_lim =3D hinic_rx_desc_lim; > info->tx_desc_lim =3D hinic_tx_desc_lim; > + > + return 0; > } >=20=20 > static int hinic_config_rx_mode(struct hinic_nic_dev *nic_dev, u32 rx_mo= de_ctrl) > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 4e40b7ab52..390cb21964 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -239,8 +239,8 @@ static int i40e_dev_xstats_get_names(struct rte_eth_d= ev *dev, > static void i40e_dev_stats_reset(struct rte_eth_dev *dev); > static int i40e_fw_version_get(struct rte_eth_dev *dev, > char *fw_version, size_t fw_size); > -static void i40e_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int i40e_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int i40e_vlan_filter_set(struct rte_eth_dev *dev, > uint16_t vlan_id, > int on); > @@ -3483,7 +3483,7 @@ i40e_need_stop_lldp(struct rte_eth_dev *dev) > return false; > } >=20=20 > -static void > +static int > i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_= info) > { > struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > @@ -3620,6 +3620,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *dev_info) > } > dev_info->default_rxportconf.burst_size =3D 32; > dev_info->default_txportconf.burst_size =3D 32; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_vf.c > index c77b30c54b..eca418522f 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -75,8 +75,8 @@ enum i40evf_aq_result { > static int i40evf_dev_configure(struct rte_eth_dev *dev); > static int i40evf_dev_start(struct rte_eth_dev *dev); > static void i40evf_dev_stop(struct rte_eth_dev *dev); > -static void i40evf_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int i40evf_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int i40evf_dev_link_update(struct rte_eth_dev *dev, > int wait_to_complete); > static int i40evf_dev_stats_get(struct rte_eth_dev *dev, > @@ -2216,7 +2216,7 @@ i40evf_dev_allmulticast_disable(struct rte_eth_dev = *dev) > vf->promisc_multicast_enabled =3D FALSE; > } >=20=20 > -static void > +static int > i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *de= v_info) > { > struct i40e_vf *vf =3D I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > @@ -2292,6 +2292,8 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct= rte_eth_dev_info *dev_info) > .nb_min =3D I40E_MIN_RING_DESC, > .nb_align =3D I40E_ALIGN_RING_DESC, > }; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i4= 0e_vf_representor.c > index 633dca6c3a..652f0accca 100644 > --- a/drivers/net/i40e/i40e_vf_representor.c > +++ b/drivers/net/i40e/i40e_vf_representor.c > @@ -22,7 +22,7 @@ i40e_vf_representor_link_update(struct rte_eth_dev *eth= dev, > return i40e_dev_link_update(representor->adapter->eth_dev, > wait_to_complete); > } > -static void > +static int > i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, > struct rte_eth_dev_info *dev_info) > { > @@ -100,6 +100,8 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev = *ethdev, > representor->adapter->eth_dev->device->name; > dev_info->switch_info.domain_id =3D representor->switch_domain_id; > dev_info->switch_info.port_id =3D representor->vf_id; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c > index 8f3907378c..99b1f43b82 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -37,7 +37,7 @@ static int iavf_dev_configure(struct rte_eth_dev *dev); > static int iavf_dev_start(struct rte_eth_dev *dev); > static void iavf_dev_stop(struct rte_eth_dev *dev); > static void iavf_dev_close(struct rte_eth_dev *dev); > -static void iavf_dev_info_get(struct rte_eth_dev *dev, > +static int iavf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev = *dev); > static int iavf_dev_stats_get(struct rte_eth_dev *dev, > @@ -495,7 +495,7 @@ iavf_dev_stop(struct rte_eth_dev *dev) > hw->adapter_stopped =3D 1; > } >=20=20 > -static void > +static int > iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_= info) > { > struct iavf_info *vf =3D IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > @@ -556,6 +556,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte= _eth_dev_info *dev_info) > .nb_min =3D IAVF_MIN_RING_DESC, > .nb_align =3D IAVF_ALIGN_RING_DESC, > }; > + > + return 0; > } >=20=20 > static const uint32_t * > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c > index 63997fdfba..9d0e339a5d 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -36,8 +36,8 @@ static int ice_dev_start(struct rte_eth_dev *dev); > static void ice_dev_stop(struct rte_eth_dev *dev); > static void ice_dev_close(struct rte_eth_dev *dev); > static int ice_dev_reset(struct rte_eth_dev *dev); > -static void ice_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int ice_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int ice_link_update(struct rte_eth_dev *dev, > int wait_to_complete); > static int ice_dev_set_link_up(struct rte_eth_dev *dev); > @@ -2105,7 +2105,7 @@ ice_dev_reset(struct rte_eth_dev *dev) > return 0; > } >=20=20 > -static void > +static int > ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_i= nfo) > { > struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); > @@ -2225,6 +2225,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) > dev_info->default_txportconf.nb_queues =3D 1; > dev_info->default_rxportconf.ring_size =3D ICE_BUF_SIZE_MIN; > dev_info->default_txportconf.ring_size =3D ICE_BUF_SIZE_MIN; > + > + return 0; > } >=20=20 > static inline int > diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke= /ipn3ke_representor.c > index 8300cc38c4..476d5e52bd 100644 > --- a/drivers/net/ipn3ke/ipn3ke_representor.c > +++ b/drivers/net/ipn3ke/ipn3ke_representor.c > @@ -40,7 +40,7 @@ static rte_spinlock_t ipn3ke_link_notify_list_lk =3D RT= E_SPINLOCK_INITIALIZER; > static int > ipn3ke_rpst_link_check(struct ipn3ke_rpst *rpst); >=20=20 > -static void > +static int > ipn3ke_rpst_dev_infos_get(struct rte_eth_dev *ethdev, > struct rte_eth_dev_info *dev_info) > { > @@ -101,6 +101,8 @@ ipn3ke_rpst_dev_infos_get(struct rte_eth_dev *ethdev, > dev_info->switch_info.name =3D ethdev->device->name; > dev_info->switch_info.domain_id =3D rpst->switch_domain_id; > dev_info->switch_info.port_id =3D rpst->port_id; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index 7eb3d0567b..0108db890b 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -182,11 +182,11 @@ static int ixgbe_dev_queue_stats_mapping_set(struct= rte_eth_dev *eth_dev, > uint8_t is_rx); > static int ixgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_versio= n, > size_t fw_size); > -static void ixgbe_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int ixgbe_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static const uint32_t *ixgbe_dev_supported_ptypes_get(struct rte_eth_dev= *dev); > -static void ixgbevf_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int ixgbevf_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); >=20=20 > static int ixgbe_vlan_filter_set(struct rte_eth_dev *dev, > @@ -3777,7 +3777,7 @@ ixgbe_fw_version_get(struct rte_eth_dev *dev, char = *fw_version, size_t fw_size) > return 0; > } >=20=20 > -static void > +static int > ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev= _info) > { > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > @@ -3861,6 +3861,8 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct = rte_eth_dev_info *dev_info) > dev_info->default_txportconf.nb_queues =3D 1; > dev_info->default_rxportconf.ring_size =3D 256; > dev_info->default_txportconf.ring_size =3D 256; > + > + return 0; > } >=20=20 > static const uint32_t * > @@ -3902,7 +3904,7 @@ ixgbe_dev_supported_ptypes_get(struct rte_eth_dev *= dev) > return NULL; > } >=20=20 > -static void > +static int > ixgbevf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -3954,6 +3956,8 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev, >=20=20 > dev_info->rx_desc_lim =3D rx_desc_lim; > dev_info->tx_desc_lim =3D tx_desc_lim; > + > + return 0; > } >=20=20 > static int > @@ -5018,8 +5022,11 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_= t mtu) > struct rte_eth_dev_info dev_info; > uint32_t frame_size =3D mtu + IXGBE_ETH_OVERHEAD; > struct rte_eth_dev_data *dev_data =3D dev->data; > + int ret; >=20=20 > - ixgbe_dev_info_get(dev, &dev_info); > + ret =3D ixgbe_dev_info_get(dev, &dev_info); > + if (ret !=3D 0) > + return ret; >=20=20 > /* check that mtu is within the allowed range */ > if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) > diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe= /ixgbe_vf_representor.c > index 2c01f6e33c..dbbef294ae 100644 > --- a/drivers/net/ixgbe/ixgbe_vf_representor.c > +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c > @@ -34,7 +34,7 @@ ixgbe_vf_representor_mac_addr_set(struct rte_eth_dev *e= thdev, > representor->vf_id, mac_addr); > } >=20=20 > -static void > +static int > ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, > struct rte_eth_dev_info *dev_info) > { > @@ -76,6 +76,8 @@ ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *= ethdev, > representor->pf_ethdev->device->name; > dev_info->switch_info.domain_id =3D representor->switch_domain_id; > dev_info->switch_info.port_id =3D representor->vf_id; > + > + return 0; > } >=20=20 > static int ixgbe_vf_representor_dev_configure( > diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c > index 515c0aa14d..5e1623d250 100644 > --- a/drivers/net/kni/rte_eth_kni.c > +++ b/drivers/net/kni/rte_eth_kni.c > @@ -200,7 +200,7 @@ eth_kni_dev_configure(struct rte_eth_dev *dev __rte_u= nused) > return 0; > } >=20=20 > -static void > +static int > eth_kni_dev_info(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *dev_info) > { > @@ -209,6 +209,8 @@ eth_kni_dev_info(struct rte_eth_dev *dev __rte_unused, > dev_info->max_rx_queues =3D KNI_MAX_QUEUE_PER_PORT; > dev_info->max_tx_queues =3D KNI_MAX_QUEUE_PER_PORT; > dev_info->min_rx_bufsize =3D 0; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio= _ethdev.c > index c25dab00c7..d97e357e3c 100644 > --- a/drivers/net/liquidio/lio_ethdev.c > +++ b/drivers/net/liquidio/lio_ethdev.c > @@ -367,7 +367,7 @@ lio_dev_stats_reset(struct rte_eth_dev *eth_dev) > } > } >=20=20 > -static void > +static int > lio_dev_info_get(struct rte_eth_dev *eth_dev, > struct rte_eth_dev_info *devinfo) > { > @@ -393,6 +393,7 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev, > devinfo->speed_capa =3D ETH_LINK_SPEED_10G; > lio_dev_err(lio_dev, > "Unknown CN23XX subsystem device id. Setting 10G as default link = speed.\n"); > + return -EINVAL; > } >=20=20 > devinfo->max_rx_queues =3D lio_dev->max_rx_queues; > @@ -423,6 +424,7 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev, > ETH_RSS_NONFRAG_IPV6_TCP | > ETH_RSS_IPV6_EX | > ETH_RSS_IPV6_TCP_EX); > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_et= h_memif.c > index a59f809671..0d4360e5c2 100644 > --- a/drivers/net/memif/rte_eth_memif.c > +++ b/drivers/net/memif/rte_eth_memif.c > @@ -164,7 +164,7 @@ memif_mp_request_regions(struct rte_eth_dev *dev) > return memif_connect(dev); > } >=20=20 > -static void > +static int > memif_dev_info(struct rte_eth_dev *dev __rte_unused, struct rte_eth_dev_= info *dev_info) > { > dev_info->max_mac_addrs =3D 1; > @@ -172,6 +172,8 @@ memif_dev_info(struct rte_eth_dev *dev __rte_unused, = struct rte_eth_dev_info *de > dev_info->max_rx_queues =3D ETH_MEMIF_MAX_NUM_Q_PAIRS; > dev_info->max_tx_queues =3D ETH_MEMIF_MAX_NUM_Q_PAIRS; > dev_info->min_rx_bufsize =3D 0; > + > + return 0; > } >=20=20 > static memif_ring_t * > diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h > index 9823577169..7730b530af 100644 > --- a/drivers/net/mlx4/mlx4.h > +++ b/drivers/net/mlx4/mlx4.h > @@ -219,8 +219,8 @@ int mlx4_vlan_filter_set(struct rte_eth_dev *dev, uin= t16_t vlan_id, int on); > int mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats); > void mlx4_stats_reset(struct rte_eth_dev *dev); > int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw= _size); > -void mlx4_dev_infos_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *info); > +int mlx4_dev_infos_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *info); > int mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete); > int mlx4_flow_ctrl_get(struct rte_eth_dev *dev, > struct rte_eth_fc_conf *fc_conf); > diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethde= v.c > index 5d28c0116d..623ebd88cb 100644 > --- a/drivers/net/mlx4/mlx4_ethdev.c > +++ b/drivers/net/mlx4/mlx4_ethdev.c > @@ -611,7 +611,7 @@ mlx4_mac_addr_set(struct rte_eth_dev *dev, struct rte= _ether_addr *mac_addr) > * @param[out] info > * Info structure output buffer. > */ > -void > +int > mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *inf= o) > { > struct mlx4_priv *priv =3D dev->data->dev_private; > @@ -645,6 +645,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *info) > ETH_LINK_SPEED_40G | > ETH_LINK_SPEED_56G; > info->flow_type_rss_offloads =3D mlx4_conv_rss_types(priv, 0, 1); > + > + return 0; > } >=20=20 > /** > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h > index f559f835d0..cd08d001e9 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -685,7 +685,7 @@ int mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *m= tu); > int mlx5_set_flags(struct rte_eth_dev *dev, unsigned int keep, > unsigned int flags); > int mlx5_dev_configure(struct rte_eth_dev *dev); > -void mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info= *info); > +int mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info = *info); > int mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock); > int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw= _size); > const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev); > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethde= v.c > index 33a32fc2fa..766e1946d5 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -542,7 +542,7 @@ mlx5_set_txlimit_params(struct rte_eth_dev *dev, stru= ct rte_eth_dev_info *info) > * @param[out] info > * Info structure output buffer. > */ > -void > +int > mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *inf= o) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > @@ -600,6 +600,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *info) > break; > } > } > + > + return 0; > } >=20=20 > /** > diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvne= ta_ethdev.c > index a8def8fc4e..3ba0ac76e2 100644 > --- a/drivers/net/mvneta/mvneta_ethdev.c > +++ b/drivers/net/mvneta/mvneta_ethdev.c > @@ -153,7 +153,7 @@ mvneta_dev_configure(struct rte_eth_dev *dev) > * @param info > * Info structure output buffer. > */ > -static void > +static int > mvneta_dev_infos_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *info) > { > @@ -187,6 +187,8 @@ mvneta_dev_infos_get(struct rte_eth_dev *dev __rte_un= used, > info->default_txconf.offloads =3D 0; >=20=20 > info->max_rx_pktlen =3D MVNETA_PKT_SIZE_MAX; > + > + return 0; > } >=20=20 > /** > diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_eth= dev.c > index 810a703fc3..345c24404d 100644 > --- a/drivers/net/mvpp2/mrvl_ethdev.c > +++ b/drivers/net/mvpp2/mrvl_ethdev.c > @@ -1422,7 +1422,7 @@ mrvl_xstats_get_names(struct rte_eth_dev *dev __rte= _unused, > * @param info > * Info structure output buffer. > */ > -static void > +static int > mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *info) > { > @@ -1457,6 +1457,8 @@ mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_un= used, > info->default_rxconf.rx_drop_en =3D 1; >=20=20 > info->max_rx_pktlen =3D MRVL_PKT_SIZE_MAX; > + > + return 0; > } >=20=20 > /** > diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethde= v.c > index 2a90d674e9..7353211c12 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -238,10 +238,11 @@ hn_dev_link_update(struct rte_eth_dev *dev, > return rte_eth_linkstatus_set(dev, &link); > } >=20=20 > -static void hn_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info) > +static int hn_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info) > { > struct hn_data *hv =3D dev->data->dev_private; > + int rc; >=20=20 > dev_info->speed_capa =3D ETH_LINK_SPEED_10G; > dev_info->min_rx_bufsize =3D HN_MIN_RX_BUF_SIZE; > @@ -255,8 +256,15 @@ static void hn_dev_info_get(struct rte_eth_dev *dev, > dev_info->max_rx_queues =3D hv->max_queues; > dev_info->max_tx_queues =3D hv->max_queues; >=20=20 > - hn_rndis_get_offload(hv, dev_info); > - hn_vf_info_get(hv, dev_info); > + rc =3D hn_rndis_get_offload(hv, dev_info); > + if (rc !=3D 0) > + return rc; > + > + rc =3D hn_vf_info_get(hv, dev_info); > + if (rc !=3D 0) > + return rc; > + > + return 0; > } >=20=20 > static int hn_rss_reta_update(struct rte_eth_dev *dev, > diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c > index f4093d43d8..b039ab6fc2 100644 > --- a/drivers/net/nfb/nfb_ethdev.c > +++ b/drivers/net/nfb/nfb_ethdev.c > @@ -188,7 +188,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_u= nused) > * @param[out] info > * Info structure output buffer. > */ > -static void > +static int > nfb_eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -197,6 +197,8 @@ nfb_eth_dev_info(struct rte_eth_dev *dev, > dev_info->max_rx_queues =3D dev->data->nb_rx_queues; > dev_info->max_tx_queues =3D dev->data->nb_tx_queues; > dev_info->speed_capa =3D ETH_LINK_SPEED_100G; > + > + return 0; > } >=20=20 > /** > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > index f1a3ef2f92..3d5b99c943 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -81,8 +81,8 @@ static int nfp_net_configure(struct rte_eth_dev *dev); > static void nfp_net_dev_interrupt_handler(void *param); > static void nfp_net_dev_interrupt_delayed_handler(void *param); > static int nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); > -static void nfp_net_infos_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int nfp_net_infos_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static int nfp_net_init(struct rte_eth_dev *eth_dev); > static int nfp_net_link_update(struct rte_eth_dev *dev, int wait_to_comp= lete); > static void nfp_net_promisc_enable(struct rte_eth_dev *dev); > @@ -1204,7 +1204,7 @@ nfp_net_stats_reset(struct rte_eth_dev *dev) > nn_cfg_readq(hw, NFP_NET_CFG_STATS_RX_DISCARDS); > } >=20=20 > -static void > +static int > nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_= info) > { > struct nfp_net_hw *hw; > @@ -1275,6 +1275,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct r= te_eth_dev_info *dev_info) > dev_info->speed_capa =3D ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | > ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G | > ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G; > + > + return 0; > } >=20=20 > static const uint32_t * > diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_n= ull.c > index 0c60d241ac..aec0cab8f9 100644 > --- a/drivers/net/null/rte_eth_null.c > +++ b/drivers/net/null/rte_eth_null.c > @@ -259,14 +259,14 @@ eth_mtu_set(struct rte_eth_dev *dev __rte_unused, u= int16_t mtu __rte_unused) > return 0; > } >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > struct pmd_internals *internals; >=20=20 > if ((dev =3D=3D NULL) || (dev_info =3D=3D NULL)) > - return; > + return -EINVAL; >=20=20 > internals =3D dev->data->dev_private; > dev_info->max_mac_addrs =3D 1; > @@ -276,6 +276,8 @@ eth_dev_info(struct rte_eth_dev *dev, > dev_info->min_rx_bufsize =3D 0; > dev_info->reta_size =3D internals->reta_size; > dev_info->flow_type_rss_offloads =3D internals->flow_type_rss_offloads; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeont= x/octeontx_ethdev.c > index 27eed47bb0..1faa7b7c6b 100644 > --- a/drivers/net/octeontx/octeontx_ethdev.c > +++ b/drivers/net/octeontx/octeontx_ethdev.c > @@ -569,7 +569,7 @@ octeontx_dev_default_mac_addr_set(struct rte_eth_dev = *dev, > return ret; > } >=20=20 > -static void > +static int > octeontx_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -600,6 +600,8 @@ octeontx_dev_info(struct rte_eth_dev *dev, >=20=20 > dev_info->rx_offload_capa =3D OCTEONTX_RX_OFFLOADS; > dev_info->tx_offload_capa =3D OCTEONTX_TX_OFFLOADS; > + > + return 0; > } >=20=20 > static void > diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/= otx2_ethdev.h > index 7b15d6bc86..5de0a1d4d1 100644 > --- a/drivers/net/octeontx2/otx2_ethdev.h > +++ b/drivers/net/octeontx2/otx2_ethdev.h > @@ -357,8 +357,8 @@ otx2_eth_pmd_priv(struct rte_eth_dev *eth_dev) > } >=20=20 > /* Ops */ > -void otx2_nix_info_get(struct rte_eth_dev *eth_dev, > - struct rte_eth_dev_info *dev_info); > +int otx2_nix_info_get(struct rte_eth_dev *eth_dev, > + struct rte_eth_dev_info *dev_info); > int otx2_nix_dev_filter_ctrl(struct rte_eth_dev *eth_dev, > enum rte_filter_type filter_type, > enum rte_filter_op filter_op, void *arg); > diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeon= tx2/otx2_ethdev_ops.c > index 7c6532b6fc..024c295aa6 100644 > --- a/drivers/net/octeontx2/otx2_ethdev_ops.c > +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c > @@ -403,7 +403,7 @@ otx2_nix_get_module_eeprom(struct rte_eth_dev *eth_de= v, > return 0; > } >=20=20 > -void > +int > otx2_nix_info_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *= devinfo) > { > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(eth_dev); > @@ -467,4 +467,6 @@ otx2_nix_info_get(struct rte_eth_dev *eth_dev, struct= rte_eth_dev_info *devinfo) >=20=20 > devinfo->dev_capa =3D RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP | > RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP; > + > + return 0; > } > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_p= cap.c > index 5489010b64..50a0655a33 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -652,7 +652,7 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unuse= d) > return 0; > } >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -664,6 +664,8 @@ eth_dev_info(struct rte_eth_dev *dev, > dev_info->max_rx_queues =3D dev->data->nb_rx_queues; > dev_info->max_tx_queues =3D dev->data->nb_tx_queues; > dev_info->min_rx_bufsize =3D 0; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethde= v.c > index 528b33e8c4..9eb57fd78e 100644 > --- a/drivers/net/qede/qede_ethdev.c > +++ b/drivers/net/qede/qede_ethdev.c > @@ -1253,7 +1253,7 @@ static const struct rte_eth_desc_lim qede_tx_desc_l= im =3D { > .nb_mtu_seg_max =3D ETH_TX_MAX_BDS_PER_NON_LSO_PACKET > }; >=20=20 > -static void > +static int > qede_dev_info_get(struct rte_eth_dev *eth_dev, > struct rte_eth_dev_info *dev_info) > { > @@ -1333,6 +1333,8 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev, > if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G) > speed_cap |=3D ETH_LINK_SPEED_100G; > dev_info->speed_capa =3D speed_cap; > + > + return 0; > } >=20=20 > /* return 0 means link status changed, -1 means not changed */ > @@ -2228,7 +2230,11 @@ static int qede_set_mtu(struct rte_eth_dev *dev, u= int16_t mtu) > int i, rc; >=20=20 > PMD_INIT_FUNC_TRACE(edev); > - qede_dev_info_get(dev, &dev_info); > + rc =3D qede_dev_info_get(dev, &dev_info); > + if (rc !=3D 0) { > + DP_ERR(edev, "Error during getting ethernet device info\n"); > + return rc; > + } > max_rx_pkt_len =3D mtu + QEDE_MAX_ETHER_HDR_LEN; > frame_size =3D max_rx_pkt_len; > if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) { > diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_r= ing.c > index 634da63211..686246032e 100644 > --- a/drivers/net/ring/rte_eth_ring.c > +++ b/drivers/net/ring/rte_eth_ring.c > @@ -151,7 +151,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t = tx_queue_id, > } >=20=20 >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -162,6 +162,8 @@ eth_dev_info(struct rte_eth_dev *dev, > dev_info->max_rx_queues =3D (uint16_t)internals->max_rx_queues; > dev_info->max_tx_queues =3D (uint16_t)internals->max_tx_queues; > dev_info->min_rx_bufsize =3D 0; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c > index 1f78a3d8ad..013b6bbd63 100644 > --- a/drivers/net/sfc/sfc_ethdev.c > +++ b/drivers/net/sfc/sfc_ethdev.c > @@ -86,7 +86,7 @@ sfc_fw_version_get(struct rte_eth_dev *dev, char *fw_ve= rsion, size_t fw_size) > return 0; > } >=20=20 > -static void > +static int > sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_= info) > { > const struct sfc_adapter_priv *sap =3D sfc_adapter_priv_by_eth_dev(dev); > @@ -184,6 +184,8 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte= _eth_dev_info *dev_info) >=20=20 > dev_info->dev_capa =3D RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP | > RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP; > + > + return 0; > } >=20=20 > static const uint32_t * > diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/= rte_eth_softnic.c > index e3ad241618..11723778fd 100644 > --- a/drivers/net/softnic/rte_eth_softnic.c > +++ b/drivers/net/softnic/rte_eth_softnic.c > @@ -86,13 +86,15 @@ static int pmd_softnic_logtype; > rte_log(RTE_LOG_ ## level, pmd_softnic_logtype, \ > "%s(): " fmt "\n", __func__, ##args) >=20=20 > -static void > +static int > pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *dev_info) > { > dev_info->max_rx_pktlen =3D UINT32_MAX; > dev_info->max_rx_queues =3D UINT16_MAX; > dev_info->max_tx_queues =3D UINT16_MAX; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedat= a2/rte_eth_szedata2.c > index 99d5ca5ac0..ca066a3d3d 100644 > --- a/drivers/net/szedata2/rte_eth_szedata2.c > +++ b/drivers/net/szedata2/rte_eth_szedata2.c > @@ -1044,7 +1044,7 @@ eth_dev_configure(struct rte_eth_dev *dev) > return 0; > } >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -1061,6 +1061,8 @@ eth_dev_info(struct rte_eth_dev *dev, > dev_info->rx_queue_offload_capa =3D 0; > dev_info->tx_queue_offload_capa =3D 0; > dev_info->speed_capa =3D ETH_LINK_SPEED_100G; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c > index 64bd049110..f85458c3cd 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -915,7 +915,7 @@ tap_dev_speed_capa(void) > return capa; > } >=20=20 > -static void > +static int > tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > { > struct pmd_internals *internals =3D dev->data->dev_private; > @@ -939,6 +939,8 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_= dev_info *dev_info) > * functions together and not in partial combinations > */ > dev_info->flow_type_rss_offloads =3D ~TAP_RSS_HF_MASK; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/n= icvf_ethdev.c > index 56769ef859..f3ba07ae37 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -1393,7 +1393,7 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, u= int16_t qidx, > return 0; > } >=20=20 > -static void > +static int > nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev= _info) > { > struct nicvf *nic =3D nicvf_pmd_priv(dev); > @@ -1440,6 +1440,8 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct = rte_eth_dev_info *dev_info) > DEV_TX_OFFLOAD_UDP_CKSUM | > DEV_TX_OFFLOAD_TCP_CKSUM, > }; > + > + return 0; > } >=20=20 > static nicvf_iova_addr_t > diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_et= h_vhost.c > index a4892d7a0d..74cc7361b2 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -1054,7 +1054,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_= t tx_queue_id, > return 0; > } >=20=20 > -static void > +static int > eth_dev_info(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > { > @@ -1063,7 +1063,7 @@ eth_dev_info(struct rte_eth_dev *dev, > internal =3D dev->data->dev_private; > if (internal =3D=3D NULL) { > VHOST_LOG(ERR, "Invalid device specified\n"); > - return; > + return -ENODEV; > } >=20=20 > dev_info->max_mac_addrs =3D 1; > @@ -1075,6 +1075,8 @@ eth_dev_info(struct rte_eth_dev *dev, > dev_info->tx_offload_capa =3D DEV_TX_OFFLOAD_MULTI_SEGS | > DEV_TX_OFFLOAD_VLAN_INSERT; > dev_info->rx_offload_capa =3D DEV_RX_OFFLOAD_VLAN_STRIP; > + > + return 0; > } >=20=20 > static int > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virt= io_ethdev.c > index f96588b9da..8fe9dcebda 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -45,7 +45,7 @@ static void virtio_dev_promiscuous_enable(struct rte_et= h_dev *dev); > static void virtio_dev_promiscuous_disable(struct rte_eth_dev *dev); > static void virtio_dev_allmulticast_enable(struct rte_eth_dev *dev); > static void virtio_dev_allmulticast_disable(struct rte_eth_dev *dev); > -static void virtio_dev_info_get(struct rte_eth_dev *dev, > +static int virtio_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static int virtio_dev_link_update(struct rte_eth_dev *dev, > int wait_to_complete); > @@ -2394,7 +2394,7 @@ virtio_dev_vlan_offload_set(struct rte_eth_dev *dev= , int mask) > return 0; > } >=20=20 > -static void > +static int > virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *de= v_info) > { > uint64_t tso_mask, host_features; > @@ -2436,6 +2436,8 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct= rte_eth_dev_info *dev_info) > (1ULL << VIRTIO_NET_F_HOST_TSO6); > if ((host_features & tso_mask) =3D=3D tso_mask) > dev_info->tx_offload_capa |=3D DEV_TX_OFFLOAD_TCP_TSO; > + > + return 0; > } >=20=20 > /* > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/v= mxnet3_ethdev.c > index 9cd5eb65be..551c511943 100644 > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > @@ -82,8 +82,8 @@ static int vmxnet3_dev_xstats_get_names(struct rte_eth_= dev *dev, > unsigned int n); > static int vmxnet3_dev_xstats_get(struct rte_eth_dev *dev, > struct rte_eth_xstat *xstats, unsigned int n); > -static void vmxnet3_dev_info_get(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +static int vmxnet3_dev_info_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > static const uint32_t * > vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev); > static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev, > @@ -1149,7 +1149,7 @@ vmxnet3_dev_stats_reset(struct rte_eth_dev *dev) > } > } >=20=20 > -static void > +static int > vmxnet3_dev_info_get(struct rte_eth_dev *dev __rte_unused, > struct rte_eth_dev_info *dev_info) > { > @@ -1186,6 +1186,8 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev __rte_= unused, > dev_info->rx_queue_offload_capa =3D 0; > dev_info->tx_offload_capa =3D VMXNET3_TX_OFFLOAD_CAP; > dev_info->tx_queue_offload_capa =3D 0; > + > + return 0; > } >=20=20 > static const uint32_t * > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.c > index 42b1d6e30a..30b0c7803f 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -2559,6 +2559,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_e= th_dev_info *dev_info) > .nb_seg_max =3D UINT16_MAX, > .nb_mtu_seg_max =3D UINT16_MAX, > }; > + int diag; >=20=20 > /* > * Init dev_info before port_id check since caller does not have > @@ -2576,7 +2577,13 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_= eth_dev_info *dev_info) > dev_info->max_mtu =3D UINT16_MAX; >=20=20 > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP); > - (*dev->dev_ops->dev_infos_get)(dev, dev_info); > + diag =3D (*dev->dev_ops->dev_infos_get)(dev, dev_info); > + if (diag !=3D 0) { > + /* Cleanup already filled in device information */ > + memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); > + return eth_err(port_id, diag); > + } > + > dev_info->driver_name =3D dev->device->driver->name; > dev_info->nb_rx_queues =3D dev->data->nb_rx_queues; > dev_info->nb_tx_queues =3D dev->data->nb_tx_queues; > diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_= ethdev_core.h > index 2922d5b7cc..2394b32c83 100644 > --- a/lib/librte_ethdev/rte_ethdev_core.h > +++ b/lib/librte_ethdev/rte_ethdev_core.h > @@ -103,8 +103,8 @@ typedef int (*eth_queue_stats_mapping_set_t)(struct r= te_eth_dev *dev, > uint8_t is_rx); > /**< @internal Set a queue statistics mapping for a tx/rx queue of an Et= hernet device. */ >=20=20 > -typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev, > - struct rte_eth_dev_info *dev_info); > +typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > /**< @internal Get specific information of an Ethernet device. */ >=20=20 > typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth= _dev *dev);