[v3,15/54] net/netvsc: check status of getting ethdev info

Message ID 1567755066-31389-16-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: change rte_eth_dev_info_get() return value to int |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Andrew Rybchenko Sept. 6, 2019, 7:30 a.m. UTC
  From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

rte_eth_dev_info_get() return value was changed from void to int,
so this patch modify rte_eth_dev_info_get() usage across
net/netvsc according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/netvsc/hn_var.h |  2 +-
 drivers/net/netvsc/hn_vf.c  | 15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
index 3f5e8dfa74..e0ebe4e1c8 100644
--- a/drivers/net/netvsc/hn_var.h
+++ b/drivers/net/netvsc/hn_var.h
@@ -201,7 +201,7 @@  hn_get_vf_dev(const struct hn_data *hv)
 		return &rte_eth_devices[vf_port];
 }
 
-void	hn_vf_info_get(struct hn_data *hv,
+int	hn_vf_info_get(struct hn_data *hv,
 		       struct rte_eth_dev_info *info);
 int	hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv);
 int	hn_vf_configure(struct rte_eth_dev *dev,
diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
index 03f855b945..d53d27bb73 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -172,12 +172,15 @@  hn_nvs_handle_vfassoc(struct rte_eth_dev *dev,
  * use the default config of the VF
  * and the minimum number of queues and buffer sizes.
  */
-static void hn_vf_info_merge(struct rte_eth_dev *vf_dev,
+static int hn_vf_info_merge(struct rte_eth_dev *vf_dev,
 			     struct rte_eth_dev_info *info)
 {
 	struct rte_eth_dev_info vf_info;
+	int ret;
 
-	rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
+	ret = rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
+	if (ret != 0)
+		return ret;
 
 	info->speed_capa = vf_info.speed_capa;
 	info->default_rxportconf = vf_info.default_rxportconf;
@@ -198,17 +201,21 @@  static void hn_vf_info_merge(struct rte_eth_dev *vf_dev,
 				       info->min_rx_bufsize);
 	info->max_rx_pktlen  = RTE_MAX(vf_info.max_rx_pktlen,
 				       info->max_rx_pktlen);
+
+	return 0;
 }
 
-void hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info)
+int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info)
 {
 	struct rte_eth_dev *vf_dev;
+	int ret = 0;
 
 	rte_spinlock_lock(&hv->vf_lock);
 	vf_dev = hn_get_vf_dev(hv);
 	if (vf_dev)
-		hn_vf_info_merge(vf_dev, info);
+		ret = hn_vf_info_merge(vf_dev, info);
 	rte_spinlock_unlock(&hv->vf_lock);
+	return ret;
 }
 
 int hn_vf_link_update(struct rte_eth_dev *dev,