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 6594CA2E1B for ; Tue, 3 Sep 2019 16:04:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4BCC1EBCA; Tue, 3 Sep 2019 15:58:55 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 52A9B1EA31 for ; Tue, 3 Sep 2019 15:58:02 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id EB2BE68007A; Tue, 3 Sep 2019 13:57:59 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 3 Sep 2019 06:57:55 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 3 Sep 2019 06:57:54 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x83Dvqbg000440; Tue, 3 Sep 2019 14:57:52 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 9228B1613D1; Tue, 3 Sep 2019 14:57:52 +0100 (BST) From: Andrew Rybchenko To: "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 CC: , Ivan Ilchenko Date: Tue, 3 Sep 2019 14:56:51 +0100 Message-ID: <1567519051-28189-18-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1567519051-28189-1-git-send-email-arybchenko@solarflare.com> References: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> <1567519051-28189-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24886.005 X-TM-AS-Result: No-10.421200-4.000000-10 X-TMASE-MatchedRID: z6Bo2YY7hCee/kF8Pup4HEPdsiR0fGlpy0Q+dW8+UWRjLp8Cm8vwF4gg kHfdF/Q7/7yMlJ1P+1GF0jPFsyHqkqPKM9uZBgjQNVRz+HwqL4JUE+MH85/4VB3RY4pGTCyHiiG PD3c6GvPTQUky8ZUXi+e40v4bMUWPeSWMGAfFG76cVWc2a+/ju0tc8DbogbSE31GU/N5W5BCweW tIY1I6ZhafOsBxPPR6xVuJ7nmLWiOescXXGhKTEkf49ONH0RaS6qG5M9QNAO1HZg0gWH5yUbvw3 98mrl6z7WU4F6iDZNsA0QlTWt/bdYzQp7mciZRICWlWR223da5JaD67iKvY0+LRtyO/WUoI+3n5 TORW5IvUUs7nK8wP0lMj8dGaLC2fBOzLkK2T9qMgCPGiZqtI8G9Xf86cwKVaVMUpAF7vXify71H qi5zuoGax/fbH3zHfzmlEEytj49kf0H3tYJmWPXYZxYoZm58FhVDnkfzD7uZXsxBNtOXTbzgK6r BjXxyiS1TFhsixXNjEQ3H5QnWSg7psZSK2STq1UFJbPlmBv8N+B1uQ8ONV5TFidTBRWb28W2g2r 2LI8m3eAyV/CtDqTpWmfTcTyE/WIQJt3nwJw/D805SSvoAPN3vEgoSBmr8BAdy4MyAZLgOoIli0 eoN5Plz2XR9W+CwxE7KatI8jySvo4fT4WEihVUotTp10jk3idGR9C0tIqI/WXfwzppZ8SHYaSXW 3Db5Yc4f9cTsPSes3/MV17KXXs9LucdA1OHpBR0BY8wG7yRDMMe1W2YBpitqUml4VvcDYKKqyc9 Qq8XobfFCYjM/R/Npbr6HNO/GB6/ZmBZgi9MKeAiCmPx4NwBnUJ0Ek6yhjxEHRux+uk8jpP8tMO yYmaA== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.421200-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24886.005 X-MDID: 1567519081-vpA6qDZ0S9n6 Subject: [dpdk-dev] [PATCH v2 17/54] ethdev: change eth_dev_infos_get_t 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" 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 --- 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_core.h | 4 ++-- 58 files changed, 269 insertions(+), 118 deletions(-) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 55c2bdb..e295891 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -78,7 +78,7 @@ static void virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused) return -1; } -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 @@ static void virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused) dev_info->max_tx_queues = (uint16_t)512; dev_info->min_rx_bufsize = 0; + + return 0; } static int diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 6df09f2..66131b5 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 @@ struct pmd_internals { return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct pmd_internals *internals = dev->data->dev_private; @@ -310,6 +310,8 @@ struct pmd_internals { dev_info->max_rx_queues = (uint16_t)internals->nb_queues; dev_info->max_tx_queues = (uint16_t)internals->nb_queues; dev_info->min_rx_bufsize = 0; + + return 0; } 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 41ed5b2..aa716f3 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 @@ struct pmd_internals { return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct pmd_internals *internals = dev->data->dev_private; @@ -421,6 +421,8 @@ struct pmd_internals { dev_info->default_txportconf.nb_queues = 1; dev_info->default_rxportconf.ring_size = ETH_AF_XDP_DFLT_NUM_DESCS; dev_info->default_txportconf.ring_size = ETH_AF_XDP_DFLT_NUM_DESCS; + + return 0; } static int diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 4c807f8..2b3f8e3 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -31,8 +31,8 @@ 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 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev, dev->data->mac_addrs = 0; } -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 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev, ETH_LINK_SPEED_40G | ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G); + + return 0; } static int diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 4a99699..b056f82 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 *pci_drv __rte_unused, struct rte_pci_device *pci_dev); static int eth_atl_pci_remove(struct rte_pci_device *pci_dev); -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); int atl_logtype_init; @@ -1074,7 +1074,7 @@ int atl_macsec_select_rxsa(struct rte_eth_dev *dev, return 0; } -static void +static int atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); @@ -1115,6 +1115,8 @@ int atl_macsec_select_rxsa(struct rte_eth_dev *dev, dev_info->speed_capa |= ETH_LINK_SPEED_100M; dev_info->speed_capa |= ETH_LINK_SPEED_2_5G; dev_info->speed_capa |= ETH_LINK_SPEED_5G; + + return 0; } static const uint32_t * @@ -1600,9 +1602,12 @@ int atl_dev_set_eeprom(struct rte_eth_dev *dev, 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 = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; - atl_dev_info_get(dev, &dev_info); + ret = atl_dev_info_get(dev, &dev_info); + if (ret != 0) + return ret; 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 504435e..c5801f3 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -41,8 +41,8 @@ static int avp_dev_create(struct rte_pci_device *pci_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_complete); static void avp_dev_promiscuous_enable(struct rte_eth_dev *dev); @@ -2185,7 +2185,7 @@ struct avp_queue { rte_spinlock_unlock(&avp->lock); } -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 @@ struct avp_queue { dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; } + + return 0; } static int diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 4fcede8..5a7da75 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 *dev, 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); /* The set of PCI devices this driver supports */ @@ -354,7 +354,7 @@ static int axgbe_phy_reset(struct axgbe_port *pdata) } } -static void +static int axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct axgbe_port *pdata = dev->data->dev_private; @@ -393,6 +393,8 @@ static int axgbe_phy_reset(struct axgbe_port *pdata) dev_info->default_txconf = (struct rte_eth_txconf) { .tx_free_thresh = AXGBE_TX_FREE_THRESH, }; + + return 0; } 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_ethdev.c index cda29e6..b735951 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -478,7 +478,7 @@ void bnx2x_periodic_stop(void *param) return num; } -static void +static int bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct bnx2x_softc *sc = dev->data->dev_private; @@ -494,6 +494,8 @@ void bnx2x_periodic_stop(void *param) dev_info->rx_desc_lim.nb_max = MAX_RX_AVAIL; dev_info->rx_desc_lim.nb_min = MIN_RX_SIZE_NONTPA; dev_info->tx_desc_lim.nb_max = MAX_TX_AVAIL; + + return 0; } static int diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6685ee7..b521a72 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 */ -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 = 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, dev_info->vmdq_pool_base = 0; dev_info->vmdq_queue_base = 0; + + return 0; } /* 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 = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS; - bnxt_dev_info_get_op(eth_dev, &dev_info); + rc = bnxt_dev_info_get_op(eth_dev, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, "Error during getting ethernet device info\n"); + return rc; + } 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 a1b5014..a994c9a 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2115,7 +2115,7 @@ struct bwg_slave { /* forward declaration */ static int bond_ethdev_configure(struct rte_eth_dev *dev); -static void +static int bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct bond_dev_private *internals = dev->data->dev_private; @@ -2151,7 +2151,7 @@ struct bwg_slave { slave.port_id, strerror(-ret)); - return; + return ret; } if (slave_info.max_rx_queues < max_nb_rx_queues) @@ -2198,6 +2198,8 @@ struct bwg_slave { dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; dev_info->reta_size = internals->reta_size; + + return 0; } static int diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index efb458d..19c2a3c 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_mbuf **rx_pkts, return work_done; } -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 = 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 = cxgbe_desc_lim; device_info->tx_desc_lim = cxgbe_desc_lim; cxgbe_get_speed_caps(pi, &device_info->speed_capa); + + return 0; } 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, uint16_t mtu) int err; uint16_t new_mtu = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; - cxgbe_dev_info_get(eth_dev, &dev_info); + err = cxgbe_dev_info_get(eth_dev, &dev_info); + if (err != 0) + return err; /* 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); - cxgbe_dev_info_get(eth_dev, &dev_info); + err = cxgbe_dev_info_get(eth_dev, &dev_info); + if (err != 0) { + dev_err(adap, "%s: error during getting ethernet device info", + __func__); + return err; + } /* 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_pfvf.h index 03145ce..011ec13 100644 --- a/drivers/net/cxgbe/cxgbe_pfvf.h +++ b/drivers/net/cxgbe/cxgbe_pfvf.h @@ -10,8 +10,8 @@ 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_ethdev.c index 7154fb9..25deadb 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -124,7 +124,7 @@ struct rte_dpaa_xstats_name_off { static struct rte_dpaa_driver rte_dpaa_pmd; -static void +static int dpaa_eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static inline void @@ -330,8 +330,8 @@ static void dpaa_eth_dev_close(struct rte_eth_dev *dev) return 0; } -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 = dev->data->dev_private; @@ -346,13 +346,15 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->max_vmdq_pools = ETH_16_POOLS; dev_info->flow_type_rss_offloads = DPAA_RSS_OFFLOAD_ALL; - if (dpaa_intf->fif->mac_type == fman_mac_1g) + if (dpaa_intf->fif->mac_type == fman_mac_1g) { dev_info->speed_capa = ETH_LINK_SPEED_1G; - else if (dpaa_intf->fif->mac_type == fman_mac_10g) + } else if (dpaa_intf->fif->mac_type == fman_mac_10g) { dev_info->speed_capa = (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; + } dev_info->rx_offload_capa = 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 = DPAA_DEF_RX_BURST_SIZE; dev_info->default_txportconf.burst_size = DPAA_DEF_TX_BURST_SIZE; + + return 0; } 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_ethdev.c index dd6a78f..879bbc1 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -243,7 +243,7 @@ static int dpaa2_dev_link_update(struct rte_eth_dev *dev, return 0; } -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 = dev->data->dev_private; @@ -269,6 +269,8 @@ static int dpaa2_dev_link_update(struct rte_eth_dev *dev, dev_info->max_vfs = 0; dev_info->max_vmdq_pools = ETH_16_POOLS; dev_info->flow_type_rss_offloads = DPAA2_RSS_OFFLOAD_ALL; + + return 0; } static int diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 20b5406..305588f 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 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev) } } -static void +static int eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1107,6 +1107,8 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev) dev_info->default_txportconf.nb_queues = 1; dev_info->default_txportconf.ring_size = 256; dev_info->default_rxportconf.ring_size = 256; + + return 0; } /* return 0 means link status changed, -1 means not changed */ @@ -1776,8 +1778,12 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev) struct e1000_hw *hw; uint32_t frame_size; uint32_t rctl; + int ret; + + ret = eth_em_infos_get(dev, &dev_info); + if (ret != 0) + return ret; - eth_em_infos_get(dev, &dev_info); frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE; diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index fec2b42..6172f9a 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -102,10 +102,10 @@ static int eth_igb_xstats_get_names_by_id(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 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, return 0; } -static void +static int eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -2255,7 +2255,7 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, default: /* Should not happen */ - break; + return -EINVAL; } dev_info->hash_key_size = IGB_HKEY_MAX_INDEX * sizeof(uint32_t); dev_info->reta_size = ETH_RSS_RETA_SIZE_128; @@ -2291,6 +2291,7 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, dev_info->max_mtu = dev_info->max_rx_pktlen - E1000_ETH_OVERHEAD; dev_info->min_mtu = RTE_ETHER_MIN_MTU; + return 0; } static const uint32_t * @@ -2320,7 +2321,7 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, return NULL; } -static void +static int eth_igbvf_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -2345,7 +2346,7 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, break; default: /* Should not happen */ - break; + return -EINVAL; } dev_info->rx_queue_offload_capa = igb_get_rx_queue_offloads_capa(dev); @@ -2377,6 +2378,8 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, dev_info->rx_desc_lim = rx_desc_lim; dev_info->tx_desc_lim = tx_desc_lim; + + return 0; } /* return 0 means link status changed, -1 means not changed */ @@ -2794,6 +2797,7 @@ static int eth_igbvf_xstats_get_names(__rte_unused struct rte_eth_dev *dev, static int eth_igb_rxq_interrupt_setup(struct rte_eth_dev *dev) { uint32_t mask, regval; + int ret; struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); @@ -2802,7 +2806,9 @@ static int eth_igb_rxq_interrupt_setup(struct rte_eth_dev *dev) struct rte_eth_dev_info dev_info; memset(&dev_info, 0, sizeof(dev_info)); - eth_igb_infos_get(dev, &dev_info); + ret = eth_igb_infos_get(dev, &dev_info); + if (ret != 0) + return ret; mask = (0xFFFFFFFF >> (32 - dev_info.max_rx_queues)) << misc_shift; regval = E1000_READ_REG(hw, E1000_EIMS); @@ -3176,9 +3182,12 @@ void igbvf_mbx_process(struct rte_eth_dev *dev) u16 i; struct rte_eth_dev_info dev_info; struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + int ret; memset(&dev_info, 0, sizeof(dev_info)); - eth_igbvf_infos_get(dev, &dev_info); + ret = eth_igbvf_infos_get(dev, &dev_info); + if (ret != 0) + return; /* Clear interrupt mask to stop from interrupts being generated */ igbvf_intr_disable(hw); @@ -4475,6 +4484,7 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on) struct e1000_hw *hw; struct rte_eth_dev_info dev_info; uint32_t frame_size = mtu + E1000_ETH_OVERHEAD; + int ret; hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -4483,7 +4493,9 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on) if (hw->mac.type == e1000_82571) return -ENOTSUP; #endif - eth_igb_infos_get(dev, &dev_info); + ret = eth_igb_infos_get(dev, &dev_info); + if (ret != 0) + return ret; /* 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 7d4a3b2..8fefacf 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -227,8 +227,8 @@ static void ena_queue_stop_all(struct rte_eth_dev *dev, 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 *adapter) } } -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 = RTE_MIN(ENA_PKT_MAX_BUFS, adapter->max_tx_sgl_size); + + return 0; } static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index 6c5501a..dec42b9 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -144,7 +144,7 @@ return 0; } -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 @@ DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_KEEP_CRC | DEV_RX_OFFLOAD_JUMBO_FRAME); + + return 0; } static int diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 06dc671..90fdeda 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; } -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 = pmd_priv(eth_dev); @@ -555,6 +555,8 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev, .nb_queues = ENIC_DEFAULT_TX_RINGS, }; device_info->speed_capa = speed_capa_from_pci_id(eth_dev); + + return 0; } static const uint32_t *enicpmd_dev_supported_ptypes_get(struct rte_eth_dev *dev) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index b3df626..cc14bc2 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -860,7 +860,7 @@ * 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 @@ ret = rte_eth_dev_info_get(PORT_ID(sdev), &sub_info); if (ret != 0) - return; + return ret; fs_dev_merge_info(infos, &sub_info); } + + return 0; } static const uint32_t * diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index db4d721..8cb7337 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -60,8 +60,8 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev *dev, static int fm10k_check_ftag(struct rte_devargs *devargs); static int fm10k_link_update(struct rte_eth_dev *dev, int wait_to_complete); -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 @@ static int fm10k_xstats_get_names(__rte_unused struct rte_eth_dev *dev, fm10k_rebind_hw_stats(hw, hw_stats); } -static void +static int fm10k_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -1438,6 +1438,8 @@ static int fm10k_xstats_get_names(__rte_unused struct rte_eth_dev *dev, dev_info->speed_capa = 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; } #ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 044af90..17a3625 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 *info) { struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); @@ -697,6 +697,8 @@ static void hinic_get_speed_capa(struct rte_eth_dev *dev, uint32_t *speed_capa) info->flow_type_rss_offloads = HINIC_RSS_OFFLOAD_ALL; info->rx_desc_lim = hinic_rx_desc_lim; info->tx_desc_lim = hinic_tx_desc_lim; + + return 0; } static int hinic_config_rx_mode(struct hinic_nic_dev *nic_dev, u32 rx_mode_ctrl) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4e40b7a..390cb21 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_dev *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 @@ static int i40e_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, return false; } -static void +static int i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -3620,6 +3620,8 @@ static int i40e_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, } dev_info->default_rxportconf.burst_size = 32; dev_info->default_txportconf.burst_size = 32; + + return 0; } static int diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index c77b30c..eca4185 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 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) vf->promisc_multicast_enabled = FALSE; } -static void +static int i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); @@ -2292,6 +2292,8 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) .nb_min = I40E_MIN_RING_DESC, .nb_align = I40E_ALIGN_RING_DESC, }; + + return 0; } static int diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c index 633dca6..652f0ac 100644 --- a/drivers/net/i40e/i40e_vf_representor.c +++ b/drivers/net/i40e/i40e_vf_representor.c @@ -22,7 +22,7 @@ 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 @@ representor->adapter->eth_dev->device->name; dev_info->switch_info.domain_id = representor->switch_domain_id; dev_info->switch_info.port_id = representor->vf_id; + + return 0; } static int diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 8f39073..99b1f43 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -37,7 +37,7 @@ 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 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, hw->adapter_stopped = 1; } -static void +static int iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); @@ -556,6 +556,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, .nb_min = IAVF_MIN_RING_DESC, .nb_align = IAVF_ALIGN_RING_DESC, }; + + return 0; } static const uint32_t * diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 63997fd..9d0e339 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -36,8 +36,8 @@ 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 @@ static int ice_init_rss(struct ice_pf *pf) return 0; } -static void +static int ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -2225,6 +2225,8 @@ static int ice_init_rss(struct ice_pf *pf) dev_info->default_txportconf.nb_queues = 1; dev_info->default_rxportconf.ring_size = ICE_BUF_SIZE_MIN; dev_info->default_txportconf.ring_size = ICE_BUF_SIZE_MIN; + + return 0; } static inline int diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index 8300cc3..476d5e5 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -40,7 +40,7 @@ static int ipn3ke_rpst_link_check(struct ipn3ke_rpst *rpst); -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 @@ dev_info->switch_info.name = ethdev->device->name; dev_info->switch_info.domain_id = rpst->switch_domain_id; dev_info->switch_info.port_id = rpst->port_id; + + return 0; } static int diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 03fc1f7..b4547ed 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_version, 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); static int ixgbe_vlan_filter_set(struct rte_eth_dev *dev, @@ -3777,7 +3777,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, return 0; } -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 = RTE_ETH_DEV_TO_PCI(dev); @@ -3861,6 +3861,8 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, dev_info->default_txportconf.nb_queues = 1; dev_info->default_rxportconf.ring_size = 256; dev_info->default_txportconf.ring_size = 256; + + return 0; } static const uint32_t * @@ -3902,7 +3904,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, return NULL; } -static void +static int ixgbevf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -3953,6 +3955,8 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, dev_info->rx_desc_lim = rx_desc_lim; dev_info->tx_desc_lim = tx_desc_lim; + + return 0; } static int @@ -5018,8 +5022,11 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, struct rte_eth_dev_info dev_info; uint32_t frame_size = mtu + IXGBE_ETH_OVERHEAD; struct rte_eth_dev_data *dev_data = dev->data; + int ret; - ixgbe_dev_info_get(dev, &dev_info); + ret = ixgbe_dev_info_get(dev, &dev_info); + if (ret != 0) + return ret; /* 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 2c01f6e..dbbef29 100644 --- a/drivers/net/ixgbe/ixgbe_vf_representor.c +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c @@ -34,7 +34,7 @@ representor->vf_id, mac_addr); } -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 @@ representor->pf_ethdev->device->name; dev_info->switch_info.domain_id = representor->switch_domain_id; dev_info->switch_info.port_id = representor->vf_id; + + return 0; } 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 515c0aa..5e1623d 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -200,7 +200,7 @@ struct pmd_internals { return 0; } -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 @@ struct pmd_internals { dev_info->max_rx_queues = KNI_MAX_QUEUE_PER_PORT; dev_info->max_tx_queues = KNI_MAX_QUEUE_PER_PORT; dev_info->min_rx_bufsize = 0; + + return 0; } static int diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index c25dab0..d97e357 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -367,7 +367,7 @@ struct rte_lio_xstats_name_off { } } -static void +static int lio_dev_info_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *devinfo) { @@ -393,6 +393,7 @@ struct rte_lio_xstats_name_off { devinfo->speed_capa = ETH_LINK_SPEED_10G; lio_dev_err(lio_dev, "Unknown CN23XX subsystem device id. Setting 10G as default link speed.\n"); + return -EINVAL; } devinfo->max_rx_queues = lio_dev->max_rx_queues; @@ -423,6 +424,7 @@ struct rte_lio_xstats_name_off { ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_IPV6_EX | ETH_RSS_IPV6_TCP_EX); + return 0; } static int diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index a59f809..0d4360e 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -164,7 +164,7 @@ struct mp_region_msg { return memif_connect(dev); } -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 = 1; @@ -172,6 +172,8 @@ struct mp_region_msg { dev_info->max_rx_queues = ETH_MEMIF_MAX_NUM_Q_PAIRS; dev_info->max_tx_queues = ETH_MEMIF_MAX_NUM_Q_PAIRS; dev_info->min_rx_bufsize = 0; + + return 0; } static memif_ring_t * diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index 9823577..7730b53 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -219,8 +219,8 @@ int mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *list, 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_ethdev.c index 5d28c01..623ebd8 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -611,7 +611,7 @@ enum rxmode_toggle { * @param[out] info * Info structure output buffer. */ -void +int mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) { struct mlx4_priv *priv = dev->data->dev_private; @@ -645,6 +645,8 @@ enum rxmode_toggle { ETH_LINK_SPEED_40G | ETH_LINK_SPEED_56G; info->flow_type_rss_offloads = mlx4_conv_rss_types(priv, 0, 1); + + return 0; } /** diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index f559f83..cd08d00 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -685,7 +685,7 @@ int32_t mlx5_release_dbr(struct rte_eth_dev *dev, uint32_t umem_id, 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_ethdev.c index 33a32fc..766e194 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -542,7 +542,7 @@ struct ethtool_link_settings { * @param[out] info * Info structure output buffer. */ -void +int mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) { struct mlx5_priv *priv = dev->data->dev_private; @@ -600,6 +600,8 @@ struct ethtool_link_settings { break; } } + + return 0; } /** diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index a8def8f..3ba0ac7 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -153,7 +153,7 @@ struct mvneta_ifnames { * @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 @@ struct mvneta_ifnames { info->default_txconf.offloads = 0; info->max_rx_pktlen = MVNETA_PKT_SIZE_MAX; + + return 0; } /** diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 810a703..345c244 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1422,7 +1422,7 @@ static uint16_t mrvl_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, * @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 @@ static uint16_t mrvl_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, info->default_rxconf.rx_drop_en = 1; info->max_rx_pktlen = MRVL_PKT_SIZE_MAX; + + return 0; } /** diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 2a90d67..7353211 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -238,10 +238,11 @@ static int hn_parse_args(const struct rte_eth_dev *dev) return rte_eth_linkstatus_set(dev, &link); } -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 = dev->data->dev_private; + int rc; dev_info->speed_capa = ETH_LINK_SPEED_10G; dev_info->min_rx_bufsize = 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 = hv->max_queues; dev_info->max_tx_queues = hv->max_queues; - hn_rndis_get_offload(hv, dev_info); - hn_vf_info_get(hv, dev_info); + rc = hn_rndis_get_offload(hv, dev_info); + if (rc != 0) + return rc; + + rc = hn_vf_info_get(hv, dev_info); + if (rc != 0) + return rc; + + return 0; } 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 f4093d4..b039ab6 100644 --- a/drivers/net/nfb/nfb_ethdev.c +++ b/drivers/net/nfb/nfb_ethdev.c @@ -188,7 +188,7 @@ * @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 @@ dev_info->max_rx_queues = dev->data->nb_rx_queues; dev_info->max_tx_queues = dev->data->nb_tx_queues; dev_info->speed_capa = ETH_LINK_SPEED_100G; + + return 0; } /** diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index f1a3ef2..3d5b99c 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -81,8 +81,8 @@ 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_complete); static void nfp_net_promisc_enable(struct rte_eth_dev *dev); @@ -1204,7 +1204,7 @@ enum nfp_qcp_ptr { nn_cfg_readq(hw, NFP_NET_CFG_STATS_RX_DISCARDS); } -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 @@ enum nfp_qcp_ptr { dev_info->speed_capa = 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; } static const uint32_t * diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 0c60d24..aec0cab 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -259,14 +259,14 @@ struct pmd_internals { return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct pmd_internals *internals; if ((dev == NULL) || (dev_info == NULL)) - return; + return -EINVAL; internals = dev->data->dev_private; dev_info->max_mac_addrs = 1; @@ -276,6 +276,8 @@ struct pmd_internals { dev_info->min_rx_bufsize = 0; dev_info->reta_size = internals->reta_size; dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads; + + return 0; } static int diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 27eed47..1faa7b7 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -569,7 +569,7 @@ enum octeontx_link_speed { return ret; } -static void +static int octeontx_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -600,6 +600,8 @@ enum octeontx_link_speed { dev_info->rx_offload_capa = OCTEONTX_RX_OFFLOADS; dev_info->tx_offload_capa = OCTEONTX_TX_OFFLOADS; + + return 0; } static void diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 7b15d6b..5de0a1d 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -357,8 +357,8 @@ struct otx2_eth_rxq { } /* 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/octeontx2/otx2_ethdev_ops.c index 7c6532b..024c295 100644 --- a/drivers/net/octeontx2/otx2_ethdev_ops.c +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c @@ -403,7 +403,7 @@ return 0; } -void +int otx2_nix_info_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *devinfo) { struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); @@ -467,4 +467,6 @@ devinfo->dev_capa = 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_pcap.c index 5489010..50a0655 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -652,7 +652,7 @@ struct pmd_devargs_all { return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -664,6 +664,8 @@ struct pmd_devargs_all { dev_info->max_rx_queues = dev->data->nb_rx_queues; dev_info->max_tx_queues = dev->data->nb_tx_queues; dev_info->min_rx_bufsize = 0; + + return 0; } static int diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 528b33e..9eb57fd 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1253,7 +1253,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) .nb_mtu_seg_max = ETH_TX_MAX_BDS_PER_NON_LSO_PACKET }; -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 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G) speed_cap |= ETH_LINK_SPEED_100G; dev_info->speed_capa = speed_cap; + + return 0; } /* return 0 means link status changed, -1 means not changed */ @@ -2228,7 +2230,11 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) int i, rc; PMD_INIT_FUNC_TRACE(edev); - qede_dev_info_get(dev, &dev_info); + rc = qede_dev_info_get(dev, &dev_info); + if (rc != 0) { + DP_ERR(edev, "Error during getting ethernet device info\n"); + return rc; + } max_rx_pkt_len = mtu + QEDE_MAX_ETHER_HDR_LEN; frame_size = 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_ring.c index 634da63..6862460 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -151,7 +151,7 @@ struct pmd_internals { } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -162,6 +162,8 @@ struct pmd_internals { dev_info->max_rx_queues = (uint16_t)internals->max_rx_queues; dev_info->max_tx_queues = (uint16_t)internals->max_tx_queues; dev_info->min_rx_bufsize = 0; + + return 0; } static int diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 1f78a3d..013b6bb 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -86,7 +86,7 @@ return 0; } -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 = sfc_adapter_priv_by_eth_dev(dev); @@ -184,6 +184,8 @@ dev_info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP | RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP; + + return 0; } static const uint32_t * diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index e3ad241..1172377 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -86,13 +86,15 @@ rte_log(RTE_LOG_ ## level, pmd_softnic_logtype, \ "%s(): " fmt "\n", __func__, ##args) -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 = UINT32_MAX; dev_info->max_rx_queues = UINT16_MAX; dev_info->max_tx_queues = UINT16_MAX; + + return 0; } static int diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 99d5ca5..ca066a3 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1044,7 +1044,7 @@ struct szedata2_tx_queue { return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -1061,6 +1061,8 @@ struct szedata2_tx_queue { dev_info->rx_queue_offload_capa = 0; dev_info->tx_queue_offload_capa = 0; dev_info->speed_capa = ETH_LINK_SPEED_100G; + + return 0; } static int diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 64bd049..f85458c 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -915,7 +915,7 @@ struct ipc_queues { return capa; } -static void +static int tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct pmd_internals *internals = dev->data->dev_private; @@ -939,6 +939,8 @@ struct ipc_queues { * functions together and not in partial combinations */ dev_info->flow_type_rss_offloads = ~TAP_RSS_HF_MASK; + + return 0; } static int diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 56769ef..f3ba07a 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -1393,7 +1393,7 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, return 0; } -static void +static int nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct nicvf *nic = nicvf_pmd_priv(dev); @@ -1440,6 +1440,8 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM, }; + + return 0; } static nicvf_iova_addr_t diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index a4892d7..74cc736 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1054,7 +1054,7 @@ struct vhost_xstats_name_off { return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -1063,7 +1063,7 @@ struct vhost_xstats_name_off { internal = dev->data->dev_private; if (internal == NULL) { VHOST_LOG(ERR, "Invalid device specified\n"); - return; + return -ENODEV; } dev_info->max_mac_addrs = 1; @@ -1075,6 +1075,8 @@ struct vhost_xstats_name_off { dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS | DEV_TX_OFFLOAD_VLAN_INSERT; dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; + + return 0; } static int diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index f96588b..8fe9dce 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -45,7 +45,7 @@ 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 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev) return 0; } -static void +static int virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { uint64_t tso_mask, host_features; @@ -2436,6 +2436,8 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev) (1ULL << VIRTIO_NET_F_HOST_TSO6); if ((host_features & tso_mask) == tso_mask) dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO; + + return 0; } /* diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 57feb37..fa50ae0 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -84,8 +84,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, @@ -1151,7 +1151,7 @@ static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev) } } -static void +static int vmxnet3_dev_info_get(struct rte_eth_dev *dev __rte_unused, struct rte_eth_dev_info *dev_info) { @@ -1188,6 +1188,8 @@ static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev) dev_info->rx_queue_offload_capa = 0; dev_info->tx_offload_capa = VMXNET3_TX_OFFLOAD_CAP; dev_info->tx_queue_offload_capa = 0; + + return 0; } static const uint32_t * diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 2922d5b..2394b32 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 rte_eth_dev *dev, uint8_t is_rx); /**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */ -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. */ typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev); -- 1.8.3.1