From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78F21A2EDB for ; Mon, 30 Sep 2019 10:43:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32A95324D; Mon, 30 Sep 2019 10:43:55 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 47C6D2A6C for ; Mon, 30 Sep 2019 10:43:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Sep 2019 01:43:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,565,1559545200"; d="scan'208";a="274589119" Received: from kmsmsx156.gar.corp.intel.com ([172.21.138.133]) by orsmga001.jf.intel.com with ESMTP; 30 Sep 2019 01:43:49 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.183]) by KMSMSX156.gar.corp.intel.com ([169.254.1.31]) with mapi id 14.03.0439.000; Mon, 30 Sep 2019 16:43:48 +0800 From: "Zhao1, Wei" To: Andrew Rybchenko , "Lu, Wenzhuo" , "Wu, Jingjing" , "Iremonger, Bernard" , Adrien Mazarguil CC: "dev@dpdk.org" , Ivan Ilchenko Thread-Topic: [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info Thread-Index: AQHVXOOAOutCsjZJgEaAI7RVeWMTiqdEG/PA Date: Mon, 30 Sep 2019 08:43:48 +0000 Message-ID: References: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> <1566915962-5472-3-git-send-email-arybchenko@solarflare.com> In-Reply-To: <1566915962-5472-3-git-send-email-arybchenko@solarflare.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting ethdev info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Ivan Ilchenko and Andrew Rybchenko An error is cause by this patch, it is very easy to reappear. You only need to bind a ixgbe nic driver , and run up testpmd: ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i --portmask=3D0= xff --rxq=3D8 --txq=3D8 --port-topology=3Dloop Then input a rte_flow rss action cmd: flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / udp / end act= ions rss queues 4 5 end / end bad arguments =20 so, rte_flow action rss can not be used after this patch. =20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andrew Rybchenko > Sent: Tuesday, August 27, 2019 10:25 PM > To: Lu, Wenzhuo ; Wu, Jingjing > ; Iremonger, Bernard > ; Adrien Mazarguil > > Cc: dev@dpdk.org; Ivan Ilchenko > Subject: [dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting > ethdev info >=20 > From: Ivan Ilchenko >=20 > 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. >=20 > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > --- > 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(-) >=20 > 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 =3D 1; > int diag; > uint16_t i; > + int ret; >=20 > if (!strcmp(res->value, "all")) > rss_conf.rss_hf =3D 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; >=20 > - rte_eth_dev_info_get(i, &dev_info); > + ret =3D eth_dev_info_get_print_err(i, &dev_info); > + if (ret !=3D 0) > + return; > + > if (use_default) > rss_conf.rss_hf =3D dev_info.flow_type_rss_offloads; >=20 > @@ -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; >=20 > memset(&dev_info, 0, sizeof(dev_info)); > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (dev_info.hash_key_size > 0 && > dev_info.hash_key_size <=3D sizeof(hash_key)) > hash_key_size =3D dev_info.hash_key_size; @@ -2945,7 > +2953,10 @@ struct cmd_config_rss_reta { > struct cmd_config_rss_reta *res =3D parsed_result; >=20 > memset(&dev_info, 0, sizeof(dev_info)); > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (dev_info.reta_size =3D=3D 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; >=20 > memset(&dev_info, 0, sizeof(dev_info)); > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > max_reta_size =3D RTE_MIN(dev_info.reta_size, > ETH_RSS_RETA_SIZE_512); > if (res->size =3D=3D 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 =3D parsed_result; > struct rte_eth_dev_info dev_info; > uint16_t rec_nb_pkts; > + int ret; >=20 > 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 =3D eth_dev_info_get_print_err(0, &dev_info); > + if (ret !=3D 0) > + return; > + > rec_nb_pkts =3D > dev_info.default_rxportconf.burst_size; >=20 > if (rec_nb_pkts =3D=3D 0) { > @@ -4375,6 +4394,7 @@ struct cmd_csum_result { { > struct rte_eth_dev_info dev_info; > uint64_t tx_offloads; > + int ret; >=20 > tx_offloads =3D 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"); >=20 > /* display warnings if configuration is not supported by the NIC */ > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) && > (dev_info.tx_offload_capa & > DEV_TX_OFFLOAD_IPV4_CKSUM) =3D=3D 0) { > printf("Warning: hardware IP checksum enabled but not " > @@ -4447,6 +4470,7 @@ struct cmd_csum_result { > int hw =3D 0; > uint64_t csum_offloads =3D 0; > struct rte_eth_dev_info dev_info; > + int ret; >=20 > 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; > } >=20 > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (!strcmp(res->mode, "set")) { >=20 > if (!strcmp(res->hwsw, "hw")) > @@ -4645,6 +4672,7 @@ struct cmd_tso_set_result { { > struct cmd_tso_set_result *res =3D parsed_result; > struct rte_eth_dev_info dev_info; > + int ret; >=20 > 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 =3D res->tso_segsz; >=20 > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if ((ports[res->port_id].tso_segsz !=3D 0) && > (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) > =3D=3D 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]); >=20 > /* display warnings if configuration is not supported by the NIC */ > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if ((ports[res->port_id].tso_segsz !=3D 0) && > (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) > =3D=3D 0) { > printf("Warning: TSO enabled but not " > @@ -4746,7 +4780,8 @@ struct cmd_tunnel_tso_set_result { { > struct rte_eth_dev_info dev_info; >=20 > - 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; >=20 > memset(&dev_info, 0, sizeof(dev_info)); > - rte_eth_dev_info_get(res->port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(res->port_id, > + &dev_info); > + if (ret !=3D 0) > + return; > + > errno =3D 0; > vf_id =3D strtoul(res->pf_vf + 2, &end, 10); > if (errno !=3D 0 || *end !=3D '\0' || > @@ -14176,7 +14215,10 @@ struct cmd_macsec_offload_on_result { > return; > } >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) > { #ifdef RTE_LIBRTE_IXGBE_PMD > ret =3D rte_pmd_ixgbe_macsec_enable(port_id, en, rp); @@ - > 14270,7 +14312,10 @@ struct cmd_macsec_offload_off_result { > return; > } >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) > { #ifdef RTE_LIBRTE_IXGBE_PMD > ret =3D rte_pmd_ixgbe_macsec_disable(port_id); > @@ -17980,8 +18025,12 @@ struct cmd_rx_offload_get_capa_result { > portid_t port_id =3D res->port_id; > uint64_t queue_offloads; > uint64_t port_offloads; > + int ret; > + > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > queue_offloads =3D dev_info.rx_queue_offload_capa; > port_offloads =3D dev_info.rx_offload_capa ^ queue_offloads; >=20 > @@ -18053,6 +18102,7 @@ struct cmd_rx_offload_get_configuration_result > { > uint64_t queue_offloads; > uint16_t nb_rx_queues; > int q; > + int ret; >=20 > printf("Rx Offloading Configuration of port %d :\n", port_id); >=20 > @@ -18061,7 +18111,10 @@ struct > cmd_rx_offload_get_configuration_result { > print_rx_offloads(port_offloads); > printf("\n"); >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > nb_rx_queues =3D dev_info.nb_rx_queues; > for (q =3D 0; q < nb_rx_queues; q++) { > queue_offloads =3D 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; >=20 > if (port->port_status !=3D 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; > } >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > nb_rx_queues =3D dev_info.nb_rx_queues; > if (!strcmp(res->on_off, "on")) { > port->dev_conf.rxmode.offloads |=3D single_offload; @@ - > 18261,6 +18318,7 @@ struct cmd_config_per_queue_rx_offload_result { > uint16_t queue_id =3D res->queue_id; > struct rte_port *port =3D &ports[port_id]; > uint64_t single_offload; > + int ret; >=20 > if (port->port_status !=3D 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; > } >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (queue_id >=3D 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 =3D res->port_id; > uint64_t queue_offloads; > uint64_t port_offloads; > + int ret; > + > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > queue_offloads =3D dev_info.tx_queue_offload_capa; > port_offloads =3D dev_info.tx_offload_capa ^ queue_offloads; >=20 > @@ -18447,6 +18512,7 @@ struct cmd_tx_offload_get_configuration_result > { > uint64_t queue_offloads; > uint16_t nb_tx_queues; > int q; > + int ret; >=20 > printf("Tx Offloading Configuration of port %d :\n", port_id); >=20 > @@ -18455,7 +18521,10 @@ struct > cmd_tx_offload_get_configuration_result { > print_tx_offloads(port_offloads); > printf("\n"); >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > nb_tx_queues =3D dev_info.nb_tx_queues; > for (q =3D 0; q < nb_tx_queues; q++) { > queue_offloads =3D 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; >=20 > if (port->port_status !=3D 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; > } >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > nb_tx_queues =3D dev_info.nb_tx_queues; > if (!strcmp(res->on_off, "on")) { > port->dev_conf.txmode.offloads |=3D single_offload; @@ - > 18663,6 +18736,7 @@ struct cmd_config_per_queue_tx_offload_result { > uint16_t queue_id =3D res->queue_id; > struct rte_port *port =3D &ports[port_id]; > uint64_t single_offload; > + int ret; >=20 > if (port->port_status !=3D 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; > } >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (queue_id >=3D 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 !=3D (portid_t)RTE_PORT_ALL) { > struct rte_eth_dev_info info; >=20 > - rte_eth_dev_info_get(ctx->port, &info); > + ret =3D rte_eth_dev_info_get(ctx->port, &info); > + if (ret !=3D 0) > + return ret; > + > action_rss_data->conf.key_len =3D > 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 =3D "*********************"; > uint16_t mtu; > char name[RTE_ETH_NAME_MAX_LEN]; > + int ret; >=20 > 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 =3D &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 =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 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; >=20 > 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) > } >=20 > rte_eth_link_get_nowait(port_id, &link); > - rte_eth_dev_info_get(port_id, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > rte_eth_dev_get_name_by_port(port_id, name); > rte_eth_macaddr_get(port_id, &mac_addr); >=20 > @@ -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 =3D "************"; > + int ret; >=20 > if (port_id_is_invalid(port_id, ENABLED_WARN)) > return; >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; >=20 > 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; >=20 > if (port_id_is_invalid(port_id, ENABLED_WARN)) > return; > - rte_eth_dev_info_get(port_id, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 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 =3D > (struct igb_ring_desc_16_bytes *)ring_mz->addr; #ifndef > RTE_LIBRTE_I40E_16BYTE_RX_DESC > struct rte_eth_dev_info dev_info; >=20 > memset(&dev_info, 0, sizeof(dev_info)); > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (strstr(dev_info.driver_name, "i40e") !=3D NULL) { > /* 32 bytes RX descriptor, i40e only */ > struct igb_ring_desc_32_bytes *ring =3D @@ -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; >=20 > if (port_id_is_invalid(port_id, ENABLED_WARN)) > return; >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if (dev_info.hash_key_size > 0 && > dev_info.hash_key_size <=3D sizeof(rss_key)) > hash_key_size =3D 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; >=20 > if (port_id_is_invalid(portid, ENABLED_WARN)) > return; >=20 > - rte_eth_dev_info_get(portid, &dev_info); > + ret =3D eth_dev_info_get_print_err(portid, &dev_info); > + if (ret !=3D 0) > + return; > + > for (queue =3D 0; queue < dev_info.nb_rx_queues; queue++) > if (!ports[portid].rx_dump_cb[queue]) > ports[portid].rx_dump_cb[queue] =3D > @@ -2813,10 +2843,15 @@ struct igb_ring_desc_16_bytes { { > struct rte_eth_dev_info dev_info; > uint16_t queue; > + int ret; >=20 > if (port_id_is_invalid(portid, ENABLED_WARN)) > return; > - rte_eth_dev_info_get(portid, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(portid, &dev_info); > + if (ret !=3D 0) > + return; > + > for (queue =3D 0; queue < dev_info.nb_tx_queues; queue++) > if (!ports[portid].tx_dump_cb[queue]) > ports[portid].tx_dump_cb[queue] =3D > @@ -2829,10 +2864,15 @@ struct igb_ring_desc_16_bytes { { > struct rte_eth_dev_info dev_info; > uint16_t queue; > + int ret; >=20 > if (port_id_is_invalid(portid, ENABLED_WARN)) > return; > - rte_eth_dev_info_get(portid, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(portid, &dev_info); > + if (ret !=3D 0) > + return; > + > for (queue =3D 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; >=20 > if (port_id_is_invalid(portid, ENABLED_WARN)) > return; > - rte_eth_dev_info_get(portid, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(portid, &dev_info); > + if (ret !=3D 0) > + return; > + > for (queue =3D 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; >=20 > 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 =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) > =3D=3D 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; >=20 > 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; >=20 > - rte_eth_dev_info_get(port_id, &dev_info); > + ret =3D eth_dev_info_get_print_err(port_id, &dev_info); > + if (ret !=3D 0) > + return; > + > if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) > =3D=3D 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 =3D tx_mode.offloads; > struct rte_eth_dev_info dev_info; > uint16_t rec_nb_pkts; > + int ret; >=20 > static struct option lgopts[] =3D { > { "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 =3D eth_dev_info_get_print_err( > + 0, > + &dev_info); > + if (ret !=3D 0) > + return; > + > rec_nb_pkts =3D dev_info >=20 > .default_rxportconf.burst_size; >=20 > 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; >=20 > 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 =3D dev_info.max_rx_queues; > *pid =3D pi; > @@ -1062,7 +1063,8 @@ struct extmem_param { > struct rte_eth_dev_info dev_info; >=20 > 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 =3D dev_info.max_tx_queues; > *pid =3D pi; > @@ -1109,6 +1111,7 @@ struct extmem_param { > uint16_t data_size; > bool warning =3D 0; > int k; > + int ret; >=20 > memset(port_per_socket,0,RTE_MAX_NUMA_NODES); >=20 > @@ -1136,7 +1139,10 @@ struct extmem_param { > /* Apply default TxRx configuration for all ports */ > port->dev_conf.txmode =3D tx_mode; > port->dev_conf.rxmode =3D rx_mode; > - rte_eth_dev_info_get(pid, &port->dev_info); > + > + ret =3D eth_dev_info_get_print_err(pid, &port->dev_info); > + if (ret !=3D 0) > + return; >=20 > 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; >=20 > /* Reconfiguration of Ethernet ports. */ > port =3D &ports[new_port_id]; > - rte_eth_dev_info_get(new_port_id, &port->dev_info); > + > + ret =3D eth_dev_info_get_print_err(new_port_id, &port->dev_info); > + if (ret !=3D 0) > + return; >=20 > /* set flag to initialize port/queue */ > port->need_reconfig =3D 1; > @@ -2927,11 +2937,16 @@ struct pmd_test_command { { > portid_t pid; > struct rte_port *port; > + int ret; >=20 > RTE_ETH_FOREACH_DEV(pid) { > port =3D &ports[pid]; > port->dev_conf.fdir_conf =3D fdir_conf; > - rte_eth_dev_info_get(pid, &port->dev_info); > + > + ret =3D eth_dev_info_get_print_err(pid, &port->dev_info); > + if (ret !=3D 0) > + return; > + > if (nb_rxq > 1) { > port->dev_conf.rx_adv_conf.rss_conf.rss_key =3D > NULL; > port->dev_conf.rx_adv_conf.rss_conf.rss_hf =3D @@ - > 3106,7 +3121,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid) > retval =3D 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 =3D eth_dev_info_get_print_err(pid, &rte_port->dev_info); > + if (retval !=3D 0) > + return retval; >=20 > /* 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); > + >=20 > /* Functions to manage the set of filtered Multicast MAC addresses */ v= oid > 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; >=20 > if (port_id_is_invalid(portid, ENABLED_WARN)) > return; > - rte_eth_dev_info_get(portid, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(portid, &dev_info); > + if (ret !=3D 0) > + return; > + > for (queue =3D 0; queue < dev_info.nb_tx_queues; queue++) > if (!ports[portid].tx_set_md_cb[queue]) > ports[portid].tx_set_md_cb[queue] =3D > @@ -210,10 +215,15 @@ > { > struct rte_eth_dev_info dev_info; > uint16_t queue; > + int ret; >=20 > if (port_id_is_invalid(portid, ENABLED_WARN)) > return; > - rte_eth_dev_info_get(portid, &dev_info); > + > + ret =3D eth_dev_info_get_print_err(portid, &dev_info); > + if (ret !=3D 0) > + return; > + > for (queue =3D 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] =3D NULL; > } > } > + > +int > +eth_dev_info_get_print_err(uint16_t port_id, > + struct rte_eth_dev_info *dev_info) { > + int ret; > + > + ret =3D rte_eth_dev_info_get(port_id, dev_info); > + if (ret !=3D 0) > + printf("Error during getting device (port %u) info: %s\n", > + port_id, strerror(-ret)); > + > + return ret; > +} > -- > 1.8.3.1