All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
@ 2019-08-27 14:25 Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 01/51] " Andrew Rybchenko
                   ` (54 more replies)
  0 siblings, 55 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit; +Cc: dev

It is the first patch series to get rid of void returning functions
in ethdev in accordance with deprecation notice [1].

The patch to change dev_infos_get callback prototype to allow driver
return error will follow.

[1] https://patches.dpdk.org/patch/56969/

Ivan Ilchenko (51):
  ethdev: change rte_eth_dev_info_get() return value to int
  app/testpmd: check status of getting ethdev info
  app/eventdev: check status of getting ethdev info
  kni: check status of getting ethdev info
  latency: check status of getting ethdev info
  pdump: check status of getting ethdev info
  ring: check status of getting ethdev info
  app/procinfo: check status of getting ethdev info
  app/test: check status of getting ethdev info in bonding
  app/test: check ethdev info get result in event Rx adapter
  net/bnxt: check status of getting ethdev info
  net/bonding: check status of getting ethdev info
  net/netvsc: check status of getting ethdev info
  net/softnic: check status of getting ethdev info
  examples/rxtx_callbacks: check status of getting ethdev info
  examples/l3fwd: check status of getting ethdev info
  examples/qos_meter: check status of getting ethdev info
  examples/ip_frag: check status of getting ethdev info
  examples/performance-thread: check dev info get result
  examples/vmdq: check status of getting ethdev info
  examples/distributor: check status of getting ethdev info
  examples/l3fwd-acl: check status of getting ethdev info
  examples/vm_power: check status of getting ethdev info
  examples/qos_sched: check status of getting ethdev info
  examples/flow_filtering: check status of getting ethdev info
  examples/l3fwd-power: check status of getting ethdev info
  examples/l2fwd: check status of getting ethdev info
  examples/skeleton: check status of getting ethdev info
  examples/vmdq_dcb: check status of getting ethdev info
  examples/ipv4_multicast: check status of getting ethdev info
  examples/l2fwd-jobstats: check status of getting ethdev info
  examples/bond: check status of getting ethdev info
  examples/eventdev: check status of getting ethdev info
  examples/ip_reassembly: check status of getting ethdev info
  examples/vhost: check status of getting ethdev info
  examples/ptpclient: check status of getting ethdev info
  examples/link_status_interrupt: check dev info get result
  examples/tep_termination: check dev info get result
  examples/server_node_efd: check dev info get result
  examples/flow_classify: check status of getting ethdev info
  examples/packet_ordering: check dev info get result
  examples/l2fwd-crypto: check status of getting ethdev info
  examples/multi_process: check status of getting ethdev info
  examples/ipsec-secgw: check status of getting ethdev info
  examples/netmap_compat: check status of getting ethdev info
  examples/l2fwd-keepalive: check dev info get result
  examples/ip_pipeline: check status of getting ethdev info
  examples/load_balancer: check status of getting ethdev info
  examples/kni: check status of getting ethdev info
  examples/ethtool: check status of getting ethdev info
  examples/exception_path: check status of getting ethdev info

 app/proc-info/main.c                            |  15 ++-
 app/test-eventdev/test_perf_common.c            |   8 +-
 app/test-eventdev/test_pipeline_common.c        |   9 +-
 app/test-pmd/cmdline.c                          | 119 +++++++++++++++++++----
 app/test-pmd/cmdline_flow.c                     |   5 +-
 app/test-pmd/config.c                           |  78 ++++++++++++---
 app/test-pmd/parameters.c                       |   8 +-
 app/test-pmd/testpmd.c                          |  30 ++++--
 app/test-pmd/testpmd.h                          |   3 +
 app/test-pmd/util.c                             |  28 +++++-
 app/test/test_event_eth_rx_adapter.c            |   4 +-
 app/test/test_kni.c                             |  27 +++++-
 app/test/test_link_bonding_rssconf.c            |  33 ++++++-
 app/test/test_pmd_ring.c                        |   8 +-
 doc/guides/rel_notes/deprecation.rst            |   1 -
 doc/guides/rel_notes/release_19_11.rst          |   5 +-
 drivers/net/bnxt/rte_pmd_bnxt.c                 | 122 +++++++++++++++++++++---
 drivers/net/bonding/rte_eth_bond_api.c          |  10 +-
 drivers/net/bonding/rte_eth_bond_pmd.c          |  36 ++++++-
 drivers/net/netvsc/hn_vf.c                      |  10 +-
 drivers/net/softnic/rte_eth_softnic_link.c      |   5 +-
 examples/bond/main.c                            |  14 ++-
 examples/distributor/main.c                     |   8 +-
 examples/ethtool/ethtool-app/main.c             |   8 +-
 examples/ethtool/lib/rte_ethtool.c              |  21 +++-
 examples/eventdev_pipeline/main.c               |   8 +-
 examples/exception_path/main.c                  |   7 +-
 examples/flow_classify/flow_classify.c          |   8 +-
 examples/flow_filtering/main.c                  |   7 +-
 examples/ip_fragmentation/main.c                |  14 ++-
 examples/ip_pipeline/kni.c                      |   5 +-
 examples/ip_pipeline/link.c                     |   3 +-
 examples/ip_reassembly/main.c                   |   7 +-
 examples/ipsec-secgw/ipsec-secgw.c              |   6 +-
 examples/ipsec-secgw/ipsec.c                    |   9 +-
 examples/ipsec-secgw/sa.c                       |  10 +-
 examples/ipv4_multicast/main.c                  |   7 +-
 examples/kni/main.c                             |  26 ++++-
 examples/l2fwd-crypto/main.c                    |   9 +-
 examples/l2fwd-jobstats/main.c                  |   8 +-
 examples/l2fwd-keepalive/main.c                 |   8 +-
 examples/l2fwd/main.c                           |   8 +-
 examples/l3fwd-acl/main.c                       |  22 ++++-
 examples/l3fwd-power/main.c                     |  22 ++++-
 examples/l3fwd/main.c                           |  14 ++-
 examples/link_status_interrupt/main.c           |   8 +-
 examples/load_balancer/init.c                   |   7 +-
 examples/multi_process/symmetric_mp/main.c      |   8 +-
 examples/netmap_compat/lib/compat_netmap.c      |   9 +-
 examples/packet_ordering/main.c                 |   8 +-
 examples/performance-thread/l3fwd-thread/main.c |  15 ++-
 examples/ptpclient/ptpclient.c                  |   9 +-
 examples/qos_meter/main.c                       |  16 +++-
 examples/qos_sched/init.c                       |   8 +-
 examples/rxtx_callbacks/main.c                  |   9 +-
 examples/server_node_efd/server/init.c          |   5 +-
 examples/skeleton/basicfwd.c                    |   8 +-
 examples/tep_termination/vxlan_setup.c          |   6 +-
 examples/vhost/main.c                           |   9 +-
 examples/vm_power_manager/main.c                |   8 +-
 examples/vmdq/main.c                            |  16 +++-
 examples/vmdq_dcb/main.c                        |  18 +++-
 lib/librte_ethdev/rte_ethdev.c                  |  71 ++++++++++----
 lib/librte_ethdev/rte_ethdev.h                  |   6 +-
 lib/librte_latencystats/rte_latencystats.c      |  23 ++++-
 lib/librte_pdump/rte_pdump.c                    |   9 +-
 66 files changed, 940 insertions(+), 159 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-28  9:51   ` Jan Viktorin
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info Andrew Rybchenko
                   ` (53 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

Change rte_eth_dev_info_get() return value from void to int and return
negative errno values in case of error conditions.
Modify rte_eth_dev_info_get() usage across the ethdev according
to new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/rel_notes/deprecation.rst   |  1 -
 doc/guides/rel_notes/release_19_11.rst |  5 ++-
 lib/librte_ethdev/rte_ethdev.c         | 71 ++++++++++++++++++++++++----------
 lib/librte_ethdev/rte_ethdev.h         |  6 ++-
 4 files changed, 60 insertions(+), 23 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 0ee8533..cbb4c34 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -88,7 +88,6 @@ Deprecation Notices
   negative errno values to indicate various error conditions (e.g.
   invalid port ID, unsupported operation, failed operation):
 
-  - ``rte_eth_dev_info_get``
   - ``rte_eth_promiscuous_enable`` and ``rte_eth_promiscuous_disable``
   - ``rte_eth_allmulticast_enable`` and ``rte_eth_allmulticast_disable``
   - ``rte_eth_link_get`` and ``rte_eth_link_get_nowait``
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8490d89..5424b6a 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -85,6 +85,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to
+  ``int`` to provide a way to report various error conditions.
+
 
 ABI Changes
 -----------
@@ -136,7 +139,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_distributor.so.1
      librte_eal.so.11
      librte_efd.so.1
-     librte_ethdev.so.12
+   + librte_ethdev.so.13
      librte_eventdev.so.7
      librte_flow_classify.so.1
      librte_gro.so.1
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..4b6cbe2 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1125,7 +1125,6 @@ struct rte_eth_dev *
 
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);
 
 	if (dev->data->dev_started) {
@@ -1144,7 +1143,9 @@ struct rte_eth_dev *
 	 */
 	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* If number of queues specified by application for both Rx and Tx is
 	 * zero, use driver preferred values. This cannot be done individually
@@ -1406,6 +1407,7 @@ struct rte_eth_dev *
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	int diag;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1420,7 +1422,9 @@ struct rte_eth_dev *
 		return 0;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* Lets restore MAC now if device does not support live change */
 	if (*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)
@@ -1584,7 +1588,6 @@ struct rte_eth_dev *
 		return -EINVAL;
 	}
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_setup, -ENOTSUP);
 
 	/*
@@ -1592,7 +1595,10 @@ struct rte_eth_dev *
 	 * This value must be provided in the private data of the memory pool.
 	 * First check that the memory pool has a valid private data.
 	 */
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	if (mp->private_data_size < sizeof(struct rte_pktmbuf_pool_private)) {
 		RTE_ETHDEV_LOG(ERR, "%s private_data_size %d < %d\n",
 			mp->name, (int)mp->private_data_size,
@@ -1703,6 +1709,7 @@ struct rte_eth_dev *
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_txconf local_conf;
 	void **txq;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1712,10 +1719,11 @@ struct rte_eth_dev *
 		return -EINVAL;
 	}
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_queue_setup, -ENOTSUP);
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* Use default specified by driver, if nb_tx_desc is zero */
 	if (nb_tx_desc == 0) {
@@ -2540,7 +2548,7 @@ struct rte_eth_dev *
 							fw_version, fw_size));
 }
 
-void
+int
 rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 {
 	struct rte_eth_dev *dev;
@@ -2558,7 +2566,7 @@ struct rte_eth_dev *
 	 */
 	memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
 	dev_info->rx_desc_lim = lim;
@@ -2567,13 +2575,15 @@ struct rte_eth_dev *
 	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
 	dev_info->max_mtu = UINT16_MAX;
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
 	dev_info->driver_name = dev->device->driver->name;
 	dev_info->nb_rx_queues = dev->data->nb_rx_queues;
 	dev_info->nb_tx_queues = dev->data->nb_tx_queues;
 
 	dev_info->dev_flags = &dev->data->dev_flags;
+
+	return 0;
 }
 
 int
@@ -2643,7 +2653,10 @@ struct rte_eth_dev *
 	 * which relies on dev->dev_ops->dev_infos_get.
 	 */
 	if (*dev->dev_ops->dev_infos_get != NULL) {
-		rte_eth_dev_info_get(port_id, &dev_info);
+		ret = rte_eth_dev_info_get(port_id, &dev_info);
+		if (ret != 0)
+			return ret;
+
 		if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu)
 			return -EINVAL;
 	}
@@ -2991,10 +3004,15 @@ struct rte_eth_dev *
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
 		RTE_ETHDEV_LOG(ERR,
@@ -3100,9 +3118,13 @@ struct rte_eth_dev *
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	unsigned i;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	for (i = 0; i < dev_info.max_mac_addrs; i++)
 		if (memcmp(addr, &dev->data->mac_addrs[i],
@@ -3233,8 +3255,14 @@ struct rte_eth_dev *
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	unsigned i;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	if (!dev->data->hash_mac_addrs)
 		return -1;
 
@@ -3319,11 +3347,15 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_link link;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
 	link = dev->data->dev_link;
 
 	if (queue_idx > dev_info.max_tx_queues) {
@@ -4363,15 +4395,14 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
 				 uint16_t *nb_rx_desc,
 				 uint16_t *nb_tx_desc)
 {
-	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
-	dev = &rte_eth_devices[port_id];
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
-
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	if (nb_rx_desc != NULL)
 		rte_eth_dev_adjust_nb_desc(nb_rx_desc, &dev_info.rx_desc_lim);
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index dc6596b..09c278d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2366,8 +2366,12 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
  * @param dev_info
  *   A pointer to a structure of type *rte_eth_dev_info* to be filled with
  *   the contextual information of the Ethernet device.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if support for dev_infos_get() does not exist for the device.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
+int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
 
 /**
  * Retrieve the firmware version of a device.
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 01/51] " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-09-02 12:40   ` Ferruh Yigit
  2019-09-30  8:43   ` Zhao1, Wei
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 03/51] app/eventdev: " Andrew Rybchenko
                   ` (52 subsequent siblings)
  54 siblings, 2 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Adrien Mazarguil
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

Add eth_dev_info_get_print_err() which is a wrapper for
rte_eth_dev_info_get() printing error if rte_eth_dev_info_get()
fails and returning its status code.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-pmd/cmdline.c      | 119 ++++++++++++++++++++++++++++++++++++--------
 app/test-pmd/cmdline_flow.c |   5 +-
 app/test-pmd/config.c       |  78 ++++++++++++++++++++++++-----
 app/test-pmd/parameters.c   |   8 ++-
 app/test-pmd/testpmd.c      |  30 ++++++++---
 app/test-pmd/testpmd.h      |   3 ++
 app/test-pmd/util.c         |  28 ++++++++++-
 7 files changed, 228 insertions(+), 43 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 56783aa..d4ab143 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2273,6 +2273,7 @@ struct cmd_config_rss {
 	int all_updated = 1;
 	int diag;
 	uint16_t i;
+	int ret;
 
 	if (!strcmp(res->value, "all"))
 		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
@@ -2312,7 +2313,10 @@ struct cmd_config_rss {
 	RTE_ETH_FOREACH_DEV(i) {
 		struct rte_eth_rss_conf local_rss_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = eth_dev_info_get_print_err(i, &dev_info);
+		if (ret != 0)
+			return;
+
 		if (use_default)
 			rss_conf.rss_hf = dev_info.flow_type_rss_offloads;
 
@@ -2410,9 +2414,13 @@ struct cmd_config_rss_hash_key {
 	struct rte_eth_dev_info dev_info;
 	uint8_t hash_key_size;
 	uint32_t key_len;
+	int ret;
 
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(hash_key))
 		hash_key_size = dev_info.hash_key_size;
@@ -2945,7 +2953,10 @@ struct cmd_config_rss_reta {
 	struct cmd_config_rss_reta *res = parsed_result;
 
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.reta_size == 0) {
 		printf("Redirection table size is 0 which is "
 					"invalid for RSS\n");
@@ -3063,9 +3074,13 @@ struct cmd_showport_reta {
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct rte_eth_dev_info dev_info;
 	uint16_t max_reta_size;
+	int ret;
 
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
 	if (res->size == 0 || res->size > max_reta_size) {
 		printf("Invalid redirection table size: %u (1-%u)\n",
@@ -3292,6 +3307,7 @@ struct cmd_config_burst {
 	struct cmd_config_burst *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
 	uint16_t rec_nb_pkts;
+	int ret;
 
 	if (!all_ports_stopped()) {
 		printf("Please stop all ports first\n");
@@ -3305,7 +3321,10 @@ struct cmd_config_burst {
 			 * size for all ports, so assume all ports are the same
 			 * NIC model and use the values from Port 0.
 			 */
-			rte_eth_dev_info_get(0, &dev_info);
+			ret = eth_dev_info_get_print_err(0, &dev_info);
+			if (ret != 0)
+				return;
+
 			rec_nb_pkts = dev_info.default_rxportconf.burst_size;
 
 			if (rec_nb_pkts == 0) {
@@ -4375,6 +4394,7 @@ struct cmd_csum_result {
 {
 	struct rte_eth_dev_info dev_info;
 	uint64_t tx_offloads;
+	int ret;
 
 	tx_offloads = ports[port_id].dev_conf.txmode.offloads;
 	printf("Parse tunnel is %s\n",
@@ -4393,7 +4413,10 @@ struct cmd_csum_result {
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) {
 		printf("Warning: hardware IP checksum enabled but not "
@@ -4447,6 +4470,7 @@ struct cmd_csum_result {
 	int hw = 0;
 	uint64_t csum_offloads = 0;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(res->port_id, ENABLED_WARN)) {
 		printf("invalid port %d\n", res->port_id);
@@ -4457,7 +4481,10 @@ struct cmd_csum_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (!strcmp(res->mode, "set")) {
 
 		if (!strcmp(res->hwsw, "hw"))
@@ -4645,6 +4672,7 @@ struct cmd_tso_set_result {
 {
 	struct cmd_tso_set_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
 		return;
@@ -4656,7 +4684,10 @@ struct cmd_tso_set_result {
 	if (!strcmp(res->mode, "set"))
 		ports[res->port_id].tso_segsz = res->tso_segsz;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((ports[res->port_id].tso_segsz != 0) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {
 		printf("Error: TSO is not supported by port %d\n",
@@ -4677,7 +4708,10 @@ struct cmd_tso_set_result {
 	cmd_config_queue_tx_offloads(&ports[res->port_id]);
 
 	/* display warnings if configuration is not supported by the NIC */
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((ports[res->port_id].tso_segsz != 0) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {
 		printf("Warning: TSO enabled but not "
@@ -4746,7 +4780,8 @@ struct cmd_tunnel_tso_set_result {
 {
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	eth_dev_info_get_print_err(port_id, &dev_info);
+
 	if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO))
 		printf("Warning: VXLAN TUNNEL TSO not supported therefore "
 		       "not enabled for port %d\n", port_id);
@@ -11184,7 +11219,11 @@ struct cmd_flow_director_result {
 			struct rte_eth_dev_info dev_info;
 
 			memset(&dev_info, 0, sizeof(dev_info));
-			rte_eth_dev_info_get(res->port_id, &dev_info);
+			ret = eth_dev_info_get_print_err(res->port_id,
+						&dev_info);
+			if (ret != 0)
+				return;
+
 			errno = 0;
 			vf_id = strtoul(res->pf_vf + 2, &end, 10);
 			if (errno != 0 || *end != '\0' ||
@@ -14176,7 +14215,10 @@ struct cmd_macsec_offload_on_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
 #ifdef RTE_LIBRTE_IXGBE_PMD
 		ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp);
@@ -14270,7 +14312,10 @@ struct cmd_macsec_offload_off_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
 #ifdef RTE_LIBRTE_IXGBE_PMD
 		ret = rte_pmd_ixgbe_macsec_disable(port_id);
@@ -17980,8 +18025,12 @@ struct cmd_rx_offload_get_capa_result {
 	portid_t port_id = res->port_id;
 	uint64_t queue_offloads;
 	uint64_t port_offloads;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	queue_offloads = dev_info.rx_queue_offload_capa;
 	port_offloads = dev_info.rx_offload_capa ^ queue_offloads;
 
@@ -18053,6 +18102,7 @@ struct cmd_rx_offload_get_configuration_result {
 	uint64_t queue_offloads;
 	uint16_t nb_rx_queues;
 	int q;
+	int ret;
 
 	printf("Rx Offloading Configuration of port %d :\n", port_id);
 
@@ -18061,7 +18111,10 @@ struct cmd_rx_offload_get_configuration_result {
 	print_rx_offloads(port_offloads);
 	printf("\n");
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_rx_queues = dev_info.nb_rx_queues;
 	for (q = 0; q < nb_rx_queues; q++) {
 		queue_offloads = port->rx_conf[q].offloads;
@@ -18160,6 +18213,7 @@ struct cmd_config_per_port_rx_offload_result {
 	uint64_t single_offload;
 	uint16_t nb_rx_queues;
 	int q;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18173,7 +18227,10 @@ struct cmd_config_per_port_rx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_rx_queues = dev_info.nb_rx_queues;
 	if (!strcmp(res->on_off, "on")) {
 		port->dev_conf.rxmode.offloads |= single_offload;
@@ -18261,6 +18318,7 @@ struct cmd_config_per_queue_rx_offload_result {
 	uint16_t queue_id = res->queue_id;
 	struct rte_port *port = &ports[port_id];
 	uint64_t single_offload;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18268,7 +18326,10 @@ struct cmd_config_per_queue_rx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (queue_id >= dev_info.nb_rx_queues) {
 		printf("Error: input queue_id should be 0 ... "
 		       "%d\n", dev_info.nb_rx_queues - 1);
@@ -18374,8 +18435,12 @@ struct cmd_tx_offload_get_capa_result {
 	portid_t port_id = res->port_id;
 	uint64_t queue_offloads;
 	uint64_t port_offloads;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	queue_offloads = dev_info.tx_queue_offload_capa;
 	port_offloads = dev_info.tx_offload_capa ^ queue_offloads;
 
@@ -18447,6 +18512,7 @@ struct cmd_tx_offload_get_configuration_result {
 	uint64_t queue_offloads;
 	uint16_t nb_tx_queues;
 	int q;
+	int ret;
 
 	printf("Tx Offloading Configuration of port %d :\n", port_id);
 
@@ -18455,7 +18521,10 @@ struct cmd_tx_offload_get_configuration_result {
 	print_tx_offloads(port_offloads);
 	printf("\n");
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_tx_queues = dev_info.nb_tx_queues;
 	for (q = 0; q < nb_tx_queues; q++) {
 		queue_offloads = port->tx_conf[q].offloads;
@@ -18559,6 +18628,7 @@ struct cmd_config_per_port_tx_offload_result {
 	uint64_t single_offload;
 	uint16_t nb_tx_queues;
 	int q;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18572,7 +18642,10 @@ struct cmd_config_per_port_tx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_tx_queues = dev_info.nb_tx_queues;
 	if (!strcmp(res->on_off, "on")) {
 		port->dev_conf.txmode.offloads |= single_offload;
@@ -18663,6 +18736,7 @@ struct cmd_config_per_queue_tx_offload_result {
 	uint16_t queue_id = res->queue_id;
 	struct rte_port *port = &ports[port_id];
 	uint64_t single_offload;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18670,7 +18744,10 @@ struct cmd_config_per_queue_tx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (queue_id >= dev_info.nb_tx_queues) {
 		printf("Error: input queue_id should be 0 ... "
 		       "%d\n", dev_info.nb_tx_queues - 1);
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4958713..369426c 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -3550,7 +3550,10 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
 	    ctx->port != (portid_t)RTE_PORT_ALL) {
 		struct rte_eth_dev_info info;
 
-		rte_eth_dev_info_get(ctx->port, &info);
+		ret = rte_eth_dev_info_get(ctx->port, &info);
+		if (ret != 0)
+			return ret;
+
 		action_rss_data->conf.key_len =
 			RTE_MIN(sizeof(action_rss_data->key),
 				info.hash_key_size);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..0ef7c36 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -471,6 +471,7 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	static const char *info_border = "*********************";
 	uint16_t mtu;
 	char name[RTE_ETH_NAME_MAX_LEN];
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -479,7 +480,11 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	port = &ports[port_id];
 	rte_eth_link_get_nowait(port_id, &link);
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	printf("\n%s Infos for port %-2d %s\n",
 	       info_border, port_id, info_border);
 	rte_eth_macaddr_get(port_id, &mac_addr);
@@ -618,6 +623,7 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	struct rte_eth_link link;
 	struct rte_eth_dev_info dev_info;
 	char name[RTE_ETH_NAME_MAX_LEN];
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -625,7 +631,11 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	}
 
 	rte_eth_link_get_nowait(port_id, &link);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	rte_eth_dev_get_name_by_port(port_id, name);
 	rte_eth_macaddr_get(port_id, &mac_addr);
 
@@ -642,11 +652,14 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 {
 	struct rte_eth_dev_info dev_info;
 	static const char *info_border = "************";
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
 	printf("\n%s Port %d supported offload features: %s\n",
 		info_border, port_id, info_border);
@@ -1140,10 +1153,15 @@ void print_valid_ports(void)
 {
 	int diag;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (mtu > dev_info.max_mtu || mtu < dev_info.min_mtu) {
 		printf("Set MTU failed. MTU:%u is not in valid range, min:%u - max:%u\n",
 			mtu, dev_info.min_mtu, dev_info.max_mtu);
@@ -1618,13 +1636,17 @@ struct igb_ring_desc_16_bytes {
 #endif
 			   uint16_t desc_id)
 {
+	int ret;
 	struct igb_ring_desc_16_bytes *ring =
 		(struct igb_ring_desc_16_bytes *)ring_mz->addr;
 #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 	struct rte_eth_dev_info dev_info;
 
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (strstr(dev_info.driver_name, "i40e") != NULL) {
 		/* 32 bytes RX descriptor, i40e only */
 		struct igb_ring_desc_32_bytes *ring =
@@ -1834,11 +1856,15 @@ struct igb_ring_desc_16_bytes {
 	int diag;
 	struct rte_eth_dev_info dev_info;
 	uint8_t hash_key_size;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(rss_key))
 		hash_key_size = dev_info.hash_key_size;
@@ -2796,11 +2822,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_rx_queues; queue++)
 		if (!ports[portid].rx_dump_cb[queue])
 			ports[portid].rx_dump_cb[queue] =
@@ -2813,10 +2843,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (!ports[portid].tx_dump_cb[queue])
 			ports[portid].tx_dump_cb[queue] =
@@ -2829,10 +2864,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_rx_queues; queue++)
 		if (ports[portid].rx_dump_cb[queue]) {
 			rte_eth_remove_rx_callback(portid, queue,
@@ -2846,10 +2886,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (ports[portid].tx_dump_cb[queue]) {
 			rte_eth_remove_tx_callback(portid, queue,
@@ -3037,6 +3082,7 @@ struct igb_ring_desc_16_bytes {
 tx_vlan_set(portid_t port_id, uint16_t vlan_id)
 {
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
@@ -3048,7 +3094,11 @@ struct igb_ring_desc_16_bytes {
 		printf("Error, as QinQ has been enabled.\n");
 		return;
 	}
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) == 0) {
 		printf("Error: vlan insert is not supported by port %d\n",
 			port_id);
@@ -3064,6 +3114,7 @@ struct igb_ring_desc_16_bytes {
 tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
 {
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
@@ -3072,7 +3123,10 @@ struct igb_ring_desc_16_bytes {
 	if (vlan_id_is_invalid(vlan_id_outer))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) {
 		printf("Error: qinq insert not supported by port %d\n",
 			port_id);
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 5244872..6c78dca 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -562,6 +562,7 @@
 	uint64_t tx_offloads = tx_mode.offloads;
 	struct rte_eth_dev_info dev_info;
 	uint16_t rec_nb_pkts;
+	int ret;
 
 	static struct option lgopts[] = {
 		{ "help",			0, 0, 0 },
@@ -1050,7 +1051,12 @@
 					 * value, on the assumption that all
 					 * ports are of the same NIC model.
 					 */
-					rte_eth_dev_info_get(0, &dev_info);
+					ret = eth_dev_info_get_print_err(
+								0,
+								&dev_info);
+					if (ret != 0)
+						return;
+
 					rec_nb_pkts = dev_info
 						.default_rxportconf.burst_size;
 
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e8e2a39..0117236 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1016,7 +1016,8 @@ struct extmem_param {
 	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pi) {
-		rte_eth_dev_info_get(pi, &dev_info);
+		eth_dev_info_get_print_err(pi, &dev_info);
+
 		if (dev_info.max_rx_queues < allowed_max_rxq) {
 			allowed_max_rxq = dev_info.max_rx_queues;
 			*pid = pi;
@@ -1062,7 +1063,8 @@ struct extmem_param {
 	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pi) {
-		rte_eth_dev_info_get(pi, &dev_info);
+		eth_dev_info_get_print_err(pi, &dev_info);
+
 		if (dev_info.max_tx_queues < allowed_max_txq) {
 			allowed_max_txq = dev_info.max_tx_queues;
 			*pid = pi;
@@ -1109,6 +1111,7 @@ struct extmem_param {
 	uint16_t data_size;
 	bool warning = 0;
 	int k;
+	int ret;
 
 	memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
 
@@ -1136,7 +1139,10 @@ struct extmem_param {
 		/* Apply default TxRx configuration for all ports */
 		port->dev_conf.txmode = tx_mode;
 		port->dev_conf.rxmode = rx_mode;
-		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+		if (ret != 0)
+			return;
 
 		if (!(port->dev_info.tx_offload_capa &
 		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
@@ -1295,10 +1301,14 @@ struct extmem_param {
 reconfig(portid_t new_port_id, unsigned socket_id)
 {
 	struct rte_port *port;
+	int ret;
 
 	/* Reconfiguration of Ethernet ports. */
 	port = &ports[new_port_id];
-	rte_eth_dev_info_get(new_port_id, &port->dev_info);
+
+	ret = eth_dev_info_get_print_err(new_port_id, &port->dev_info);
+	if (ret != 0)
+		return;
 
 	/* set flag to initialize port/queue */
 	port->need_reconfig = 1;
@@ -2927,11 +2937,16 @@ struct pmd_test_command {
 {
 	portid_t pid;
 	struct rte_port *port;
+	int ret;
 
 	RTE_ETH_FOREACH_DEV(pid) {
 		port = &ports[pid];
 		port->dev_conf.fdir_conf = fdir_conf;
-		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+		if (ret != 0)
+			return;
+
 		if (nb_rxq > 1) {
 			port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
 			port->dev_conf.rx_adv_conf.rss_conf.rss_hf =
@@ -3106,7 +3121,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)
 	retval = rte_eth_dev_configure(pid, nb_rxq, nb_rxq, &port_conf);
 	if (retval < 0)
 		return retval;
-	rte_eth_dev_info_get(pid, &rte_port->dev_info);
+
+	retval = eth_dev_info_get_print_err(pid, &rte_port->dev_info);
+	if (retval != 0)
+		return retval;
 
 	/* If dev_info.vmdq_pool_base is greater than 0,
 	 * the queue id of vmdq pools is started after pf queues.
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index ce13eb8..d73955d 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -822,6 +822,9 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[],
 void setup_gro_flush_cycles(uint8_t cycles);
 void show_gro(portid_t port_id);
 void setup_gso(const char *mode, portid_t port_id);
+int eth_dev_info_get_print_err(uint16_t port_id,
+			struct rte_eth_dev_info *dev_info);
+
 
 /* Functions to manage the set of filtered Multicast MAC addresses */
 void mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr);
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 18dfdca..009d226 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -194,10 +194,15 @@
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (!ports[portid].tx_set_md_cb[queue])
 			ports[portid].tx_set_md_cb[queue] =
@@ -210,10 +215,15 @@
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (ports[portid].tx_set_md_cb[queue]) {
 			rte_eth_remove_tx_callback(portid, queue,
@@ -221,3 +231,17 @@
 			ports[portid].tx_set_md_cb[queue] = NULL;
 		}
 }
+
+int
+eth_dev_info_get_print_err(uint16_t port_id,
+					struct rte_eth_dev_info *dev_info)
+{
+	int ret;
+
+	ret = rte_eth_dev_info_get(port_id, dev_info);
+	if (ret != 0)
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+
+	return ret;
+}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 03/51] app/eventdev: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 01/51] " Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 04/51] kni: " Andrew Rybchenko
                   ` (51 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, Ivan Ilchenko

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 app/test-eventdev
according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-eventdev/test_perf_common.c     | 8 +++++++-
 app/test-eventdev/test_pipeline_common.c | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index aa925a7..e75582b 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -660,6 +660,7 @@
 perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	struct test_perf *t = evt_test_priv(test);
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
@@ -688,7 +689,12 @@
 		struct rte_eth_dev_info dev_info;
 		struct rte_eth_conf local_port_conf = port_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+					i, strerror(-ret));
+			return ret;
+		}
 
 		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 			dev_info.flow_type_rss_offloads;
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 16c49b8..ef8ae28 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -159,6 +159,7 @@
 pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	uint8_t nb_queues = 1;
 	struct test_pipeline *t = evt_test_priv(test);
 	struct rte_eth_rxconf rx_conf;
@@ -191,7 +192,13 @@
 		if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT))
 			t->internal_port = 0;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return ret;
+		}
+
 		rx_conf = dev_info.default_rxconf;
 		rx_conf.offloads = port_conf.rxmode.offloads;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 04/51] kni: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (2 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 03/51] app/eventdev: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 05/51] latency: " Andrew Rybchenko
                   ` (50 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Ivan Ilchenko

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
app/test/test_kni.c according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_kni.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 7a65de1..2c33374 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -436,7 +436,13 @@ struct test_kni_stats {
 	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
 
-	rte_eth_dev_info_get(port_id, &info);
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return -1;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	if (bus && !strcmp(bus->name, "pci")) {
@@ -622,7 +628,14 @@ struct test_kni_stats {
 	memset(&info, 0, sizeof(info));
 	memset(&conf, 0, sizeof(conf));
 	memset(&ops, 0, sizeof(ops));
-	rte_eth_dev_info_get(port_id, &info);
+
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return -1;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	else
@@ -658,7 +671,15 @@ struct test_kni_stats {
 	memset(&conf, 0, sizeof(conf));
 	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
-	rte_eth_dev_info_get(port_id, &info);
+
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		ret = -1;
+		goto fail;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	else
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 05/51] latency: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (3 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 04/51] kni: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 06/51] pdump: " Andrew Rybchenko
                   ` (49 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

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
latency component according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_latencystats/rte_latencystats.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 06c6283..98e0189 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -208,6 +208,7 @@ struct latency_stats_nameoff {
 	const char *ptr_strings[NUM_LATENCY_STATS] = {0};
 	const struct rte_memzone *mz = NULL;
 	const unsigned int flags = 0;
+	int ret;
 
 	if (rte_memzone_lookup(MZ_RTE_LATENCY_STATS))
 		return -EEXIST;
@@ -239,7 +240,16 @@ struct latency_stats_nameoff {
 	/** Register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(pid, &dev_info);
+
+		ret = rte_eth_dev_info_get(pid, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(INFO, LATENCY_STATS,
+				"Error during getting device (port %u) info: %s\n",
+				pid, strerror(-ret));
+
+			continue;
+		}
+
 		for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
 			cbs = &rx_cbs[pid][qid];
 			cbs->cb = rte_eth_add_first_rx_callback(pid, qid,
@@ -274,7 +284,16 @@ struct latency_stats_nameoff {
 	/** De register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(pid, &dev_info);
+
+		ret = rte_eth_dev_info_get(pid, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(INFO, LATENCY_STATS,
+				"Error during getting device (port %u) info: %s\n",
+				pid, strerror(-ret));
+
+			continue;
+		}
+
 		for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
 			cbs = &rx_cbs[pid][qid];
 			ret = rte_eth_remove_rx_callback(pid, qid, cbs->cb);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 06/51] pdump: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (4 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 05/51] latency: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 07/51] ring: " Andrew Rybchenko
                   ` (48 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

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
pdump component according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_pdump/rte_pdump.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index cd24dd0..ac94fea 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -333,7 +333,14 @@ struct pdump_response {
 	if (queue == RTE_PDUMP_ALL_QUEUES) {
 		struct rte_eth_dev_info dev_info;
 
-		rte_eth_dev_info_get(port, &dev_info);
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(ERR, PDUMP,
+				"Error during getting device (port %u) info: %s\n",
+				port, strerror(-ret));
+			return ret;
+		}
+
 		nb_rx_q = dev_info.nb_rx_queues;
 		nb_tx_q = dev_info.nb_tx_queues;
 		if (nb_rx_q == 0 && flags & RTE_PDUMP_FLAG_RX) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 07/51] ring: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (5 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 06/51] pdump: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 08/51] app/procinfo: " Andrew Rybchenko
                   ` (47 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Ivan Ilchenko

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
app/test/test_pmd_ring.c according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_pmd_ring.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 6414bbd..eb49735 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -490,10 +490,16 @@
 test_command_line_ring_port(void)
 {
 	int port, cmdl_port0 = -1;
+	int ret;
 	/* find a port created with the --vdev=net_ring0 command line option */
 	RTE_ETH_FOREACH_DEV(port) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(port, &dev_info);
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		TEST_ASSERT((ret != 0),
+				"Error during getting device (port %d) info: %s\n",
+				port, strerror(-ret));
+
 		if (!strcmp(dev_info.driver_name, "Rings PMD")) {
 			printf("found a command line ring port=%d\n", port);
 			cmdl_port0 = port;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 08/51] app/procinfo: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (6 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 07/51] ring: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 09/51] app/test: check status of getting ethdev info in bonding Andrew Rybchenko
                   ` (46 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Maryam Tahhan, Reshma Pattan; +Cc: dev, Ivan Ilchenko

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 app/procinfo
according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/proc-info/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index a89b51b..34eb7a7 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -683,7 +683,12 @@ static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 		if (ret == 0)
 			printf("\t  -- mtu (%d)\n", mtu);
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
 
 		printf("  - queue\n");
 		for (j = 0; j < dev_info.nb_rx_queues; j++) {
@@ -836,7 +841,13 @@ static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 		memset(&cap, 0, sizeof(cap));
 		memset(&error, 0, sizeof(error));
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
+
 		printf("  - Generic for port (%u)\n"
 			"\t  -- driver name %s\n"
 			"\t  -- max vf (%u)\n"
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 09/51] app/test: check status of getting ethdev info in bonding
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (7 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 08/51] app/procinfo: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 10/51] app/test: check ethdev info get result in event Rx adapter Andrew Rybchenko
                   ` (45 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

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
app/test/test_link_bonding_rssconf.c according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_link_bonding_rssconf.c | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 65de3b9..1a9571e 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -329,7 +329,11 @@ struct link_bonding_rssconf_unittest_params {
 	uint64_t rss_hf = 0;
 	uint64_t default_rss_hf = 0;
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((retval == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-retval));
 
 	/*
 	 *  Test hash function propagation
@@ -443,10 +447,16 @@ struct link_bonding_rssconf_unittest_params {
 	/**
 	 * Configure bonding port in RSS mq mode
 	 */
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&rss_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+					&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -468,10 +478,16 @@ struct link_bonding_rssconf_unittest_params {
 static int
 test_rss_lazy(void)
 {
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -532,6 +548,10 @@ struct link_bonding_rssconf_unittest_params {
 		rte_eth_dev_default_mac_addr_set(port->port_id, &mac_addr);
 
 		rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		retval = rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	if (test_params.bond_port_id == INVALID_PORT_ID) {
@@ -545,8 +565,11 @@ struct link_bonding_rssconf_unittest_params {
 		TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 				&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-		rte_eth_dev_info_get(test_params.bond_port_id,
-				&test_params.bond_dev_info);
+		retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	return TEST_SUCCESS;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 10/51] app/test: check ethdev info get result in event Rx adapter
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (8 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 09/51] app/test: check status of getting ethdev info in bonding Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 11/51] net/bnxt: check status of getting ethdev info Andrew Rybchenko
                   ` (44 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Nikhil Rao; +Cc: dev, Ivan Ilchenko

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
app/test/test_event_eth_rx_adapter.c according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_event_eth_rx_adapter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 953b827..950bc67 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -45,7 +45,9 @@ struct event_eth_rx_adapter_test_params {
 
 	retval = rte_eth_dev_configure(port, 0, 0, port_conf);
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0)
+		return retval;
 
 	default_params.rx_rings = RTE_MIN(dev_info.max_rx_queues,
 					MAX_NUM_RX_QUEUE);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 11/51] net/bnxt: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (9 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 10/51] app/test: check ethdev info get result in event Rx adapter Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:44   ` Somnath Kotur
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 12/51] net/bonding: " Andrew Rybchenko
                   ` (43 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur; +Cc: dev, Ivan Ilchenko

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/bnxt 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/bnxt/rte_pmd_bnxt.c | 122 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 109 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index fbd2dd4..4374034 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -145,7 +145,15 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
+
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs || mac_addr == NULL)
@@ -179,7 +187,14 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(eth_dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = eth_dev->data->dev_private;
 
 	if (!bp->pf.active_vfs)
@@ -230,7 +245,14 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
@@ -282,7 +304,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
@@ -332,7 +361,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs)
@@ -369,7 +405,14 @@ int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!bp->pf.vf_info)
@@ -545,12 +588,20 @@ int rte_pmd_bnxt_get_vf_stats(uint16_t port,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -572,12 +623,20 @@ int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -598,12 +657,20 @@ int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id)
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -625,12 +692,20 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -662,7 +737,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -738,7 +820,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs)
@@ -775,7 +864,14 @@ int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on)
 		return -EINVAL;
 
 	dev = &rte_eth_devices[port];
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 12/51] net/bonding: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (10 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 11/51] net/bnxt: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 13/51] net/netvsc: " Andrew Rybchenko
                   ` (42 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

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/bonding 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/bonding/rte_eth_bond_api.c | 10 +++++++++-
 drivers/net/bonding/rte_eth_bond_pmd.c | 36 ++++++++++++++++++++++++++++++----
 2 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 0fc4c5e..e2e27e9 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -452,6 +452,7 @@
 	struct bond_dev_private *internals;
 	struct rte_eth_link link_props;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
 	internals = bonded_eth_dev->data->dev_private;
@@ -465,7 +466,14 @@
 		return -1;
 	}
 
-	rte_eth_dev_info_get(slave_port_id, &dev_info);
+	ret = rte_eth_dev_info_get(slave_port_id, &dev_info);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"%s: Error during getting device (port %u) info: %s\n",
+			__func__, slave_port_id, strerror(-ret));
+
+		return ret;
+	}
 	if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) {
 		RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small",
 			     slave_port_id);
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 97ab3f2..a1b5014 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -186,7 +186,15 @@
 		return -1;
 	}
 
-	rte_eth_dev_info_get(slave_port, &slave_info);
+	ret = rte_eth_dev_info_get(slave_port, &slave_info);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"%s: Error during getting device (port %u) info: %s\n",
+			__func__, slave_port, strerror(-ret));
+
+		return ret;
+	}
+
 	if (slave_info.max_rx_queues < bond_dev->data->nb_rx_queues ||
 			slave_info.max_tx_queues < bond_dev->data->nb_tx_queues) {
 		RTE_BOND_LOG(ERR,
@@ -204,10 +212,19 @@
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
 	struct rte_eth_dev_info bond_info;
 	uint16_t idx;
+	int ret;
 
 	/* Verify if all slaves in bonding supports flow director and */
 	if (internals->slave_count > 0) {
-		rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
+		ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
+		if (ret != 0) {
+			RTE_BOND_LOG(ERR,
+				"%s: Error during getting device (port %u) info: %s\n",
+				__func__, bond_dev->data->port_id,
+				strerror(-ret));
+
+			return ret;
+		}
 
 		internals->mode4.dedicated_queues.rx_qid = bond_info.nb_rx_queues;
 		internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues;
@@ -2102,6 +2119,8 @@ struct bwg_slave {
 bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct bond_dev_private *internals = dev->data->dev_private;
+	struct bond_slave_details slave;
+	int ret;
 
 	uint16_t max_nb_rx_queues = UINT16_MAX;
 	uint16_t max_nb_tx_queues = UINT16_MAX;
@@ -2123,8 +2142,17 @@ struct bwg_slave {
 		uint16_t idx;
 
 		for (idx = 0; idx < internals->slave_count; idx++) {
-			rte_eth_dev_info_get(internals->slaves[idx].port_id,
-					&slave_info);
+			slave = internals->slaves[idx];
+			ret = rte_eth_dev_info_get(slave.port_id, &slave_info);
+			if (ret != 0) {
+				RTE_BOND_LOG(ERR,
+					"%s: Error during getting device (port %u) info: %s\n",
+					__func__,
+					slave.port_id,
+					strerror(-ret));
+
+				return;
+			}
 
 			if (slave_info.max_rx_queues < max_nb_rx_queues)
 				max_nb_rx_queues = slave_info.max_rx_queues;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 13/51] net/netvsc: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (11 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 12/51] net/bonding: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 20:17   ` Stephen Hemminger
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 14/51] net/softnic: " Andrew Rybchenko
                   ` (41 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang; +Cc: dev, Ivan Ilchenko

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_vf.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
index 03f855b..b6b1e5d 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -176,8 +176,16 @@ static void 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;
+
+	ret = rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
+	if (ret != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			vf_dev->data->port_id, strerror(-ret));
 
-	rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
+		return;
+	}
 
 	info->speed_capa = vf_info.speed_capa;
 	info->default_rxportconf = vf_info.default_rxportconf;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 14/51] net/softnic: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (12 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 13/51] net/netvsc: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 15/51] examples/rxtx_callbacks: " Andrew Rybchenko
                   ` (40 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Jasvinder Singh, Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

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/softnic 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/softnic/rte_eth_softnic_link.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/softnic/rte_eth_softnic_link.c b/drivers/net/softnic/rte_eth_softnic_link.c
index d669913..21a6406 100644
--- a/drivers/net/softnic/rte_eth_softnic_link.c
+++ b/drivers/net/softnic/rte_eth_softnic_link.c
@@ -57,6 +57,7 @@ struct softnic_link *
 	struct rte_eth_dev_info port_info;
 	struct softnic_link *link;
 	uint16_t port_id;
+	int ret;
 
 	/* Check input params */
 	if (name == NULL ||
@@ -78,7 +79,9 @@ struct softnic_link *
 			return NULL;
 	}
 
-	rte_eth_dev_info_get(port_id, &port_info);
+	ret = rte_eth_dev_info_get(port_id, &port_info);
+	if (ret != 0)
+		return NULL;
 
 	/* Node allocation */
 	link = calloc(1, sizeof(struct softnic_link));
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 15/51] examples/rxtx_callbacks: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (13 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 14/51] net/softnic: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 16/51] examples/l3fwd: " Andrew Rybchenko
                   ` (39 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/rxtx_callbacks according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/rxtx_callbacks/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4..9fd4b8e 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -112,7 +112,14 @@
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 16/51] examples/l3fwd: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (14 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 15/51] examples/rxtx_callbacks: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 17/51] examples/qos_meter: " Andrew Rybchenko
                   ` (38 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/l3fwd according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l3fwd/main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 3800bad..3294ac2 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -874,7 +874,12 @@ enum {
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue );
 
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -985,7 +990,12 @@ enum {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			if (!per_port_pool)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 17/51] examples/qos_meter: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (15 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 16/51] examples/l3fwd: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 18/51] examples/ip_frag: " Andrew Rybchenko
                   ` (37 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

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
examples/qos_meter according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/qos_meter/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8..13c85e9 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -329,7 +329,13 @@ static __attribute__((noreturn)) int
 
 	/* NIC init */
 	conf = port_conf;
-	rte_eth_dev_info_get(port_rx, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_rx, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_rx, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
@@ -369,7 +375,13 @@ static __attribute__((noreturn)) int
 	rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
 
 	conf = port_conf;
-	rte_eth_dev_info_get(port_tx, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_tx, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_tx, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 18/51] examples/ip_frag: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (16 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 17/51] examples/qos_meter: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 19/51] examples/performance-thread: check dev info get result Andrew Rybchenko
                   ` (36 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ivan Ilchenko

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
examples/ip_frag according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ip_fragmentation/main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 324d607..6b83244 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -903,7 +903,12 @@ struct rte_lpm6_config lpm6_config = {
 		qconf = &lcore_queue_conf[rx_lcore_id];
 
 		/* limit the frame size to the maximum supported by NIC */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
@@ -984,7 +989,12 @@ struct rte_lpm6_config lpm6_config = {
 		printf("\n");
 
 		/* init one TX queue per couple (lcore,port) */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		queueid = 0;
 		for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
 			if (rte_lcore_is_enabled(lcore_id) == 0)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 19/51] examples/performance-thread: check dev info get result
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (17 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 18/51] examples/ip_frag: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 20/51] examples/vmdq: check status of getting ethdev info Andrew Rybchenko
                   ` (35 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/performance-thread according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/performance-thread/l3fwd-thread/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 49d9424..00f5350 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -3559,7 +3559,13 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -3663,7 +3669,12 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 20/51] examples/vmdq: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (18 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 19/51] examples/performance-thread: check dev info get result Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 21/51] examples/distributor: " Andrew Rybchenko
                   ` (34 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/vmdq according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vmdq/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd..91f9a99 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -169,7 +169,13 @@
 	 * The max pool number from dev_info will be used to validate the pool
 	 * number specified in cmd line
 	 */
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
 	/*
 	 * We allow to process part of VMDQ pools specified by num_pools in
@@ -214,7 +220,13 @@
 	rxRings = (uint16_t)dev_info.max_rx_queues;
 	txRings = (uint16_t)dev_info.max_tx_queues;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 21/51] examples/distributor: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (19 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 20/51] examples/vmdq: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 22/51] examples/l3fwd-acl: " Andrew Rybchenko
                   ` (33 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Ivan Ilchenko

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
examples/distributor according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/distributor/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca6..8942f36 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -120,7 +120,13 @@ struct output_buffer {
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 22/51] examples/l3fwd-acl: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (20 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 21/51] examples/distributor: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 23/51] examples/vm_power: " Andrew Rybchenko
                   ` (32 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ivan Ilchenko

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
examples/l3fwd-acl according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l3fwd-acl/main.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df7..60531ce 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1924,7 +1924,13 @@ struct lcore_conf {
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -1994,7 +2000,12 @@ struct lcore_conf {
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			txconf = &dev_info.default_txconf;
 			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
@@ -2036,7 +2047,12 @@ struct lcore_conf {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 23/51] examples/vm_power: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (21 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 22/51] examples/l3fwd-acl: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 24/51] examples/qos_sched: " Andrew Rybchenko
                   ` (31 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Ivan Ilchenko

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
examples/vm_power according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vm_power_manager/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c7046..0f48ae9 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -71,7 +71,13 @@
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 24/51] examples/qos_sched: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (22 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 23/51] examples/vm_power: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 25/51] examples/flow_filtering: " Andrew Rybchenko
                   ` (30 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Cristian Dumitrescu, Jasvinder Singh; +Cc: dev, Ivan Ilchenko

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
examples/qos_sched according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/qos_sched/init.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d..cf9e8f4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -98,7 +98,13 @@ struct ring_thresh tx_thresh = {
 	/* init port */
 	RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid);
 	fflush(stdout);
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 25/51] examples/flow_filtering: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (23 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 24/51] examples/qos_sched: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 26/51] examples/l3fwd-power: " Andrew Rybchenko
                   ` (29 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/flow_filtering according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/flow_filtering/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be..fe064fa 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -136,7 +136,12 @@
 	struct rte_eth_rxconf rxq_conf;
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_id, strerror(-ret));
+
 	port_conf.txmode.offloads &= dev_info.tx_offload_capa;
 	printf(":: initializing port: %d\n", port_id);
 	ret = rte_eth_dev_configure(port_id,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 26/51] examples/l3fwd-power: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (24 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 25/51] examples/flow_filtering: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 27/51] examples/l2fwd: " Andrew Rybchenko
                   ` (28 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Ivan Ilchenko

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
examples/l3fwd-power according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l3fwd-power/main.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d952..bfcaa46 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2257,7 +2257,12 @@ static int check_ptype(uint16_t portid)
 		printf("Initializing port %d ... ", portid );
 		fflush(stdout);
 
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		dev_rxq_num = dev_info.max_rx_queues;
 		dev_txq_num = dev_info.max_tx_queues;
 
@@ -2275,7 +2280,13 @@ static int check_ptype(uint16_t portid)
 		/* If number of Rx queue is 0, no need to enable Rx interrupt */
 		if (nb_rx_queue == 0)
 			local_port_conf.intr_conf.rxq = 0;
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -2398,7 +2409,12 @@ static int check_ptype(uint16_t portid)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 27/51] examples/l2fwd: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (25 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 26/51] examples/l3fwd-power: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 28/51] examples/skeleton: " Andrew Rybchenko
                   ` (27 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/l2fwd according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b142..8d4c539 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -635,7 +635,13 @@ enum {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 28/51] examples/skeleton: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (26 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 27/51] examples/l2fwd: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 29/51] examples/vmdq_dcb: " Andrew Rybchenko
                   ` (26 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/skeleton according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/skeleton/basicfwd.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98..171ebde 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -44,7 +44,13 @@
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 29/51] examples/vmdq_dcb: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (27 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 28/51] examples/skeleton: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 30/51] examples/ipv4_multicast: " Andrew Rybchenko
                   ` (25 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/vmdq_dcb according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vmdq_dcb/main.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 3890003..2122e41 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -202,7 +202,14 @@
 	 * The max pool number from dev_info will be used to validate the pool
 	 * number specified in cmd line
 	 */
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
 	/*
 	 * We allow to process part of VMDQ pools specified by num_pools in
@@ -253,7 +260,14 @@
 	if (retval < 0)
 		return retval;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 30/51] examples/ipv4_multicast: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (28 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 29/51] examples/vmdq_dcb: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 31/51] examples/l2fwd-jobstats: " Andrew Rybchenko
                   ` (24 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/ipv4_multicast according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ipv4_multicast/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc..1ee3b61 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -686,7 +686,12 @@ struct mcast_group_params {
 		qconf = &lcore_queue_conf[rx_lcore_id];
 
 		/* limit the frame size to the maximum supported by NIC */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 31/51] examples/l2fwd-jobstats: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (29 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 30/51] examples/ipv4_multicast: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 32/51] examples/bond: " Andrew Rybchenko
                   ` (23 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, Ivan Ilchenko

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
examples/l2fwd-jobstats according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd-jobstats/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc..5fcba5c 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -842,7 +842,13 @@ struct l2fwd_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 32/51] examples/bond: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (30 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 31/51] examples/l2fwd-jobstats: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 33/51] examples/eventdev: " Andrew Rybchenko
                   ` (22 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

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
examples/bond according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/bond/main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d..be62c17 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -148,7 +148,12 @@
 	if (!rte_eth_dev_is_valid_port(portid))
 		rte_exit(EXIT_FAILURE, "Invalid port\n");
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	retval = rte_eth_dev_info_get(portid, &dev_info);
+	if (retval != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-retval));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -230,7 +235,12 @@
 
 	BOND_PORT = retval;
 
-	rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	retval = rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	if (retval != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			BOND_PORT, strerror(-retval));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 33/51] examples/eventdev: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (31 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 32/51] examples/bond: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 34/51] examples/ip_reassembly: " Andrew Rybchenko
                   ` (21 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev, Ivan Ilchenko

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
examples/eventdev according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/eventdev_pipeline/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f5..3789fbf 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -274,7 +274,13 @@ static int xdigit2val(unsigned char c)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 34/51] examples/ip_reassembly: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (32 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 33/51] examples/eventdev: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 35/51] examples/vhost: " Andrew Rybchenko
                   ` (20 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ivan Ilchenko

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
examples/ip_reassembly according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ip_reassembly/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be..87d4b5c 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1038,7 +1038,12 @@ struct rte_lpm6_config lpm6_config = {
 		qconf = &lcore_queue_conf[rx_lcore_id];
 
 		/* limit the frame size to the maximum supported by NIC */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 35/51] examples/vhost: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (33 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 34/51] examples/ip_reassembly: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 36/51] examples/ptpclient: " Andrew Rybchenko
                   ` (19 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Maxime Coquelin, Tiwei Bie, Zhihong Wang; +Cc: dev, Ivan Ilchenko

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
examples/vhost according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vhost/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db0..794d12b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -228,7 +228,14 @@ struct mbuf_table {
 	uint16_t q;
 
 	/* The max pool number from dev_info will be used to validate the pool number specified in cmd line */
-	rte_eth_dev_info_get (port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		RTE_LOG(ERR, VHOST_PORT,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-retval));
+
+		return retval;
+	}
 
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 36/51] examples/ptpclient: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (34 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 35/51] examples/vhost: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 37/51] examples/link_status_interrupt: check dev info get result Andrew Rybchenko
                   ` (18 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/ptpclient according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ptpclient/ptpclient.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd..bc427a5 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -189,7 +189,14 @@ static inline uint64_t timespec64_to_ns(const struct timespec *ts)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 37/51] examples/link_status_interrupt: check dev info get result
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (35 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 36/51] examples/ptpclient: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 38/51] examples/tep_termination: " Andrew Rybchenko
                   ` (17 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/link_status_interrupt according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/link_status_interrupt/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7..0c3dfc6 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -609,7 +609,13 @@ struct lsi_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 38/51] examples/tep_termination: check dev info get result
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (36 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 37/51] examples/link_status_interrupt: check dev info get result Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 39/51] examples/server_node_efd: " Andrew Rybchenko
                   ` (16 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

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
examples/tep_termination according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/tep_termination/vxlan_setup.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a08800..8d6514d 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -119,7 +119,11 @@
 
 	pconf->dst_port = udp_port;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-retval));
 
 	if (dev_info.max_rx_queues > MAX_QUEUES) {
 		rte_exit(EXIT_FAILURE,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 39/51] examples/server_node_efd: check dev info get result
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (37 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 38/51] examples/tep_termination: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 40/51] examples/flow_classify: check status of getting ethdev info Andrew Rybchenko
                   ` (15 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Byron Marohn, Pablo de Lara Guarch; +Cc: dev, Ivan Ilchenko

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
examples/server_node_efd according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/server_node_efd/server/init.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e..773780b 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -111,7 +111,10 @@
 	printf("Port %u init ... ", port_num);
 	fflush(stdout);
 
-	rte_eth_dev_info_get(port_num, &dev_info);
+	retval = rte_eth_dev_info_get(port_num, &dev_info);
+	if (retval != 0)
+		return retval;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 40/51] examples/flow_classify: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (38 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 39/51] examples/server_node_efd: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 41/51] examples/packet_ordering: check dev info get result Andrew Rybchenko
                   ` (14 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev, Ivan Ilchenko

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
examples/flow_classify according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/flow_classify/flow_classify.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43e..2130c13 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -202,7 +202,13 @@ struct rte_flow_query_count count = {
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 41/51] examples/packet_ordering: check dev info get result
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (39 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 40/51] examples/flow_classify: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 42/51] examples/l2fwd-crypto: check status of getting ethdev info Andrew Rybchenko
                   ` (13 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

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
examples/packet_ordering according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/packet_ordering/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e922..a99961f 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -283,7 +283,13 @@ struct wkr_stats_per {
 	if (!rte_eth_dev_is_valid_port(port_id))
 		return -1;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return ret;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 42/51] examples/l2fwd-crypto: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (40 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 41/51] examples/packet_ordering: check dev info get result Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 43/51] examples/multi_process: " Andrew Rybchenko
                   ` (12 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Pablo de Lara, Declan Doherty; +Cc: dev, Ivan Ilchenko

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
examples/l2fwd-crypto according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd-crypto/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba7..9a370f2 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2513,7 +2513,14 @@ struct l2fwd_crypto_statistics {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		retval = rte_eth_dev_info_get(portid, &dev_info);
+		if (retval != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+					portid, strerror(-retval));
+			return retval;
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 43/51] examples/multi_process: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (41 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 42/51] examples/l2fwd-crypto: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 44/51] examples/ipsec-secgw: " Andrew Rybchenko
                   ` (11 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, Ivan Ilchenko

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
examples/multi_process according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/multi_process/symmetric_mp/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 62771e0..9ae8efb 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -209,7 +209,13 @@ struct port_stats{
 	printf("# Initialising port %u... ", port);
 	fflush(stdout);
 
-	rte_eth_dev_info_get(port, &info);
+	retval = rte_eth_dev_info_get(port, &info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	info.default_rxconf.rx_drop_en = 1;
 
 	if (info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 44/51] examples/ipsec-secgw: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (42 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 43/51] examples/multi_process: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 45/51] examples/netmap_compat: " Andrew Rybchenko
                   ` (10 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/ipsec-secgw according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ipsec-secgw/ipsec-secgw.c |  6 +++++-
 examples/ipsec-secgw/ipsec.c       |  9 ++++++++-
 examples/ipsec-secgw/sa.c          | 10 +++++++++-
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6a..534830a 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1911,7 +1911,11 @@ struct lcore_conf {
 	struct rte_ether_addr ethaddr;
 	struct rte_eth_conf local_port_conf = port_conf;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-ret));
 
 	/* limit allowed HW offloafs, as user requested */
 	dev_info.rx_offload_capa &= dev_rx_offload;
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index dc85adf..7720080 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -243,7 +243,14 @@
 			unsigned int i;
 			unsigned int j;
 
-			rte_eth_dev_info_get(sa->portid, &dev_info);
+			ret = rte_eth_dev_info_get(sa->portid, &dev_info);
+			if (ret != 0) {
+				RTE_LOG(ERR, IPSEC,
+					"Error during getting device (port %u) info: %s\n",
+					sa->portid, strerror(-ret));
+				return ret;
+			}
+
 			sa->action[2].type = RTE_FLOW_ACTION_TYPE_END;
 			/* Try RSS. */
 			sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index c3cf3bd..14ee947 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -756,8 +756,16 @@ struct sa_ctx {
 check_eth_dev_caps(uint16_t portid, uint32_t inbound)
 {
 	struct rte_eth_dev_info dev_info;
+	int retval;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	retval = rte_eth_dev_info_get(portid, &dev_info);
+	if (retval != 0) {
+		RTE_LOG(ERR, IPSEC,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-retval));
+
+		return retval;
+	}
 
 	if (inbound) {
 		if ((dev_info.rx_offload_capa &
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 45/51] examples/netmap_compat: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (43 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 44/51] examples/ipsec-secgw: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 46/51] examples/l2fwd-keepalive: check dev info get result Andrew Rybchenko
                   ` (9 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/netmap_compat according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/netmap_compat/lib/compat_netmap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index 10a4379..c25cc09 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -684,7 +684,14 @@ struct netmap_state {
 		return -EINVAL;
 	}
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret != 0) {
+		RTE_LOG(ERR, USER1,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-ret));
+		return ret;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf->eth_conf->txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 46/51] examples/l2fwd-keepalive: check dev info get result
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (44 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 45/51] examples/netmap_compat: " Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 47/51] examples/ip_pipeline: check status of getting ethdev info Andrew Rybchenko
                   ` (8 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: dev; +Cc: Ivan Ilchenko

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
examples/l2fwd-keepalive according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd-keepalive/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a43..a051390 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -634,7 +634,13 @@ static void handle_sigterm(__rte_unused int value)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 47/51] examples/ip_pipeline: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (45 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 46/51] examples/l2fwd-keepalive: check dev info get result Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 48/51] examples/load_balancer: " Andrew Rybchenko
                   ` (7 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

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
examples/ip_pipeline according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ip_pipeline/kni.c  | 5 ++++-
 examples/ip_pipeline/link.c | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/ip_pipeline/kni.c b/examples/ip_pipeline/kni.c
index e9262e0..4519685 100644
--- a/examples/ip_pipeline/kni.c
+++ b/examples/ip_pipeline/kni.c
@@ -109,6 +109,7 @@ struct kni *
 	struct rte_kni *k;
 	const struct rte_pci_device *pci_dev;
 	const struct rte_bus *bus = NULL;
+	int ret;
 
 	/* Check input params */
 	if ((name == NULL) ||
@@ -123,7 +124,9 @@ struct kni *
 		return NULL;
 
 	/* Resource create */
-	rte_eth_dev_info_get(link->port_id, &dev_info);
+	ret = rte_eth_dev_info_get(link->port_id, &dev_info);
+	if (ret != 0)
+		return NULL;
 
 	memset(&kni_conf, 0, sizeof(kni_conf));
 	strlcpy(kni_conf.name, name, RTE_KNI_NAMESIZE);
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb86..4e3a40b 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -129,7 +129,8 @@ struct link *
 		if (!rte_eth_dev_is_valid_port(port_id))
 			return NULL;
 
-	rte_eth_dev_info_get(port_id, &port_info);
+	if (rte_eth_dev_info_get(port_id, &port_info) != 0)
+		return NULL;
 
 	mempool = mempool_find(params->rx.mempool_name);
 	if (mempool == NULL)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 48/51] examples/load_balancer: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (46 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 47/51] examples/ip_pipeline: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:25 ` Andrew Rybchenko
  2019-08-27 14:26 ` [dpdk-dev] [PATCH 49/51] examples/kni: " Andrew Rybchenko
                   ` (6 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:25 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/load_balancer according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/load_balancer/init.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d02..660f5a8 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -411,7 +411,12 @@
 
 		/* Init port */
 		printf("Initializing NIC port %u ...\n", port);
-		rte_eth_dev_info_get(port, &dev_info);
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		if (ret != 0)
+			rte_panic("Error during getting device (port %u) info: %s\n",
+				port, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 49/51] examples/kni: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (47 preceding siblings ...)
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 48/51] examples/load_balancer: " Andrew Rybchenko
@ 2019-08-27 14:26 ` Andrew Rybchenko
  2019-08-27 14:26 ` [dpdk-dev] [PATCH 50/51] examples/ethtool: " Andrew Rybchenko
                   ` (5 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:26 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Ivan Ilchenko

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
examples/kni according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/kni/main.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d71..c0ea9ca 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -595,7 +595,13 @@ struct kni_interface_stats {
 	/* Initialise device and RX/TX queues */
 	RTE_LOG(INFO, APP, "Initialising port %u ...\n", (unsigned)port);
 	fflush(stdout);
-	rte_eth_dev_info_get(port, &dev_info);
+
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -780,7 +786,15 @@ struct kni_interface_stats {
 				"for port%u (%d)\n", (unsigned int)port_id,
 				ret);
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		RTE_LOG(ERR, APP,
+			"Error during getting device (port %u) info: %s\n",
+			port_id, strerror(-ret));
+
+		return ret;
+	}
+
 	rxq_conf = dev_info.default_rxconf;
 	rxq_conf.offloads = conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
@@ -869,6 +883,7 @@ struct kni_interface_stats {
 	struct rte_kni *kni;
 	struct rte_kni_conf conf;
 	struct kni_port_params **params = kni_port_params_array;
+	int ret;
 
 	if (port_id >= RTE_MAX_ETHPORTS || !params[port_id])
 		return -1;
@@ -899,7 +914,12 @@ struct kni_interface_stats {
 			struct rte_eth_dev_info dev_info;
 
 			memset(&dev_info, 0, sizeof(dev_info));
-			rte_eth_dev_info_get(port_id, &dev_info);
+
+			ret = rte_eth_dev_info_get(port_id, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					port_id, strerror(-ret));
 
 			/* Get the interface default mac address */
 			rte_eth_macaddr_get(port_id,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 50/51] examples/ethtool: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (48 preceding siblings ...)
  2019-08-27 14:26 ` [dpdk-dev] [PATCH 49/51] examples/kni: " Andrew Rybchenko
@ 2019-08-27 14:26 ` Andrew Rybchenko
  2019-08-27 14:26 ` [dpdk-dev] [PATCH 51/51] examples/exception_path: " Andrew Rybchenko
                   ` (4 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:26 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/ethtool according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ethtool/ethtool-app/main.c |  8 +++++++-
 examples/ethtool/lib/rte_ethtool.c  | 21 ++++++++++++++++++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index 3d2a70d..774df7e 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -95,6 +95,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 	char str_name[16];
 	uint16_t nb_rxd = PORT_RX_QUEUE_SIZE;
 	uint16_t nb_txd = PORT_TX_QUEUE_SIZE;
+	int ret;
 
 	memset(&cfg_port, 0, sizeof(cfg_port));
 	cfg_port.txmode.mq_mode = ETH_MQ_TX_NONE;
@@ -102,7 +103,12 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 	for (idx_port = 0; idx_port < cnt_ports; idx_port++) {
 		struct app_port *ptr_port = &app_cfg->ports[idx_port];
 
-		rte_eth_dev_info_get(idx_port, &dev_info);
+		ret = rte_eth_dev_info_get(idx_port, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				idx_port, strerror(-ret));
+
 		size_pktpool = dev_info.rx_desc_lim.nb_max +
 			dev_info.tx_desc_lim.nb_max + PKTPOOL_EXTRA_SIZE;
 
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index 571c4e5..3954376 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -42,7 +42,14 @@
 		       "the minimum size should be %d\n", ret);
 
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+
+		return ret;
+	}
 
 	strlcpy(drvinfo->driver, dev_info.driver_name,
 		sizeof(drvinfo->driver));
@@ -371,9 +378,14 @@
 	uint16_t num_vfs;
 	struct rte_eth_dev_info dev_info;
 	uint16_t vf;
+	int ret;
 
 	memset(&dev_info, 0, sizeof(dev_info));
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	num_vfs = dev_info.max_vfs;
 
 	/* Set VF vf_rx_mode, VF unsupport status is discard */
@@ -399,11 +411,14 @@
 	struct rte_eth_rxq_info rx_qinfo;
 	struct rte_eth_txq_info tx_qinfo;
 	int stat;
+	int ret;
 
 	if (ring_param == NULL)
 		return -EINVAL;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	stat = rte_eth_rx_queue_info_get(port_id, 0, &rx_qinfo);
 	if (stat != 0)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH 51/51] examples/exception_path: check status of getting ethdev info
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (49 preceding siblings ...)
  2019-08-27 14:26 ` [dpdk-dev] [PATCH 50/51] examples/ethtool: " Andrew Rybchenko
@ 2019-08-27 14:26 ` Andrew Rybchenko
  2019-08-27 20:47 ` [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Aaron Conole
                   ` (3 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 14:26 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

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
examples/exception_path according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/exception_path/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a..d7f3598 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -432,7 +432,12 @@ static int tap_create(char *name)
 	/* Initialise device and RX/TX queues */
 	PRINT_INFO("Initialising port %u ...", port);
 	fflush(stdout);
-	rte_eth_dev_info_get(port, &dev_info);
+
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0)
+		FATAL_ERROR("Error during getting device (port %u) info: %s\n",
+			port, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 11/51] net/bnxt: check status of getting ethdev info
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 11/51] net/bnxt: check status of getting ethdev info Andrew Rybchenko
@ 2019-08-27 14:44   ` Somnath Kotur
  0 siblings, 0 replies; 272+ messages in thread
From: Somnath Kotur @ 2019-08-27 14:44 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: Ajit Khaparde, dev, Ivan Ilchenko

On Tue, Aug 27, 2019 at 7:56 PM Andrew Rybchenko
<arybchenko@solarflare.com> wrote:
>
> 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/bnxt 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/bnxt/rte_pmd_bnxt.c | 122 +++++++++++++++++++++++++++++++++++-----
>  1 file changed, 109 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
> index fbd2dd4..4374034 100644
> --- a/drivers/net/bnxt/rte_pmd_bnxt.c
> +++ b/drivers/net/bnxt/rte_pmd_bnxt.c
> @@ -145,7 +145,15 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
> +
>         bp = dev->data->dev_private;
>
>         if (vf >= dev_info.max_vfs || mac_addr == NULL)
> @@ -179,7 +187,14 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
>         if (!is_bnxt_supported(eth_dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = eth_dev->data->dev_private;
>
>         if (!bp->pf.active_vfs)
> @@ -230,7 +245,14 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (!BNXT_PF(bp)) {
> @@ -282,7 +304,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (!BNXT_PF(bp)) {
> @@ -332,7 +361,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf >= dev_info.max_vfs)
> @@ -369,7 +405,14 @@ int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (!bp->pf.vf_info)
> @@ -545,12 +588,20 @@ int rte_pmd_bnxt_get_vf_stats(uint16_t port,
>         struct rte_eth_dev *dev;
>         struct rte_eth_dev_info dev_info;
>         struct bnxt *bp;
> +       int rc;
>
>         dev = &rte_eth_devices[port];
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf_id >= dev_info.max_vfs)
> @@ -572,12 +623,20 @@ int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
>         struct rte_eth_dev *dev;
>         struct rte_eth_dev_info dev_info;
>         struct bnxt *bp;
> +       int rc;
>
>         dev = &rte_eth_devices[port];
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf_id >= dev_info.max_vfs)
> @@ -598,12 +657,20 @@ int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id)
>         struct rte_eth_dev *dev;
>         struct rte_eth_dev_info dev_info;
>         struct bnxt *bp;
> +       int rc;
>
>         dev = &rte_eth_devices[port];
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf_id >= dev_info.max_vfs)
> @@ -625,12 +692,20 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
>         struct rte_eth_dev *dev;
>         struct rte_eth_dev_info dev_info;
>         struct bnxt *bp;
> +       int rc;
>
>         dev = &rte_eth_devices[port];
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf_id >= dev_info.max_vfs)
> @@ -662,7 +737,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf_id >= dev_info.max_vfs)
> @@ -738,7 +820,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
>         if (!is_bnxt_supported(dev))
>                 return -ENOTSUP;
>
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }
>         bp = dev->data->dev_private;
>
>         if (vf >= dev_info.max_vfs)
> @@ -775,7 +864,14 @@ int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on)
>                 return -EINVAL;
>
>         dev = &rte_eth_devices[port];
> -       rte_eth_dev_info_get(port, &dev_info);
> +       rc = rte_eth_dev_info_get(port, &dev_info);
> +       if (rc != 0) {
> +               PMD_DRV_LOG(ERR,
> +                       "Error during getting device (port %u) info: %s\n",
> +                       port, strerror(-rc));
> +
> +               return rc;
> +       }

Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>

>         bp = dev->data->dev_private;
>
>         if (!BNXT_PF(bp)) {
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 13/51] net/netvsc: check status of getting ethdev info
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 13/51] net/netvsc: " Andrew Rybchenko
@ 2019-08-27 20:17   ` Stephen Hemminger
  2019-08-28  7:06     ` Andrew Rybchenko
  0 siblings, 1 reply; 272+ messages in thread
From: Stephen Hemminger @ 2019-08-27 20:17 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang, dev, Ivan Ilchenko

On Tue, 27 Aug 2019 15:25:24 +0100
Andrew Rybchenko <arybchenko@solarflare.com> wrote:

> 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_vf.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
> index 03f855b..b6b1e5d 100644
> --- a/drivers/net/netvsc/hn_vf.c
> +++ b/drivers/net/netvsc/hn_vf.c
> @@ -176,8 +176,16 @@ static void 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;
> +
> +	ret = rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
> +	if (ret != 0) {
> +		PMD_DRV_LOG(ERR,
> +			"Error during getting device (port %u) info: %s\n",
> +			vf_dev->data->port_id, strerror(-ret));
>  
> -	rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
> +		return;
> +	}
>  

I would prefer that the driver api callback change to return an
error and not add more log messages.

Or maybe this patch is temporary until you get there in the patchset.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (50 preceding siblings ...)
  2019-08-27 14:26 ` [dpdk-dev] [PATCH 51/51] examples/exception_path: " Andrew Rybchenko
@ 2019-08-27 20:47 ` Aaron Conole
  2019-08-28  7:02   ` Andrew Rybchenko
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                   ` (2 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Aaron Conole @ 2019-08-27 20:47 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: Thomas Monjalon, Ferruh Yigit, dev

Andrew Rybchenko <arybchenko@solarflare.com> writes:

> It is the first patch series to get rid of void returning functions
> in ethdev in accordance with deprecation notice [1].

This is a huge series, and I suggest to combine some of the work, and/or
break it up.

Additionally, this patch breaks the ring_pmd_autotest unit test, but I
didn't bisect it to find out where.

> The patch to change dev_infos_get callback prototype to allow driver
> return error will follow.
>
> [1] https://patches.dpdk.org/patch/56969/
>
> Ivan Ilchenko (51):
>   ethdev: change rte_eth_dev_info_get() return value to int
>   app/testpmd: check status of getting ethdev info
>   app/eventdev: check status of getting ethdev info
>   kni: check status of getting ethdev info
>   latency: check status of getting ethdev info
>   pdump: check status of getting ethdev info
>   ring: check status of getting ethdev info
>   app/procinfo: check status of getting ethdev info
>   app/test: check status of getting ethdev info in bonding
>   app/test: check ethdev info get result in event Rx adapter
>   net/bnxt: check status of getting ethdev info
>   net/bonding: check status of getting ethdev info
>   net/netvsc: check status of getting ethdev info
>   net/softnic: check status of getting ethdev info
>   examples/rxtx_callbacks: check status of getting ethdev info
>   examples/l3fwd: check status of getting ethdev info
>   examples/qos_meter: check status of getting ethdev info
>   examples/ip_frag: check status of getting ethdev info
>   examples/performance-thread: check dev info get result
>   examples/vmdq: check status of getting ethdev info
>   examples/distributor: check status of getting ethdev info
>   examples/l3fwd-acl: check status of getting ethdev info
>   examples/vm_power: check status of getting ethdev info
>   examples/qos_sched: check status of getting ethdev info
>   examples/flow_filtering: check status of getting ethdev info
>   examples/l3fwd-power: check status of getting ethdev info
>   examples/l2fwd: check status of getting ethdev info
>   examples/skeleton: check status of getting ethdev info
>   examples/vmdq_dcb: check status of getting ethdev info
>   examples/ipv4_multicast: check status of getting ethdev info
>   examples/l2fwd-jobstats: check status of getting ethdev info
>   examples/bond: check status of getting ethdev info
>   examples/eventdev: check status of getting ethdev info
>   examples/ip_reassembly: check status of getting ethdev info
>   examples/vhost: check status of getting ethdev info
>   examples/ptpclient: check status of getting ethdev info
>   examples/link_status_interrupt: check dev info get result
>   examples/tep_termination: check dev info get result
>   examples/server_node_efd: check dev info get result
>   examples/flow_classify: check status of getting ethdev info
>   examples/packet_ordering: check dev info get result
>   examples/l2fwd-crypto: check status of getting ethdev info
>   examples/multi_process: check status of getting ethdev info
>   examples/ipsec-secgw: check status of getting ethdev info
>   examples/netmap_compat: check status of getting ethdev info
>   examples/l2fwd-keepalive: check dev info get result
>   examples/ip_pipeline: check status of getting ethdev info
>   examples/load_balancer: check status of getting ethdev info
>   examples/kni: check status of getting ethdev info
>   examples/ethtool: check status of getting ethdev info
>   examples/exception_path: check status of getting ethdev info
>
>  app/proc-info/main.c                            |  15 ++-
>  app/test-eventdev/test_perf_common.c            |   8 +-
>  app/test-eventdev/test_pipeline_common.c        |   9 +-
>  app/test-pmd/cmdline.c                          | 119 +++++++++++++++++++----
>  app/test-pmd/cmdline_flow.c                     |   5 +-
>  app/test-pmd/config.c                           |  78 ++++++++++++---
>  app/test-pmd/parameters.c                       |   8 +-
>  app/test-pmd/testpmd.c                          |  30 ++++--
>  app/test-pmd/testpmd.h                          |   3 +
>  app/test-pmd/util.c                             |  28 +++++-
>  app/test/test_event_eth_rx_adapter.c            |   4 +-
>  app/test/test_kni.c                             |  27 +++++-
>  app/test/test_link_bonding_rssconf.c            |  33 ++++++-
>  app/test/test_pmd_ring.c                        |   8 +-
>  doc/guides/rel_notes/deprecation.rst            |   1 -
>  doc/guides/rel_notes/release_19_11.rst          |   5 +-
>  drivers/net/bnxt/rte_pmd_bnxt.c                 | 122 +++++++++++++++++++++---
>  drivers/net/bonding/rte_eth_bond_api.c          |  10 +-
>  drivers/net/bonding/rte_eth_bond_pmd.c          |  36 ++++++-
>  drivers/net/netvsc/hn_vf.c                      |  10 +-
>  drivers/net/softnic/rte_eth_softnic_link.c      |   5 +-
>  examples/bond/main.c                            |  14 ++-
>  examples/distributor/main.c                     |   8 +-
>  examples/ethtool/ethtool-app/main.c             |   8 +-
>  examples/ethtool/lib/rte_ethtool.c              |  21 +++-
>  examples/eventdev_pipeline/main.c               |   8 +-
>  examples/exception_path/main.c                  |   7 +-
>  examples/flow_classify/flow_classify.c          |   8 +-
>  examples/flow_filtering/main.c                  |   7 +-
>  examples/ip_fragmentation/main.c                |  14 ++-
>  examples/ip_pipeline/kni.c                      |   5 +-
>  examples/ip_pipeline/link.c                     |   3 +-
>  examples/ip_reassembly/main.c                   |   7 +-
>  examples/ipsec-secgw/ipsec-secgw.c              |   6 +-
>  examples/ipsec-secgw/ipsec.c                    |   9 +-
>  examples/ipsec-secgw/sa.c                       |  10 +-
>  examples/ipv4_multicast/main.c                  |   7 +-
>  examples/kni/main.c                             |  26 ++++-
>  examples/l2fwd-crypto/main.c                    |   9 +-
>  examples/l2fwd-jobstats/main.c                  |   8 +-
>  examples/l2fwd-keepalive/main.c                 |   8 +-
>  examples/l2fwd/main.c                           |   8 +-
>  examples/l3fwd-acl/main.c                       |  22 ++++-
>  examples/l3fwd-power/main.c                     |  22 ++++-
>  examples/l3fwd/main.c                           |  14 ++-
>  examples/link_status_interrupt/main.c           |   8 +-
>  examples/load_balancer/init.c                   |   7 +-
>  examples/multi_process/symmetric_mp/main.c      |   8 +-
>  examples/netmap_compat/lib/compat_netmap.c      |   9 +-
>  examples/packet_ordering/main.c                 |   8 +-
>  examples/performance-thread/l3fwd-thread/main.c |  15 ++-
>  examples/ptpclient/ptpclient.c                  |   9 +-
>  examples/qos_meter/main.c                       |  16 +++-
>  examples/qos_sched/init.c                       |   8 +-
>  examples/rxtx_callbacks/main.c                  |   9 +-
>  examples/server_node_efd/server/init.c          |   5 +-
>  examples/skeleton/basicfwd.c                    |   8 +-
>  examples/tep_termination/vxlan_setup.c          |   6 +-
>  examples/vhost/main.c                           |   9 +-
>  examples/vm_power_manager/main.c                |   8 +-
>  examples/vmdq/main.c                            |  16 +++-
>  examples/vmdq_dcb/main.c                        |  18 +++-
>  lib/librte_ethdev/rte_ethdev.c                  |  71 ++++++++++----
>  lib/librte_ethdev/rte_ethdev.h                  |   6 +-
>  lib/librte_latencystats/rte_latencystats.c      |  23 ++++-
>  lib/librte_pdump/rte_pdump.c                    |   9 +-
>  66 files changed, 940 insertions(+), 159 deletions(-)

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-27 20:47 ` [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Aaron Conole
@ 2019-08-28  7:02   ` Andrew Rybchenko
  2019-08-28 13:42     ` Aaron Conole
  0 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-28  7:02 UTC (permalink / raw)
  To: Aaron Conole; +Cc: Thomas Monjalon, Ferruh Yigit, dev, Ivan Ilchenko

On 8/27/19 11:47 PM, Aaron Conole wrote:
> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>
>> It is the first patch series to get rid of void returning functions
>> in ethdev in accordance with deprecation notice [1].
> This is a huge series, and I suggest to combine some of the work, and/or
> break it up.

I can send patches for examples separately, but it will not help a lot.
I can squash changes in examples, but I think it is wrong since it would
make review harder - different maintainers and different practices to
handle error in different examples (and we tried to take it into account).

Other ideas?

> Additionally, this patch breaks the ring_pmd_autotest unit test, but I
> didn't bisect it to find out where.

Many thanks, we'll take a look.


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 13/51] net/netvsc: check status of getting ethdev info
  2019-08-27 20:17   ` Stephen Hemminger
@ 2019-08-28  7:06     ` Andrew Rybchenko
  0 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-28  7:06 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang, dev, Ivan Ilchenko

On 8/27/19 11:17 PM, Stephen Hemminger wrote:
> On Tue, 27 Aug 2019 15:25:24 +0100
> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>
>> 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_vf.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
>> index 03f855b..b6b1e5d 100644
>> --- a/drivers/net/netvsc/hn_vf.c
>> +++ b/drivers/net/netvsc/hn_vf.c
>> @@ -176,8 +176,16 @@ static void 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;
>> +
>> +	ret = rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
>> +	if (ret != 0) {
>> +		PMD_DRV_LOG(ERR,
>> +			"Error during getting device (port %u) info: %s\n",
>> +			vf_dev->data->port_id, strerror(-ret));
>>   
>> -	rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
>> +		return;
>> +	}
>>   
> I would prefer that the driver api callback change to return an
> error and not add more log messages.
>
> Or maybe this patch is temporary until you get there in the patchset.

Got it. We'll change hn_vf_info_merge() and hn_vf_info_get() to return
int in this patch, but the return value will be ignored hn_dev_info_get()
before the patch which changes dev_infos_get prototype to return int
(that patch will be huge since it should update all drivers at once, so
it is better to preparation here).

Thanks.


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 01/51] " Andrew Rybchenko
@ 2019-08-28  9:51   ` Jan Viktorin
  2019-08-28 10:09     ` Andrew Rybchenko
  0 siblings, 1 reply; 272+ messages in thread
From: Jan Viktorin @ 2019-08-28  9:51 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit, dev, Ivan Ilchenko

On Tue, 27 Aug 2019 15:25:12 +0100
Andrew Rybchenko <arybchenko@solarflare.com> wrote:

> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> 
> Change rte_eth_dev_info_get() return value from void to int and return
> negative errno values in case of error conditions.
> Modify rte_eth_dev_info_get() usage across the ethdev according
> to new return type.

Hello Andrew,

I didn't find any cover letter describing the true intentions of this
patchset. Anyway, see below a short comment...

> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  doc/guides/rel_notes/deprecation.rst   |  1 -
>  doc/guides/rel_notes/release_19_11.rst |  5 ++-
>  lib/librte_ethdev/rte_ethdev.c         | 71
> ++++++++++++++++++++++++---------- lib/librte_ethdev/rte_ethdev.h
>     |  6 ++- 4 files changed, 60 insertions(+), 23 deletions(-)

[...]

> b/lib/librte_ethdev/rte_ethdev.h index dc6596b..09c278d 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -2366,8 +2366,12 @@ int
> rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
>   * @param dev_info
>   *   A pointer to a structure of type *rte_eth_dev_info* to be
> filled with
>   *   the contextual information of the Ethernet device.
> + * @return
> + *   - (0) if successful.
> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist for
> the device.

I believe that allowing PMDs to return -ENOTSUP is not a good idea.
At the moment, all PMDs provides this kind of information. It is not
always very reliable piece of information but for me, it is a piece of
gold I would not like to loose when configuring devices.

I think it should be mandatory for all PMDs to provide this function.
Another possible way, give a sane default contents of this structure.
But, please, do not return -ENOTSUP.

Regards
Jan

> + *   - (-ENODEV) if *port_id* invalid.
>   */
> -void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info
> *dev_info); +int rte_eth_dev_info_get(uint16_t port_id, struct
> rte_eth_dev_info *dev_info); 
>  /**
>   * Retrieve the firmware version of a device.


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28  9:51   ` Jan Viktorin
@ 2019-08-28 10:09     ` Andrew Rybchenko
  2019-08-28 11:26       ` Jan Viktorin
  0 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-28 10:09 UTC (permalink / raw)
  To: Jan Viktorin
  Cc: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit, dev, Ivan Ilchenko

On 8/28/19 12:51 PM, Jan Viktorin wrote:
> On Tue, 27 Aug 2019 15:25:12 +0100
> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>
>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>
>> Change rte_eth_dev_info_get() return value from void to int and return
>> negative errno values in case of error conditions.
>> Modify rte_eth_dev_info_get() usage across the ethdev according
>> to new return type.
> Hello Andrew,
>
> I didn't find any cover letter describing the true intentions of this
> patchset. Anyway, see below a short comment...

The cover letter [1] was sent together with the patch.

[1] http://mails.dpdk.org/archives/dev/2019-August/141593.html

>> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>>   doc/guides/rel_notes/deprecation.rst   |  1 -
>>   doc/guides/rel_notes/release_19_11.rst |  5 ++-
>>   lib/librte_ethdev/rte_ethdev.c         | 71
>> ++++++++++++++++++++++++---------- lib/librte_ethdev/rte_ethdev.h
>>      |  6 ++- 4 files changed, 60 insertions(+), 23 deletions(-)
> [...]
>
>> b/lib/librte_ethdev/rte_ethdev.h index dc6596b..09c278d 100644
>> --- a/lib/librte_ethdev/rte_ethdev.h
>> +++ b/lib/librte_ethdev/rte_ethdev.h
>> @@ -2366,8 +2366,12 @@ int
>> rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
>>    * @param dev_info
>>    *   A pointer to a structure of type *rte_eth_dev_info* to be
>> filled with
>>    *   the contextual information of the Ethernet device.
>> + * @return
>> + *   - (0) if successful.
>> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist for
>> the device.
> I believe that allowing PMDs to return -ENOTSUP is not a good idea.
> At the moment, all PMDs provides this kind of information. It is not
> always very reliable piece of information but for me, it is a piece of
> gold I would not like to loose when configuring devices.
>
> I think it should be mandatory for all PMDs to provide this function.
> Another possible way, give a sane default contents of this structure.
> But, please, do not return -ENOTSUP.

I agree that dev_infos_get() callback should be mandatory, but
what the function should do if the callback is not provided?
I think that a sane default contents is more harm than an error
(basically that's what we had before the patch).
Since the function may return error, caller should take it into
account anyway. Yes, some error codes could have special
handling, but default error handling is required in any case.


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28 10:09     ` Andrew Rybchenko
@ 2019-08-28 11:26       ` Jan Viktorin
  2019-08-28 14:39         ` Andrew Rybchenko
  0 siblings, 1 reply; 272+ messages in thread
From: Jan Viktorin @ 2019-08-28 11:26 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit, dev, Ivan Ilchenko

On Wed, 28 Aug 2019 13:09:51 +0300
Andrew Rybchenko <arybchenko@solarflare.com> wrote:

> On 8/28/19 12:51 PM, Jan Viktorin wrote:
> > On Tue, 27 Aug 2019 15:25:12 +0100
> > Andrew Rybchenko <arybchenko@solarflare.com> wrote:
> >  
> >> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> >>
> >> Change rte_eth_dev_info_get() return value from void to int and
> >> return negative errno values in case of error conditions.
> >> Modify rte_eth_dev_info_get() usage across the ethdev according
> >> to new return type.  
> > Hello Andrew,
> >
> > I didn't find any cover letter describing the true intentions of
> > this patchset. Anyway, see below a short comment...  
> 
> The cover letter [1] was sent together with the patch.
> 
> [1] http://mails.dpdk.org/archives/dev/2019-August/141593.html

Thanks. So, the goal is "just" to replace void by int. This is what I
was missing...

See below.

> 
> >> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> >> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> >> ---
> >>   doc/guides/rel_notes/deprecation.rst   |  1 -
> >>   doc/guides/rel_notes/release_19_11.rst |  5 ++-
> >>   lib/librte_ethdev/rte_ethdev.c         | 71
> >> ++++++++++++++++++++++++---------- lib/librte_ethdev/rte_ethdev.h
> >>      |  6 ++- 4 files changed, 60 insertions(+), 23 deletions(-)  
> > [...]
> >  
> >> b/lib/librte_ethdev/rte_ethdev.h index dc6596b..09c278d 100644
> >> --- a/lib/librte_ethdev/rte_ethdev.h
> >> +++ b/lib/librte_ethdev/rte_ethdev.h
> >> @@ -2366,8 +2366,12 @@ int
> >> rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
> >>    * @param dev_info
> >>    *   A pointer to a structure of type *rte_eth_dev_info* to be
> >> filled with
> >>    *   the contextual information of the Ethernet device.
> >> + * @return
> >> + *   - (0) if successful.
> >> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist
> >> for the device.  
> > I believe that allowing PMDs to return -ENOTSUP is not a good idea.
> > At the moment, all PMDs provides this kind of information. It is not
> > always very reliable piece of information but for me, it is a piece
> > of gold I would not like to loose when configuring devices.
> >
> > I think it should be mandatory for all PMDs to provide this
> > function. Another possible way, give a sane default contents of
> > this structure. But, please, do not return -ENOTSUP.  
> 
> I agree that dev_infos_get() callback should be mandatory, but
> what the function should do if the callback is not provided?

One way would be to fail to register a PMD without that callback.
Such PMD driver would be simply wrong. This is what I mean by saying
"mandatory" - the callback MUST be provided.

DPDK could be so nice to provide a default callback named like
default_dev_infos_get_when_you_are_incompetent_pmd_author() returning
mostly zeros and some always "known metadata" like device pointer,
driver_name, ...

> I think that a sane default contents is more harm than an error
> (basically that's what we had before the patch).

Well, the dev info API is not in the best possible condition. And I
believe that this is not a secret. Especially, I am missing a kind of
specification of the structure contents (API doc is not satisfactory at
the moment). E.g. what does it mean when dev_info.max_rx_queues ==
65535? Similarly max_rx_pktlen == 65535. IMHO, this is the source of
harm - no spec. Let's return back to the thread topic.

For me, at the application level, I need to get at least identification
of the device - bus name, driver name, device ID. The dev info
structure gives me those. If there is a better way to retrieve these
info by port_id then I have no objections to allow to return -ENOTSUP.
However, the only well-defined way seems to be rte_eth_dev_info_get().
If a PMD does not give it to me, such PMD becomes simply useless.

I am currently experiencing 2 different PMDs and both provide slightly
different semantics of the dev info structure. That is bad, of course.
However, I can stand it if I know some info about the device -
as I've already mentioned: ID, driver and bus.

> Since the function may return error, caller should take it into
> account anyway. Yes, some error codes could have special
> handling, but default error handling is required in any case.
> 

You are absolutely right and I support such changes.

Regards
Jan


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28  7:02   ` Andrew Rybchenko
@ 2019-08-28 13:42     ` Aaron Conole
  2019-08-28 14:29       ` Andrew Rybchenko
  0 siblings, 1 reply; 272+ messages in thread
From: Aaron Conole @ 2019-08-28 13:42 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: Thomas Monjalon, Ferruh Yigit, dev, Ivan Ilchenko

Andrew Rybchenko <arybchenko@solarflare.com> writes:

> On 8/27/19 11:47 PM, Aaron Conole wrote:
>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>
>>> It is the first patch series to get rid of void returning functions
>>> in ethdev in accordance with deprecation notice [1].
>> This is a huge series, and I suggest to combine some of the work, and/or
>> break it up.
>
> I can send patches for examples separately, but it will not help a lot.
> I can squash changes in examples, but I think it is wrong since it would
> make review harder - different maintainers and different practices to
> handle error in different examples (and we tried to take it into account).

Hrrm?  Not sure what you mean.

Patches should be broken up by logical change.  That way, it is easy to
bisect and isolate what has changed.  This series, it seems like there's
a single logical change, and that's been spread over lots of patches.

I think grouping all the examples and all the app/test together, would
make the series 14 review-able patches.  As it is, stepping through 40+
10-line emails is much more tedious (not to mention needing to apply
them, check each for build, etc).

> Other ideas?
>
>> Additionally, this patch breaks the ring_pmd_autotest unit test, but I
>> didn't bisect it to find out where.
>
> Many thanks, we'll take a look.

This is actually what I'm more concerned about anyway.  Please do
address this.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28 13:42     ` Aaron Conole
@ 2019-08-28 14:29       ` Andrew Rybchenko
  2019-08-29 17:05         ` Thomas Monjalon
  0 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-28 14:29 UTC (permalink / raw)
  To: Aaron Conole; +Cc: Thomas Monjalon, Ferruh Yigit, dev, Ivan Ilchenko

On 8/28/19 4:42 PM, Aaron Conole wrote:
> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>
>> On 8/27/19 11:47 PM, Aaron Conole wrote:
>>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>>
>>>> It is the first patch series to get rid of void returning functions
>>>> in ethdev in accordance with deprecation notice [1].
>>> This is a huge series, and I suggest to combine some of the work, and/or
>>> break it up.
>> I can send patches for examples separately, but it will not help a lot.
>> I can squash changes in examples, but I think it is wrong since it would
>> make review harder - different maintainers and different practices to
>> handle error in different examples (and we tried to take it into account).
> Hrrm?  Not sure what you mean.

I mean that it is easier to review many small patches than one huge patch
especially when these files are maintained by different people.

> Patches should be broken up by logical change.  That way, it is easy to
> bisect and isolate what has changed.  This series, it seems like there's
> a single logical change, and that's been spread over lots of patches.

Single huge patch is worse for both bisect and review. When patch is huge
and bisect says that the patch is guilty, you still need to find out which
snippet/change is guilty.

In this particular case nothing prevents to split the patch make it easier
to review and bisect.

> I think grouping all the examples and all the app/test together, would
> make the series 14 review-able patches.  As it is, stepping through 40+
> 10-line emails is much more tedious (not to mention needing to apply
> them, check each for build, etc).

Yes, less build cycles are required for smaller number of patches, but
anyway automation does (should do) it. So, not that important.

I disagree that it is easier to review one huge patch. Sorry.
I think it is important here that different examples are maintained
by different people. Anyway if more reviewers will support the idea
to squash examples into once patch, technically it is trial to do.

>> Other ideas?
>>
>>> Additionally, this patch breaks the ring_pmd_autotest unit test, but I
>>> didn't bisect it to find out where.
>> Many thanks, we'll take a look.
> This is actually what I'm more concerned about anyway.  Please do
> address this.


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28 11:26       ` Jan Viktorin
@ 2019-08-28 14:39         ` Andrew Rybchenko
  2019-08-29 16:56           ` Thomas Monjalon
  0 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-08-28 14:39 UTC (permalink / raw)
  To: Jan Viktorin, Thomas Monjalon, Ferruh Yigit
  Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, Ivan Ilchenko

@Thomas, @Ferruh, please, see below.

On 8/28/19 2:26 PM, Jan Viktorin wrote:
> On Wed, 28 Aug 2019 13:09:51 +0300
> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>
>> On 8/28/19 12:51 PM, Jan Viktorin wrote:
>>> On Tue, 27 Aug 2019 15:25:12 +0100
>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>   
>>>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>>>
>>>> Change rte_eth_dev_info_get() return value from void to int and
>>>> return negative errno values in case of error conditions.
>>>> Modify rte_eth_dev_info_get() usage across the ethdev according
>>>> to new return type.
>>> Hello Andrew,
>>>
>>> I didn't find any cover letter describing the true intentions of
>>> this patchset. Anyway, see below a short comment...
>> The cover letter [1] was sent together with the patch.
>>
>> [1] http://mails.dpdk.org/archives/dev/2019-August/141593.html
> Thanks. So, the goal is "just" to replace void by int. This is what I
> was missing...

Got it. Will try to improve it.

> See below.

See below as well.

>>>> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> ---
>>>>    doc/guides/rel_notes/deprecation.rst   |  1 -
>>>>    doc/guides/rel_notes/release_19_11.rst |  5 ++-
>>>>    lib/librte_ethdev/rte_ethdev.c         | 71
>>>> ++++++++++++++++++++++++---------- lib/librte_ethdev/rte_ethdev.h
>>>>       |  6 ++- 4 files changed, 60 insertions(+), 23 deletions(-)
>>> [...]
>>>   
>>>> b/lib/librte_ethdev/rte_ethdev.h index dc6596b..09c278d 100644
>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>> @@ -2366,8 +2366,12 @@ int
>>>> rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
>>>>     * @param dev_info
>>>>     *   A pointer to a structure of type *rte_eth_dev_info* to be
>>>> filled with
>>>>     *   the contextual information of the Ethernet device.
>>>> + * @return
>>>> + *   - (0) if successful.
>>>> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist
>>>> for the device.
>>> I believe that allowing PMDs to return -ENOTSUP is not a good idea.
>>> At the moment, all PMDs provides this kind of information. It is not
>>> always very reliable piece of information but for me, it is a piece
>>> of gold I would not like to loose when configuring devices.
>>>
>>> I think it should be mandatory for all PMDs to provide this
>>> function. Another possible way, give a sane default contents of
>>> this structure. But, please, do not return -ENOTSUP.
>> I agree that dev_infos_get() callback should be mandatory, but
>> what the function should do if the callback is not provided?
> One way would be to fail to register a PMD without that callback.
> Such PMD driver would be simply wrong. This is what I mean by saying
> "mandatory" - the callback MUST be provided.

Typically callbacks are set on probe and
rte_eth_dev_pci_generic_probe() and similar functions could
be updated to reject devices with missing dev_infos_get callback.
However, there is a secondary process cases where dev_infos_get
is not essential since control path may be unsupported in secondary
process.

Anyway, I think it is a separate story.

> DPDK could be so nice to provide a default callback named like
> default_dev_infos_get_when_you_are_incompetent_pmd_author() returning
> mostly zeros and some always "known metadata" like device pointer,
> driver_name, ...

Thomas, Ferruh, what do you think?

>> I think that a sane default contents is more harm than an error
>> (basically that's what we had before the patch).
> Well, the dev info API is not in the best possible condition. And I
> believe that this is not a secret. Especially, I am missing a kind of
> specification of the structure contents (API doc is not satisfactory at
> the moment). E.g. what does it mean when dev_info.max_rx_queues ==
> 65535? Similarly max_rx_pktlen == 65535. IMHO, this is the source of
> harm - no spec. Let's return back to the thread topic.

I see.

> For me, at the application level, I need to get at least identification
> of the device - bus name, driver name, device ID. The dev info
> structure gives me those. If there is a better way to retrieve these
> info by port_id then I have no objections to allow to return -ENOTSUP.
> However, the only well-defined way seems to be rte_eth_dev_info_get().
> If a PMD does not give it to me, such PMD becomes simply useless.
>
> I am currently experiencing 2 different PMDs and both provide slightly
> different semantics of the dev info structure. That is bad, of course.
> However, I can stand it if I know some info about the device -
> as I've already mentioned: ID, driver and bus.
>
>> Since the function may return error, caller should take it into
>> account anyway. Yes, some error codes could have special
>> handling, but default error handling is required in any case.
>>
> You are absolutely right and I support such changes.

Thanks,
Andrew.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28 14:39         ` Andrew Rybchenko
@ 2019-08-29 16:56           ` Thomas Monjalon
  2019-09-02  9:33             ` Ferruh Yigit
  0 siblings, 1 reply; 272+ messages in thread
From: Thomas Monjalon @ 2019-08-29 16:56 UTC (permalink / raw)
  To: Andrew Rybchenko, Jan Viktorin, Ferruh Yigit
  Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, Ivan Ilchenko

28/08/2019 16:39, Andrew Rybchenko:
> On 8/28/19 2:26 PM, Jan Viktorin wrote:
> > Andrew Rybchenko <arybchenko@solarflare.com> wrote:
> >> On 8/28/19 12:51 PM, Jan Viktorin wrote:
> >>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
> >>>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> >>>> + * @return
> >>>> + *   - (0) if successful.
> >>>> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist
> >>>> for the device.
> >>> I believe that allowing PMDs to return -ENOTSUP is not a good idea.
> >>> At the moment, all PMDs provides this kind of information. It is not
> >>> always very reliable piece of information but for me, it is a piece
> >>> of gold I would not like to loose when configuring devices.
> >>>
> >>> I think it should be mandatory for all PMDs to provide this
> >>> function. Another possible way, give a sane default contents of
> >>> this structure. But, please, do not return -ENOTSUP.
> >> I agree that dev_infos_get() callback should be mandatory, but
> >> what the function should do if the callback is not provided?
> > One way would be to fail to register a PMD without that callback.
> > Such PMD driver would be simply wrong. This is what I mean by saying
> > "mandatory" - the callback MUST be provided.
> 
> Typically callbacks are set on probe and
> rte_eth_dev_pci_generic_probe() and similar functions could
> be updated to reject devices with missing dev_infos_get callback.
> However, there is a secondary process cases where dev_infos_get
> is not essential since control path may be unsupported in secondary
> process.
> 
> Anyway, I think it is a separate story.
> 
> > DPDK could be so nice to provide a default callback named like
> > default_dev_infos_get_when_you_are_incompetent_pmd_author() returning
> > mostly zeros and some always "known metadata" like device pointer,
> > driver_name, ...
> 
> Thomas, Ferruh, what do you think?

I like the idea of making some functions mandatory.
If we need to provide a default callback, why not.

I'm also thinking we need to better enforce a standardization
of basic features to be implemented. It would make DPDK more mature.



^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-28 14:29       ` Andrew Rybchenko
@ 2019-08-29 17:05         ` Thomas Monjalon
  2019-09-02 13:04           ` Ferruh Yigit
  2019-09-03 12:27           ` Andrew Rybchenko
  0 siblings, 2 replies; 272+ messages in thread
From: Thomas Monjalon @ 2019-08-29 17:05 UTC (permalink / raw)
  To: Andrew Rybchenko, Aaron Conole; +Cc: Ferruh Yigit, dev, Ivan Ilchenko

28/08/2019 16:29, Andrew Rybchenko:
> On 8/28/19 4:42 PM, Aaron Conole wrote:
> > Andrew Rybchenko <arybchenko@solarflare.com> writes:
> >> On 8/27/19 11:47 PM, Aaron Conole wrote:
> >>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
> >>>
> >>>> It is the first patch series to get rid of void returning functions
> >>>> in ethdev in accordance with deprecation notice [1].
> >>> This is a huge series, and I suggest to combine some of the work, and/or
> >>> break it up.
> >> I can send patches for examples separately, but it will not help a lot.
> >> I can squash changes in examples, but I think it is wrong since it would
> >> make review harder - different maintainers and different practices to
> >> handle error in different examples (and we tried to take it into account).
> > Hrrm?  Not sure what you mean.
> 
> I mean that it is easier to review many small patches than one huge patch
> especially when these files are maintained by different people.
> 
> > Patches should be broken up by logical change.  That way, it is easy to
> > bisect and isolate what has changed.  This series, it seems like there's
> > a single logical change, and that's been spread over lots of patches.
> 
> Single huge patch is worse for both bisect and review. When patch is huge
> and bisect says that the patch is guilty, you still need to find out which
> snippet/change is guilty.
> 
> In this particular case nothing prevents to split the patch make it easier
> to review and bisect.
> 
> > I think grouping all the examples and all the app/test together, would
> > make the series 14 review-able patches.  As it is, stepping through 40+
> > 10-line emails is much more tedious (not to mention needing to apply
> > them, check each for build, etc).
> 
> Yes, less build cycles are required for smaller number of patches, but
> anyway automation does (should do) it. So, not that important.
> 
> I disagree that it is easier to review one huge patch. Sorry.
> I think it is important here that different examples are maintained
> by different people. Anyway if more reviewers will support the idea
> to squash examples into once patch, technically it is trial to do.

When doing same kind of change on multiple applications,
splitting patches won't help any bisect (they are all different
applications anyway). And I think squashing can better show the idea that
every applications got the same kind of change (thanks for that).
In general, I think patches deserve to be split when there is something
interesting to say in the commit log. If you want to describe a
different logic of each app, why not. The other way is to explain
some exceptions for some applications in a signle patch.

My conclusion is that it is often hard to find the good balance,
between split and squash, and I can understand any motivation :)
Sometimes I squash some patches on apply after they got all reviewed
separately. In this case, I didn't look yet :)



^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-29 16:56           ` Thomas Monjalon
@ 2019-09-02  9:33             ` Ferruh Yigit
  2019-09-03 12:09               ` Andrew Rybchenko
  0 siblings, 1 reply; 272+ messages in thread
From: Ferruh Yigit @ 2019-09-02  9:33 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko, Jan Viktorin
  Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, Ivan Ilchenko

On 8/29/2019 5:56 PM, Thomas Monjalon wrote:
> 28/08/2019 16:39, Andrew Rybchenko:
>> On 8/28/19 2:26 PM, Jan Viktorin wrote:
>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>> On 8/28/19 12:51 PM, Jan Viktorin wrote:
>>>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>>>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>>>>> + * @return
>>>>>> + *   - (0) if successful.
>>>>>> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist
>>>>>> for the device.
>>>>> I believe that allowing PMDs to return -ENOTSUP is not a good idea.
>>>>> At the moment, all PMDs provides this kind of information. It is not
>>>>> always very reliable piece of information but for me, it is a piece
>>>>> of gold I would not like to loose when configuring devices.
>>>>>
>>>>> I think it should be mandatory for all PMDs to provide this
>>>>> function. Another possible way, give a sane default contents of
>>>>> this structure. But, please, do not return -ENOTSUP.
>>>> I agree that dev_infos_get() callback should be mandatory, but
>>>> what the function should do if the callback is not provided?
>>> One way would be to fail to register a PMD without that callback.
>>> Such PMD driver would be simply wrong. This is what I mean by saying
>>> "mandatory" - the callback MUST be provided.
>>
>> Typically callbacks are set on probe and
>> rte_eth_dev_pci_generic_probe() and similar functions could
>> be updated to reject devices with missing dev_infos_get callback.
>> However, there is a secondary process cases where dev_infos_get
>> is not essential since control path may be unsupported in secondary
>> process.
>>
>> Anyway, I think it is a separate story.
>>
>>> DPDK could be so nice to provide a default callback named like
>>> default_dev_infos_get_when_you_are_incompetent_pmd_author() returning
>>> mostly zeros and some always "known metadata" like device pointer,
>>> driver_name, ...
>>
>> Thomas, Ferruh, what do you think?
> 
> I like the idea of making some functions mandatory.
> If we need to provide a default callback, why not.
> 
> I'm also thinking we need to better enforce a standardization
> of basic features to be implemented. It would make DPDK more mature.
> 
> 

+1 to make some dev_ops mandatory. At first I can think of:
dev_infos_get
dev_configure
rx_queue_setup
tx_queue_setup
dev_start
dev_stop

specific to 'dev_infos_get', it is to get device info, not sure a default
callback is good idea for it.

And overall agree that 'rte_eth_dev_info_get()' can be documented more/better ...


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info
  2019-08-27 14:25 ` [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-02 12:40   ` Ferruh Yigit
  2019-09-03 11:59     ` Andrew Rybchenko
  2019-09-30  8:43   ` Zhao1, Wei
  1 sibling, 1 reply; 272+ messages in thread
From: Ferruh Yigit @ 2019-09-02 12:40 UTC (permalink / raw)
  To: Andrew Rybchenko, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	Adrien Mazarguil
  Cc: dev, Ivan Ilchenko

On 8/27/2019 3:25 PM, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> 
> Add eth_dev_info_get_print_err() which is a wrapper for
> rte_eth_dev_info_get() printing error if rte_eth_dev_info_get()
> fails and returning its status code.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

<...>

> @@ -2410,9 +2414,13 @@ struct cmd_config_rss_hash_key {
>  	struct rte_eth_dev_info dev_info;
>  	uint8_t hash_key_size;
>  	uint32_t key_len;
> +	int ret;
>  
>  	memset(&dev_info, 0, sizeof(dev_info));

It should be in different most probably, but the 'memset' before
'rte_eth_dev_info_get()' looks redundant, since API does the same.

<...>

> @@ -4746,7 +4780,8 @@ struct cmd_tunnel_tso_set_result {
>  {
>  	struct rte_eth_dev_info dev_info;
>  
> -	rte_eth_dev_info_get(port_id, &dev_info);
> +	eth_dev_info_get_print_err(port_id, &dev_info);

Should we check the return value here too? And return 'dev_info' immediately on
error instead of going on.

<...>

> @@ -1136,7 +1139,10 @@ struct extmem_param {
>  		/* Apply default TxRx configuration for all ports */
>  		port->dev_conf.txmode = tx_mode;
>  		port->dev_conf.rxmode = rx_mode;
> -		rte_eth_dev_info_get(pid, &port->dev_info);
> +
> +		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
> +		if (ret != 0)
> +			return;

What do you think 'rte_exit()' here instead of 'return', 'init_config()' doesn't
return error, and returning from init will assume everyting setup, 0 number of
queues for any port eventually will cause an exit in the app, better to fail
where error occurs.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-29 17:05         ` Thomas Monjalon
@ 2019-09-02 13:04           ` Ferruh Yigit
  2019-09-03 12:27           ` Andrew Rybchenko
  1 sibling, 0 replies; 272+ messages in thread
From: Ferruh Yigit @ 2019-09-02 13:04 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko, Aaron Conole; +Cc: dev, Ivan Ilchenko

On 8/29/2019 6:05 PM, Thomas Monjalon wrote:
> 28/08/2019 16:29, Andrew Rybchenko:
>> On 8/28/19 4:42 PM, Aaron Conole wrote:
>>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>>> On 8/27/19 11:47 PM, Aaron Conole wrote:
>>>>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>>>>
>>>>>> It is the first patch series to get rid of void returning functions
>>>>>> in ethdev in accordance with deprecation notice [1].
>>>>> This is a huge series, and I suggest to combine some of the work, and/or
>>>>> break it up.
>>>> I can send patches for examples separately, but it will not help a lot.
>>>> I can squash changes in examples, but I think it is wrong since it would
>>>> make review harder - different maintainers and different practices to
>>>> handle error in different examples (and we tried to take it into account).
>>> Hrrm?  Not sure what you mean.
>>
>> I mean that it is easier to review many small patches than one huge patch
>> especially when these files are maintained by different people.
>>
>>> Patches should be broken up by logical change.  That way, it is easy to
>>> bisect and isolate what has changed.  This series, it seems like there's
>>> a single logical change, and that's been spread over lots of patches.
>>
>> Single huge patch is worse for both bisect and review. When patch is huge
>> and bisect says that the patch is guilty, you still need to find out which
>> snippet/change is guilty.
>>
>> In this particular case nothing prevents to split the patch make it easier
>> to review and bisect.
>>
>>> I think grouping all the examples and all the app/test together, would
>>> make the series 14 review-able patches.  As it is, stepping through 40+
>>> 10-line emails is much more tedious (not to mention needing to apply
>>> them, check each for build, etc).
>>
>> Yes, less build cycles are required for smaller number of patches, but
>> anyway automation does (should do) it. So, not that important.
>>
>> I disagree that it is easier to review one huge patch. Sorry.
>> I think it is important here that different examples are maintained
>> by different people. Anyway if more reviewers will support the idea
>> to squash examples into once patch, technically it is trial to do.
> 
> When doing same kind of change on multiple applications,
> splitting patches won't help any bisect (they are all different
> applications anyway). And I think squashing can better show the idea that
> every applications got the same kind of change (thanks for that).
> In general, I think patches deserve to be split when there is something
> interesting to say in the commit log. If you want to describe a
> different logic of each app, why not. The other way is to explain
> some exceptions for some applications in a signle patch.
> 
> My conclusion is that it is often hard to find the good balance,
> between split and squash, and I can understand any motivation :)
> Sometimes I squash some patches on apply after they got all reviewed
> separately. In this case, I didn't look yet :)
> 

I would like to get this early if possible, before end of this week when I
expect there will be a peak of patches before the deadline.

Overall patchset looks good to me, only one comment on the testpmd one, it also
passes automated builds/checks (including patch by patch builds).
(ring_pmd_autotest needs to be fixed of course)

For the patchset, I agree with Andrew's argument, yes logically same change and
apps/examples/tests can be merged into single commit but it would be big &
harder to review. Since it is already split, for me it looks good as it is.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info
  2019-09-02 12:40   ` Ferruh Yigit
@ 2019-09-03 11:59     ` Andrew Rybchenko
  0 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 11:59 UTC (permalink / raw)
  To: Ferruh Yigit, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	Adrien Mazarguil
  Cc: dev, Ivan Ilchenko

On 9/2/19 3:40 PM, Ferruh Yigit wrote:
> On 8/27/2019 3:25 PM, Andrew Rybchenko wrote:
>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>
>> Add eth_dev_info_get_print_err() which is a wrapper for
>> rte_eth_dev_info_get() printing error if rte_eth_dev_info_get()
>> fails and returning its status code.
>>
>> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> <...>
>
>> @@ -2410,9 +2414,13 @@ struct cmd_config_rss_hash_key {
>>   	struct rte_eth_dev_info dev_info;
>>   	uint8_t hash_key_size;
>>   	uint32_t key_len;
>> +	int ret;
>>   
>>   	memset(&dev_info, 0, sizeof(dev_info));
> It should be in different most probably, but the 'memset' before
> 'rte_eth_dev_info_get()' looks redundant, since API does the same.

I'll add pre-patch to fix it everywhere I found.

> <...>
>
>> @@ -4746,7 +4780,8 @@ struct cmd_tunnel_tso_set_result {
>>   {
>>   	struct rte_eth_dev_info dev_info;
>>   
>> -	rte_eth_dev_info_get(port_id, &dev_info);
>> +	eth_dev_info_get_print_err(port_id, &dev_info);
> Should we check the return value here too? And return 'dev_info' immediately on
> error instead of going on.

Thanks, missed it.

Also there are two more cases in testpmd to get maximum number
of Rx/Tx queue. I'll skip port and continue if device info get fails.

> <...>
>
>> @@ -1136,7 +1139,10 @@ struct extmem_param {
>>   		/* Apply default TxRx configuration for all ports */
>>   		port->dev_conf.txmode = tx_mode;
>>   		port->dev_conf.rxmode = rx_mode;
>> -		rte_eth_dev_info_get(pid, &port->dev_info);
>> +
>> +		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
>> +		if (ret != 0)
>> +			return;
> What do you think 'rte_exit()' here instead of 'return', 'init_config()' doesn't
> return error, and returning from init will assume everyting setup, 0 number of
> queues for any port eventually will cause an exit in the app, better to fail
> where error occurs.

I agree. I've considered to skip the port and continue with other port, but
it is better to catch such problems earlier instead of hiding behind complex
logic.

Thanks, Andrew.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-02  9:33             ` Ferruh Yigit
@ 2019-09-03 12:09               ` Andrew Rybchenko
  2019-09-03 12:36                 ` Ferruh Yigit
  0 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 12:09 UTC (permalink / raw)
  To: Ferruh Yigit, Thomas Monjalon, Jan Viktorin
  Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, Ivan Ilchenko

On 9/2/19 12:33 PM, Ferruh Yigit wrote:
> On 8/29/2019 5:56 PM, Thomas Monjalon wrote:
>> 28/08/2019 16:39, Andrew Rybchenko:
>>> On 8/28/19 2:26 PM, Jan Viktorin wrote:
>>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>>> On 8/28/19 12:51 PM, Jan Viktorin wrote:
>>>>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>>>>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>>>>>> + * @return
>>>>>>> + *   - (0) if successful.
>>>>>>> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist
>>>>>>> for the device.
>>>>>> I believe that allowing PMDs to return -ENOTSUP is not a good idea.
>>>>>> At the moment, all PMDs provides this kind of information. It is not
>>>>>> always very reliable piece of information but for me, it is a piece
>>>>>> of gold I would not like to loose when configuring devices.
>>>>>>
>>>>>> I think it should be mandatory for all PMDs to provide this
>>>>>> function. Another possible way, give a sane default contents of
>>>>>> this structure. But, please, do not return -ENOTSUP.
>>>>> I agree that dev_infos_get() callback should be mandatory, but
>>>>> what the function should do if the callback is not provided?
>>>> One way would be to fail to register a PMD without that callback.
>>>> Such PMD driver would be simply wrong. This is what I mean by saying
>>>> "mandatory" - the callback MUST be provided.
>>> Typically callbacks are set on probe and
>>> rte_eth_dev_pci_generic_probe() and similar functions could
>>> be updated to reject devices with missing dev_infos_get callback.
>>> However, there is a secondary process cases where dev_infos_get
>>> is not essential since control path may be unsupported in secondary
>>> process.
>>>
>>> Anyway, I think it is a separate story.
>>>
>>>> DPDK could be so nice to provide a default callback named like
>>>> default_dev_infos_get_when_you_are_incompetent_pmd_author() returning
>>>> mostly zeros and some always "known metadata" like device pointer,
>>>> driver_name, ...
>>> Thomas, Ferruh, what do you think?
>> I like the idea of making some functions mandatory.
>> If we need to provide a default callback, why not.
>>
>> I'm also thinking we need to better enforce a standardization
>> of basic features to be implemented. It would make DPDK more mature.
>>
>>
> +1 to make some dev_ops mandatory. At first I can think of:
> dev_infos_get
> dev_configure
> rx_queue_setup
> tx_queue_setup
> dev_start
> dev_stop

+1 as well, but I think it is a separate story.
I really don't want to complicate so big patchset by introducing
more logic here.

As far as I can see dev_infos_get callback is implemented in
all network PMDs. So, I think the topic is not gating the patchset.

> specific to 'dev_infos_get', it is to get device info, not sure a default
> callback is good idea for it.
>
> And overall agree that 'rte_eth_dev_info_get()' can be documented more/better ...

Me too


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-29 17:05         ` Thomas Monjalon
  2019-09-02 13:04           ` Ferruh Yigit
@ 2019-09-03 12:27           ` Andrew Rybchenko
  2019-09-03 13:58             ` Aaron Conole
  1 sibling, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 12:27 UTC (permalink / raw)
  To: Thomas Monjalon, Aaron Conole; +Cc: Ferruh Yigit, dev, Ivan Ilchenko

On 8/29/19 8:05 PM, Thomas Monjalon wrote:
> 28/08/2019 16:29, Andrew Rybchenko:
>> On 8/28/19 4:42 PM, Aaron Conole wrote:
>>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>>> On 8/27/19 11:47 PM, Aaron Conole wrote:
>>>>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>>>>
>>>>>> It is the first patch series to get rid of void returning functions
>>>>>> in ethdev in accordance with deprecation notice [1].
>>>>> This is a huge series, and I suggest to combine some of the work, and/or
>>>>> break it up.
>>>> I can send patches for examples separately, but it will not help a lot.
>>>> I can squash changes in examples, but I think it is wrong since it would
>>>> make review harder - different maintainers and different practices to
>>>> handle error in different examples (and we tried to take it into account).
>>> Hrrm?  Not sure what you mean.
>> I mean that it is easier to review many small patches than one huge patch
>> especially when these files are maintained by different people.
>>
>>> Patches should be broken up by logical change.  That way, it is easy to
>>> bisect and isolate what has changed.  This series, it seems like there's
>>> a single logical change, and that's been spread over lots of patches.
>> Single huge patch is worse for both bisect and review. When patch is huge
>> and bisect says that the patch is guilty, you still need to find out which
>> snippet/change is guilty.
>>
>> In this particular case nothing prevents to split the patch make it easier
>> to review and bisect.
>>
>>> I think grouping all the examples and all the app/test together, would
>>> make the series 14 review-able patches.  As it is, stepping through 40+
>>> 10-line emails is much more tedious (not to mention needing to apply
>>> them, check each for build, etc).
>> Yes, less build cycles are required for smaller number of patches, but
>> anyway automation does (should do) it. So, not that important.
>>
>> I disagree that it is easier to review one huge patch. Sorry.
>> I think it is important here that different examples are maintained
>> by different people. Anyway if more reviewers will support the idea
>> to squash examples into once patch, technically it is trial to do.
> When doing same kind of change on multiple applications,
> splitting patches won't help any bisect (they are all different
> applications anyway). And I think squashing can better show the idea that
> every applications got the same kind of change (thanks for that).
> In general, I think patches deserve to be split when there is something
> interesting to say in the commit log. If you want to describe a
> different logic of each app, why not. The other way is to explain
> some exceptions for some applications in a signle patch.

Thanks a lot, makes sense and I agree with explanations.
The only problem is review of such huge patches, when
reviewer needs to find out his snippet. Also split version
is better for patchwork reviewed/acked counters. It is
clear which snippets are reviewed, which are not.
Unfortunately split does not help this patchset to get
more attention from reviewers :(

> My conclusion is that it is often hard to find the good balance,
> between split and squash, and I can understand any motivation :)
> Sometimes I squash some patches on apply after they got all reviewed
> separately. In this case, I didn't look yet :)


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 12:09               ` Andrew Rybchenko
@ 2019-09-03 12:36                 ` Ferruh Yigit
  0 siblings, 0 replies; 272+ messages in thread
From: Ferruh Yigit @ 2019-09-03 12:36 UTC (permalink / raw)
  To: Andrew Rybchenko, Thomas Monjalon, Jan Viktorin
  Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, Ivan Ilchenko

On 9/3/2019 1:09 PM, Andrew Rybchenko wrote:
> On 9/2/19 12:33 PM, Ferruh Yigit wrote:
>> On 8/29/2019 5:56 PM, Thomas Monjalon wrote:
>>> 28/08/2019 16:39, Andrew Rybchenko:
>>>> On 8/28/19 2:26 PM, Jan Viktorin wrote:
>>>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>>>> On 8/28/19 12:51 PM, Jan Viktorin wrote:
>>>>>>> Andrew Rybchenko <arybchenko@solarflare.com> wrote:
>>>>>>>> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
>>>>>>>> + * @return
>>>>>>>> + *   - (0) if successful.
>>>>>>>> + *   - (-ENOTSUP) if support for dev_infos_get() does not exist
>>>>>>>> for the device.
>>>>>>> I believe that allowing PMDs to return -ENOTSUP is not a good idea.
>>>>>>> At the moment, all PMDs provides this kind of information. It is not
>>>>>>> always very reliable piece of information but for me, it is a piece
>>>>>>> of gold I would not like to loose when configuring devices.
>>>>>>>
>>>>>>> I think it should be mandatory for all PMDs to provide this
>>>>>>> function. Another possible way, give a sane default contents of
>>>>>>> this structure. But, please, do not return -ENOTSUP.
>>>>>> I agree that dev_infos_get() callback should be mandatory, but
>>>>>> what the function should do if the callback is not provided?
>>>>> One way would be to fail to register a PMD without that callback.
>>>>> Such PMD driver would be simply wrong. This is what I mean by saying
>>>>> "mandatory" - the callback MUST be provided.
>>>> Typically callbacks are set on probe and
>>>> rte_eth_dev_pci_generic_probe() and similar functions could
>>>> be updated to reject devices with missing dev_infos_get callback.
>>>> However, there is a secondary process cases where dev_infos_get
>>>> is not essential since control path may be unsupported in secondary
>>>> process.
>>>>
>>>> Anyway, I think it is a separate story.
>>>>
>>>>> DPDK could be so nice to provide a default callback named like
>>>>> default_dev_infos_get_when_you_are_incompetent_pmd_author() returning
>>>>> mostly zeros and some always "known metadata" like device pointer,
>>>>> driver_name, ...
>>>> Thomas, Ferruh, what do you think?
>>> I like the idea of making some functions mandatory.
>>> If we need to provide a default callback, why not.
>>>
>>> I'm also thinking we need to better enforce a standardization
>>> of basic features to be implemented. It would make DPDK more mature.
>>>
>>>
>> +1 to make some dev_ops mandatory. At first I can think of:
>> dev_infos_get
>> dev_configure
>> rx_queue_setup
>> tx_queue_setup
>> dev_start
>> dev_stop
> 
> +1 as well, but I think it is a separate story.
> I really don't want to complicate so big patchset by introducing
> more logic here.
> 
> As far as I can see dev_infos_get callback is implemented in
> all network PMDs. So, I think the topic is not gating the patchset.

Agreed it is a separate story and not a blocker for this set

> 
>> specific to 'dev_infos_get', it is to get device info, not sure a default
>> callback is good idea for it.
>>
>> And overall agree that 'rte_eth_dev_info_get()' can be documented more/better ...
> 
> Me too
> 


^ permalink raw reply	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (51 preceding siblings ...)
  2019-08-27 20:47 ` [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Aaron Conole
@ 2019-09-03 13:56 ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
                     ` (54 more replies)
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
  2019-09-12 16:42 ` [dpdk-dev] [PATCH v4 00/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
  54 siblings, 55 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Jan Viktorin, Aaron Conole
  Cc: dev, Ivan Ilchenko

It is the first patch series to get rid of void returning functions
in ethdev in accordance with deprecation notice [1].

Functions which return void are bad since they do not provide explicit
information to the caller if everything is OK or not. It was bugs in
rte_eth_dev_info_get() recently which kept device information
uninitialized if port ID is invalid.

The patch series updates rte_eth_dev_info_get() straightforward
to simply return error if port ID is invalid or driver does not
provide corresponding callback. In the future default callback
which fills in generic non driver specific information could be
added to help secondary processes cases when driver has no
callback in secondary process. Also the idea to make the callback
mandatory should be considered.

Patches to update examples are kept separately to simplify review,
but could be squashed on apply since logically it is the same
change in all applicable examples.

[1] https://patches.dpdk.org/patch/56969/

v2:
 - add a patch to change dev_infos_get prototype to return int as well
 - fix issue with ring_pmd_autotest (just inverted assert condition)
 - add missing net/failsafe patch
 - fix net/netsvc patch in accordance with review notes from Stephen
 - fix app/testpmd patch in accordance with review notes from Ferruh
 - add net/bnxt ack

Andrew Rybchenko (1):
  ethdev: remove redundunt device info cleanup before get

Ivan Ilchenko (53):
  ethdev: change rte_eth_dev_info_get() return value to int
  app/testpmd: check status of getting ethdev info
  app/eventdev: check status of getting ethdev info
  kni: check status of getting ethdev info
  latency: check status of getting ethdev info
  pdump: check status of getting ethdev info
  ring: check status of getting ethdev info
  app/procinfo: check status of getting ethdev info
  app/test: check status of getting ethdev info in bonding
  app/test: check ethdev info get result in event Rx adapter
  net/bnxt: check status of getting ethdev info
  net/bonding: check status of getting ethdev info
  net/failsafe: check status of getting ethdev info
  net/netvsc: check status of getting ethdev info
  net/softnic: check status of getting ethdev info
  ethdev: change eth_dev_infos_get_t to return int
  examples/rxtx_callbacks: check status of getting ethdev info
  examples/l3fwd: check status of getting ethdev info
  examples/qos_meter: check status of getting ethdev info
  examples/ip_frag: check status of getting ethdev info
  examples/performance-thread: check dev info get result
  examples/vmdq: check status of getting ethdev info
  examples/distributor: check status of getting ethdev info
  examples/l3fwd-acl: check status of getting ethdev info
  examples/vm_power: check status of getting ethdev info
  examples/qos_sched: check status of getting ethdev info
  examples/flow_filtering: check status of getting ethdev info
  examples/l3fwd-power: check status of getting ethdev info
  examples/l2fwd: check status of getting ethdev info
  examples/skeleton: check status of getting ethdev info
  examples/vmdq_dcb: check status of getting ethdev info
  examples/ipv4_multicast: check status of getting ethdev info
  examples/l2fwd-jobstats: check status of getting ethdev info
  examples/bond: check status of getting ethdev info
  examples/eventdev: check status of getting ethdev info
  examples/ip_reassembly: check status of getting ethdev info
  examples/vhost: check status of getting ethdev info
  examples/ptpclient: check status of getting ethdev info
  examples/link_status_interrupt: check dev info get result
  examples/tep_termination: check dev info get result
  examples/server_node_efd: check dev info get result
  examples/flow_classify: check status of getting ethdev info
  examples/packet_ordering: check dev info get result
  examples/l2fwd-crypto: check status of getting ethdev info
  examples/multi_process: check status of getting ethdev info
  examples/ipsec-secgw: check status of getting ethdev info
  examples/netmap_compat: check status of getting ethdev info
  examples/l2fwd-keepalive: check dev info get result
  examples/ip_pipeline: check status of getting ethdev info
  examples/load_balancer: check status of getting ethdev info
  examples/kni: check status of getting ethdev info
  examples/ethtool: check status of getting ethdev info
  examples/exception_path: check status of getting ethdev info

 app/proc-info/main.c                            |  15 ++-
 app/test-eventdev/test_perf_common.c            |   8 +-
 app/test-eventdev/test_pipeline_common.c        |   9 +-
 app/test-pmd/cmdline.c                          | 124 +++++++++++++++++++-----
 app/test-pmd/cmdline_flow.c                     |   5 +-
 app/test-pmd/config.c                           |  80 ++++++++++++---
 app/test-pmd/parameters.c                       |   8 +-
 app/test-pmd/testpmd.c                          |  40 ++++++--
 app/test-pmd/testpmd.h                          |   3 +
 app/test-pmd/util.c                             |  28 +++++-
 app/test/test_event_eth_rx_adapter.c            |   4 +-
 app/test/test_kni.c                             |  27 +++++-
 app/test/test_link_bonding_rssconf.c            |  33 ++++++-
 app/test/test_pmd_ring.c                        |   9 +-
 app/test/virtual_pmd.c                          |   4 +-
 doc/guides/rel_notes/deprecation.rst            |   1 -
 doc/guides/rel_notes/release_19_11.rst          |   5 +-
 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/bnxt/rte_pmd_bnxt.c                 | 122 ++++++++++++++++++++---
 drivers/net/bonding/rte_eth_bond_api.c          |  10 +-
 drivers/net/bonding/rte_eth_bond_pmd.c          |  40 +++++++-
 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             |   9 +-
 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/netvsc/hn_var.h                     |   2 +-
 drivers/net/netvsc/hn_vf.c                      |  15 ++-
 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/softnic/rte_eth_softnic_link.c      |   5 +-
 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 +-
 examples/bond/main.c                            |  14 ++-
 examples/distributor/main.c                     |   8 +-
 examples/ethtool/ethtool-app/main.c             |   8 +-
 examples/ethtool/lib/rte_ethtool.c              |  21 +++-
 examples/eventdev_pipeline/main.c               |   8 +-
 examples/exception_path/main.c                  |   7 +-
 examples/flow_classify/flow_classify.c          |   8 +-
 examples/flow_filtering/main.c                  |   7 +-
 examples/ip_fragmentation/main.c                |  14 ++-
 examples/ip_pipeline/kni.c                      |   5 +-
 examples/ip_pipeline/link.c                     |   3 +-
 examples/ip_reassembly/main.c                   |   7 +-
 examples/ipsec-secgw/ipsec-secgw.c              |   6 +-
 examples/ipsec-secgw/ipsec.c                    |   9 +-
 examples/ipsec-secgw/sa.c                       |  10 +-
 examples/ipv4_multicast/main.c                  |   7 +-
 examples/kni/main.c                             |  26 ++++-
 examples/l2fwd-crypto/main.c                    |   9 +-
 examples/l2fwd-jobstats/main.c                  |   8 +-
 examples/l2fwd-keepalive/main.c                 |   8 +-
 examples/l2fwd/main.c                           |   8 +-
 examples/l3fwd-acl/main.c                       |  22 ++++-
 examples/l3fwd-power/main.c                     |  22 ++++-
 examples/l3fwd/main.c                           |  14 ++-
 examples/link_status_interrupt/main.c           |   8 +-
 examples/load_balancer/init.c                   |   7 +-
 examples/multi_process/symmetric_mp/main.c      |   8 +-
 examples/netmap_compat/lib/compat_netmap.c      |   9 +-
 examples/packet_ordering/main.c                 |   8 +-
 examples/performance-thread/l3fwd-thread/main.c |  15 ++-
 examples/ptpclient/ptpclient.c                  |   9 +-
 examples/qos_meter/main.c                       |  16 ++-
 examples/qos_sched/init.c                       |   8 +-
 examples/rxtx_callbacks/main.c                  |   9 +-
 examples/server_node_efd/server/init.c          |   5 +-
 examples/skeleton/basicfwd.c                    |   8 +-
 examples/tep_termination/vxlan_setup.c          |   6 +-
 examples/vhost/main.c                           |   9 +-
 examples/vm_power_manager/main.c                |   8 +-
 examples/vmdq/main.c                            |  16 ++-
 examples/vmdq_dcb/main.c                        |  18 +++-
 lib/librte_ethdev/rte_ethdev.c                  |  71 ++++++++++----
 lib/librte_ethdev/rte_ethdev.h                  |   6 +-
 lib/librte_ethdev/rte_ethdev_core.h             |   4 +-
 lib/librte_latencystats/rte_latencystats.c      |  23 ++++-
 lib/librte_pdump/rte_pdump.c                    |   9 +-
 124 files changed, 1221 insertions(+), 291 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-04  8:32     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 02/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                     ` (53 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Pablo de Lara, Radu Nicolau,
	Akhil Goyal, Tomasz Kantecki, Ferruh Yigit
  Cc: dev, stable

rte_eth_dev_info_get() always fills in device information memory
with zeros on entry.

Fixes: b6719879855d ("ethdev: avoid getting uninitialized info for bad port")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-pmd/cmdline.c             | 4 ----
 app/test-pmd/config.c              | 2 --
 examples/ethtool/lib/rte_ethtool.c | 2 --
 examples/kni/main.c                | 1 -
 4 files changed, 9 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b6bc34b..e4dda93 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2319,7 +2319,6 @@ struct cmd_config_rss_hash_key {
 	uint8_t hash_key_size;
 	uint32_t key_len;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(hash_key))
@@ -2852,7 +2851,6 @@ struct cmd_config_rss_reta {
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct cmd_config_rss_reta *res = parsed_result;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
 	if (dev_info.reta_size == 0) {
 		printf("Redirection table size is 0 which is "
@@ -2972,7 +2970,6 @@ struct cmd_showport_reta {
 	struct rte_eth_dev_info dev_info;
 	uint16_t max_reta_size;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
 	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
 	if (res->size == 0 || res->size > max_reta_size) {
@@ -11091,7 +11088,6 @@ struct cmd_flow_director_result {
 		else if (!strncmp(res->pf_vf, "vf", 2)) {
 			struct rte_eth_dev_info dev_info;
 
-			memset(&dev_info, 0, sizeof(dev_info));
 			rte_eth_dev_info_get(res->port_id, &dev_info);
 			errno = 0;
 			vf_id = strtoul(res->pf_vf + 2, &end, 10);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..523b3d3 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -478,7 +478,6 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	}
 	port = &ports[port_id];
 	rte_eth_link_get_nowait(port_id, &link);
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	printf("\n%s Infos for port %-2d %s\n",
 	       info_border, port_id, info_border);
@@ -1623,7 +1622,6 @@ struct igb_ring_desc_16_bytes {
 #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 	struct rte_eth_dev_info dev_info;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (strstr(dev_info.driver_name, "i40e") != NULL) {
 		/* 32 bytes RX descriptor, i40e only */
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index 571c4e5..fd1692d 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -41,7 +41,6 @@
 		printf("Insufficient fw version buffer size, "
 		       "the minimum size should be %d\n", ret);
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 
 	strlcpy(drvinfo->driver, dev_info.driver_name,
@@ -372,7 +371,6 @@
 	struct rte_eth_dev_info dev_info;
 	uint16_t vf;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	num_vfs = dev_info.max_vfs;
 
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d71..17f695e 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -898,7 +898,6 @@ struct kni_interface_stats {
 			struct rte_kni_ops ops;
 			struct rte_eth_dev_info dev_info;
 
-			memset(&dev_info, 0, sizeof(dev_info));
 			rte_eth_dev_info_get(port_id, &dev_info);
 
 			/* Get the interface default mac address */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 02/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-04 16:40     ` Ferruh Yigit
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 03/54] app/testpmd: check status of getting ethdev info Andrew Rybchenko
                     ` (52 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

Change rte_eth_dev_info_get() return value from void to int and return
negative errno values in case of error conditions.
Modify rte_eth_dev_info_get() usage across the ethdev according
to new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/rel_notes/deprecation.rst   |  1 -
 doc/guides/rel_notes/release_19_11.rst |  5 ++-
 lib/librte_ethdev/rte_ethdev.c         | 71 ++++++++++++++++++++++++----------
 lib/librte_ethdev/rte_ethdev.h         |  6 ++-
 4 files changed, 60 insertions(+), 23 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 0ee8533..cbb4c34 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -88,7 +88,6 @@ Deprecation Notices
   negative errno values to indicate various error conditions (e.g.
   invalid port ID, unsupported operation, failed operation):
 
-  - ``rte_eth_dev_info_get``
   - ``rte_eth_promiscuous_enable`` and ``rte_eth_promiscuous_disable``
   - ``rte_eth_allmulticast_enable`` and ``rte_eth_allmulticast_disable``
   - ``rte_eth_link_get`` and ``rte_eth_link_get_nowait``
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9..152f120 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -94,6 +94,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to
+  ``int`` to provide a way to report various error conditions.
+
 
 ABI Changes
 -----------
@@ -145,7 +148,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_distributor.so.1
      librte_eal.so.11
      librte_efd.so.1
-     librte_ethdev.so.12
+   + librte_ethdev.so.13
      librte_eventdev.so.7
      librte_flow_classify.so.1
      librte_gro.so.1
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..4b6cbe2 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1125,7 +1125,6 @@ struct rte_eth_dev *
 
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);
 
 	if (dev->data->dev_started) {
@@ -1144,7 +1143,9 @@ struct rte_eth_dev *
 	 */
 	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* If number of queues specified by application for both Rx and Tx is
 	 * zero, use driver preferred values. This cannot be done individually
@@ -1406,6 +1407,7 @@ struct rte_eth_dev *
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	int diag;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1420,7 +1422,9 @@ struct rte_eth_dev *
 		return 0;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* Lets restore MAC now if device does not support live change */
 	if (*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)
@@ -1584,7 +1588,6 @@ struct rte_eth_dev *
 		return -EINVAL;
 	}
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_setup, -ENOTSUP);
 
 	/*
@@ -1592,7 +1595,10 @@ struct rte_eth_dev *
 	 * This value must be provided in the private data of the memory pool.
 	 * First check that the memory pool has a valid private data.
 	 */
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	if (mp->private_data_size < sizeof(struct rte_pktmbuf_pool_private)) {
 		RTE_ETHDEV_LOG(ERR, "%s private_data_size %d < %d\n",
 			mp->name, (int)mp->private_data_size,
@@ -1703,6 +1709,7 @@ struct rte_eth_dev *
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_txconf local_conf;
 	void **txq;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1712,10 +1719,11 @@ struct rte_eth_dev *
 		return -EINVAL;
 	}
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_queue_setup, -ENOTSUP);
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* Use default specified by driver, if nb_tx_desc is zero */
 	if (nb_tx_desc == 0) {
@@ -2540,7 +2548,7 @@ struct rte_eth_dev *
 							fw_version, fw_size));
 }
 
-void
+int
 rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 {
 	struct rte_eth_dev *dev;
@@ -2558,7 +2566,7 @@ struct rte_eth_dev *
 	 */
 	memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
 	dev_info->rx_desc_lim = lim;
@@ -2567,13 +2575,15 @@ struct rte_eth_dev *
 	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
 	dev_info->max_mtu = UINT16_MAX;
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
 	dev_info->driver_name = dev->device->driver->name;
 	dev_info->nb_rx_queues = dev->data->nb_rx_queues;
 	dev_info->nb_tx_queues = dev->data->nb_tx_queues;
 
 	dev_info->dev_flags = &dev->data->dev_flags;
+
+	return 0;
 }
 
 int
@@ -2643,7 +2653,10 @@ struct rte_eth_dev *
 	 * which relies on dev->dev_ops->dev_infos_get.
 	 */
 	if (*dev->dev_ops->dev_infos_get != NULL) {
-		rte_eth_dev_info_get(port_id, &dev_info);
+		ret = rte_eth_dev_info_get(port_id, &dev_info);
+		if (ret != 0)
+			return ret;
+
 		if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu)
 			return -EINVAL;
 	}
@@ -2991,10 +3004,15 @@ struct rte_eth_dev *
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
 		RTE_ETHDEV_LOG(ERR,
@@ -3100,9 +3118,13 @@ struct rte_eth_dev *
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	unsigned i;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	for (i = 0; i < dev_info.max_mac_addrs; i++)
 		if (memcmp(addr, &dev->data->mac_addrs[i],
@@ -3233,8 +3255,14 @@ struct rte_eth_dev *
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	unsigned i;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	if (!dev->data->hash_mac_addrs)
 		return -1;
 
@@ -3319,11 +3347,15 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_link link;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
 	link = dev->data->dev_link;
 
 	if (queue_idx > dev_info.max_tx_queues) {
@@ -4363,15 +4395,14 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
 				 uint16_t *nb_rx_desc,
 				 uint16_t *nb_tx_desc)
 {
-	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
-	dev = &rte_eth_devices[port_id];
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
-
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	if (nb_rx_desc != NULL)
 		rte_eth_dev_adjust_nb_desc(nb_rx_desc, &dev_info.rx_desc_lim);
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 8fa89bf..eda9e5c 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2366,8 +2366,12 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
  * @param dev_info
  *   A pointer to a structure of type *rte_eth_dev_info* to be filled with
  *   the contextual information of the Ethernet device.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if support for dev_infos_get() does not exist for the device.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
+int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
 
 /**
  * Retrieve the firmware version of a device.
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 03/54] app/testpmd: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 02/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 04/54] app/eventdev: " Andrew Rybchenko
                     ` (51 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Adrien Mazarguil
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

Add eth_dev_info_get_print_err() which is a wrapper for
rte_eth_dev_info_get() printing error if rte_eth_dev_info_get()
fails and returning its status code.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-pmd/cmdline.c      | 120 ++++++++++++++++++++++++++++++++++++--------
 app/test-pmd/cmdline_flow.c |   5 +-
 app/test-pmd/config.c       |  78 +++++++++++++++++++++++-----
 app/test-pmd/parameters.c   |   8 ++-
 app/test-pmd/testpmd.c      |  40 ++++++++++++---
 app/test-pmd/testpmd.h      |   3 ++
 app/test-pmd/util.c         |  28 ++++++++++-
 7 files changed, 237 insertions(+), 45 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index e4dda93..b1be6b4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2181,6 +2181,7 @@ struct cmd_config_rss {
 	int all_updated = 1;
 	int diag;
 	uint16_t i;
+	int ret;
 
 	if (!strcmp(res->value, "all"))
 		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
@@ -2220,7 +2221,10 @@ struct cmd_config_rss {
 	RTE_ETH_FOREACH_DEV(i) {
 		struct rte_eth_rss_conf local_rss_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = eth_dev_info_get_print_err(i, &dev_info);
+		if (ret != 0)
+			return;
+
 		if (use_default)
 			rss_conf.rss_hf = dev_info.flow_type_rss_offloads;
 
@@ -2318,8 +2322,12 @@ struct cmd_config_rss_hash_key {
 	struct rte_eth_dev_info dev_info;
 	uint8_t hash_key_size;
 	uint32_t key_len;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(hash_key))
 		hash_key_size = dev_info.hash_key_size;
@@ -2851,7 +2859,10 @@ struct cmd_config_rss_reta {
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct cmd_config_rss_reta *res = parsed_result;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.reta_size == 0) {
 		printf("Redirection table size is 0 which is "
 					"invalid for RSS\n");
@@ -2969,8 +2980,12 @@ struct cmd_showport_reta {
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct rte_eth_dev_info dev_info;
 	uint16_t max_reta_size;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
 	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
 	if (res->size == 0 || res->size > max_reta_size) {
 		printf("Invalid redirection table size: %u (1-%u)\n",
@@ -3197,6 +3212,7 @@ struct cmd_config_burst {
 	struct cmd_config_burst *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
 	uint16_t rec_nb_pkts;
+	int ret;
 
 	if (!all_ports_stopped()) {
 		printf("Please stop all ports first\n");
@@ -3210,7 +3226,10 @@ struct cmd_config_burst {
 			 * size for all ports, so assume all ports are the same
 			 * NIC model and use the values from Port 0.
 			 */
-			rte_eth_dev_info_get(0, &dev_info);
+			ret = eth_dev_info_get_print_err(0, &dev_info);
+			if (ret != 0)
+				return;
+
 			rec_nb_pkts = dev_info.default_rxportconf.burst_size;
 
 			if (rec_nb_pkts == 0) {
@@ -4280,6 +4299,7 @@ struct cmd_csum_result {
 {
 	struct rte_eth_dev_info dev_info;
 	uint64_t tx_offloads;
+	int ret;
 
 	tx_offloads = ports[port_id].dev_conf.txmode.offloads;
 	printf("Parse tunnel is %s\n",
@@ -4298,7 +4318,10 @@ struct cmd_csum_result {
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) {
 		printf("Warning: hardware IP checksum enabled but not "
@@ -4352,6 +4375,7 @@ struct cmd_csum_result {
 	int hw = 0;
 	uint64_t csum_offloads = 0;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(res->port_id, ENABLED_WARN)) {
 		printf("invalid port %d\n", res->port_id);
@@ -4362,7 +4386,10 @@ struct cmd_csum_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (!strcmp(res->mode, "set")) {
 
 		if (!strcmp(res->hwsw, "hw"))
@@ -4550,6 +4577,7 @@ struct cmd_tso_set_result {
 {
 	struct cmd_tso_set_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
 		return;
@@ -4561,7 +4589,10 @@ struct cmd_tso_set_result {
 	if (!strcmp(res->mode, "set"))
 		ports[res->port_id].tso_segsz = res->tso_segsz;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((ports[res->port_id].tso_segsz != 0) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {
 		printf("Error: TSO is not supported by port %d\n",
@@ -4582,7 +4613,10 @@ struct cmd_tso_set_result {
 	cmd_config_queue_tx_offloads(&ports[res->port_id]);
 
 	/* display warnings if configuration is not supported by the NIC */
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((ports[res->port_id].tso_segsz != 0) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {
 		printf("Warning: TSO enabled but not "
@@ -4651,7 +4685,9 @@ struct cmd_tunnel_tso_set_result {
 {
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	if (eth_dev_info_get_print_err(port_id, &dev_info) != 0)
+		return dev_info;
+
 	if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO))
 		printf("Warning: VXLAN TUNNEL TSO not supported therefore "
 		       "not enabled for port %d\n", port_id);
@@ -11088,7 +11124,11 @@ struct cmd_flow_director_result {
 		else if (!strncmp(res->pf_vf, "vf", 2)) {
 			struct rte_eth_dev_info dev_info;
 
-			rte_eth_dev_info_get(res->port_id, &dev_info);
+			ret = eth_dev_info_get_print_err(res->port_id,
+						&dev_info);
+			if (ret != 0)
+				return;
+
 			errno = 0;
 			vf_id = strtoul(res->pf_vf + 2, &end, 10);
 			if (errno != 0 || *end != '\0' ||
@@ -14080,7 +14120,10 @@ struct cmd_macsec_offload_on_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
 #ifdef RTE_LIBRTE_IXGBE_PMD
 		ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp);
@@ -14174,7 +14217,10 @@ struct cmd_macsec_offload_off_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
 #ifdef RTE_LIBRTE_IXGBE_PMD
 		ret = rte_pmd_ixgbe_macsec_disable(port_id);
@@ -17884,8 +17930,12 @@ struct cmd_rx_offload_get_capa_result {
 	portid_t port_id = res->port_id;
 	uint64_t queue_offloads;
 	uint64_t port_offloads;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	queue_offloads = dev_info.rx_queue_offload_capa;
 	port_offloads = dev_info.rx_offload_capa ^ queue_offloads;
 
@@ -17957,6 +18007,7 @@ struct cmd_rx_offload_get_configuration_result {
 	uint64_t queue_offloads;
 	uint16_t nb_rx_queues;
 	int q;
+	int ret;
 
 	printf("Rx Offloading Configuration of port %d :\n", port_id);
 
@@ -17965,7 +18016,10 @@ struct cmd_rx_offload_get_configuration_result {
 	print_rx_offloads(port_offloads);
 	printf("\n");
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_rx_queues = dev_info.nb_rx_queues;
 	for (q = 0; q < nb_rx_queues; q++) {
 		queue_offloads = port->rx_conf[q].offloads;
@@ -18064,6 +18118,7 @@ struct cmd_config_per_port_rx_offload_result {
 	uint64_t single_offload;
 	uint16_t nb_rx_queues;
 	int q;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18077,7 +18132,10 @@ struct cmd_config_per_port_rx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_rx_queues = dev_info.nb_rx_queues;
 	if (!strcmp(res->on_off, "on")) {
 		port->dev_conf.rxmode.offloads |= single_offload;
@@ -18165,6 +18223,7 @@ struct cmd_config_per_queue_rx_offload_result {
 	uint16_t queue_id = res->queue_id;
 	struct rte_port *port = &ports[port_id];
 	uint64_t single_offload;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18172,7 +18231,10 @@ struct cmd_config_per_queue_rx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (queue_id >= dev_info.nb_rx_queues) {
 		printf("Error: input queue_id should be 0 ... "
 		       "%d\n", dev_info.nb_rx_queues - 1);
@@ -18278,8 +18340,12 @@ struct cmd_tx_offload_get_capa_result {
 	portid_t port_id = res->port_id;
 	uint64_t queue_offloads;
 	uint64_t port_offloads;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	queue_offloads = dev_info.tx_queue_offload_capa;
 	port_offloads = dev_info.tx_offload_capa ^ queue_offloads;
 
@@ -18351,6 +18417,7 @@ struct cmd_tx_offload_get_configuration_result {
 	uint64_t queue_offloads;
 	uint16_t nb_tx_queues;
 	int q;
+	int ret;
 
 	printf("Tx Offloading Configuration of port %d :\n", port_id);
 
@@ -18359,7 +18426,10 @@ struct cmd_tx_offload_get_configuration_result {
 	print_tx_offloads(port_offloads);
 	printf("\n");
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_tx_queues = dev_info.nb_tx_queues;
 	for (q = 0; q < nb_tx_queues; q++) {
 		queue_offloads = port->tx_conf[q].offloads;
@@ -18463,6 +18533,7 @@ struct cmd_config_per_port_tx_offload_result {
 	uint64_t single_offload;
 	uint16_t nb_tx_queues;
 	int q;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18476,7 +18547,10 @@ struct cmd_config_per_port_tx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_tx_queues = dev_info.nb_tx_queues;
 	if (!strcmp(res->on_off, "on")) {
 		port->dev_conf.txmode.offloads |= single_offload;
@@ -18567,6 +18641,7 @@ struct cmd_config_per_queue_tx_offload_result {
 	uint16_t queue_id = res->queue_id;
 	struct rte_port *port = &ports[port_id];
 	uint64_t single_offload;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18574,7 +18649,10 @@ struct cmd_config_per_queue_tx_offload_result {
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (queue_id >= dev_info.nb_tx_queues) {
 		printf("Error: input queue_id should be 0 ... "
 		       "%d\n", dev_info.nb_tx_queues - 1);
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4958713..369426c 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -3550,7 +3550,10 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
 	    ctx->port != (portid_t)RTE_PORT_ALL) {
 		struct rte_eth_dev_info info;
 
-		rte_eth_dev_info_get(ctx->port, &info);
+		ret = rte_eth_dev_info_get(ctx->port, &info);
+		if (ret != 0)
+			return ret;
+
 		action_rss_data->conf.key_len =
 			RTE_MIN(sizeof(action_rss_data->key),
 				info.hash_key_size);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 523b3d3..24158e5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -471,6 +471,7 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	static const char *info_border = "*********************";
 	uint16_t mtu;
 	char name[RTE_ETH_NAME_MAX_LEN];
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -478,7 +479,11 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	}
 	port = &ports[port_id];
 	rte_eth_link_get_nowait(port_id, &link);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	printf("\n%s Infos for port %-2d %s\n",
 	       info_border, port_id, info_border);
 	rte_eth_macaddr_get(port_id, &mac_addr);
@@ -617,6 +622,7 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	struct rte_eth_link link;
 	struct rte_eth_dev_info dev_info;
 	char name[RTE_ETH_NAME_MAX_LEN];
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -624,7 +630,11 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	}
 
 	rte_eth_link_get_nowait(port_id, &link);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	rte_eth_dev_get_name_by_port(port_id, name);
 	rte_eth_macaddr_get(port_id, &mac_addr);
 
@@ -641,11 +651,14 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 {
 	struct rte_eth_dev_info dev_info;
 	static const char *info_border = "************";
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
 	printf("\n%s Port %d supported offload features: %s\n",
 		info_border, port_id, info_border);
@@ -1139,10 +1152,15 @@ void print_valid_ports(void)
 {
 	int diag;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (mtu > dev_info.max_mtu || mtu < dev_info.min_mtu) {
 		printf("Set MTU failed. MTU:%u is not in valid range, min:%u - max:%u\n",
 			mtu, dev_info.min_mtu, dev_info.max_mtu);
@@ -1617,12 +1635,16 @@ struct igb_ring_desc_16_bytes {
 #endif
 			   uint16_t desc_id)
 {
+	int ret;
 	struct igb_ring_desc_16_bytes *ring =
 		(struct igb_ring_desc_16_bytes *)ring_mz->addr;
 #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (strstr(dev_info.driver_name, "i40e") != NULL) {
 		/* 32 bytes RX descriptor, i40e only */
 		struct igb_ring_desc_32_bytes *ring =
@@ -1832,11 +1854,15 @@ struct igb_ring_desc_16_bytes {
 	int diag;
 	struct rte_eth_dev_info dev_info;
 	uint8_t hash_key_size;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(rss_key))
 		hash_key_size = dev_info.hash_key_size;
@@ -2794,11 +2820,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_rx_queues; queue++)
 		if (!ports[portid].rx_dump_cb[queue])
 			ports[portid].rx_dump_cb[queue] =
@@ -2811,10 +2841,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (!ports[portid].tx_dump_cb[queue])
 			ports[portid].tx_dump_cb[queue] =
@@ -2827,10 +2862,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_rx_queues; queue++)
 		if (ports[portid].rx_dump_cb[queue]) {
 			rte_eth_remove_rx_callback(portid, queue,
@@ -2844,10 +2884,15 @@ struct igb_ring_desc_16_bytes {
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (ports[portid].tx_dump_cb[queue]) {
 			rte_eth_remove_tx_callback(portid, queue,
@@ -3035,6 +3080,7 @@ struct igb_ring_desc_16_bytes {
 tx_vlan_set(portid_t port_id, uint16_t vlan_id)
 {
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
@@ -3046,7 +3092,11 @@ struct igb_ring_desc_16_bytes {
 		printf("Error, as QinQ has been enabled.\n");
 		return;
 	}
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) == 0) {
 		printf("Error: vlan insert is not supported by port %d\n",
 			port_id);
@@ -3062,6 +3112,7 @@ struct igb_ring_desc_16_bytes {
 tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
 {
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
@@ -3070,7 +3121,10 @@ struct igb_ring_desc_16_bytes {
 	if (vlan_id_is_invalid(vlan_id_outer))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) {
 		printf("Error: qinq insert not supported by port %d\n",
 			port_id);
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 5244872..6c78dca 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -562,6 +562,7 @@
 	uint64_t tx_offloads = tx_mode.offloads;
 	struct rte_eth_dev_info dev_info;
 	uint16_t rec_nb_pkts;
+	int ret;
 
 	static struct option lgopts[] = {
 		{ "help",			0, 0, 0 },
@@ -1050,7 +1051,12 @@
 					 * value, on the assumption that all
 					 * ports are of the same NIC model.
 					 */
-					rte_eth_dev_info_get(0, &dev_info);
+					ret = eth_dev_info_get_print_err(
+								0,
+								&dev_info);
+					if (ret != 0)
+						return;
+
 					rec_nb_pkts = dev_info
 						.default_rxportconf.burst_size;
 
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e8e2a39..cbf73e6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1012,17 +1012,21 @@ struct extmem_param {
 get_allowed_max_nb_rxq(portid_t *pid)
 {
 	queueid_t allowed_max_rxq = MAX_QUEUE_ID;
+	bool max_rxq_valid = false;
 	portid_t pi;
 	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pi) {
-		rte_eth_dev_info_get(pi, &dev_info);
+		if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
+			continue;
+
+		max_rxq_valid = true;
 		if (dev_info.max_rx_queues < allowed_max_rxq) {
 			allowed_max_rxq = dev_info.max_rx_queues;
 			*pid = pi;
 		}
 	}
-	return allowed_max_rxq;
+	return max_rxq_valid ? allowed_max_rxq : 0;
 }
 
 /*
@@ -1058,17 +1062,21 @@ struct extmem_param {
 get_allowed_max_nb_txq(portid_t *pid)
 {
 	queueid_t allowed_max_txq = MAX_QUEUE_ID;
+	bool max_txq_valid = false;
 	portid_t pi;
 	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pi) {
-		rte_eth_dev_info_get(pi, &dev_info);
+		if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
+			continue;
+
+		max_txq_valid = true;
 		if (dev_info.max_tx_queues < allowed_max_txq) {
 			allowed_max_txq = dev_info.max_tx_queues;
 			*pid = pi;
 		}
 	}
-	return allowed_max_txq;
+	return max_txq_valid ? allowed_max_txq : 0;
 }
 
 /*
@@ -1109,6 +1117,7 @@ struct extmem_param {
 	uint16_t data_size;
 	bool warning = 0;
 	int k;
+	int ret;
 
 	memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
 
@@ -1136,7 +1145,10 @@ struct extmem_param {
 		/* Apply default TxRx configuration for all ports */
 		port->dev_conf.txmode = tx_mode;
 		port->dev_conf.rxmode = rx_mode;
-		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE, "FAIL from init_config()\n");
 
 		if (!(port->dev_info.tx_offload_capa &
 		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
@@ -1295,10 +1307,14 @@ struct extmem_param {
 reconfig(portid_t new_port_id, unsigned socket_id)
 {
 	struct rte_port *port;
+	int ret;
 
 	/* Reconfiguration of Ethernet ports. */
 	port = &ports[new_port_id];
-	rte_eth_dev_info_get(new_port_id, &port->dev_info);
+
+	ret = eth_dev_info_get_print_err(new_port_id, &port->dev_info);
+	if (ret != 0)
+		return;
 
 	/* set flag to initialize port/queue */
 	port->need_reconfig = 1;
@@ -2927,11 +2943,16 @@ struct pmd_test_command {
 {
 	portid_t pid;
 	struct rte_port *port;
+	int ret;
 
 	RTE_ETH_FOREACH_DEV(pid) {
 		port = &ports[pid];
 		port->dev_conf.fdir_conf = fdir_conf;
-		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+		if (ret != 0)
+			return;
+
 		if (nb_rxq > 1) {
 			port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
 			port->dev_conf.rx_adv_conf.rss_conf.rss_hf =
@@ -3106,7 +3127,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)
 	retval = rte_eth_dev_configure(pid, nb_rxq, nb_rxq, &port_conf);
 	if (retval < 0)
 		return retval;
-	rte_eth_dev_info_get(pid, &rte_port->dev_info);
+
+	retval = eth_dev_info_get_print_err(pid, &rte_port->dev_info);
+	if (retval != 0)
+		return retval;
 
 	/* If dev_info.vmdq_pool_base is greater than 0,
 	 * the queue id of vmdq pools is started after pf queues.
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index ce13eb8..d73955d 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -822,6 +822,9 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[],
 void setup_gro_flush_cycles(uint8_t cycles);
 void show_gro(portid_t port_id);
 void setup_gso(const char *mode, portid_t port_id);
+int eth_dev_info_get_print_err(uint16_t port_id,
+			struct rte_eth_dev_info *dev_info);
+
 
 /* Functions to manage the set of filtered Multicast MAC addresses */
 void mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr);
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 18dfdca..009d226 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -194,10 +194,15 @@
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (!ports[portid].tx_set_md_cb[queue])
 			ports[portid].tx_set_md_cb[queue] =
@@ -210,10 +215,15 @@
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (ports[portid].tx_set_md_cb[queue]) {
 			rte_eth_remove_tx_callback(portid, queue,
@@ -221,3 +231,17 @@
 			ports[portid].tx_set_md_cb[queue] = NULL;
 		}
 }
+
+int
+eth_dev_info_get_print_err(uint16_t port_id,
+					struct rte_eth_dev_info *dev_info)
+{
+	int ret;
+
+	ret = rte_eth_dev_info_get(port_id, dev_info);
+	if (ret != 0)
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+
+	return ret;
+}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 04/54] app/eventdev: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (2 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 03/54] app/testpmd: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 05/54] kni: " Andrew Rybchenko
                     ` (50 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-eventdev/test_perf_common.c     | 8 +++++++-
 app/test-eventdev/test_pipeline_common.c | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index aa925a7..e75582b 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -660,6 +660,7 @@
 perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	struct test_perf *t = evt_test_priv(test);
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
@@ -688,7 +689,12 @@
 		struct rte_eth_dev_info dev_info;
 		struct rte_eth_conf local_port_conf = port_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+					i, strerror(-ret));
+			return ret;
+		}
 
 		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 			dev_info.flow_type_rss_offloads;
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 16c49b8..ef8ae28 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -159,6 +159,7 @@
 pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	uint8_t nb_queues = 1;
 	struct test_pipeline *t = evt_test_priv(test);
 	struct rte_eth_rxconf rx_conf;
@@ -191,7 +192,13 @@
 		if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT))
 			t->internal_port = 0;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return ret;
+		}
+
 		rx_conf = dev_info.default_rxconf;
 		rx_conf.offloads = port_conf.rxmode.offloads;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 05/54] kni: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (3 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 04/54] app/eventdev: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 06/54] latency: " Andrew Rybchenko
                     ` (49 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_kni.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 7a65de1..2c33374 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -436,7 +436,13 @@ struct test_kni_stats {
 	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
 
-	rte_eth_dev_info_get(port_id, &info);
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return -1;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	if (bus && !strcmp(bus->name, "pci")) {
@@ -622,7 +628,14 @@ struct test_kni_stats {
 	memset(&info, 0, sizeof(info));
 	memset(&conf, 0, sizeof(conf));
 	memset(&ops, 0, sizeof(ops));
-	rte_eth_dev_info_get(port_id, &info);
+
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return -1;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	else
@@ -658,7 +671,15 @@ struct test_kni_stats {
 	memset(&conf, 0, sizeof(conf));
 	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
-	rte_eth_dev_info_get(port_id, &info);
+
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		ret = -1;
+		goto fail;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	else
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 06/54] latency: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (4 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 05/54] kni: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 07/54] pdump: " Andrew Rybchenko
                     ` (48 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_latencystats/rte_latencystats.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 06c6283..98e0189 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -208,6 +208,7 @@ struct latency_stats_nameoff {
 	const char *ptr_strings[NUM_LATENCY_STATS] = {0};
 	const struct rte_memzone *mz = NULL;
 	const unsigned int flags = 0;
+	int ret;
 
 	if (rte_memzone_lookup(MZ_RTE_LATENCY_STATS))
 		return -EEXIST;
@@ -239,7 +240,16 @@ struct latency_stats_nameoff {
 	/** Register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(pid, &dev_info);
+
+		ret = rte_eth_dev_info_get(pid, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(INFO, LATENCY_STATS,
+				"Error during getting device (port %u) info: %s\n",
+				pid, strerror(-ret));
+
+			continue;
+		}
+
 		for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
 			cbs = &rx_cbs[pid][qid];
 			cbs->cb = rte_eth_add_first_rx_callback(pid, qid,
@@ -274,7 +284,16 @@ struct latency_stats_nameoff {
 	/** De register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(pid, &dev_info);
+
+		ret = rte_eth_dev_info_get(pid, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(INFO, LATENCY_STATS,
+				"Error during getting device (port %u) info: %s\n",
+				pid, strerror(-ret));
+
+			continue;
+		}
+
 		for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
 			cbs = &rx_cbs[pid][qid];
 			ret = rte_eth_remove_rx_callback(pid, qid, cbs->cb);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 07/54] pdump: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (5 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 06/54] latency: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 08/54] ring: " Andrew Rybchenko
                     ` (47 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_pdump/rte_pdump.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index cd24dd0..ac94fea 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -333,7 +333,14 @@ struct pdump_response {
 	if (queue == RTE_PDUMP_ALL_QUEUES) {
 		struct rte_eth_dev_info dev_info;
 
-		rte_eth_dev_info_get(port, &dev_info);
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(ERR, PDUMP,
+				"Error during getting device (port %u) info: %s\n",
+				port, strerror(-ret));
+			return ret;
+		}
+
 		nb_rx_q = dev_info.nb_rx_queues;
 		nb_tx_q = dev_info.nb_tx_queues;
 		if (nb_rx_q == 0 && flags & RTE_PDUMP_FLAG_RX) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 08/54] ring: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (6 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 07/54] pdump: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 09/54] app/procinfo: " Andrew Rybchenko
                     ` (46 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_pmd_ring.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 6414bbd..65ab6e7 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -490,10 +490,17 @@
 test_command_line_ring_port(void)
 {
 	int port, cmdl_port0 = -1;
+	int ret;
+
 	/* find a port created with the --vdev=net_ring0 command line option */
 	RTE_ETH_FOREACH_DEV(port) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(port, &dev_info);
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		TEST_ASSERT((ret == 0),
+				"Error during getting device (port %d) info: %s\n",
+				port, strerror(-ret));
+
 		if (!strcmp(dev_info.driver_name, "Rings PMD")) {
 			printf("found a command line ring port=%d\n", port);
 			cmdl_port0 = port;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 09/54] app/procinfo: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (7 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 08/54] ring: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 10/54] app/test: check status of getting ethdev info in bonding Andrew Rybchenko
                     ` (45 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Maryam Tahhan, Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/proc-info/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index a89b51b..34eb7a7 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -683,7 +683,12 @@ static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 		if (ret == 0)
 			printf("\t  -- mtu (%d)\n", mtu);
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
 
 		printf("  - queue\n");
 		for (j = 0; j < dev_info.nb_rx_queues; j++) {
@@ -836,7 +841,13 @@ static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 		memset(&cap, 0, sizeof(cap));
 		memset(&error, 0, sizeof(error));
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
+
 		printf("  - Generic for port (%u)\n"
 			"\t  -- driver name %s\n"
 			"\t  -- max vf (%u)\n"
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 10/54] app/test: check status of getting ethdev info in bonding
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (8 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 09/54] app/procinfo: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 11/54] app/test: check ethdev info get result in event Rx adapter Andrew Rybchenko
                     ` (44 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_link_bonding_rssconf.c | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 65de3b9..1a9571e 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -329,7 +329,11 @@ struct link_bonding_rssconf_unittest_params {
 	uint64_t rss_hf = 0;
 	uint64_t default_rss_hf = 0;
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((retval == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-retval));
 
 	/*
 	 *  Test hash function propagation
@@ -443,10 +447,16 @@ struct link_bonding_rssconf_unittest_params {
 	/**
 	 * Configure bonding port in RSS mq mode
 	 */
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&rss_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+					&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -468,10 +478,16 @@ struct link_bonding_rssconf_unittest_params {
 static int
 test_rss_lazy(void)
 {
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -532,6 +548,10 @@ struct link_bonding_rssconf_unittest_params {
 		rte_eth_dev_default_mac_addr_set(port->port_id, &mac_addr);
 
 		rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		retval = rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	if (test_params.bond_port_id == INVALID_PORT_ID) {
@@ -545,8 +565,11 @@ struct link_bonding_rssconf_unittest_params {
 		TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 				&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-		rte_eth_dev_info_get(test_params.bond_port_id,
-				&test_params.bond_dev_info);
+		retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	return TEST_SUCCESS;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 11/54] app/test: check ethdev info get result in event Rx adapter
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (9 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 10/54] app/test: check status of getting ethdev info in bonding Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 12/54] net/bnxt: check status of getting ethdev info Andrew Rybchenko
                     ` (43 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Nikhil Rao; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_event_eth_rx_adapter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 953b827..950bc67 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -45,7 +45,9 @@ struct event_eth_rx_adapter_test_params {
 
 	retval = rte_eth_dev_configure(port, 0, 0, port_conf);
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0)
+		return retval;
 
 	default_params.rx_rings = RTE_MIN(dev_info.max_rx_queues,
 					MAX_NUM_RX_QUEUE);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 12/54] net/bnxt: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (10 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 11/54] app/test: check ethdev info get result in event Rx adapter Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 13/54] net/bonding: " Andrew Rybchenko
                     ` (42 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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/bnxt according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 122 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 109 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index fbd2dd4..4374034 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -145,7 +145,15 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
+
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs || mac_addr == NULL)
@@ -179,7 +187,14 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(eth_dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = eth_dev->data->dev_private;
 
 	if (!bp->pf.active_vfs)
@@ -230,7 +245,14 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
@@ -282,7 +304,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
@@ -332,7 +361,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs)
@@ -369,7 +405,14 @@ int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!bp->pf.vf_info)
@@ -545,12 +588,20 @@ int rte_pmd_bnxt_get_vf_stats(uint16_t port,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -572,12 +623,20 @@ int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -598,12 +657,20 @@ int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id)
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -625,12 +692,20 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -662,7 +737,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -738,7 +820,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs)
@@ -775,7 +864,14 @@ int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on)
 		return -EINVAL;
 
 	dev = &rte_eth_devices[port];
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 13/54] net/bonding: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (11 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 12/54] net/bnxt: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 14/54] net/failsafe: " Andrew Rybchenko
                     ` (41 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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/bonding according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 10 +++++++++-
 drivers/net/bonding/rte_eth_bond_pmd.c | 36 ++++++++++++++++++++++++++++++----
 2 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 0fc4c5e..e2e27e9 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -452,6 +452,7 @@
 	struct bond_dev_private *internals;
 	struct rte_eth_link link_props;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
 	internals = bonded_eth_dev->data->dev_private;
@@ -465,7 +466,14 @@
 		return -1;
 	}
 
-	rte_eth_dev_info_get(slave_port_id, &dev_info);
+	ret = rte_eth_dev_info_get(slave_port_id, &dev_info);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"%s: Error during getting device (port %u) info: %s\n",
+			__func__, slave_port_id, strerror(-ret));
+
+		return ret;
+	}
 	if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) {
 		RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small",
 			     slave_port_id);
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 97ab3f2..a1b5014 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -186,7 +186,15 @@
 		return -1;
 	}
 
-	rte_eth_dev_info_get(slave_port, &slave_info);
+	ret = rte_eth_dev_info_get(slave_port, &slave_info);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"%s: Error during getting device (port %u) info: %s\n",
+			__func__, slave_port, strerror(-ret));
+
+		return ret;
+	}
+
 	if (slave_info.max_rx_queues < bond_dev->data->nb_rx_queues ||
 			slave_info.max_tx_queues < bond_dev->data->nb_tx_queues) {
 		RTE_BOND_LOG(ERR,
@@ -204,10 +212,19 @@
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
 	struct rte_eth_dev_info bond_info;
 	uint16_t idx;
+	int ret;
 
 	/* Verify if all slaves in bonding supports flow director and */
 	if (internals->slave_count > 0) {
-		rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
+		ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
+		if (ret != 0) {
+			RTE_BOND_LOG(ERR,
+				"%s: Error during getting device (port %u) info: %s\n",
+				__func__, bond_dev->data->port_id,
+				strerror(-ret));
+
+			return ret;
+		}
 
 		internals->mode4.dedicated_queues.rx_qid = bond_info.nb_rx_queues;
 		internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues;
@@ -2102,6 +2119,8 @@ struct bwg_slave {
 bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct bond_dev_private *internals = dev->data->dev_private;
+	struct bond_slave_details slave;
+	int ret;
 
 	uint16_t max_nb_rx_queues = UINT16_MAX;
 	uint16_t max_nb_tx_queues = UINT16_MAX;
@@ -2123,8 +2142,17 @@ struct bwg_slave {
 		uint16_t idx;
 
 		for (idx = 0; idx < internals->slave_count; idx++) {
-			rte_eth_dev_info_get(internals->slaves[idx].port_id,
-					&slave_info);
+			slave = internals->slaves[idx];
+			ret = rte_eth_dev_info_get(slave.port_id, &slave_info);
+			if (ret != 0) {
+				RTE_BOND_LOG(ERR,
+					"%s: Error during getting device (port %u) info: %s\n",
+					__func__,
+					slave.port_id,
+					strerror(-ret));
+
+				return;
+			}
 
 			if (slave_info.max_rx_queues < max_nb_rx_queues)
 				max_nb_rx_queues = slave_info.max_rx_queues;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 14/54] net/failsafe: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (12 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 13/54] net/bonding: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 14:20     ` Gaëtan Rivet
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 15/54] net/netvsc: " Andrew Rybchenko
                     ` (40 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev, Ivan Ilchenko

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/failsafe 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/failsafe/failsafe_ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 96e05d4..b3df626 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -866,6 +866,7 @@
 {
 	struct sub_device *sdev;
 	uint8_t i;
+	int ret;
 
 	/* Use maximum upper bounds by default */
 	infos->max_rx_pktlen = UINT32_MAX;
@@ -933,7 +934,9 @@
 	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
 		struct rte_eth_dev_info sub_info;
 
-		rte_eth_dev_info_get(PORT_ID(sdev), &sub_info);
+		ret = rte_eth_dev_info_get(PORT_ID(sdev), &sub_info);
+		if (ret != 0)
+			return;
 
 		fs_dev_merge_info(infos, &sub_info);
 	}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 15/54] net/netvsc: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (13 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 14/54] net/failsafe: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 16/54] net/softnic: " Andrew Rybchenko
                     ` (39 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang; +Cc: dev, Ivan Ilchenko

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(-)

diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
index 3f5e8df..e0ebe4e 100644
--- a/drivers/net/netvsc/hn_var.h
+++ b/drivers/net/netvsc/hn_var.h
@@ -201,7 +201,7 @@ int	hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		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 03f855b..d53d27b 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -172,12 +172,15 @@ static void hn_vf_remove(struct hn_data *hv)
  * 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,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 16/54] net/softnic: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (14 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 15/54] net/netvsc: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-09  7:01     ` Singh, Jasvinder
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 17/54] ethdev: change eth_dev_infos_get_t to return int Andrew Rybchenko
                     ` (38 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Jasvinder Singh, Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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/softnic according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/softnic/rte_eth_softnic_link.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/softnic/rte_eth_softnic_link.c b/drivers/net/softnic/rte_eth_softnic_link.c
index d669913..21a6406 100644
--- a/drivers/net/softnic/rte_eth_softnic_link.c
+++ b/drivers/net/softnic/rte_eth_softnic_link.c
@@ -57,6 +57,7 @@ struct softnic_link *
 	struct rte_eth_dev_info port_info;
 	struct softnic_link *link;
 	uint16_t port_id;
+	int ret;
 
 	/* Check input params */
 	if (name == NULL ||
@@ -78,7 +79,9 @@ struct softnic_link *
 			return NULL;
 	}
 
-	rte_eth_dev_info_get(port_id, &port_info);
+	ret = rte_eth_dev_info_get(port_id, &port_info);
+	if (ret != 0)
+		return NULL;
 
 	/* Node allocation */
 	link = calloc(1, sizeof(struct softnic_link));
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 17/54] ethdev: change eth_dev_infos_get_t to return int
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (15 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 16/54] net/softnic: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 18/54] examples/rxtx_callbacks: check status of getting ethdev info Andrew Rybchenko
                     ` (37 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  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: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

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 <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 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


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 18/54] examples/rxtx_callbacks: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (16 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 17/54] ethdev: change eth_dev_infos_get_t to return int Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 19/54] examples/l3fwd: " Andrew Rybchenko
                     ` (36 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/rxtx_callbacks/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4..9fd4b8e 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -112,7 +112,14 @@
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 19/54] examples/l3fwd: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (17 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 18/54] examples/rxtx_callbacks: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 20/54] examples/qos_meter: " Andrew Rybchenko
                     ` (35 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l3fwd/main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 3800bad..3294ac2 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -874,7 +874,12 @@ enum {
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue );
 
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -985,7 +990,12 @@ enum {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			if (!per_port_pool)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 20/54] examples/qos_meter: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (18 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 19/54] examples/l3fwd: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 21/54] examples/ip_frag: " Andrew Rybchenko
                     ` (34 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/qos_meter/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8..13c85e9 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -329,7 +329,13 @@ static __attribute__((noreturn)) int
 
 	/* NIC init */
 	conf = port_conf;
-	rte_eth_dev_info_get(port_rx, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_rx, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_rx, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
@@ -369,7 +375,13 @@ static __attribute__((noreturn)) int
 	rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
 
 	conf = port_conf;
-	rte_eth_dev_info_get(port_tx, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_tx, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_tx, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 21/54] examples/ip_frag: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (19 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 20/54] examples/qos_meter: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 22/54] examples/performance-thread: check dev info get result Andrew Rybchenko
                     ` (33 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ip_fragmentation/main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 324d607..6b83244 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -903,7 +903,12 @@ struct rte_lpm6_config lpm6_config = {
 		qconf = &lcore_queue_conf[rx_lcore_id];
 
 		/* limit the frame size to the maximum supported by NIC */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
@@ -984,7 +989,12 @@ struct rte_lpm6_config lpm6_config = {
 		printf("\n");
 
 		/* init one TX queue per couple (lcore,port) */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		queueid = 0;
 		for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
 			if (rte_lcore_is_enabled(lcore_id) == 0)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 22/54] examples/performance-thread: check dev info get result
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (20 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 21/54] examples/ip_frag: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 23/54] examples/vmdq: check status of getting ethdev info Andrew Rybchenko
                     ` (32 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/performance-thread/l3fwd-thread/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 49d9424..00f5350 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -3559,7 +3559,13 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -3663,7 +3669,12 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 23/54] examples/vmdq: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (21 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 22/54] examples/performance-thread: check dev info get result Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 24/54] examples/distributor: " Andrew Rybchenko
                     ` (31 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vmdq/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd..91f9a99 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -169,7 +169,13 @@
 	 * The max pool number from dev_info will be used to validate the pool
 	 * number specified in cmd line
 	 */
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
 	/*
 	 * We allow to process part of VMDQ pools specified by num_pools in
@@ -214,7 +220,13 @@
 	rxRings = (uint16_t)dev_info.max_rx_queues;
 	txRings = (uint16_t)dev_info.max_tx_queues;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 24/54] examples/distributor: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (22 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 23/54] examples/vmdq: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 25/54] examples/l3fwd-acl: " Andrew Rybchenko
                     ` (30 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/distributor/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca6..8942f36 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -120,7 +120,13 @@ struct output_buffer {
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 25/54] examples/l3fwd-acl: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (23 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 24/54] examples/distributor: " Andrew Rybchenko
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 26/54] examples/vm_power: " Andrew Rybchenko
                     ` (29 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l3fwd-acl/main.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df7..60531ce 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1924,7 +1924,13 @@ struct lcore_conf {
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -1994,7 +2000,12 @@ struct lcore_conf {
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			txconf = &dev_info.default_txconf;
 			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
@@ -2036,7 +2047,12 @@ struct lcore_conf {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 26/54] examples/vm_power: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (24 preceding siblings ...)
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 25/54] examples/l3fwd-acl: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 27/54] examples/qos_sched: " Andrew Rybchenko
                     ` (28 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vm_power_manager/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c7046..0f48ae9 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -71,7 +71,13 @@
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 27/54] examples/qos_sched: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (25 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 26/54] examples/vm_power: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 28/54] examples/flow_filtering: " Andrew Rybchenko
                     ` (27 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Cristian Dumitrescu, Jasvinder Singh; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/qos_sched/init.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d..cf9e8f4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -98,7 +98,13 @@ struct ring_thresh tx_thresh = {
 	/* init port */
 	RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid);
 	fflush(stdout);
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 28/54] examples/flow_filtering: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (26 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 27/54] examples/qos_sched: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-04  5:57     ` Ori Kam
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 29/54] examples/l3fwd-power: " Andrew Rybchenko
                     ` (26 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/flow_filtering/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be..fe064fa 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -136,7 +136,12 @@
 	struct rte_eth_rxconf rxq_conf;
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_id, strerror(-ret));
+
 	port_conf.txmode.offloads &= dev_info.tx_offload_capa;
 	printf(":: initializing port: %d\n", port_id);
 	ret = rte_eth_dev_configure(port_id,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 29/54] examples/l3fwd-power: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (27 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 28/54] examples/flow_filtering: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 30/54] examples/l2fwd: " Andrew Rybchenko
                     ` (25 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l3fwd-power/main.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d952..bfcaa46 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2257,7 +2257,12 @@ static int check_ptype(uint16_t portid)
 		printf("Initializing port %d ... ", portid );
 		fflush(stdout);
 
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		dev_rxq_num = dev_info.max_rx_queues;
 		dev_txq_num = dev_info.max_tx_queues;
 
@@ -2275,7 +2280,13 @@ static int check_ptype(uint16_t portid)
 		/* If number of Rx queue is 0, no need to enable Rx interrupt */
 		if (nb_rx_queue == 0)
 			local_port_conf.intr_conf.rxq = 0;
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -2398,7 +2409,12 @@ static int check_ptype(uint16_t portid)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
+			ret = rte_eth_dev_info_get(portid, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
 			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 30/54] examples/l2fwd: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (28 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 29/54] examples/l3fwd-power: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 31/54] examples/skeleton: " Andrew Rybchenko
                     ` (24 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b142..8d4c539 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -635,7 +635,13 @@ enum {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 31/54] examples/skeleton: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (29 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 30/54] examples/l2fwd: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 32/54] examples/vmdq_dcb: " Andrew Rybchenko
                     ` (23 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/skeleton/basicfwd.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98..171ebde 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -44,7 +44,13 @@
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 32/54] examples/vmdq_dcb: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (30 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 31/54] examples/skeleton: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 33/54] examples/ipv4_multicast: " Andrew Rybchenko
                     ` (22 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vmdq_dcb/main.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 3890003..2122e41 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -202,7 +202,14 @@
 	 * The max pool number from dev_info will be used to validate the pool
 	 * number specified in cmd line
 	 */
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
 	/*
 	 * We allow to process part of VMDQ pools specified by num_pools in
@@ -253,7 +260,14 @@
 	if (retval < 0)
 		return retval;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 33/54] examples/ipv4_multicast: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (31 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 32/54] examples/vmdq_dcb: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 34/54] examples/l2fwd-jobstats: " Andrew Rybchenko
                     ` (21 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ipv4_multicast/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc..1ee3b61 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -686,7 +686,12 @@ struct mcast_group_params {
 		qconf = &lcore_queue_conf[rx_lcore_id];
 
 		/* limit the frame size to the maximum supported by NIC */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 34/54] examples/l2fwd-jobstats: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (32 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 33/54] examples/ipv4_multicast: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 35/54] examples/bond: " Andrew Rybchenko
                     ` (20 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd-jobstats/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc..5fcba5c 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -842,7 +842,13 @@ struct l2fwd_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 35/54] examples/bond: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (33 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 34/54] examples/l2fwd-jobstats: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 36/54] examples/eventdev: " Andrew Rybchenko
                     ` (19 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/bond/main.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d..be62c17 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -148,7 +148,12 @@
 	if (!rte_eth_dev_is_valid_port(portid))
 		rte_exit(EXIT_FAILURE, "Invalid port\n");
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	retval = rte_eth_dev_info_get(portid, &dev_info);
+	if (retval != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-retval));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -230,7 +235,12 @@
 
 	BOND_PORT = retval;
 
-	rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	retval = rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	if (retval != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			BOND_PORT, strerror(-retval));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 36/54] examples/eventdev: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (34 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 35/54] examples/bond: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 37/54] examples/ip_reassembly: " Andrew Rybchenko
                     ` (18 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/eventdev_pipeline/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f5..3789fbf 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -274,7 +274,13 @@ static int xdigit2val(unsigned char c)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 37/54] examples/ip_reassembly: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (35 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 36/54] examples/eventdev: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 38/54] examples/vhost: " Andrew Rybchenko
                     ` (17 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ip_reassembly/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be..87d4b5c 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1038,7 +1038,12 @@ struct rte_lpm6_config lpm6_config = {
 		qconf = &lcore_queue_conf[rx_lcore_id];
 
 		/* limit the frame size to the maximum supported by NIC */
-		rte_eth_dev_info_get(portid, &dev_info);
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 38/54] examples/vhost: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (36 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 37/54] examples/ip_reassembly: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 39/54] examples/ptpclient: " Andrew Rybchenko
                     ` (16 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Maxime Coquelin, Tiwei Bie, Zhihong Wang; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/vhost/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db0..794d12b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -228,7 +228,14 @@ struct mbuf_table {
 	uint16_t q;
 
 	/* The max pool number from dev_info will be used to validate the pool number specified in cmd line */
-	rte_eth_dev_info_get (port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		RTE_LOG(ERR, VHOST_PORT,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-retval));
+
+		return retval;
+	}
 
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 39/54] examples/ptpclient: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (37 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 38/54] examples/vhost: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 40/54] examples/link_status_interrupt: check dev info get result Andrew Rybchenko
                     ` (15 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ptpclient/ptpclient.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd..bc427a5 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -189,7 +189,14 @@ static inline uint64_t timespec64_to_ns(const struct timespec *ts)
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 40/54] examples/link_status_interrupt: check dev info get result
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (38 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 39/54] examples/ptpclient: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 41/54] examples/tep_termination: " Andrew Rybchenko
                     ` (14 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/link_status_interrupt/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7..0c3dfc6 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -609,7 +609,13 @@ struct lsi_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 41/54] examples/tep_termination: check dev info get result
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (39 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 40/54] examples/link_status_interrupt: check dev info get result Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 42/54] examples/server_node_efd: " Andrew Rybchenko
                     ` (13 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/tep_termination/vxlan_setup.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a08800..8d6514d 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -119,7 +119,11 @@
 
 	pconf->dst_port = udp_port;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-retval));
 
 	if (dev_info.max_rx_queues > MAX_QUEUES) {
 		rte_exit(EXIT_FAILURE,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 42/54] examples/server_node_efd: check dev info get result
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (40 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 41/54] examples/tep_termination: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 43/54] examples/flow_classify: check status of getting ethdev info Andrew Rybchenko
                     ` (12 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Byron Marohn, Pablo de Lara Guarch; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/server_node_efd/server/init.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e..773780b 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -111,7 +111,10 @@
 	printf("Port %u init ... ", port_num);
 	fflush(stdout);
 
-	rte_eth_dev_info_get(port_num, &dev_info);
+	retval = rte_eth_dev_info_get(port_num, &dev_info);
+	if (retval != 0)
+		return retval;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 43/54] examples/flow_classify: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (41 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 42/54] examples/server_node_efd: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 44/54] examples/packet_ordering: check dev info get result Andrew Rybchenko
                     ` (11 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/flow_classify/flow_classify.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43e..2130c13 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -202,7 +202,13 @@ struct rte_flow_query_count count = {
 	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 44/54] examples/packet_ordering: check dev info get result
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (42 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 43/54] examples/flow_classify: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 45/54] examples/l2fwd-crypto: check status of getting ethdev info Andrew Rybchenko
                     ` (10 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/packet_ordering/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e922..a99961f 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -283,7 +283,13 @@ struct wkr_stats_per {
 	if (!rte_eth_dev_is_valid_port(port_id))
 		return -1;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return ret;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 45/54] examples/l2fwd-crypto: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (43 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 44/54] examples/packet_ordering: check dev info get result Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 46/54] examples/multi_process: " Andrew Rybchenko
                     ` (9 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Pablo de Lara, Declan Doherty; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd-crypto/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba7..9a370f2 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2513,7 +2513,14 @@ struct l2fwd_crypto_statistics {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		retval = rte_eth_dev_info_get(portid, &dev_info);
+		if (retval != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+					portid, strerror(-retval));
+			return retval;
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 46/54] examples/multi_process: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (44 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 45/54] examples/l2fwd-crypto: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 47/54] examples/ipsec-secgw: " Andrew Rybchenko
                     ` (8 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/multi_process/symmetric_mp/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 62771e0..9ae8efb 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -209,7 +209,13 @@ struct port_stats{
 	printf("# Initialising port %u... ", port);
 	fflush(stdout);
 
-	rte_eth_dev_info_get(port, &info);
+	retval = rte_eth_dev_info_get(port, &info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	info.default_rxconf.rx_drop_en = 1;
 
 	if (info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 47/54] examples/ipsec-secgw: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (45 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 46/54] examples/multi_process: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-04  9:11     ` Akhil Goyal
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 48/54] examples/netmap_compat: " Andrew Rybchenko
                     ` (7 subsequent siblings)
  54 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ipsec-secgw/ipsec-secgw.c |  6 +++++-
 examples/ipsec-secgw/ipsec.c       |  9 ++++++++-
 examples/ipsec-secgw/sa.c          | 10 +++++++++-
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6a..534830a 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1911,7 +1911,11 @@ struct lcore_conf {
 	struct rte_ether_addr ethaddr;
 	struct rte_eth_conf local_port_conf = port_conf;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-ret));
 
 	/* limit allowed HW offloafs, as user requested */
 	dev_info.rx_offload_capa &= dev_rx_offload;
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index dc85adf..7720080 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -243,7 +243,14 @@
 			unsigned int i;
 			unsigned int j;
 
-			rte_eth_dev_info_get(sa->portid, &dev_info);
+			ret = rte_eth_dev_info_get(sa->portid, &dev_info);
+			if (ret != 0) {
+				RTE_LOG(ERR, IPSEC,
+					"Error during getting device (port %u) info: %s\n",
+					sa->portid, strerror(-ret));
+				return ret;
+			}
+
 			sa->action[2].type = RTE_FLOW_ACTION_TYPE_END;
 			/* Try RSS. */
 			sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index c3cf3bd..14ee947 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -756,8 +756,16 @@ struct sa_ctx {
 check_eth_dev_caps(uint16_t portid, uint32_t inbound)
 {
 	struct rte_eth_dev_info dev_info;
+	int retval;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	retval = rte_eth_dev_info_get(portid, &dev_info);
+	if (retval != 0) {
+		RTE_LOG(ERR, IPSEC,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-retval));
+
+		return retval;
+	}
 
 	if (inbound) {
 		if ((dev_info.rx_offload_capa &
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 48/54] examples/netmap_compat: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (46 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 47/54] examples/ipsec-secgw: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 49/54] examples/l2fwd-keepalive: check dev info get result Andrew Rybchenko
                     ` (6 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/netmap_compat/lib/compat_netmap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index 10a4379..c25cc09 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -684,7 +684,14 @@ struct netmap_state {
 		return -EINVAL;
 	}
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret != 0) {
+		RTE_LOG(ERR, USER1,
+			"Error during getting device (port %u) info: %s\n",
+			portid, strerror(-ret));
+		return ret;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf->eth_conf->txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 49/54] examples/l2fwd-keepalive: check dev info get result
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (47 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 48/54] examples/netmap_compat: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 50/54] examples/ip_pipeline: check status of getting ethdev info Andrew Rybchenko
                     ` (5 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/l2fwd-keepalive/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a43..a051390 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -634,7 +634,13 @@ static void handle_sigterm(__rte_unused int value)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 50/54] examples/ip_pipeline: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (48 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 49/54] examples/l2fwd-keepalive: check dev info get result Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 51/54] examples/load_balancer: " Andrew Rybchenko
                     ` (4 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ip_pipeline/kni.c  | 5 ++++-
 examples/ip_pipeline/link.c | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/ip_pipeline/kni.c b/examples/ip_pipeline/kni.c
index e9262e0..4519685 100644
--- a/examples/ip_pipeline/kni.c
+++ b/examples/ip_pipeline/kni.c
@@ -109,6 +109,7 @@ struct kni *
 	struct rte_kni *k;
 	const struct rte_pci_device *pci_dev;
 	const struct rte_bus *bus = NULL;
+	int ret;
 
 	/* Check input params */
 	if ((name == NULL) ||
@@ -123,7 +124,9 @@ struct kni *
 		return NULL;
 
 	/* Resource create */
-	rte_eth_dev_info_get(link->port_id, &dev_info);
+	ret = rte_eth_dev_info_get(link->port_id, &dev_info);
+	if (ret != 0)
+		return NULL;
 
 	memset(&kni_conf, 0, sizeof(kni_conf));
 	strlcpy(kni_conf.name, name, RTE_KNI_NAMESIZE);
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb86..4e3a40b 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -129,7 +129,8 @@ struct link *
 		if (!rte_eth_dev_is_valid_port(port_id))
 			return NULL;
 
-	rte_eth_dev_info_get(port_id, &port_info);
+	if (rte_eth_dev_info_get(port_id, &port_info) != 0)
+		return NULL;
 
 	mempool = mempool_find(params->rx.mempool_name);
 	if (mempool == NULL)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 51/54] examples/load_balancer: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (49 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 50/54] examples/ip_pipeline: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 52/54] examples/kni: " Andrew Rybchenko
                     ` (3 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/load_balancer/init.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d02..660f5a8 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -411,7 +411,12 @@
 
 		/* Init port */
 		printf("Initializing NIC port %u ...\n", port);
-		rte_eth_dev_info_get(port, &dev_info);
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		if (ret != 0)
+			rte_panic("Error during getting device (port %u) info: %s\n",
+				port, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 52/54] examples/kni: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (50 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 51/54] examples/load_balancer: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 53/54] examples/ethtool: " Andrew Rybchenko
                     ` (2 subsequent siblings)
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/kni/main.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index 17f695e..e43f174 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -595,7 +595,13 @@ struct kni_interface_stats {
 	/* Initialise device and RX/TX queues */
 	RTE_LOG(INFO, APP, "Initialising port %u ...\n", (unsigned)port);
 	fflush(stdout);
-	rte_eth_dev_info_get(port, &dev_info);
+
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@ -780,7 +786,15 @@ struct kni_interface_stats {
 				"for port%u (%d)\n", (unsigned int)port_id,
 				ret);
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		RTE_LOG(ERR, APP,
+			"Error during getting device (port %u) info: %s\n",
+			port_id, strerror(-ret));
+
+		return ret;
+	}
+
 	rxq_conf = dev_info.default_rxconf;
 	rxq_conf.offloads = conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
@@ -869,6 +883,7 @@ struct kni_interface_stats {
 	struct rte_kni *kni;
 	struct rte_kni_conf conf;
 	struct kni_port_params **params = kni_port_params_array;
+	int ret;
 
 	if (port_id >= RTE_MAX_ETHPORTS || !params[port_id])
 		return -1;
@@ -898,7 +913,11 @@ struct kni_interface_stats {
 			struct rte_kni_ops ops;
 			struct rte_eth_dev_info dev_info;
 
-			rte_eth_dev_info_get(port_id, &dev_info);
+			ret = rte_eth_dev_info_get(port_id, &dev_info);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) info: %s\n",
+					port_id, strerror(-ret));
 
 			/* Get the interface default mac address */
 			rte_eth_macaddr_get(port_id,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 53/54] examples/ethtool: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (51 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 52/54] examples/kni: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 54/54] examples/exception_path: " Andrew Rybchenko
  2019-09-03 18:14   ` [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int Aaron Conole
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/ethtool/ethtool-app/main.c |  8 +++++++-
 examples/ethtool/lib/rte_ethtool.c  | 19 ++++++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index 3d2a70d..774df7e 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -95,6 +95,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 	char str_name[16];
 	uint16_t nb_rxd = PORT_RX_QUEUE_SIZE;
 	uint16_t nb_txd = PORT_TX_QUEUE_SIZE;
+	int ret;
 
 	memset(&cfg_port, 0, sizeof(cfg_port));
 	cfg_port.txmode.mq_mode = ETH_MQ_TX_NONE;
@@ -102,7 +103,12 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 	for (idx_port = 0; idx_port < cnt_ports; idx_port++) {
 		struct app_port *ptr_port = &app_cfg->ports[idx_port];
 
-		rte_eth_dev_info_get(idx_port, &dev_info);
+		ret = rte_eth_dev_info_get(idx_port, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				idx_port, strerror(-ret));
+
 		size_pktpool = dev_info.rx_desc_lim.nb_max +
 			dev_info.tx_desc_lim.nb_max + PKTPOOL_EXTRA_SIZE;
 
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index fd1692d..43cacc0 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -41,7 +41,13 @@
 		printf("Insufficient fw version buffer size, "
 		       "the minimum size should be %d\n", ret);
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+		       port_id, strerror(-ret));
+
+		return ret;
+	}
 
 	strlcpy(drvinfo->driver, dev_info.driver_name,
 		sizeof(drvinfo->driver));
@@ -370,8 +376,12 @@
 	uint16_t num_vfs;
 	struct rte_eth_dev_info dev_info;
 	uint16_t vf;
+	int ret;
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	num_vfs = dev_info.max_vfs;
 
 	/* Set VF vf_rx_mode, VF unsupport status is discard */
@@ -397,11 +407,14 @@
 	struct rte_eth_rxq_info rx_qinfo;
 	struct rte_eth_txq_info tx_qinfo;
 	int stat;
+	int ret;
 
 	if (ring_param == NULL)
 		return -EINVAL;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	stat = rte_eth_rx_queue_info_get(port_id, 0, &rx_qinfo);
 	if (stat != 0)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v2 54/54] examples/exception_path: check status of getting ethdev info
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (52 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 53/54] examples/ethtool: " Andrew Rybchenko
@ 2019-09-03 13:57   ` Andrew Rybchenko
  2019-09-03 18:14   ` [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int Aaron Conole
  54 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:57 UTC (permalink / raw)
  To: Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/exception_path/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a..d7f3598 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -432,7 +432,12 @@ static int tap_create(char *name)
 	/* Initialise device and RX/TX queues */
 	PRINT_INFO("Initialising port %u ...", port);
 	fflush(stdout);
-	rte_eth_dev_info_get(port, &dev_info);
+
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0)
+		FATAL_ERROR("Error during getting device (port %u) info: %s\n",
+			port, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		local_port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 12:27           ` Andrew Rybchenko
@ 2019-09-03 13:58             ` Aaron Conole
  0 siblings, 0 replies; 272+ messages in thread
From: Aaron Conole @ 2019-09-03 13:58 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: Thomas Monjalon, Ferruh Yigit, dev, Ivan Ilchenko

Andrew Rybchenko <arybchenko@solarflare.com> writes:

> On 8/29/19 8:05 PM, Thomas Monjalon wrote:
>
>  28/08/2019 16:29, Andrew Rybchenko:
>
>  On 8/28/19 4:42 PM, Aaron Conole wrote:
>
>  Andrew Rybchenko <arybchenko@solarflare.com> writes:
>
>  On 8/27/19 11:47 PM, Aaron Conole wrote:
>
>  Andrew Rybchenko <arybchenko@solarflare.com> writes:
>
>  It is the first patch series to get rid of void returning functions
> in ethdev in accordance with deprecation notice [1].
>
> This is a huge series, and I suggest to combine some of the work, and/or
> break it up.
>
> I can send patches for examples separately, but it will not help a lot.
> I can squash changes in examples, but I think it is wrong since it would
> make review harder - different maintainers and different practices to
> handle error in different examples (and we tried to take it into account).
>
> Hrrm?  Not sure what you mean.
>
>
> I mean that it is easier to review many small patches than one huge patch
> especially when these files are maintained by different people.
>
>  Patches should be broken up by logical change.  That way, it is easy to
> bisect and isolate what has changed.  This series, it seems like there's
> a single logical change, and that's been spread over lots of patches.
>
>
> Single huge patch is worse for both bisect and review. When patch is huge
> and bisect says that the patch is guilty, you still need to find out which
> snippet/change is guilty.
>
> In this particular case nothing prevents to split the patch make it easier
> to review and bisect.
>
>  I think grouping all the examples and all the app/test together, would
> make the series 14 review-able patches.  As it is, stepping through 40+
> 10-line emails is much more tedious (not to mention needing to apply
> them, check each for build, etc).
>
>
> Yes, less build cycles are required for smaller number of patches, but
> anyway automation does (should do) it. So, not that important.
>
> I disagree that it is easier to review one huge patch. Sorry.
> I think it is important here that different examples are maintained
> by different people. Anyway if more reviewers will support the idea
> to squash examples into once patch, technically it is trial to do.
>
>
> When doing same kind of change on multiple applications,
> splitting patches won't help any bisect (they are all different
> applications anyway). And I think squashing can better show the idea that
> every applications got the same kind of change (thanks for that).
> In general, I think patches deserve to be split when there is something
> interesting to say in the commit log. If you want to describe a
> different logic of each app, why not. The other way is to explain
> some exceptions for some applications in a signle patch.
>
> Thanks a lot, makes sense and I agree with explanations.
> The only problem is review of such huge patches, when
> reviewer needs to find out his snippet.

At least, hopefully the reviewer knows from the changestat what to look
for to narrow it down.

> Also split version
> is better for patchwork reviewed/acked counters. It is
> clear which snippets are reviewed, which are not.
> Unfortunately split does not help this patchset to get
> more attention from reviewers :(

That's a problem for which I have no solution.  If you solve it please
let me know how. :)

>  My conclusion is that it is often hard to find the good balance,
> between split and squash, and I can understand any motivation :)
> Sometimes I squash some patches on apply after they got all reviewed
> separately. In this case, I didn't look yet :)

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 14/54] net/failsafe: check status of getting ethdev info
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 14/54] net/failsafe: " Andrew Rybchenko
@ 2019-09-03 14:20     ` Gaëtan Rivet
  0 siblings, 0 replies; 272+ messages in thread
From: Gaëtan Rivet @ 2019-09-03 14:20 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: dev, Ivan Ilchenko

Hello Andrew, Ivan,

I would have found more consistent merging this patch with the main
ethdev one. It is short enough, I'm not sure this warrants a patch on
its own.

In any case,
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

On Tue, Sep 03, 2019 at 02:56:48PM +0100, Andrew Rybchenko wrote:
> 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/failsafe 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/failsafe/failsafe_ops.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
> index 96e05d4..b3df626 100644
> --- a/drivers/net/failsafe/failsafe_ops.c
> +++ b/drivers/net/failsafe/failsafe_ops.c
> @@ -866,6 +866,7 @@
>  {
>  	struct sub_device *sdev;
>  	uint8_t i;
> +	int ret;
>  
>  	/* Use maximum upper bounds by default */
>  	infos->max_rx_pktlen = UINT32_MAX;
> @@ -933,7 +934,9 @@
>  	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
>  		struct rte_eth_dev_info sub_info;
>  
> -		rte_eth_dev_info_get(PORT_ID(sdev), &sub_info);
> +		ret = rte_eth_dev_info_get(PORT_ID(sdev), &sub_info);
> +		if (ret != 0)
> +			return;
>  
>  		fs_dev_merge_info(infos, &sub_info);
>  	}
> -- 
> 1.8.3.1
> 

-- 
Gaëtan Rivet
6WIND

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
                     ` (53 preceding siblings ...)
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 54/54] examples/exception_path: " Andrew Rybchenko
@ 2019-09-03 18:14   ` Aaron Conole
  2019-09-03 18:24     ` Andrew Rybchenko
  54 siblings, 1 reply; 272+ messages in thread
From: Aaron Conole @ 2019-09-03 18:14 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Thomas Monjalon, Ferruh Yigit, Jan Viktorin, dev, Ivan Ilchenko

Andrew Rybchenko <arybchenko@solarflare.com> writes:

> It is the first patch series to get rid of void returning functions
> in ethdev in accordance with deprecation notice [1].
>
> Functions which return void are bad since they do not provide explicit
> information to the caller if everything is OK or not. It was bugs in
> rte_eth_dev_info_get() recently which kept device information
> uninitialized if port ID is invalid.
>
> The patch series updates rte_eth_dev_info_get() straightforward
> to simply return error if port ID is invalid or driver does not
> provide corresponding callback. In the future default callback
> which fills in generic non driver specific information could be
> added to help secondary processes cases when driver has no
> callback in secondary process. Also the idea to make the callback
> mandatory should be considered.
>
> Patches to update examples are kept separately to simplify review,
> but could be squashed on apply since logically it is the same
> change in all applicable examples.
>
> [1] https://patches.dpdk.org/patch/56969/

Some errors with the series:

   https://travis-ci.com/ovsrobot/dpdk/builds/125755853

> v2:
>  - add a patch to change dev_infos_get prototype to return int as well
>  - fix issue with ring_pmd_autotest (just inverted assert condition)
>  - add missing net/failsafe patch
>  - fix net/netsvc patch in accordance with review notes from Stephen
>  - fix app/testpmd patch in accordance with review notes from Ferruh
>  - add net/bnxt ack
>
> Andrew Rybchenko (1):
>   ethdev: remove redundunt device info cleanup before get
>
> Ivan Ilchenko (53):
>   ethdev: change rte_eth_dev_info_get() return value to int
>   app/testpmd: check status of getting ethdev info
>   app/eventdev: check status of getting ethdev info
>   kni: check status of getting ethdev info
>   latency: check status of getting ethdev info
>   pdump: check status of getting ethdev info
>   ring: check status of getting ethdev info
>   app/procinfo: check status of getting ethdev info
>   app/test: check status of getting ethdev info in bonding
>   app/test: check ethdev info get result in event Rx adapter
>   net/bnxt: check status of getting ethdev info
>   net/bonding: check status of getting ethdev info
>   net/failsafe: check status of getting ethdev info
>   net/netvsc: check status of getting ethdev info
>   net/softnic: check status of getting ethdev info
>   ethdev: change eth_dev_infos_get_t to return int
>   examples/rxtx_callbacks: check status of getting ethdev info
>   examples/l3fwd: check status of getting ethdev info
>   examples/qos_meter: check status of getting ethdev info
>   examples/ip_frag: check status of getting ethdev info
>   examples/performance-thread: check dev info get result
>   examples/vmdq: check status of getting ethdev info
>   examples/distributor: check status of getting ethdev info
>   examples/l3fwd-acl: check status of getting ethdev info
>   examples/vm_power: check status of getting ethdev info
>   examples/qos_sched: check status of getting ethdev info
>   examples/flow_filtering: check status of getting ethdev info
>   examples/l3fwd-power: check status of getting ethdev info
>   examples/l2fwd: check status of getting ethdev info
>   examples/skeleton: check status of getting ethdev info
>   examples/vmdq_dcb: check status of getting ethdev info
>   examples/ipv4_multicast: check status of getting ethdev info
>   examples/l2fwd-jobstats: check status of getting ethdev info
>   examples/bond: check status of getting ethdev info
>   examples/eventdev: check status of getting ethdev info
>   examples/ip_reassembly: check status of getting ethdev info
>   examples/vhost: check status of getting ethdev info
>   examples/ptpclient: check status of getting ethdev info
>   examples/link_status_interrupt: check dev info get result
>   examples/tep_termination: check dev info get result
>   examples/server_node_efd: check dev info get result
>   examples/flow_classify: check status of getting ethdev info
>   examples/packet_ordering: check dev info get result
>   examples/l2fwd-crypto: check status of getting ethdev info
>   examples/multi_process: check status of getting ethdev info
>   examples/ipsec-secgw: check status of getting ethdev info
>   examples/netmap_compat: check status of getting ethdev info
>   examples/l2fwd-keepalive: check dev info get result
>   examples/ip_pipeline: check status of getting ethdev info
>   examples/load_balancer: check status of getting ethdev info
>   examples/kni: check status of getting ethdev info
>   examples/ethtool: check status of getting ethdev info
>   examples/exception_path: check status of getting ethdev info
>
>  app/proc-info/main.c                            |  15 ++-
>  app/test-eventdev/test_perf_common.c            |   8 +-
>  app/test-eventdev/test_pipeline_common.c        |   9 +-
>  app/test-pmd/cmdline.c                          | 124 +++++++++++++++++++-----
>  app/test-pmd/cmdline_flow.c                     |   5 +-
>  app/test-pmd/config.c                           |  80 ++++++++++++---
>  app/test-pmd/parameters.c                       |   8 +-
>  app/test-pmd/testpmd.c                          |  40 ++++++--
>  app/test-pmd/testpmd.h                          |   3 +
>  app/test-pmd/util.c                             |  28 +++++-
>  app/test/test_event_eth_rx_adapter.c            |   4 +-
>  app/test/test_kni.c                             |  27 +++++-
>  app/test/test_link_bonding_rssconf.c            |  33 ++++++-
>  app/test/test_pmd_ring.c                        |   9 +-
>  app/test/virtual_pmd.c                          |   4 +-
>  doc/guides/rel_notes/deprecation.rst            |   1 -
>  doc/guides/rel_notes/release_19_11.rst          |   5 +-
>  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/bnxt/rte_pmd_bnxt.c                 | 122 ++++++++++++++++++++---
>  drivers/net/bonding/rte_eth_bond_api.c          |  10 +-
>  drivers/net/bonding/rte_eth_bond_pmd.c          |  40 +++++++-
>  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             |   9 +-
>  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/netvsc/hn_var.h                     |   2 +-
>  drivers/net/netvsc/hn_vf.c                      |  15 ++-
>  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/softnic/rte_eth_softnic_link.c      |   5 +-
>  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 +-
>  examples/bond/main.c                            |  14 ++-
>  examples/distributor/main.c                     |   8 +-
>  examples/ethtool/ethtool-app/main.c             |   8 +-
>  examples/ethtool/lib/rte_ethtool.c              |  21 +++-
>  examples/eventdev_pipeline/main.c               |   8 +-
>  examples/exception_path/main.c                  |   7 +-
>  examples/flow_classify/flow_classify.c          |   8 +-
>  examples/flow_filtering/main.c                  |   7 +-
>  examples/ip_fragmentation/main.c                |  14 ++-
>  examples/ip_pipeline/kni.c                      |   5 +-
>  examples/ip_pipeline/link.c                     |   3 +-
>  examples/ip_reassembly/main.c                   |   7 +-
>  examples/ipsec-secgw/ipsec-secgw.c              |   6 +-
>  examples/ipsec-secgw/ipsec.c                    |   9 +-
>  examples/ipsec-secgw/sa.c                       |  10 +-
>  examples/ipv4_multicast/main.c                  |   7 +-
>  examples/kni/main.c                             |  26 ++++-
>  examples/l2fwd-crypto/main.c                    |   9 +-
>  examples/l2fwd-jobstats/main.c                  |   8 +-
>  examples/l2fwd-keepalive/main.c                 |   8 +-
>  examples/l2fwd/main.c                           |   8 +-
>  examples/l3fwd-acl/main.c                       |  22 ++++-
>  examples/l3fwd-power/main.c                     |  22 ++++-
>  examples/l3fwd/main.c                           |  14 ++-
>  examples/link_status_interrupt/main.c           |   8 +-
>  examples/load_balancer/init.c                   |   7 +-
>  examples/multi_process/symmetric_mp/main.c      |   8 +-
>  examples/netmap_compat/lib/compat_netmap.c      |   9 +-
>  examples/packet_ordering/main.c                 |   8 +-
>  examples/performance-thread/l3fwd-thread/main.c |  15 ++-
>  examples/ptpclient/ptpclient.c                  |   9 +-
>  examples/qos_meter/main.c                       |  16 ++-
>  examples/qos_sched/init.c                       |   8 +-
>  examples/rxtx_callbacks/main.c                  |   9 +-
>  examples/server_node_efd/server/init.c          |   5 +-
>  examples/skeleton/basicfwd.c                    |   8 +-
>  examples/tep_termination/vxlan_setup.c          |   6 +-
>  examples/vhost/main.c                           |   9 +-
>  examples/vm_power_manager/main.c                |   8 +-
>  examples/vmdq/main.c                            |  16 ++-
>  examples/vmdq_dcb/main.c                        |  18 +++-
>  lib/librte_ethdev/rte_ethdev.c                  |  71 ++++++++++----
>  lib/librte_ethdev/rte_ethdev.h                  |   6 +-
>  lib/librte_ethdev/rte_ethdev_core.h             |   4 +-
>  lib/librte_latencystats/rte_latencystats.c      |  23 ++++-
>  lib/librte_pdump/rte_pdump.c                    |   9 +-
>  124 files changed, 1221 insertions(+), 291 deletions(-)

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 18:14   ` [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int Aaron Conole
@ 2019-09-03 18:24     ` Andrew Rybchenko
  2019-09-03 20:06       ` Aaron Conole
  0 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 18:24 UTC (permalink / raw)
  To: Aaron Conole
  Cc: Thomas Monjalon, Ferruh Yigit, Jan Viktorin, dev, Ivan Ilchenko

On September 3, 2019 21:14:58 Aaron Conole <aconole@redhat.com> wrote:

> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>
>> It is the first patch series to get rid of void returning functions
>> in ethdev in accordance with deprecation notice [1].
>>
>>
>> Functions which return void are bad since they do not provide explicit
>> information to the caller if everything is OK or not. It was bugs in
>> rte_eth_dev_info_get() recently which kept device information
>> uninitialized if port ID is invalid.
>>
>>
>> The patch series updates rte_eth_dev_info_get() straightforward
>> to simply return error if port ID is invalid or driver does not
>> provide corresponding callback. In the future default callback
>> which fills in generic non driver specific information could be
>> added to help secondary processes cases when driver has no
>> callback in secondary process. Also the idea to make the callback
>> mandatory should be considered.
>>
>>
>> Patches to update examples are kept separately to simplify review,
>> but could be squashed on apply since logically it is the same
>> change in all applicable examples.
>>
>>
>> [1] https://patches.dpdk.org/patch/56969/
>
> Some errors with the series:
>
>   https://travis-ci.com/ovsrobot/dpdk/builds/125755853

I guess it was applied to dpdk main repo, but should be on top of 
dpdk-next-net which has pre-patch applied.

>
>
>> v2:
>> - add a patch to change dev_infos_get prototype to return int as well
>> - fix issue with ring_pmd_autotest (just inverted assert condition)
>> - add missing net/failsafe patch
>> - fix net/netsvc patch in accordance with review notes from Stephen
>> - fix app/testpmd patch in accordance with review notes from Ferruh
>> - add net/bnxt ack
>>
>>
>> Andrew Rybchenko (1):
>> ethdev: remove redundunt device info cleanup before get
>>
>>
>> Ivan Ilchenko (53):
>> ethdev: change rte_eth_dev_info_get() return value to int
>> app/testpmd: check status of getting ethdev info
>> app/eventdev: check status of getting ethdev info
>> kni: check status of getting ethdev info
>> latency: check status of getting ethdev info
>> pdump: check status of getting ethdev info
>> ring: check status of getting ethdev info
>> app/procinfo: check status of getting ethdev info
>> app/test: check status of getting ethdev info in bonding
>> app/test: check ethdev info get result in event Rx adapter
>> net/bnxt: check status of getting ethdev info
>> net/bonding: check status of getting ethdev info
>> net/failsafe: check status of getting ethdev info
>> net/netvsc: check status of getting ethdev info
>> net/softnic: check status of getting ethdev info
>> ethdev: change eth_dev_infos_get_t to return int
>> examples/rxtx_callbacks: check status of getting ethdev info
>> examples/l3fwd: check status of getting ethdev info
>> examples/qos_meter: check status of getting ethdev info
>> examples/ip_frag: check status of getting ethdev info
>> examples/performance-thread: check dev info get result
>> examples/vmdq: check status of getting ethdev info
>> examples/distributor: check status of getting ethdev info
>> examples/l3fwd-acl: check status of getting ethdev info
>> examples/vm_power: check status of getting ethdev info
>> examples/qos_sched: check status of getting ethdev info
>> examples/flow_filtering: check status of getting ethdev info
>> examples/l3fwd-power: check status of getting ethdev info
>> examples/l2fwd: check status of getting ethdev info
>> examples/skeleton: check status of getting ethdev info
>> examples/vmdq_dcb: check status of getting ethdev info
>> examples/ipv4_multicast: check status of getting ethdev info
>> examples/l2fwd-jobstats: check status of getting ethdev info
>> examples/bond: check status of getting ethdev info
>> examples/eventdev: check status of getting ethdev info
>> examples/ip_reassembly: check status of getting ethdev info
>> examples/vhost: check status of getting ethdev info
>> examples/ptpclient: check status of getting ethdev info
>> examples/link_status_interrupt: check dev info get result
>> examples/tep_termination: check dev info get result
>> examples/server_node_efd: check dev info get result
>> examples/flow_classify: check status of getting ethdev info
>> examples/packet_ordering: check dev info get result
>> examples/l2fwd-crypto: check status of getting ethdev info
>> examples/multi_process: check status of getting ethdev info
>> examples/ipsec-secgw: check status of getting ethdev info
>> examples/netmap_compat: check status of getting ethdev info
>> examples/l2fwd-keepalive: check dev info get result
>> examples/ip_pipeline: check status of getting ethdev info
>> examples/load_balancer: check status of getting ethdev info
>> examples/kni: check status of getting ethdev info
>> examples/ethtool: check status of getting ethdev info
>> examples/exception_path: check status of getting ethdev info
>>
>>
>> app/proc-info/main.c                            |  15 ++-
>> app/test-eventdev/test_perf_common.c            |   8 +-
>> app/test-eventdev/test_pipeline_common.c        |   9 +-
>> app/test-pmd/cmdline.c                          | 124 +++++++++++++++++++-----
>> app/test-pmd/cmdline_flow.c                     |   5 +-
>> app/test-pmd/config.c                           |  80 ++++++++++++---
>> app/test-pmd/parameters.c                       |   8 +-
>> app/test-pmd/testpmd.c                          |  40 ++++++--
>> app/test-pmd/testpmd.h                          |   3 +
>> app/test-pmd/util.c                             |  28 +++++-
>> app/test/test_event_eth_rx_adapter.c            |   4 +-
>> app/test/test_kni.c                             |  27 +++++-
>> app/test/test_link_bonding_rssconf.c            |  33 ++++++-
>> app/test/test_pmd_ring.c                        |   9 +-
>> app/test/virtual_pmd.c                          |   4 +-
>> doc/guides/rel_notes/deprecation.rst            |   1 -
>> doc/guides/rel_notes/release_19_11.rst          |   5 +-
>> 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/bnxt/rte_pmd_bnxt.c                 | 122 ++++++++++++++++++++---
>> drivers/net/bonding/rte_eth_bond_api.c          |  10 +-
>> drivers/net/bonding/rte_eth_bond_pmd.c          |  40 +++++++-
>> 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             |   9 +-
>> 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/netvsc/hn_var.h                     |   2 +-
>> drivers/net/netvsc/hn_vf.c                      |  15 ++-
>> 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/softnic/rte_eth_softnic_link.c      |   5 +-
>> 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 +-
>> examples/bond/main.c                            |  14 ++-
>> examples/distributor/main.c                     |   8 +-
>> examples/ethtool/ethtool-app/main.c             |   8 +-
>> examples/ethtool/lib/rte_ethtool.c              |  21 +++-
>> examples/eventdev_pipeline/main.c               |   8 +-
>> examples/exception_path/main.c                  |   7 +-
>> examples/flow_classify/flow_classify.c          |   8 +-
>> examples/flow_filtering/main.c                  |   7 +-
>> examples/ip_fragmentation/main.c                |  14 ++-
>> examples/ip_pipeline/kni.c                      |   5 +-
>> examples/ip_pipeline/link.c                     |   3 +-
>> examples/ip_reassembly/main.c                   |   7 +-
>> examples/ipsec-secgw/ipsec-secgw.c              |   6 +-
>> examples/ipsec-secgw/ipsec.c                    |   9 +-
>> examples/ipsec-secgw/sa.c                       |  10 +-
>> examples/ipv4_multicast/main.c                  |   7 +-
>> examples/kni/main.c                             |  26 ++++-
>> examples/l2fwd-crypto/main.c                    |   9 +-
>> examples/l2fwd-jobstats/main.c                  |   8 +-
>> examples/l2fwd-keepalive/main.c                 |   8 +-
>> examples/l2fwd/main.c                           |   8 +-
>> examples/l3fwd-acl/main.c                       |  22 ++++-
>> examples/l3fwd-power/main.c                     |  22 ++++-
>> examples/l3fwd/main.c                           |  14 ++-
>> examples/link_status_interrupt/main.c           |   8 +-
>> examples/load_balancer/init.c                   |   7 +-
>> examples/multi_process/symmetric_mp/main.c      |   8 +-
>> examples/netmap_compat/lib/compat_netmap.c      |   9 +-
>> examples/packet_ordering/main.c                 |   8 +-
>> examples/performance-thread/l3fwd-thread/main.c |  15 ++-
>> examples/ptpclient/ptpclient.c                  |   9 +-
>> examples/qos_meter/main.c                       |  16 ++-
>> examples/qos_sched/init.c                       |   8 +-
>> examples/rxtx_callbacks/main.c                  |   9 +-
>> examples/server_node_efd/server/init.c          |   5 +-
>> examples/skeleton/basicfwd.c                    |   8 +-
>> examples/tep_termination/vxlan_setup.c          |   6 +-
>> examples/vhost/main.c                           |   9 +-
>> examples/vm_power_manager/main.c                |   8 +-
>> examples/vmdq/main.c                            |  16 ++-
>> examples/vmdq_dcb/main.c                        |  18 +++-
>> lib/librte_ethdev/rte_ethdev.c                  |  71 ++++++++++----
>> lib/librte_ethdev/rte_ethdev.h                  |   6 +-
>> lib/librte_ethdev/rte_ethdev_core.h             |   4 +-
>> lib/librte_latencystats/rte_latencystats.c      |  23 ++++-
>> lib/librte_pdump/rte_pdump.c                    |   9 +-
>> 124 files changed, 1221 insertions(+), 291 deletions(-)




^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 18:24     ` Andrew Rybchenko
@ 2019-09-03 20:06       ` Aaron Conole
  2019-09-03 20:18         ` Thomas Monjalon
  0 siblings, 1 reply; 272+ messages in thread
From: Aaron Conole @ 2019-09-03 20:06 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Thomas Monjalon, Ferruh Yigit, Jan Viktorin, dev, Ivan Ilchenko

Andrew Rybchenko <arybchenko@solarflare.com> writes:

> On September 3, 2019 21:14:58 Aaron Conole <aconole@redhat.com> wrote:
>
>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>>
>>> It is the first patch series to get rid of void returning functions
>>> in ethdev in accordance with deprecation notice [1].
>>>
>>>
>>> Functions which return void are bad since they do not provide explicit
>>> information to the caller if everything is OK or not. It was bugs in
>>> rte_eth_dev_info_get() recently which kept device information
>>> uninitialized if port ID is invalid.
>>>
>>>
>>> The patch series updates rte_eth_dev_info_get() straightforward
>>> to simply return error if port ID is invalid or driver does not
>>> provide corresponding callback. In the future default callback
>>> which fills in generic non driver specific information could be
>>> added to help secondary processes cases when driver has no
>>> callback in secondary process. Also the idea to make the callback
>>> mandatory should be considered.
>>>
>>>
>>> Patches to update examples are kept separately to simplify review,
>>> but could be squashed on apply since logically it is the same
>>> change in all applicable examples.
>>>
>>>
>>> [1] https://patches.dpdk.org/patch/56969/
>>
>> Some errors with the series:
>>
>>   https://travis-ci.com/ovsrobot/dpdk/builds/125755853
>
> I guess it was applied to dpdk main repo, but should be on top of
> dpdk-next-net which has pre-patch applied.

Okay.  This ends up getting confusing to write automation around.  I
know UNH uses some scripts to figure out whether a particular patch
should apply to certain trees - I'll follow up with them.

Meanwhile, I'll try to manually rebase the series so that we have a
clean run.

>>
>>
>>> v2:
>>> - add a patch to change dev_infos_get prototype to return int as well
>>> - fix issue with ring_pmd_autotest (just inverted assert condition)
>>> - add missing net/failsafe patch
>>> - fix net/netsvc patch in accordance with review notes from Stephen
>>> - fix app/testpmd patch in accordance with review notes from Ferruh
>>> - add net/bnxt ack
>>>
>>>
>>> Andrew Rybchenko (1):
>>> ethdev: remove redundunt device info cleanup before get
>>>
>>>
>>> Ivan Ilchenko (53):
>>> ethdev: change rte_eth_dev_info_get() return value to int
>>> app/testpmd: check status of getting ethdev info
>>> app/eventdev: check status of getting ethdev info
>>> kni: check status of getting ethdev info
>>> latency: check status of getting ethdev info
>>> pdump: check status of getting ethdev info
>>> ring: check status of getting ethdev info
>>> app/procinfo: check status of getting ethdev info
>>> app/test: check status of getting ethdev info in bonding
>>> app/test: check ethdev info get result in event Rx adapter
>>> net/bnxt: check status of getting ethdev info
>>> net/bonding: check status of getting ethdev info
>>> net/failsafe: check status of getting ethdev info
>>> net/netvsc: check status of getting ethdev info
>>> net/softnic: check status of getting ethdev info
>>> ethdev: change eth_dev_infos_get_t to return int
>>> examples/rxtx_callbacks: check status of getting ethdev info
>>> examples/l3fwd: check status of getting ethdev info
>>> examples/qos_meter: check status of getting ethdev info
>>> examples/ip_frag: check status of getting ethdev info
>>> examples/performance-thread: check dev info get result
>>> examples/vmdq: check status of getting ethdev info
>>> examples/distributor: check status of getting ethdev info
>>> examples/l3fwd-acl: check status of getting ethdev info
>>> examples/vm_power: check status of getting ethdev info
>>> examples/qos_sched: check status of getting ethdev info
>>> examples/flow_filtering: check status of getting ethdev info
>>> examples/l3fwd-power: check status of getting ethdev info
>>> examples/l2fwd: check status of getting ethdev info
>>> examples/skeleton: check status of getting ethdev info
>>> examples/vmdq_dcb: check status of getting ethdev info
>>> examples/ipv4_multicast: check status of getting ethdev info
>>> examples/l2fwd-jobstats: check status of getting ethdev info
>>> examples/bond: check status of getting ethdev info
>>> examples/eventdev: check status of getting ethdev info
>>> examples/ip_reassembly: check status of getting ethdev info
>>> examples/vhost: check status of getting ethdev info
>>> examples/ptpclient: check status of getting ethdev info
>>> examples/link_status_interrupt: check dev info get result
>>> examples/tep_termination: check dev info get result
>>> examples/server_node_efd: check dev info get result
>>> examples/flow_classify: check status of getting ethdev info
>>> examples/packet_ordering: check dev info get result
>>> examples/l2fwd-crypto: check status of getting ethdev info
>>> examples/multi_process: check status of getting ethdev info
>>> examples/ipsec-secgw: check status of getting ethdev info
>>> examples/netmap_compat: check status of getting ethdev info
>>> examples/l2fwd-keepalive: check dev info get result
>>> examples/ip_pipeline: check status of getting ethdev info
>>> examples/load_balancer: check status of getting ethdev info
>>> examples/kni: check status of getting ethdev info
>>> examples/ethtool: check status of getting ethdev info
>>> examples/exception_path: check status of getting ethdev info
>>>
>>>
>>> app/proc-info/main.c                            |  15 ++-
>>> app/test-eventdev/test_perf_common.c            |   8 +-
>>> app/test-eventdev/test_pipeline_common.c        |   9 +-
>>> app/test-pmd/cmdline.c                          | 124 +++++++++++++++++++-----
>>> app/test-pmd/cmdline_flow.c                     |   5 +-
>>> app/test-pmd/config.c                           |  80 ++++++++++++---
>>> app/test-pmd/parameters.c                       |   8 +-
>>> app/test-pmd/testpmd.c                          |  40 ++++++--
>>> app/test-pmd/testpmd.h                          |   3 +
>>> app/test-pmd/util.c                             |  28 +++++-
>>> app/test/test_event_eth_rx_adapter.c            |   4 +-
>>> app/test/test_kni.c                             |  27 +++++-
>>> app/test/test_link_bonding_rssconf.c            |  33 ++++++-
>>> app/test/test_pmd_ring.c                        |   9 +-
>>> app/test/virtual_pmd.c                          |   4 +-
>>> doc/guides/rel_notes/deprecation.rst            |   1 -
>>> doc/guides/rel_notes/release_19_11.rst          |   5 +-
>>> 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/bnxt/rte_pmd_bnxt.c                 | 122 ++++++++++++++++++++---
>>> drivers/net/bonding/rte_eth_bond_api.c          |  10 +-
>>> drivers/net/bonding/rte_eth_bond_pmd.c          |  40 +++++++-
>>> 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             |   9 +-
>>> 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/netvsc/hn_var.h                     |   2 +-
>>> drivers/net/netvsc/hn_vf.c                      |  15 ++-
>>> 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/softnic/rte_eth_softnic_link.c      |   5 +-
>>> 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 +-
>>> examples/bond/main.c                            |  14 ++-
>>> examples/distributor/main.c                     |   8 +-
>>> examples/ethtool/ethtool-app/main.c             |   8 +-
>>> examples/ethtool/lib/rte_ethtool.c              |  21 +++-
>>> examples/eventdev_pipeline/main.c               |   8 +-
>>> examples/exception_path/main.c                  |   7 +-
>>> examples/flow_classify/flow_classify.c          |   8 +-
>>> examples/flow_filtering/main.c                  |   7 +-
>>> examples/ip_fragmentation/main.c                |  14 ++-
>>> examples/ip_pipeline/kni.c                      |   5 +-
>>> examples/ip_pipeline/link.c                     |   3 +-
>>> examples/ip_reassembly/main.c                   |   7 +-
>>> examples/ipsec-secgw/ipsec-secgw.c              |   6 +-
>>> examples/ipsec-secgw/ipsec.c                    |   9 +-
>>> examples/ipsec-secgw/sa.c                       |  10 +-
>>> examples/ipv4_multicast/main.c                  |   7 +-
>>> examples/kni/main.c                             |  26 ++++-
>>> examples/l2fwd-crypto/main.c                    |   9 +-
>>> examples/l2fwd-jobstats/main.c                  |   8 +-
>>> examples/l2fwd-keepalive/main.c                 |   8 +-
>>> examples/l2fwd/main.c                           |   8 +-
>>> examples/l3fwd-acl/main.c                       |  22 ++++-
>>> examples/l3fwd-power/main.c                     |  22 ++++-
>>> examples/l3fwd/main.c                           |  14 ++-
>>> examples/link_status_interrupt/main.c           |   8 +-
>>> examples/load_balancer/init.c                   |   7 +-
>>> examples/multi_process/symmetric_mp/main.c      |   8 +-
>>> examples/netmap_compat/lib/compat_netmap.c      |   9 +-
>>> examples/packet_ordering/main.c                 |   8 +-
>>> examples/performance-thread/l3fwd-thread/main.c |  15 ++-
>>> examples/ptpclient/ptpclient.c                  |   9 +-
>>> examples/qos_meter/main.c                       |  16 ++-
>>> examples/qos_sched/init.c                       |   8 +-
>>> examples/rxtx_callbacks/main.c                  |   9 +-
>>> examples/server_node_efd/server/init.c          |   5 +-
>>> examples/skeleton/basicfwd.c                    |   8 +-
>>> examples/tep_termination/vxlan_setup.c          |   6 +-
>>> examples/vhost/main.c                           |   9 +-
>>> examples/vm_power_manager/main.c                |   8 +-
>>> examples/vmdq/main.c                            |  16 ++-
>>> examples/vmdq_dcb/main.c                        |  18 +++-
>>> lib/librte_ethdev/rte_ethdev.c                  |  71 ++++++++++----
>>> lib/librte_ethdev/rte_ethdev.h                  |   6 +-
>>> lib/librte_ethdev/rte_ethdev_core.h             |   4 +-
>>> lib/librte_latencystats/rte_latencystats.c      |  23 ++++-
>>> lib/librte_pdump/rte_pdump.c                    |   9 +-
>>> 124 files changed, 1221 insertions(+), 291 deletions(-)

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 20:06       ` Aaron Conole
@ 2019-09-03 20:18         ` Thomas Monjalon
  2019-09-04 13:07           ` Aaron Conole
  0 siblings, 1 reply; 272+ messages in thread
From: Thomas Monjalon @ 2019-09-03 20:18 UTC (permalink / raw)
  To: Aaron Conole
  Cc: Andrew Rybchenko, Ferruh Yigit, Jan Viktorin, dev, Ivan Ilchenko

03/09/2019 22:06, Aaron Conole:
> Andrew Rybchenko <arybchenko@solarflare.com> writes:
> > On September 3, 2019 21:14:58 Aaron Conole <aconole@redhat.com> wrote:
> >> Some errors with the series:
> >>
> >>   https://travis-ci.com/ovsrobot/dpdk/builds/125755853
> >
> > I guess it was applied to dpdk main repo, but should be on top of
> > dpdk-next-net which has pre-patch applied.
> 
> Okay.  This ends up getting confusing to write automation around.  I
> know UNH uses some scripts to figure out whether a particular patch
> should apply to certain trees - I'll follow up with them.

You can check the script here:
	http://git.dpdk.org/tools/dpdk-ci/tree/tools/guess_git_tree.py




^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 28/54] examples/flow_filtering: check status of getting ethdev info
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 28/54] examples/flow_filtering: " Andrew Rybchenko
@ 2019-09-04  5:57     ` Ori Kam
  0 siblings, 0 replies; 272+ messages in thread
From: Ori Kam @ 2019-09-04  5:57 UTC (permalink / raw)
  To: Andrew Rybchenko, Marko Kovacevic, Bruce Richardson,
	Pablo de Lara, Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko



> -----Original Message-----
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> Sent: Tuesday, September 3, 2019 4:57 PM
> To: Marko Kovacevic <marko.kovacevic@intel.com>; Ori Kam
> <orika@mellanox.com>; Bruce Richardson <bruce.richardson@intel.com>;
> Pablo de Lara <pablo.de.lara.guarch@intel.com>; Radu Nicolau
> <radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; Tomasz
> Kantecki <tomasz.kantecki@intel.com>
> Cc: dev@dpdk.org; Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> Subject: [PATCH v2 28/54] examples/flow_filtering: check status of getting
> ethdev info
> 
> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> 
> rte_eth_dev_info_get() return value was changed from void to
> int, so this patch modify rte_eth_dev_info_get() usage across
> examples/flow_filtering according to its new return type.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori Kam

> ---
>  examples/flow_filtering/main.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
> index a0487be..fe064fa 100644
> --- a/examples/flow_filtering/main.c
> +++ b/examples/flow_filtering/main.c
> @@ -136,7 +136,12 @@
>  	struct rte_eth_rxconf rxq_conf;
>  	struct rte_eth_dev_info dev_info;
> 
> -	rte_eth_dev_info_get(port_id, &dev_info);
> +	ret = rte_eth_dev_info_get(port_id, &dev_info);
> +	if (ret != 0)
> +		rte_exit(EXIT_FAILURE,
> +			"Error during getting device (port %u) info: %s\n",
> +			port_id, strerror(-ret));
> +
>  	port_conf.txmode.offloads &= dev_info.tx_offload_capa;
>  	printf(":: initializing port: %d\n", port_id);
>  	ret = rte_eth_dev_configure(port_id,
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
@ 2019-09-04  8:32     ` Ferruh Yigit
  0 siblings, 0 replies; 272+ messages in thread
From: Ferruh Yigit @ 2019-09-04  8:32 UTC (permalink / raw)
  To: Andrew Rybchenko, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, stable

On 9/3/2019 2:56 PM, Andrew Rybchenko wrote:
> rte_eth_dev_info_get() always fills in device information memory
> with zeros on entry.
> 
> Fixes: b6719879855d ("ethdev: avoid getting uninitialized info for bad port")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 47/54] examples/ipsec-secgw: check status of getting ethdev info
  2019-09-03 13:57   ` [dpdk-dev] [PATCH v2 47/54] examples/ipsec-secgw: " Andrew Rybchenko
@ 2019-09-04  9:11     ` Akhil Goyal
  0 siblings, 0 replies; 272+ messages in thread
From: Akhil Goyal @ 2019-09-04  9:11 UTC (permalink / raw)
  To: Andrew Rybchenko, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Pablo de Lara, Radu Nicolau, Tomasz Kantecki
  Cc: dev, Ivan Ilchenko


> 
> rte_eth_dev_info_get() return value was changed from void to
> int, so this patch modify rte_eth_dev_info_get() usage across
> examples/ipsec-secgw according to its new return type.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>


^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 20:18         ` Thomas Monjalon
@ 2019-09-04 13:07           ` Aaron Conole
  0 siblings, 0 replies; 272+ messages in thread
From: Aaron Conole @ 2019-09-04 13:07 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Andrew Rybchenko, Ferruh Yigit, Jan Viktorin, dev, Ivan Ilchenko

Thomas Monjalon <thomas@monjalon.net> writes:

> 03/09/2019 22:06, Aaron Conole:
>> Andrew Rybchenko <arybchenko@solarflare.com> writes:
>> > On September 3, 2019 21:14:58 Aaron Conole <aconole@redhat.com> wrote:
>> >> Some errors with the series:
>> >>
>> >>   https://travis-ci.com/ovsrobot/dpdk/builds/125755853
>> >
>> > I guess it was applied to dpdk main repo, but should be on top of
>> > dpdk-next-net which has pre-patch applied.
>> 
>> Okay.  This ends up getting confusing to write automation around.  I
>> know UNH uses some scripts to figure out whether a particular patch
>> should apply to certain trees - I'll follow up with them.
>
> You can check the script here:
> 	http://git.dpdk.org/tools/dpdk-ci/tree/tools/guess_git_tree.py

Thanks.  I'll check it out.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* Re: [dpdk-dev] [PATCH v2 02/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-03 13:56   ` [dpdk-dev] [PATCH v2 02/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
@ 2019-09-04 16:40     ` Ferruh Yigit
  2019-09-06  7:30       ` Andrew Rybchenko
  0 siblings, 1 reply; 272+ messages in thread
From: Ferruh Yigit @ 2019-09-04 16:40 UTC (permalink / raw)
  To: Andrew Rybchenko, Neil Horman, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Ivan Ilchenko

On 9/3/2019 2:56 PM, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> 
> Change rte_eth_dev_info_get() return value from void to int and return
> negative errno values in case of error conditions.
> Modify rte_eth_dev_info_get() usage across the ethdev according
> to new return type.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

<...>

> @@ -1144,7 +1143,9 @@ struct rte_eth_dev *

The diff output seems not able to detect the function/block which makes it
harder to review, same patch I am getting a diff output like below:
 @@ -1144,7 +1143,9 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q,
uint16_t nb_tx_q,

Can you please either check a newer version of git, as far as I can see you are
using '1.8.3.1', or can you please try by removing/updating '.gitattributes' file?

>  	 */
>  	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
>  
> -	rte_eth_dev_info_get(port_id, &dev_info);
> +	ret = rte_eth_dev_info_get(port_id, &dev_info);
> +	if (ret != 0)
> +		return ret;

'dev->data->dev_conf' should be restored from 'orig_conf' on failure, before return.

<...>

> -void
> +int
>  rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
>  {
>  	struct rte_eth_dev *dev;
> @@ -2558,7 +2566,7 @@ struct rte_eth_dev *
>  	 */
>  	memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
>  
> -	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>  	dev = &rte_eth_devices[port_id];
>  
>  	dev_info->rx_desc_lim = lim;
> @@ -2567,13 +2575,15 @@ struct rte_eth_dev *
>  	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
>  	dev_info->max_mtu = UINT16_MAX;
>  
> -	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
>  	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
>  	dev_info->driver_name = dev->device->driver->name;
>  	dev_info->nb_rx_queues = dev->data->nb_rx_queues;
>  	dev_info->nb_tx_queues = dev->data->nb_tx_queues;
>  
>  	dev_info->dev_flags = &dev->data->dev_flags;
> +
> +	return 0;

Should API use "return eth_err(port_id, ret);" syntax, as other APIs do,
I am not very clear about the 'eth_err()', Thomas can provide better
description/suggestion on this.

<...>

> @@ -3100,9 +3118,13 @@ struct rte_eth_dev *
>  	struct rte_eth_dev_info dev_info;
>  	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
>  	unsigned i;
> +	int ret;
>  
>  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> -	rte_eth_dev_info_get(port_id, &dev_info);
> +
> +	ret = rte_eth_dev_info_get(port_id, &dev_info);
> +	if (ret != 0)
> +		return ret;

This is 'get_mac_addr_index()' static function, and it should either send
negative value for error, or 'index' value in case of success. So should we be
sure here only negative value sent? Incase 'rte_eth_dev_info_get()' returns
positive value in the future.

>  
>  	for (i = 0; i < dev_info.max_mac_addrs; i++)
>  		if (memcmp(addr, &dev->data->mac_addrs[i],
> @@ -3233,8 +3255,14 @@ struct rte_eth_dev *
>  	struct rte_eth_dev_info dev_info;
>  	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
>  	unsigned i;
> +	int ret;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	ret = rte_eth_dev_info_get(port_id, &dev_info);
> +	if (ret != 0)
> +		return ret;

Same comment as above, for this 'get_hash_mac_addr_index()' static function.

^ permalink raw reply	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 00/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-08-27 14:25 [dpdk-dev] [PATCH 00/51] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                   ` (52 preceding siblings ...)
  2019-09-03 13:56 ` [dpdk-dev] [PATCH v2 00/54] " Andrew Rybchenko
@ 2019-09-06  7:30 ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
                     ` (53 more replies)
  2019-09-12 16:42 ` [dpdk-dev] [PATCH v4 00/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
  54 siblings, 54 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Jan Viktorin, Aaron Conole
  Cc: dev, Ivan Ilchenko

It is the first patch series to get rid of void returning functions
in ethdev in accordance with deprecation notice [1].

Functions which return void are bad since they do not provide explicit
information to the caller if everything is OK or not. It was bugs in
rte_eth_dev_info_get() recently which kept device information
uninitialized if port ID is invalid.

The patch series updates rte_eth_dev_info_get() straightforward
to simply return error if port ID is invalid or driver does not
provide corresponding callback. In the future default callback
which fills in generic non driver specific information could be
added to help secondary processes cases when driver has no
callback in secondary process. Also the idea to make the callback
mandatory should be considered.

Patches to update examples are kept separately to simplify review,
but could be squashed on apply since logically it is the same
change in all applicable examples.

[1] https://patches.dpdk.org/patch/56969/

v3:
 - add acks received on v2 patches
 - fix callback patch to take callback return value into account
 - use newer Git version to generate easier to review patches
 - return -1 from get_mac_addr_index() and get_hash_mac_addr_index()
 - rollback dev_conf in the case of rte_eth_dev_info_get() failure

v2:
 - add a patch to change dev_infos_get prototype to return int as well
 - fix issue with ring_pmd_autotest (just inverted assert condition)
 - add missing net/failsafe patch
 - fix net/netsvc patch in accordance with review notes from Stephen
 - fix app/testpmd patch in accordance with review notes from Ferruh
 - add net/bnxt ack


Andrew Rybchenko (1):
  ethdev: remove redundunt device info cleanup before get

Ivan Ilchenko (53):
  ethdev: change rte_eth_dev_info_get() return value to int
  app/testpmd: check status of getting ethdev info
  app/eventdev: check status of getting ethdev info
  kni: check status of getting ethdev info
  latency: check status of getting ethdev info
  pdump: check status of getting ethdev info
  ring: check status of getting ethdev info
  app/procinfo: check status of getting ethdev info
  app/test: check status of getting ethdev info in bonding
  app/test: check ethdev info get result in event Rx adapter
  net/bnxt: check status of getting ethdev info
  net/bonding: check status of getting ethdev info
  net/failsafe: check status of getting ethdev info
  net/netvsc: check status of getting ethdev info
  net/softnic: check status of getting ethdev info
  ethdev: change device info get callback to return int
  examples/rxtx_callbacks: check status of getting ethdev info
  examples/l3fwd: check status of getting ethdev info
  examples/qos_meter: check status of getting ethdev info
  examples/ip_frag: check status of getting ethdev info
  examples/performance-thread: check dev info get result
  examples/vmdq: check status of getting ethdev info
  examples/distributor: check status of getting ethdev info
  examples/l3fwd-acl: check status of getting ethdev info
  examples/vm_power: check status of getting ethdev info
  examples/qos_sched: check status of getting ethdev info
  examples/flow_filtering: check status of getting ethdev info
  examples/l3fwd-power: check status of getting ethdev info
  examples/l2fwd: check status of getting ethdev info
  examples/skeleton: check status of getting ethdev info
  examples/vmdq_dcb: check status of getting ethdev info
  examples/ipv4_multicast: check status of getting ethdev info
  examples/l2fwd-jobstats: check status of getting ethdev info
  examples/bond: check status of getting ethdev info
  examples/eventdev: check status of getting ethdev info
  examples/ip_reassembly: check status of getting ethdev info
  examples/vhost: check status of getting ethdev info
  examples/ptpclient: check status of getting ethdev info
  examples/link_status_interrupt: check dev info get result
  examples/tep_termination: check dev info get result
  examples/server_node_efd: check dev info get result
  examples/flow_classify: check status of getting ethdev info
  examples/packet_ordering: check dev info get result
  examples/l2fwd-crypto: check status of getting ethdev info
  examples/multi_process: check status of getting ethdev info
  examples/ipsec-secgw: check status of getting ethdev info
  examples/netmap_compat: check status of getting ethdev info
  examples/l2fwd-keepalive: check dev info get result
  examples/ip_pipeline: check status of getting ethdev info
  examples/load_balancer: check status of getting ethdev info
  examples/kni: check status of getting ethdev info
  examples/ethtool: check status of getting ethdev info
  examples/exception_path: check status of getting ethdev info

 app/proc-info/main.c                          |  15 ++-
 app/test-eventdev/test_perf_common.c          |   8 +-
 app/test-eventdev/test_pipeline_common.c      |   9 +-
 app/test-pmd/cmdline.c                        | 124 ++++++++++++++----
 app/test-pmd/cmdline_flow.c                   |   5 +-
 app/test-pmd/config.c                         |  80 +++++++++--
 app/test-pmd/parameters.c                     |   8 +-
 app/test-pmd/testpmd.c                        |  41 ++++--
 app/test-pmd/testpmd.h                        |   3 +
 app/test-pmd/util.c                           |  28 +++-
 app/test/test_event_eth_rx_adapter.c          |   4 +-
 app/test/test_kni.c                           |  27 +++-
 app/test/test_link_bonding_rssconf.c          |  33 ++++-
 app/test/test_pmd_ring.c                      |   9 +-
 app/test/virtual_pmd.c                        |   4 +-
 doc/guides/rel_notes/deprecation.rst          |   1 -
 doc/guides/rel_notes/release_19_11.rst        |   5 +-
 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/bnxt/rte_pmd_bnxt.c               | 122 +++++++++++++++--
 drivers/net/bonding/rte_eth_bond_api.c        |  10 +-
 drivers/net/bonding/rte_eth_bond_pmd.c        |  40 +++++-
 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           |   9 +-
 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/netvsc/hn_var.h                   |   2 +-
 drivers/net/netvsc/hn_vf.c                    |  15 ++-
 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/softnic/rte_eth_softnic_link.c    |   5 +-
 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 +-
 examples/bond/main.c                          |  14 +-
 examples/distributor/main.c                   |   8 +-
 examples/ethtool/ethtool-app/main.c           |   8 +-
 examples/ethtool/lib/rte_ethtool.c            |  21 ++-
 examples/eventdev_pipeline/main.c             |   8 +-
 examples/exception_path/main.c                |   7 +-
 examples/flow_classify/flow_classify.c        |   8 +-
 examples/flow_filtering/main.c                |   7 +-
 examples/ip_fragmentation/main.c              |  14 +-
 examples/ip_pipeline/kni.c                    |   5 +-
 examples/ip_pipeline/link.c                   |   3 +-
 examples/ip_reassembly/main.c                 |   7 +-
 examples/ipsec-secgw/ipsec-secgw.c            |   6 +-
 examples/ipsec-secgw/ipsec.c                  |   9 +-
 examples/ipsec-secgw/sa.c                     |  10 +-
 examples/ipv4_multicast/main.c                |   7 +-
 examples/kni/main.c                           |  26 +++-
 examples/l2fwd-crypto/main.c                  |   9 +-
 examples/l2fwd-jobstats/main.c                |   8 +-
 examples/l2fwd-keepalive/main.c               |   8 +-
 examples/l2fwd/main.c                         |   8 +-
 examples/l3fwd-acl/main.c                     |  22 +++-
 examples/l3fwd-power/main.c                   |  22 +++-
 examples/l3fwd/main.c                         |  14 +-
 examples/link_status_interrupt/main.c         |   8 +-
 examples/load_balancer/init.c                 |   7 +-
 examples/multi_process/symmetric_mp/main.c    |   8 +-
 examples/netmap_compat/lib/compat_netmap.c    |   9 +-
 examples/packet_ordering/main.c               |   8 +-
 .../performance-thread/l3fwd-thread/main.c    |  15 ++-
 examples/ptpclient/ptpclient.c                |   9 +-
 examples/qos_meter/main.c                     |  16 ++-
 examples/qos_sched/init.c                     |   8 +-
 examples/rxtx_callbacks/main.c                |   9 +-
 examples/server_node_efd/server/init.c        |   5 +-
 examples/skeleton/basicfwd.c                  |   8 +-
 examples/tep_termination/vxlan_setup.c        |   6 +-
 examples/vhost/main.c                         |   9 +-
 examples/vm_power_manager/main.c              |   8 +-
 examples/vmdq/main.c                          |  16 ++-
 examples/vmdq_dcb/main.c                      |  18 ++-
 lib/librte_ethdev/rte_ethdev.c                |  78 +++++++----
 lib/librte_ethdev/rte_ethdev.h                |   6 +-
 lib/librte_ethdev/rte_ethdev_core.h           |   4 +-
 lib/librte_latencystats/rte_latencystats.c    |  23 +++-
 lib/librte_pdump/rte_pdump.c                  |   9 +-
 124 files changed, 1227 insertions(+), 293 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 01/54] ethdev: remove redundunt device info cleanup before get
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 02/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
                     ` (52 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Pablo de Lara, Radu Nicolau,
	Akhil Goyal, Tomasz Kantecki, Ferruh Yigit
  Cc: dev, stable

rte_eth_dev_info_get() always fills in device information memory
with zeros on entry.

Fixes: b6719879855d ("ethdev: avoid getting uninitialized info for bad port")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/cmdline.c             | 4 ----
 app/test-pmd/config.c              | 2 --
 examples/ethtool/lib/rte_ethtool.c | 2 --
 examples/kni/main.c                | 1 -
 4 files changed, 9 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b6bc34b4d2..e4dda93a49 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2319,7 +2319,6 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,
 	uint8_t hash_key_size;
 	uint32_t key_len;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(hash_key))
@@ -2852,7 +2851,6 @@ cmd_set_rss_reta_parsed(void *parsed_result,
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct cmd_config_rss_reta *res = parsed_result;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
 	if (dev_info.reta_size == 0) {
 		printf("Redirection table size is 0 which is "
@@ -2972,7 +2970,6 @@ cmd_showport_reta_parsed(void *parsed_result,
 	struct rte_eth_dev_info dev_info;
 	uint16_t max_reta_size;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
 	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
 	if (res->size == 0 || res->size > max_reta_size) {
@@ -11091,7 +11088,6 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 		else if (!strncmp(res->pf_vf, "vf", 2)) {
 			struct rte_eth_dev_info dev_info;
 
-			memset(&dev_info, 0, sizeof(dev_info));
 			rte_eth_dev_info_get(res->port_id, &dev_info);
 			errno = 0;
 			vf_id = strtoul(res->pf_vf + 2, &end, 10);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c13c0..523b3d3761 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -478,7 +478,6 @@ port_infos_display(portid_t port_id)
 	}
 	port = &ports[port_id];
 	rte_eth_link_get_nowait(port_id, &link);
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	printf("\n%s Infos for port %-2d %s\n",
 	       info_border, port_id, info_border);
@@ -1623,7 +1622,6 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz,
 #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 	struct rte_eth_dev_info dev_info;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (strstr(dev_info.driver_name, "i40e") != NULL) {
 		/* 32 bytes RX descriptor, i40e only */
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index 571c4e5aa5..fd1692daae 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -41,7 +41,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)
 		printf("Insufficient fw version buffer size, "
 		       "the minimum size should be %d\n", ret);
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 
 	strlcpy(drvinfo->driver, dev_info.driver_name,
@@ -372,7 +371,6 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id)
 	struct rte_eth_dev_info dev_info;
 	uint16_t vf;
 
-	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	num_vfs = dev_info.max_vfs;
 
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d71769..17f695ea99 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -898,7 +898,6 @@ kni_alloc(uint16_t port_id)
 			struct rte_kni_ops ops;
 			struct rte_eth_dev_info dev_info;
 
-			memset(&dev_info, 0, sizeof(dev_info));
 			rte_eth_dev_info_get(port_id, &dev_info);
 
 			/* Get the interface default mac address */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 02/54] ethdev: change rte_eth_dev_info_get() return value to int
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-09 16:27     ` Ferruh Yigit
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 03/54] app/testpmd: check status of getting ethdev info Andrew Rybchenko
                     ` (51 subsequent siblings)
  53 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

Change rte_eth_dev_info_get() return value from void to int and return
negative errno values in case of error conditions.
Modify rte_eth_dev_info_get() usage across the ethdev according
to new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
v3:
 - return -1 from get_mac_addr_index() and get_hash_mac_addr_index()
 - rollback dev_conf in the case of rte_eth_dev_info_get() failure

 doc/guides/rel_notes/deprecation.rst   |  1 -
 doc/guides/rel_notes/release_19_11.rst |  5 +-
 lib/librte_ethdev/rte_ethdev.c         | 69 ++++++++++++++++++--------
 lib/librte_ethdev/rte_ethdev.h         |  6 ++-
 4 files changed, 57 insertions(+), 24 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 0ee8533b13..cbb4c34efd 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -88,7 +88,6 @@ Deprecation Notices
   negative errno values to indicate various error conditions (e.g.
   invalid port ID, unsupported operation, failed operation):
 
-  - ``rte_eth_dev_info_get``
   - ``rte_eth_promiscuous_enable`` and ``rte_eth_promiscuous_disable``
   - ``rte_eth_allmulticast_enable`` and ``rte_eth_allmulticast_disable``
   - ``rte_eth_link_get`` and ``rte_eth_link_get_nowait``
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e38..152f120197 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -94,6 +94,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to
+  ``int`` to provide a way to report various error conditions.
+
 
 ABI Changes
 -----------
@@ -145,7 +148,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_distributor.so.1
      librte_eal.so.11
      librte_efd.so.1
-     librte_ethdev.so.12
+   + librte_ethdev.so.13
      librte_eventdev.so.7
      librte_flow_classify.so.1
      librte_gro.so.1
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f0..42b1d6e30a 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1125,7 +1125,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);
 
 	if (dev->data->dev_started) {
@@ -1144,7 +1143,9 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	 */
 	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		goto rollback;
 
 	/* If number of queues specified by application for both Rx and Tx is
 	 * zero, use driver preferred values. This cannot be done individually
@@ -1406,6 +1407,7 @@ rte_eth_dev_start(uint16_t port_id)
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	int diag;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1420,7 +1422,9 @@ rte_eth_dev_start(uint16_t port_id)
 		return 0;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* Lets restore MAC now if device does not support live change */
 	if (*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)
@@ -1584,7 +1588,6 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 		return -EINVAL;
 	}
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_setup, -ENOTSUP);
 
 	/*
@@ -1592,7 +1595,10 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 	 * This value must be provided in the private data of the memory pool.
 	 * First check that the memory pool has a valid private data.
 	 */
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	if (mp->private_data_size < sizeof(struct rte_pktmbuf_pool_private)) {
 		RTE_ETHDEV_LOG(ERR, "%s private_data_size %d < %d\n",
 			mp->name, (int)mp->private_data_size,
@@ -1703,6 +1709,7 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_txconf local_conf;
 	void **txq;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
@@ -1712,10 +1719,11 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
 		return -EINVAL;
 	}
 
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_queue_setup, -ENOTSUP);
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	/* Use default specified by driver, if nb_tx_desc is zero */
 	if (nb_tx_desc == 0) {
@@ -2540,7 +2548,7 @@ rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size)
 							fw_version, fw_size));
 }
 
-void
+int
 rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 {
 	struct rte_eth_dev *dev;
@@ -2558,7 +2566,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	 */
 	memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
 	dev_info->rx_desc_lim = lim;
@@ -2567,13 +2575,15 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
 	dev_info->max_mtu = UINT16_MAX;
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
 	dev_info->driver_name = dev->device->driver->name;
 	dev_info->nb_rx_queues = dev->data->nb_rx_queues;
 	dev_info->nb_tx_queues = dev->data->nb_tx_queues;
 
 	dev_info->dev_flags = &dev->data->dev_flags;
+
+	return 0;
 }
 
 int
@@ -2643,7 +2653,10 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)
 	 * which relies on dev->dev_ops->dev_infos_get.
 	 */
 	if (*dev->dev_ops->dev_infos_get != NULL) {
-		rte_eth_dev_info_get(port_id, &dev_info);
+		ret = rte_eth_dev_info_get(port_id, &dev_info);
+		if (ret != 0)
+			return ret;
+
 		if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu)
 			return -EINVAL;
 	}
@@ -2991,10 +3004,15 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
 	if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=
 	    dev_info.flow_type_rss_offloads) {
 		RTE_ETHDEV_LOG(ERR,
@@ -3100,9 +3118,11 @@ get_mac_addr_index(uint16_t port_id, const struct rte_ether_addr *addr)
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	unsigned i;
+	int ret;
 
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return -1;
 
 	for (i = 0; i < dev_info.max_mac_addrs; i++)
 		if (memcmp(addr, &dev->data->mac_addrs[i],
@@ -3233,8 +3253,12 @@ get_hash_mac_addr_index(uint16_t port_id, const struct rte_ether_addr *addr)
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	unsigned i;
+	int ret;
+
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return -1;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	if (!dev->data->hash_mac_addrs)
 		return -1;
 
@@ -3319,11 +3343,15 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_link link;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
 	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
 	link = dev->data->dev_link;
 
 	if (queue_idx > dev_info.max_tx_queues) {
@@ -4363,15 +4391,14 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
 				 uint16_t *nb_rx_desc,
 				 uint16_t *nb_tx_desc)
 {
-	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 
-	dev = &rte_eth_devices[port_id];
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
-
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
 
 	if (nb_rx_desc != NULL)
 		rte_eth_dev_adjust_nb_desc(nb_rx_desc, &dev_info.rx_desc_lim);
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e3..475dbdae17 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2366,8 +2366,12 @@ void rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);
  * @param dev_info
  *   A pointer to a structure of type *rte_eth_dev_info* to be filled with
  *   the contextual information of the Ethernet device.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if support for dev_infos_get() does not exist for the device.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
+int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
 
 /**
  * Retrieve the firmware version of a device.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 03/54] app/testpmd: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 02/54] ethdev: change rte_eth_dev_info_get() return value to int Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-12 14:29     ` Iremonger, Bernard
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 04/54] app/eventdev: " Andrew Rybchenko
                     ` (50 subsequent siblings)
  53 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Adrien Mazarguil
  Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

Add eth_dev_info_get_print_err() which is a wrapper for
rte_eth_dev_info_get() printing error if rte_eth_dev_info_get()
fails and returning its status code.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-pmd/cmdline.c      | 120 +++++++++++++++++++++++++++++-------
 app/test-pmd/cmdline_flow.c |   5 +-
 app/test-pmd/config.c       |  78 +++++++++++++++++++----
 app/test-pmd/parameters.c   |   8 ++-
 app/test-pmd/testpmd.c      |  41 +++++++++---
 app/test-pmd/testpmd.h      |   3 +
 app/test-pmd/util.c         |  28 ++++++++-
 7 files changed, 238 insertions(+), 45 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index e4dda93a49..b1be6b4c82 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2181,6 +2181,7 @@ cmd_config_rss_parsed(void *parsed_result,
 	int all_updated = 1;
 	int diag;
 	uint16_t i;
+	int ret;
 
 	if (!strcmp(res->value, "all"))
 		rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |
@@ -2220,7 +2221,10 @@ cmd_config_rss_parsed(void *parsed_result,
 	RTE_ETH_FOREACH_DEV(i) {
 		struct rte_eth_rss_conf local_rss_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = eth_dev_info_get_print_err(i, &dev_info);
+		if (ret != 0)
+			return;
+
 		if (use_default)
 			rss_conf.rss_hf = dev_info.flow_type_rss_offloads;
 
@@ -2318,8 +2322,12 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,
 	struct rte_eth_dev_info dev_info;
 	uint8_t hash_key_size;
 	uint32_t key_len;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(hash_key))
 		hash_key_size = dev_info.hash_key_size;
@@ -2851,7 +2859,10 @@ cmd_set_rss_reta_parsed(void *parsed_result,
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct cmd_config_rss_reta *res = parsed_result;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.reta_size == 0) {
 		printf("Redirection table size is 0 which is "
 					"invalid for RSS\n");
@@ -2969,8 +2980,12 @@ cmd_showport_reta_parsed(void *parsed_result,
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct rte_eth_dev_info dev_info;
 	uint16_t max_reta_size;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
 	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
 	if (res->size == 0 || res->size > max_reta_size) {
 		printf("Invalid redirection table size: %u (1-%u)\n",
@@ -3197,6 +3212,7 @@ cmd_config_burst_parsed(void *parsed_result,
 	struct cmd_config_burst *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
 	uint16_t rec_nb_pkts;
+	int ret;
 
 	if (!all_ports_stopped()) {
 		printf("Please stop all ports first\n");
@@ -3210,7 +3226,10 @@ cmd_config_burst_parsed(void *parsed_result,
 			 * size for all ports, so assume all ports are the same
 			 * NIC model and use the values from Port 0.
 			 */
-			rte_eth_dev_info_get(0, &dev_info);
+			ret = eth_dev_info_get_print_err(0, &dev_info);
+			if (ret != 0)
+				return;
+
 			rec_nb_pkts = dev_info.default_rxportconf.burst_size;
 
 			if (rec_nb_pkts == 0) {
@@ -4280,6 +4299,7 @@ csum_show(int port_id)
 {
 	struct rte_eth_dev_info dev_info;
 	uint64_t tx_offloads;
+	int ret;
 
 	tx_offloads = ports[port_id].dev_conf.txmode.offloads;
 	printf("Parse tunnel is %s\n",
@@ -4298,7 +4318,10 @@ csum_show(int port_id)
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) {
 		printf("Warning: hardware IP checksum enabled but not "
@@ -4352,6 +4375,7 @@ cmd_csum_parsed(void *parsed_result,
 	int hw = 0;
 	uint64_t csum_offloads = 0;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(res->port_id, ENABLED_WARN)) {
 		printf("invalid port %d\n", res->port_id);
@@ -4362,7 +4386,10 @@ cmd_csum_parsed(void *parsed_result,
 		return;
 	}
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (!strcmp(res->mode, "set")) {
 
 		if (!strcmp(res->hwsw, "hw"))
@@ -4550,6 +4577,7 @@ cmd_tso_set_parsed(void *parsed_result,
 {
 	struct cmd_tso_set_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
 		return;
@@ -4561,7 +4589,10 @@ cmd_tso_set_parsed(void *parsed_result,
 	if (!strcmp(res->mode, "set"))
 		ports[res->port_id].tso_segsz = res->tso_segsz;
 
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((ports[res->port_id].tso_segsz != 0) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {
 		printf("Error: TSO is not supported by port %d\n",
@@ -4582,7 +4613,10 @@ cmd_tso_set_parsed(void *parsed_result,
 	cmd_config_queue_tx_offloads(&ports[res->port_id]);
 
 	/* display warnings if configuration is not supported by the NIC */
-	rte_eth_dev_info_get(res->port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((ports[res->port_id].tso_segsz != 0) &&
 		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {
 		printf("Warning: TSO enabled but not "
@@ -4651,7 +4685,9 @@ check_tunnel_tso_nic_support(portid_t port_id)
 {
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	if (eth_dev_info_get_print_err(port_id, &dev_info) != 0)
+		return dev_info;
+
 	if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO))
 		printf("Warning: VXLAN TUNNEL TSO not supported therefore "
 		       "not enabled for port %d\n", port_id);
@@ -11088,7 +11124,11 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 		else if (!strncmp(res->pf_vf, "vf", 2)) {
 			struct rte_eth_dev_info dev_info;
 
-			rte_eth_dev_info_get(res->port_id, &dev_info);
+			ret = eth_dev_info_get_print_err(res->port_id,
+						&dev_info);
+			if (ret != 0)
+				return;
+
 			errno = 0;
 			vf_id = strtoul(res->pf_vf + 2, &end, 10);
 			if (errno != 0 || *end != '\0' ||
@@ -14080,7 +14120,10 @@ cmd_set_macsec_offload_on_parsed(
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
 #ifdef RTE_LIBRTE_IXGBE_PMD
 		ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp);
@@ -14174,7 +14217,10 @@ cmd_set_macsec_offload_off_parsed(
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
 #ifdef RTE_LIBRTE_IXGBE_PMD
 		ret = rte_pmd_ixgbe_macsec_disable(port_id);
@@ -17884,8 +17930,12 @@ cmd_rx_offload_get_capa_parsed(
 	portid_t port_id = res->port_id;
 	uint64_t queue_offloads;
 	uint64_t port_offloads;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	queue_offloads = dev_info.rx_queue_offload_capa;
 	port_offloads = dev_info.rx_offload_capa ^ queue_offloads;
 
@@ -17957,6 +18007,7 @@ cmd_rx_offload_get_configuration_parsed(
 	uint64_t queue_offloads;
 	uint16_t nb_rx_queues;
 	int q;
+	int ret;
 
 	printf("Rx Offloading Configuration of port %d :\n", port_id);
 
@@ -17965,7 +18016,10 @@ cmd_rx_offload_get_configuration_parsed(
 	print_rx_offloads(port_offloads);
 	printf("\n");
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_rx_queues = dev_info.nb_rx_queues;
 	for (q = 0; q < nb_rx_queues; q++) {
 		queue_offloads = port->rx_conf[q].offloads;
@@ -18064,6 +18118,7 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result,
 	uint64_t single_offload;
 	uint16_t nb_rx_queues;
 	int q;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18077,7 +18132,10 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result,
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_rx_queues = dev_info.nb_rx_queues;
 	if (!strcmp(res->on_off, "on")) {
 		port->dev_conf.rxmode.offloads |= single_offload;
@@ -18165,6 +18223,7 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
 	uint16_t queue_id = res->queue_id;
 	struct rte_port *port = &ports[port_id];
 	uint64_t single_offload;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18172,7 +18231,10 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (queue_id >= dev_info.nb_rx_queues) {
 		printf("Error: input queue_id should be 0 ... "
 		       "%d\n", dev_info.nb_rx_queues - 1);
@@ -18278,8 +18340,12 @@ cmd_tx_offload_get_capa_parsed(
 	portid_t port_id = res->port_id;
 	uint64_t queue_offloads;
 	uint64_t port_offloads;
+	int ret;
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	queue_offloads = dev_info.tx_queue_offload_capa;
 	port_offloads = dev_info.tx_offload_capa ^ queue_offloads;
 
@@ -18351,6 +18417,7 @@ cmd_tx_offload_get_configuration_parsed(
 	uint64_t queue_offloads;
 	uint16_t nb_tx_queues;
 	int q;
+	int ret;
 
 	printf("Tx Offloading Configuration of port %d :\n", port_id);
 
@@ -18359,7 +18426,10 @@ cmd_tx_offload_get_configuration_parsed(
 	print_tx_offloads(port_offloads);
 	printf("\n");
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_tx_queues = dev_info.nb_tx_queues;
 	for (q = 0; q < nb_tx_queues; q++) {
 		queue_offloads = port->tx_conf[q].offloads;
@@ -18463,6 +18533,7 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result,
 	uint64_t single_offload;
 	uint16_t nb_tx_queues;
 	int q;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18476,7 +18547,10 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result,
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	nb_tx_queues = dev_info.nb_tx_queues;
 	if (!strcmp(res->on_off, "on")) {
 		port->dev_conf.txmode.offloads |= single_offload;
@@ -18567,6 +18641,7 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
 	uint16_t queue_id = res->queue_id;
 	struct rte_port *port = &ports[port_id];
 	uint64_t single_offload;
+	int ret;
 
 	if (port->port_status != RTE_PORT_STOPPED) {
 		printf("Error: Can't config offload when Port %d "
@@ -18574,7 +18649,10 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
 		return;
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (queue_id >= dev_info.nb_tx_queues) {
 		printf("Error: input queue_id should be 0 ... "
 		       "%d\n", dev_info.nb_tx_queues - 1);
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 495871394e..369426cbdf 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -3550,7 +3550,10 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
 	    ctx->port != (portid_t)RTE_PORT_ALL) {
 		struct rte_eth_dev_info info;
 
-		rte_eth_dev_info_get(ctx->port, &info);
+		ret = rte_eth_dev_info_get(ctx->port, &info);
+		if (ret != 0)
+			return ret;
+
 		action_rss_data->conf.key_len =
 			RTE_MIN(sizeof(action_rss_data->key),
 				info.hash_key_size);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 523b3d3761..24158e5f7d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -471,6 +471,7 @@ port_infos_display(portid_t port_id)
 	static const char *info_border = "*********************";
 	uint16_t mtu;
 	char name[RTE_ETH_NAME_MAX_LEN];
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -478,7 +479,11 @@ port_infos_display(portid_t port_id)
 	}
 	port = &ports[port_id];
 	rte_eth_link_get_nowait(port_id, &link);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	printf("\n%s Infos for port %-2d %s\n",
 	       info_border, port_id, info_border);
 	rte_eth_macaddr_get(port_id, &mac_addr);
@@ -617,6 +622,7 @@ port_summary_display(portid_t port_id)
 	struct rte_eth_link link;
 	struct rte_eth_dev_info dev_info;
 	char name[RTE_ETH_NAME_MAX_LEN];
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -624,7 +630,11 @@ port_summary_display(portid_t port_id)
 	}
 
 	rte_eth_link_get_nowait(port_id, &link);
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	rte_eth_dev_get_name_by_port(port_id, name);
 	rte_eth_macaddr_get(port_id, &mac_addr);
 
@@ -641,11 +651,14 @@ port_offload_cap_display(portid_t port_id)
 {
 	struct rte_eth_dev_info dev_info;
 	static const char *info_border = "************";
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
 
 	printf("\n%s Port %d supported offload features: %s\n",
 		info_border, port_id, info_border);
@@ -1139,10 +1152,15 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
 {
 	int diag;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (mtu > dev_info.max_mtu || mtu < dev_info.min_mtu) {
 		printf("Set MTU failed. MTU:%u is not in valid range, min:%u - max:%u\n",
 			mtu, dev_info.min_mtu, dev_info.max_mtu);
@@ -1617,12 +1635,16 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz,
 #endif
 			   uint16_t desc_id)
 {
+	int ret;
 	struct igb_ring_desc_16_bytes *ring =
 		(struct igb_ring_desc_16_bytes *)ring_mz->addr;
 #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 	struct rte_eth_dev_info dev_info;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (strstr(dev_info.driver_name, "i40e") != NULL) {
 		/* 32 bytes RX descriptor, i40e only */
 		struct igb_ring_desc_32_bytes *ring =
@@ -1832,11 +1854,15 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 	int diag;
 	struct rte_eth_dev_info dev_info;
 	uint8_t hash_key_size;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if (dev_info.hash_key_size > 0 &&
 			dev_info.hash_key_size <= sizeof(rss_key))
 		hash_key_size = dev_info.hash_key_size;
@@ -2794,11 +2820,15 @@ add_rx_dump_callbacks(portid_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
 
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_rx_queues; queue++)
 		if (!ports[portid].rx_dump_cb[queue])
 			ports[portid].rx_dump_cb[queue] =
@@ -2811,10 +2841,15 @@ add_tx_dump_callbacks(portid_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (!ports[portid].tx_dump_cb[queue])
 			ports[portid].tx_dump_cb[queue] =
@@ -2827,10 +2862,15 @@ remove_rx_dump_callbacks(portid_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_rx_queues; queue++)
 		if (ports[portid].rx_dump_cb[queue]) {
 			rte_eth_remove_rx_callback(portid, queue,
@@ -2844,10 +2884,15 @@ remove_tx_dump_callbacks(portid_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (ports[portid].tx_dump_cb[queue]) {
 			rte_eth_remove_tx_callback(portid, queue,
@@ -3035,6 +3080,7 @@ void
 tx_vlan_set(portid_t port_id, uint16_t vlan_id)
 {
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
@@ -3046,7 +3092,11 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
 		printf("Error, as QinQ has been enabled.\n");
 		return;
 	}
-	rte_eth_dev_info_get(port_id, &dev_info);
+
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) == 0) {
 		printf("Error: vlan insert is not supported by port %d\n",
 			port_id);
@@ -3062,6 +3112,7 @@ void
 tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
 {
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
@@ -3070,7 +3121,10 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
 	if (vlan_id_is_invalid(vlan_id_outer))
 		return;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = eth_dev_info_get_print_err(port_id, &dev_info);
+	if (ret != 0)
+		return;
+
 	if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) {
 		printf("Error: qinq insert not supported by port %d\n",
 			port_id);
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 5244872c4a..6c78dca765 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -562,6 +562,7 @@ launch_args_parse(int argc, char** argv)
 	uint64_t tx_offloads = tx_mode.offloads;
 	struct rte_eth_dev_info dev_info;
 	uint16_t rec_nb_pkts;
+	int ret;
 
 	static struct option lgopts[] = {
 		{ "help",			0, 0, 0 },
@@ -1050,7 +1051,12 @@ launch_args_parse(int argc, char** argv)
 					 * value, on the assumption that all
 					 * ports are of the same NIC model.
 					 */
-					rte_eth_dev_info_get(0, &dev_info);
+					ret = eth_dev_info_get_print_err(
+								0,
+								&dev_info);
+					if (ret != 0)
+						return;
+
 					rec_nb_pkts = dev_info
 						.default_rxportconf.burst_size;
 
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e8e2a39b64..de91e1b72d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1012,17 +1012,21 @@ queueid_t
 get_allowed_max_nb_rxq(portid_t *pid)
 {
 	queueid_t allowed_max_rxq = MAX_QUEUE_ID;
+	bool max_rxq_valid = false;
 	portid_t pi;
 	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pi) {
-		rte_eth_dev_info_get(pi, &dev_info);
+		if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
+			continue;
+
+		max_rxq_valid = true;
 		if (dev_info.max_rx_queues < allowed_max_rxq) {
 			allowed_max_rxq = dev_info.max_rx_queues;
 			*pid = pi;
 		}
 	}
-	return allowed_max_rxq;
+	return max_rxq_valid ? allowed_max_rxq : 0;
 }
 
 /*
@@ -1058,17 +1062,21 @@ queueid_t
 get_allowed_max_nb_txq(portid_t *pid)
 {
 	queueid_t allowed_max_txq = MAX_QUEUE_ID;
+	bool max_txq_valid = false;
 	portid_t pi;
 	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pi) {
-		rte_eth_dev_info_get(pi, &dev_info);
+		if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
+			continue;
+
+		max_txq_valid = true;
 		if (dev_info.max_tx_queues < allowed_max_txq) {
 			allowed_max_txq = dev_info.max_tx_queues;
 			*pid = pi;
 		}
 	}
-	return allowed_max_txq;
+	return max_txq_valid ? allowed_max_txq : 0;
 }
 
 /*
@@ -1109,6 +1117,7 @@ init_config(void)
 	uint16_t data_size;
 	bool warning = 0;
 	int k;
+	int ret;
 
 	memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
 
@@ -1136,7 +1145,11 @@ init_config(void)
 		/* Apply default TxRx configuration for all ports */
 		port->dev_conf.txmode = tx_mode;
 		port->dev_conf.rxmode = rx_mode;
-		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				 "rte_eth_dev_info_get() failed\n");
 
 		if (!(port->dev_info.tx_offload_capa &
 		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
@@ -1295,10 +1308,14 @@ void
 reconfig(portid_t new_port_id, unsigned socket_id)
 {
 	struct rte_port *port;
+	int ret;
 
 	/* Reconfiguration of Ethernet ports. */
 	port = &ports[new_port_id];
-	rte_eth_dev_info_get(new_port_id, &port->dev_info);
+
+	ret = eth_dev_info_get_print_err(new_port_id, &port->dev_info);
+	if (ret != 0)
+		return;
 
 	/* set flag to initialize port/queue */
 	port->need_reconfig = 1;
@@ -2927,11 +2944,16 @@ init_port_config(void)
 {
 	portid_t pid;
 	struct rte_port *port;
+	int ret;
 
 	RTE_ETH_FOREACH_DEV(pid) {
 		port = &ports[pid];
 		port->dev_conf.fdir_conf = fdir_conf;
-		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		ret = eth_dev_info_get_print_err(pid, &port->dev_info);
+		if (ret != 0)
+			return;
+
 		if (nb_rxq > 1) {
 			port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
 			port->dev_conf.rx_adv_conf.rss_conf.rss_hf =
@@ -3106,7 +3128,10 @@ init_port_dcb_config(portid_t pid,
 	retval = rte_eth_dev_configure(pid, nb_rxq, nb_rxq, &port_conf);
 	if (retval < 0)
 		return retval;
-	rte_eth_dev_info_get(pid, &rte_port->dev_info);
+
+	retval = eth_dev_info_get_print_err(pid, &rte_port->dev_info);
+	if (retval != 0)
+		return retval;
 
 	/* If dev_info.vmdq_pool_base is greater than 0,
 	 * the queue id of vmdq pools is started after pf queues.
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index ce13eb8e6a..d73955da14 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -822,6 +822,9 @@ void setup_gro(const char *onoff, portid_t port_id);
 void setup_gro_flush_cycles(uint8_t cycles);
 void show_gro(portid_t port_id);
 void setup_gso(const char *mode, portid_t port_id);
+int eth_dev_info_get_print_err(uint16_t port_id,
+			struct rte_eth_dev_info *dev_info);
+
 
 /* Functions to manage the set of filtered Multicast MAC addresses */
 void mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr);
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 18dfdca08d..009d226764 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -194,10 +194,15 @@ add_tx_md_callback(portid_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (!ports[portid].tx_set_md_cb[queue])
 			ports[portid].tx_set_md_cb[queue] =
@@ -210,10 +215,15 @@ remove_tx_md_callback(portid_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	uint16_t queue;
+	int ret;
 
 	if (port_id_is_invalid(portid, ENABLED_WARN))
 		return;
-	rte_eth_dev_info_get(portid, &dev_info);
+
+	ret = eth_dev_info_get_print_err(portid, &dev_info);
+	if (ret != 0)
+		return;
+
 	for (queue = 0; queue < dev_info.nb_tx_queues; queue++)
 		if (ports[portid].tx_set_md_cb[queue]) {
 			rte_eth_remove_tx_callback(portid, queue,
@@ -221,3 +231,17 @@ remove_tx_md_callback(portid_t portid)
 			ports[portid].tx_set_md_cb[queue] = NULL;
 		}
 }
+
+int
+eth_dev_info_get_print_err(uint16_t port_id,
+					struct rte_eth_dev_info *dev_info)
+{
+	int ret;
+
+	ret = rte_eth_dev_info_get(port_id, dev_info);
+	if (ret != 0)
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+
+	return ret;
+}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 04/54] app/eventdev: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (2 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 03/54] app/testpmd: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 05/54] kni: " Andrew Rybchenko
                     ` (49 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-eventdev/test_perf_common.c     | 8 +++++++-
 app/test-eventdev/test_pipeline_common.c | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index aa925a7ef7..e75582b1a2 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -660,6 +660,7 @@ int
 perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	struct test_perf *t = evt_test_priv(test);
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
@@ -688,7 +689,12 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 		struct rte_eth_dev_info dev_info;
 		struct rte_eth_conf local_port_conf = port_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+					i, strerror(-ret));
+			return ret;
+		}
 
 		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 			dev_info.flow_type_rss_offloads;
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 16c49b8608..ef8ae28c93 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -159,6 +159,7 @@ int
 pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	uint8_t nb_queues = 1;
 	struct test_pipeline *t = evt_test_priv(test);
 	struct rte_eth_rxconf rx_conf;
@@ -191,7 +192,13 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 		if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT))
 			t->internal_port = 0;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return ret;
+		}
+
 		rx_conf = dev_info.default_rxconf;
 		rx_conf.offloads = port_conf.rxmode.offloads;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 05/54] kni: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (3 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 04/54] app/eventdev: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 06/54] latency: " Andrew Rybchenko
                     ` (48 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_kni.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 7a65de179b..2c333748db 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -436,7 +436,13 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)
 	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
 
-	rte_eth_dev_info_get(port_id, &info);
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return -1;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	if (bus && !strcmp(bus->name, "pci")) {
@@ -622,7 +628,14 @@ test_kni(void)
 	memset(&info, 0, sizeof(info));
 	memset(&conf, 0, sizeof(conf));
 	memset(&ops, 0, sizeof(ops));
-	rte_eth_dev_info_get(port_id, &info);
+
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return -1;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	else
@@ -658,7 +671,15 @@ test_kni(void)
 	memset(&conf, 0, sizeof(conf));
 	memset(&info, 0, sizeof(info));
 	memset(&ops, 0, sizeof(ops));
-	rte_eth_dev_info_get(port_id, &info);
+
+	ret = rte_eth_dev_info_get(port_id, &info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		ret = -1;
+		goto fail;
+	}
+
 	if (info.device)
 		bus = rte_bus_find_by_device(info.device);
 	else
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 06/54] latency: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (4 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 05/54] kni: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 07/54] pdump: " Andrew Rybchenko
                     ` (47 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_latencystats/rte_latencystats.c | 23 ++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 06c62831b4..98e018939e 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -208,6 +208,7 @@ rte_latencystats_init(uint64_t app_samp_intvl,
 	const char *ptr_strings[NUM_LATENCY_STATS] = {0};
 	const struct rte_memzone *mz = NULL;
 	const unsigned int flags = 0;
+	int ret;
 
 	if (rte_memzone_lookup(MZ_RTE_LATENCY_STATS))
 		return -EEXIST;
@@ -239,7 +240,16 @@ rte_latencystats_init(uint64_t app_samp_intvl,
 	/** Register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(pid, &dev_info);
+
+		ret = rte_eth_dev_info_get(pid, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(INFO, LATENCY_STATS,
+				"Error during getting device (port %u) info: %s\n",
+				pid, strerror(-ret));
+
+			continue;
+		}
+
 		for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
 			cbs = &rx_cbs[pid][qid];
 			cbs->cb = rte_eth_add_first_rx_callback(pid, qid,
@@ -274,7 +284,16 @@ rte_latencystats_uninit(void)
 	/** De register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(pid, &dev_info);
+
+		ret = rte_eth_dev_info_get(pid, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(INFO, LATENCY_STATS,
+				"Error during getting device (port %u) info: %s\n",
+				pid, strerror(-ret));
+
+			continue;
+		}
+
 		for (qid = 0; qid < dev_info.nb_rx_queues; qid++) {
 			cbs = &rx_cbs[pid][qid];
 			ret = rte_eth_remove_rx_callback(pid, qid, cbs->cb);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 07/54] pdump: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (5 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 06/54] latency: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 08/54] ring: " Andrew Rybchenko
                     ` (46 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_pdump/rte_pdump.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index cd24dd0109..ac94fea936 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -333,7 +333,14 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	if (queue == RTE_PDUMP_ALL_QUEUES) {
 		struct rte_eth_dev_info dev_info;
 
-		rte_eth_dev_info_get(port, &dev_info);
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		if (ret != 0) {
+			RTE_LOG(ERR, PDUMP,
+				"Error during getting device (port %u) info: %s\n",
+				port, strerror(-ret));
+			return ret;
+		}
+
 		nb_rx_q = dev_info.nb_rx_queues;
 		nb_tx_q = dev_info.nb_tx_queues;
 		if (nb_rx_q == 0 && flags & RTE_PDUMP_FLAG_RX) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 08/54] ring: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (6 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 07/54] pdump: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  9:04     ` Bruce Richardson
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 09/54] app/procinfo: " Andrew Rybchenko
                     ` (45 subsequent siblings)
  53 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_pmd_ring.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 6414bbd189..65ab6e7e00 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -490,10 +490,17 @@ static int
 test_command_line_ring_port(void)
 {
 	int port, cmdl_port0 = -1;
+	int ret;
+
 	/* find a port created with the --vdev=net_ring0 command line option */
 	RTE_ETH_FOREACH_DEV(port) {
 		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(port, &dev_info);
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		TEST_ASSERT((ret == 0),
+				"Error during getting device (port %d) info: %s\n",
+				port, strerror(-ret));
+
 		if (!strcmp(dev_info.driver_name, "Rings PMD")) {
 			printf("found a command line ring port=%d\n", port);
 			cmdl_port0 = port;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 09/54] app/procinfo: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (7 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 08/54] ring: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 10/54] app/test: check status of getting ethdev info in bonding Andrew Rybchenko
                     ` (44 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Maryam Tahhan, Reshma Pattan; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/proc-info/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index a89b51bb3f..34eb7a7cc4 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -683,7 +683,12 @@ show_port(void)
 		if (ret == 0)
 			printf("\t  -- mtu (%d)\n", mtu);
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
 
 		printf("  - queue\n");
 		for (j = 0; j < dev_info.nb_rx_queues; j++) {
@@ -836,7 +841,13 @@ show_tm(void)
 		memset(&cap, 0, sizeof(cap));
 		memset(&error, 0, sizeof(error));
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
+
 		printf("  - Generic for port (%u)\n"
 			"\t  -- driver name %s\n"
 			"\t  -- max vf (%u)\n"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 10/54] app/test: check status of getting ethdev info in bonding
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (8 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 09/54] app/procinfo: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 11/54] app/test: check ethdev info get result in event Rx adapter Andrew Rybchenko
                     ` (43 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_link_bonding_rssconf.c | 33 +++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 65de3b98d4..1a9571e5c6 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -329,7 +329,11 @@ test_propagate(void)
 	uint64_t rss_hf = 0;
 	uint64_t default_rss_hf = 0;
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((retval == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-retval));
 
 	/*
 	 *  Test hash function propagation
@@ -443,10 +447,16 @@ test_rss(void)
 	/**
 	 * Configure bonding port in RSS mq mode
 	 */
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&rss_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+					&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -468,10 +478,16 @@ test_rss(void)
 static int
 test_rss_lazy(void)
 {
+	int ret;
+
 	TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 			&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-	rte_eth_dev_info_get(test_params.bond_port_id, &test_params.bond_dev_info);
+	ret = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+	TEST_ASSERT((ret == 0),
+			"Error during getting device (port %u) info: %s\n",
+			test_params.bond_port_id, strerror(-ret));
 
 	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
 
@@ -532,6 +548,10 @@ test_setup(void)
 		rte_eth_dev_default_mac_addr_set(port->port_id, &mac_addr);
 
 		rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		retval = rte_eth_dev_info_get(port->port_id, &port->dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	if (test_params.bond_port_id == INVALID_PORT_ID) {
@@ -545,8 +565,11 @@ test_setup(void)
 		TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bond_port_id,
 				&default_pmd_conf, 0), "Failed to configure bonding device\n");
 
-		rte_eth_dev_info_get(test_params.bond_port_id,
-				&test_params.bond_dev_info);
+		retval = rte_eth_dev_info_get(test_params.bond_port_id,
+						&test_params.bond_dev_info);
+		TEST_ASSERT((retval == 0),
+				"Error during getting device (port %u) info: %s\n",
+				test_params.bond_port_id, strerror(-retval));
 	}
 
 	return TEST_SUCCESS;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 11/54] app/test: check ethdev info get result in event Rx adapter
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (9 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 10/54] app/test: check status of getting ethdev info in bonding Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 12/54] net/bnxt: check status of getting ethdev info Andrew Rybchenko
                     ` (42 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Nikhil Rao; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test/test_event_eth_rx_adapter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 953b827456..950bc67c2f 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -45,7 +45,9 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 
 	retval = rte_eth_dev_configure(port, 0, 0, port_conf);
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0)
+		return retval;
 
 	default_params.rx_rings = RTE_MIN(dev_info.max_rx_queues,
 					MAX_NUM_RX_QUEUE);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 12/54] net/bnxt: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (10 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 11/54] app/test: check ethdev info get result in event Rx adapter Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 13/54] net/bonding: " Andrew Rybchenko
                     ` (41 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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/bnxt according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 122 ++++++++++++++++++++++++++++----
 1 file changed, 109 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index fbd2dd493d..4374034c33 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -145,7 +145,15 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
+
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs || mac_addr == NULL)
@@ -179,7 +187,14 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(eth_dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = eth_dev->data->dev_private;
 
 	if (!bp->pf.active_vfs)
@@ -230,7 +245,14 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
@@ -282,7 +304,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
@@ -332,7 +361,14 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on)
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs)
@@ -369,7 +405,14 @@ int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!bp->pf.vf_info)
@@ -545,12 +588,20 @@ int rte_pmd_bnxt_get_vf_stats(uint16_t port,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -572,12 +623,20 @@ int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -598,12 +657,20 @@ int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id)
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -625,12 +692,20 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
+	int rc;
 
 	dev = &rte_eth_devices[port];
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -662,7 +737,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf_id >= dev_info.max_vfs)
@@ -738,7 +820,14 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf,
 	if (!is_bnxt_supported(dev))
 		return -ENOTSUP;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (vf >= dev_info.max_vfs)
@@ -775,7 +864,14 @@ int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on)
 		return -EINVAL;
 
 	dev = &rte_eth_devices[port];
-	rte_eth_dev_info_get(port, &dev_info);
+	rc = rte_eth_dev_info_get(port, &dev_info);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR,
+			"Error during getting device (port %u) info: %s\n",
+			port, strerror(-rc));
+
+		return rc;
+	}
 	bp = dev->data->dev_private;
 
 	if (!BNXT_PF(bp)) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 13/54] net/bonding: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (11 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 12/54] net/bnxt: check status of getting ethdev info Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 14/54] net/failsafe: " Andrew Rybchenko
                     ` (40 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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/bonding according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 10 ++++++-
 drivers/net/bonding/rte_eth_bond_pmd.c | 36 +++++++++++++++++++++++---
 2 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 0fc4c5eda5..e2e27e9f24 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -452,6 +452,7 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
 	struct bond_dev_private *internals;
 	struct rte_eth_link link_props;
 	struct rte_eth_dev_info dev_info;
+	int ret;
 
 	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
 	internals = bonded_eth_dev->data->dev_private;
@@ -465,7 +466,14 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
 		return -1;
 	}
 
-	rte_eth_dev_info_get(slave_port_id, &dev_info);
+	ret = rte_eth_dev_info_get(slave_port_id, &dev_info);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"%s: Error during getting device (port %u) info: %s\n",
+			__func__, slave_port_id, strerror(-ret));
+
+		return ret;
+	}
 	if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) {
 		RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small",
 			     slave_port_id);
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 97ab3f29f3..a1b50141f9 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -186,7 +186,15 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
 		return -1;
 	}
 
-	rte_eth_dev_info_get(slave_port, &slave_info);
+	ret = rte_eth_dev_info_get(slave_port, &slave_info);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"%s: Error during getting device (port %u) info: %s\n",
+			__func__, slave_port, strerror(-ret));
+
+		return ret;
+	}
+
 	if (slave_info.max_rx_queues < bond_dev->data->nb_rx_queues ||
 			slave_info.max_tx_queues < bond_dev->data->nb_tx_queues) {
 		RTE_BOND_LOG(ERR,
@@ -204,10 +212,19 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) {
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
 	struct rte_eth_dev_info bond_info;
 	uint16_t idx;
+	int ret;
 
 	/* Verify if all slaves in bonding supports flow director and */
 	if (internals->slave_count > 0) {
-		rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
+		ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
+		if (ret != 0) {
+			RTE_BOND_LOG(ERR,
+				"%s: Error during getting device (port %u) info: %s\n",
+				__func__, bond_dev->data->port_id,
+				strerror(-ret));
+
+			return ret;
+		}
 
 		internals->mode4.dedicated_queues.rx_qid = bond_info.nb_rx_queues;
 		internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues;
@@ -2102,6 +2119,8 @@ static void
 bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct bond_dev_private *internals = dev->data->dev_private;
+	struct bond_slave_details slave;
+	int ret;
 
 	uint16_t max_nb_rx_queues = UINT16_MAX;
 	uint16_t max_nb_tx_queues = UINT16_MAX;
@@ -2123,8 +2142,17 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		uint16_t idx;
 
 		for (idx = 0; idx < internals->slave_count; idx++) {
-			rte_eth_dev_info_get(internals->slaves[idx].port_id,
-					&slave_info);
+			slave = internals->slaves[idx];
+			ret = rte_eth_dev_info_get(slave.port_id, &slave_info);
+			if (ret != 0) {
+				RTE_BOND_LOG(ERR,
+					"%s: Error during getting device (port %u) info: %s\n",
+					__func__,
+					slave.port_id,
+					strerror(-ret));
+
+				return;
+			}
 
 			if (slave_info.max_rx_queues < max_nb_rx_queues)
 				max_nb_rx_queues = slave_info.max_rx_queues;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 14/54] net/failsafe: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (12 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 13/54] net/bonding: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  9:28     ` Gaëtan Rivet
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 15/54] net/netvsc: " Andrew Rybchenko
                     ` (39 subsequent siblings)
  53 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev, Ivan Ilchenko

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/failsafe according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 drivers/net/failsafe/failsafe_ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 96e05d4dc4..b3df626aaa 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -866,6 +866,7 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
 {
 	struct sub_device *sdev;
 	uint8_t i;
+	int ret;
 
 	/* Use maximum upper bounds by default */
 	infos->max_rx_pktlen = UINT32_MAX;
@@ -933,7 +934,9 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
 	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
 		struct rte_eth_dev_info sub_info;
 
-		rte_eth_dev_info_get(PORT_ID(sdev), &sub_info);
+		ret = rte_eth_dev_info_get(PORT_ID(sdev), &sub_info);
+		if (ret != 0)
+			return;
 
 		fs_dev_merge_info(infos, &sub_info);
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 15/54] net/netvsc: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (13 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 14/54] net/failsafe: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 16/54] net/softnic: " Andrew Rybchenko
                     ` (38 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang; +Cc: dev, Ivan Ilchenko

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(-)

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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 16/54] net/softnic: check status of getting ethdev info
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (14 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 15/54] net/netvsc: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 17/54] ethdev: change device info get callback to return int Andrew Rybchenko
                     ` (37 subsequent siblings)
  53 siblings, 0 replies; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  To: Jasvinder Singh, Cristian Dumitrescu; +Cc: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>

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/softnic according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/softnic/rte_eth_softnic_link.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/softnic/rte_eth_softnic_link.c b/drivers/net/softnic/rte_eth_softnic_link.c
index d669913a4d..21a64069f6 100644
--- a/drivers/net/softnic/rte_eth_softnic_link.c
+++ b/drivers/net/softnic/rte_eth_softnic_link.c
@@ -57,6 +57,7 @@ softnic_link_create(struct pmd_internals *p,
 	struct rte_eth_dev_info port_info;
 	struct softnic_link *link;
 	uint16_t port_id;
+	int ret;
 
 	/* Check input params */
 	if (name == NULL ||
@@ -78,7 +79,9 @@ softnic_link_create(struct pmd_internals *p,
 			return NULL;
 	}
 
-	rte_eth_dev_info_get(port_id, &port_info);
+	ret = rte_eth_dev_info_get(port_id, &port_info);
+	if (ret != 0)
+		return NULL;
 
 	/* Node allocation */
 	link = calloc(1, sizeof(struct softnic_link));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 272+ messages in thread

* [dpdk-dev] [PATCH v3 17/54] ethdev: change device info get callback to return int
  2019-09-06  7:30 ` [dpdk-dev] [PATCH v3 " Andrew Rybchenko
                     ` (15 preceding siblings ...)
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 16/54] net/softnic: " Andrew Rybchenko
@ 2019-09-06  7:30   ` Andrew Rybchenko
  2019-09-06 13:29     ` Aaron Conole
  2019-09-06  7:30   ` [dpdk-dev] [PATCH v3 18/54] examples/rxtx_callbacks: check status of getting ethdev info Andrew Rybchenko
                     ` (36 subsequent siblings)
  53 siblings, 1 reply; 272+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  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: dev, Ivan Ilchenko

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

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 <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
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;
 }
 
-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_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 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_unused)
 	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 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 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;
 }
 
-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 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 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 *dev);
 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 = 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 @@ eth_ark_dev_info_get(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 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 *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 @@ atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 	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 @@ atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 @@ 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 = 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 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_complete);
 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);
 }
 
-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 = 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 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 *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 @@ axgbe_dev_stats_reset(struct rte_eth_dev *dev)
 	}
 }
 
-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 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 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;
 }
 
-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 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 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
  */
 
-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 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);
 
-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 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 					slave.port_id,
 					strerror(-ret));
 
-				return;
+				return ret;
 			}
 
 			if (slave_info.max_rx_queues < max_nb_rx_queues)
@@ -2198,6 +2198,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 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_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 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_ethdev.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_xstats_strings[] = {
 
 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 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused,
 		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 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;
 }
 
-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 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 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)
 	}
 }
 
-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 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	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 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	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 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,