get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/58042/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 58042,
    "url": "https://patches.dpdk.org/api/patches/58042/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1566915962-5472-3-git-send-email-arybchenko@solarflare.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1566915962-5472-3-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1566915962-5472-3-git-send-email-arybchenko@solarflare.com",
    "date": "2019-08-27T14:25:13",
    "name": "[02/51] app/testpmd: check status of getting ethdev info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "620529b10bf846e35e3c48827b03ad6bbb98e3f8",
    "submitter": {
        "id": 607,
        "url": "https://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1566915962-5472-3-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 6138,
            "url": "https://patches.dpdk.org/api/series/6138/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6138",
            "date": "2019-08-27T14:25:13",
            "name": "ethdev: change rte_eth_dev_info_get() return value to int",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6138/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/58042/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/58042/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CD78F1C122;\n\tTue, 27 Aug 2019 16:26:19 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 529291C121\n\tfor <dev@dpdk.org>; Tue, 27 Aug 2019 16:26:18 +0200 (CEST)",
            "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n\tAB47B4005C; Tue, 27 Aug 2019 14:26:16 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1395.4; Tue, 27 Aug 2019 07:26:13 -0700",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1395.4 via Frontend Transport; Tue, 27 Aug 2019 07:26:13 -0700",
            "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tx7REQCdq004164; Tue, 27 Aug 2019 15:26:12 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\t22CAE1613D2; Tue, 27 Aug 2019 15:26:12 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, \n\tBernard Iremonger <bernard.iremonger@intel.com>, Adrien Mazarguil\n\t<adrien.mazarguil@6wind.com>",
        "CC": "<dev@dpdk.org>, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>",
        "Date": "Tue, 27 Aug 2019 15:25:13 +0100",
        "Message-ID": "<1566915962-5472-3-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1566915962-5472-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1566915962-5472-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.5.1010-24872.005",
        "X-TM-AS-Result": "No-12.209900-4.000000-10",
        "X-TMASE-MatchedRID": "XYH9ayZ/tvnDOgXZFRFV826HurDH4PpPIrMoP5XxqGfAlr9zf1x/liXD\n\tFxgit6TpPqH3M3bmiaYDfZ2MQc5YmiHhSBQfglfsA9lly13c/gHkY2blxNFpRx9W4auM/sn0XWj\n\tvA8TpWFjZfxIlRtpm4wD/U58aWgn/rYhfqfvQWOk49w4rSKMAfXvEgoSBmr8BqPGqHIPGZiMN1+\n\ttxgSPbZNeZJ+oAAdV6W71X4IeTTjhD0//J+TGhsUV4CvmC4hgmNU8z+tFJHR3IPbn2oQhptYh+I\n\tSUliiI59XnJpdwd/gM8PbY2Y2AtpajlE6h86PHu8pRHzcG+oi3Lvfc3C6SWwkPJD9TF1GCwokWZ\n\tuZ853Ddsw0X2Rr3oSJVf30GgZHkoAwfTUGLzbn5/OBWacv+iVUqAhuLHn5fE5FTpLuDkJ4Cf6eu\n\t+NowNgQLr7/ODm2Q3sDXJHJ4lGL0dAyevMk7vZwe06kQGFaIW+LidURF+DB3J2YQ3RSF2RKlO2e\n\tkqlDI6KS7IsrbUF+SVY4Kd+WjBkzMn84YoJAVUKUnZzo2UQD2Dk/BgpSPLP7kiJ/BgvX6rzK7j5\n\t/eb6+XgAIJkrFDGbTLQrTTCz7wd9RyhZ7e/3vJC4WIP7GtYLFRXlDwI7HfGtQ/I77hJvmXxNUSY\n\tQUCBxCgHofFah+0EldD02C9Lk3wepE04ZAJc/4ph1hAtvKZNfS0Ip2eEHnz3IzXlXlpamPoLR4+\n\tzsDTteLhcSg9d5zH0jq+ZidbW/gV3KoZBUbsSTe9i/ox+gNb6d8cwnxXv7A==",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--12.209900-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24872.005",
        "X-MDID": "1566915977-F3XcMgBweBoF",
        "Subject": "[dpdk-dev] [PATCH 02/51] app/testpmd: check status of getting\n\tethdev info",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>\n\nAdd eth_dev_info_get_print_err() which is a wrapper for\nrte_eth_dev_info_get() printing error if rte_eth_dev_info_get()\nfails and returning its status code.\n\nSigned-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n app/test-pmd/cmdline.c      | 119 ++++++++++++++++++++++++++++++++++++--------\n app/test-pmd/cmdline_flow.c |   5 +-\n app/test-pmd/config.c       |  78 ++++++++++++++++++++++++-----\n app/test-pmd/parameters.c   |   8 ++-\n app/test-pmd/testpmd.c      |  30 ++++++++---\n app/test-pmd/testpmd.h      |   3 ++\n app/test-pmd/util.c         |  28 ++++++++++-\n 7 files changed, 228 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 56783aa..d4ab143 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -2273,6 +2273,7 @@ struct cmd_config_rss {\n \tint all_updated = 1;\n \tint diag;\n \tuint16_t i;\n+\tint ret;\n \n \tif (!strcmp(res->value, \"all\"))\n \t\trss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP |\n@@ -2312,7 +2313,10 @@ struct cmd_config_rss {\n \tRTE_ETH_FOREACH_DEV(i) {\n \t\tstruct rte_eth_rss_conf local_rss_conf;\n \n-\t\trte_eth_dev_info_get(i, &dev_info);\n+\t\tret = eth_dev_info_get_print_err(i, &dev_info);\n+\t\tif (ret != 0)\n+\t\t\treturn;\n+\n \t\tif (use_default)\n \t\t\trss_conf.rss_hf = dev_info.flow_type_rss_offloads;\n \n@@ -2410,9 +2414,13 @@ struct cmd_config_rss_hash_key {\n \tstruct rte_eth_dev_info dev_info;\n \tuint8_t hash_key_size;\n \tuint32_t key_len;\n+\tint ret;\n \n \tmemset(&dev_info, 0, sizeof(dev_info));\n-\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(res->port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (dev_info.hash_key_size > 0 &&\n \t\t\tdev_info.hash_key_size <= sizeof(hash_key))\n \t\thash_key_size = dev_info.hash_key_size;\n@@ -2945,7 +2953,10 @@ struct cmd_config_rss_reta {\n \tstruct cmd_config_rss_reta *res = parsed_result;\n \n \tmemset(&dev_info, 0, sizeof(dev_info));\n-\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(res->port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (dev_info.reta_size == 0) {\n \t\tprintf(\"Redirection table size is 0 which is \"\n \t\t\t\t\t\"invalid for RSS\\n\");\n@@ -3063,9 +3074,13 @@ struct cmd_showport_reta {\n \tstruct rte_eth_rss_reta_entry64 reta_conf[8];\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t max_reta_size;\n+\tint ret;\n \n \tmemset(&dev_info, 0, sizeof(dev_info));\n-\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(res->port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tmax_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);\n \tif (res->size == 0 || res->size > max_reta_size) {\n \t\tprintf(\"Invalid redirection table size: %u (1-%u)\\n\",\n@@ -3292,6 +3307,7 @@ struct cmd_config_burst {\n \tstruct cmd_config_burst *res = parsed_result;\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t rec_nb_pkts;\n+\tint ret;\n \n \tif (!all_ports_stopped()) {\n \t\tprintf(\"Please stop all ports first\\n\");\n@@ -3305,7 +3321,10 @@ struct cmd_config_burst {\n \t\t\t * size for all ports, so assume all ports are the same\n \t\t\t * NIC model and use the values from Port 0.\n \t\t\t */\n-\t\t\trte_eth_dev_info_get(0, &dev_info);\n+\t\t\tret = eth_dev_info_get_print_err(0, &dev_info);\n+\t\t\tif (ret != 0)\n+\t\t\t\treturn;\n+\n \t\t\trec_nb_pkts = dev_info.default_rxportconf.burst_size;\n \n \t\t\tif (rec_nb_pkts == 0) {\n@@ -4375,6 +4394,7 @@ struct cmd_csum_result {\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint64_t tx_offloads;\n+\tint ret;\n \n \ttx_offloads = ports[port_id].dev_conf.txmode.offloads;\n \tprintf(\"Parse tunnel is %s\\n\",\n@@ -4393,7 +4413,10 @@ struct cmd_csum_result {\n \t\t(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? \"hw\" : \"sw\");\n \n \t/* display warnings if configuration is not supported by the NIC */\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) &&\n \t\t(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) {\n \t\tprintf(\"Warning: hardware IP checksum enabled but not \"\n@@ -4447,6 +4470,7 @@ struct cmd_csum_result {\n \tint hw = 0;\n \tuint64_t csum_offloads = 0;\n \tstruct rte_eth_dev_info dev_info;\n+\tint ret;\n \n \tif (port_id_is_invalid(res->port_id, ENABLED_WARN)) {\n \t\tprintf(\"invalid port %d\\n\", res->port_id);\n@@ -4457,7 +4481,10 @@ struct cmd_csum_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(res->port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (!strcmp(res->mode, \"set\")) {\n \n \t\tif (!strcmp(res->hwsw, \"hw\"))\n@@ -4645,6 +4672,7 @@ struct cmd_tso_set_result {\n {\n \tstruct cmd_tso_set_result *res = parsed_result;\n \tstruct rte_eth_dev_info dev_info;\n+\tint ret;\n \n \tif (port_id_is_invalid(res->port_id, ENABLED_WARN))\n \t\treturn;\n@@ -4656,7 +4684,10 @@ struct cmd_tso_set_result {\n \tif (!strcmp(res->mode, \"set\"))\n \t\tports[res->port_id].tso_segsz = res->tso_segsz;\n \n-\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(res->port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif ((ports[res->port_id].tso_segsz != 0) &&\n \t\t(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {\n \t\tprintf(\"Error: TSO is not supported by port %d\\n\",\n@@ -4677,7 +4708,10 @@ struct cmd_tso_set_result {\n \tcmd_config_queue_tx_offloads(&ports[res->port_id]);\n \n \t/* display warnings if configuration is not supported by the NIC */\n-\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(res->port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif ((ports[res->port_id].tso_segsz != 0) &&\n \t\t(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0) {\n \t\tprintf(\"Warning: TSO enabled but not \"\n@@ -4746,7 +4780,8 @@ struct cmd_tunnel_tso_set_result {\n {\n \tstruct rte_eth_dev_info dev_info;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\teth_dev_info_get_print_err(port_id, &dev_info);\n+\n \tif (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO))\n \t\tprintf(\"Warning: VXLAN TUNNEL TSO not supported therefore \"\n \t\t       \"not enabled for port %d\\n\", port_id);\n@@ -11184,7 +11219,11 @@ struct cmd_flow_director_result {\n \t\t\tstruct rte_eth_dev_info dev_info;\n \n \t\t\tmemset(&dev_info, 0, sizeof(dev_info));\n-\t\t\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\t\t\tret = eth_dev_info_get_print_err(res->port_id,\n+\t\t\t\t\t\t&dev_info);\n+\t\t\tif (ret != 0)\n+\t\t\t\treturn;\n+\n \t\t\terrno = 0;\n \t\t\tvf_id = strtoul(res->pf_vf + 2, &end, 10);\n \t\t\tif (errno != 0 || *end != '\\0' ||\n@@ -14176,7 +14215,10 @@ struct cmd_macsec_offload_on_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {\n #ifdef RTE_LIBRTE_IXGBE_PMD\n \t\tret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp);\n@@ -14270,7 +14312,10 @@ struct cmd_macsec_offload_off_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {\n #ifdef RTE_LIBRTE_IXGBE_PMD\n \t\tret = rte_pmd_ixgbe_macsec_disable(port_id);\n@@ -17980,8 +18025,12 @@ struct cmd_rx_offload_get_capa_result {\n \tportid_t port_id = res->port_id;\n \tuint64_t queue_offloads;\n \tuint64_t port_offloads;\n+\tint ret;\n+\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n \tqueue_offloads = dev_info.rx_queue_offload_capa;\n \tport_offloads = dev_info.rx_offload_capa ^ queue_offloads;\n \n@@ -18053,6 +18102,7 @@ struct cmd_rx_offload_get_configuration_result {\n \tuint64_t queue_offloads;\n \tuint16_t nb_rx_queues;\n \tint q;\n+\tint ret;\n \n \tprintf(\"Rx Offloading Configuration of port %d :\\n\", port_id);\n \n@@ -18061,7 +18111,10 @@ struct cmd_rx_offload_get_configuration_result {\n \tprint_rx_offloads(port_offloads);\n \tprintf(\"\\n\");\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tnb_rx_queues = dev_info.nb_rx_queues;\n \tfor (q = 0; q < nb_rx_queues; q++) {\n \t\tqueue_offloads = port->rx_conf[q].offloads;\n@@ -18160,6 +18213,7 @@ struct cmd_config_per_port_rx_offload_result {\n \tuint64_t single_offload;\n \tuint16_t nb_rx_queues;\n \tint q;\n+\tint ret;\n \n \tif (port->port_status != RTE_PORT_STOPPED) {\n \t\tprintf(\"Error: Can't config offload when Port %d \"\n@@ -18173,7 +18227,10 @@ struct cmd_config_per_port_rx_offload_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tnb_rx_queues = dev_info.nb_rx_queues;\n \tif (!strcmp(res->on_off, \"on\")) {\n \t\tport->dev_conf.rxmode.offloads |= single_offload;\n@@ -18261,6 +18318,7 @@ struct cmd_config_per_queue_rx_offload_result {\n \tuint16_t queue_id = res->queue_id;\n \tstruct rte_port *port = &ports[port_id];\n \tuint64_t single_offload;\n+\tint ret;\n \n \tif (port->port_status != RTE_PORT_STOPPED) {\n \t\tprintf(\"Error: Can't config offload when Port %d \"\n@@ -18268,7 +18326,10 @@ struct cmd_config_per_queue_rx_offload_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (queue_id >= dev_info.nb_rx_queues) {\n \t\tprintf(\"Error: input queue_id should be 0 ... \"\n \t\t       \"%d\\n\", dev_info.nb_rx_queues - 1);\n@@ -18374,8 +18435,12 @@ struct cmd_tx_offload_get_capa_result {\n \tportid_t port_id = res->port_id;\n \tuint64_t queue_offloads;\n \tuint64_t port_offloads;\n+\tint ret;\n+\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n \tqueue_offloads = dev_info.tx_queue_offload_capa;\n \tport_offloads = dev_info.tx_offload_capa ^ queue_offloads;\n \n@@ -18447,6 +18512,7 @@ struct cmd_tx_offload_get_configuration_result {\n \tuint64_t queue_offloads;\n \tuint16_t nb_tx_queues;\n \tint q;\n+\tint ret;\n \n \tprintf(\"Tx Offloading Configuration of port %d :\\n\", port_id);\n \n@@ -18455,7 +18521,10 @@ struct cmd_tx_offload_get_configuration_result {\n \tprint_tx_offloads(port_offloads);\n \tprintf(\"\\n\");\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tnb_tx_queues = dev_info.nb_tx_queues;\n \tfor (q = 0; q < nb_tx_queues; q++) {\n \t\tqueue_offloads = port->tx_conf[q].offloads;\n@@ -18559,6 +18628,7 @@ struct cmd_config_per_port_tx_offload_result {\n \tuint64_t single_offload;\n \tuint16_t nb_tx_queues;\n \tint q;\n+\tint ret;\n \n \tif (port->port_status != RTE_PORT_STOPPED) {\n \t\tprintf(\"Error: Can't config offload when Port %d \"\n@@ -18572,7 +18642,10 @@ struct cmd_config_per_port_tx_offload_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tnb_tx_queues = dev_info.nb_tx_queues;\n \tif (!strcmp(res->on_off, \"on\")) {\n \t\tport->dev_conf.txmode.offloads |= single_offload;\n@@ -18663,6 +18736,7 @@ struct cmd_config_per_queue_tx_offload_result {\n \tuint16_t queue_id = res->queue_id;\n \tstruct rte_port *port = &ports[port_id];\n \tuint64_t single_offload;\n+\tint ret;\n \n \tif (port->port_status != RTE_PORT_STOPPED) {\n \t\tprintf(\"Error: Can't config offload when Port %d \"\n@@ -18670,7 +18744,10 @@ struct cmd_config_per_queue_tx_offload_result {\n \t\treturn;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (queue_id >= dev_info.nb_tx_queues) {\n \t\tprintf(\"Error: input queue_id should be 0 ... \"\n \t\t       \"%d\\n\", dev_info.nb_tx_queues - 1);\ndiff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 4958713..369426c 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -3550,7 +3550,10 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,\n \t    ctx->port != (portid_t)RTE_PORT_ALL) {\n \t\tstruct rte_eth_dev_info info;\n \n-\t\trte_eth_dev_info_get(ctx->port, &info);\n+\t\tret = rte_eth_dev_info_get(ctx->port, &info);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\n \t\taction_rss_data->conf.key_len =\n \t\t\tRTE_MIN(sizeof(action_rss_data->key),\n \t\t\t\tinfo.hash_key_size);\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 1a5a5c1..0ef7c36 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -471,6 +471,7 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)\n \tstatic const char *info_border = \"*********************\";\n \tuint16_t mtu;\n \tchar name[RTE_ETH_NAME_MAX_LEN];\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN)) {\n \t\tprint_valid_ports();\n@@ -479,7 +480,11 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)\n \tport = &ports[port_id];\n \trte_eth_link_get_nowait(port_id, &link);\n \tmemset(&dev_info, 0, sizeof(dev_info));\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tprintf(\"\\n%s Infos for port %-2d %s\\n\",\n \t       info_border, port_id, info_border);\n \trte_eth_macaddr_get(port_id, &mac_addr);\n@@ -618,6 +623,7 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)\n \tstruct rte_eth_link link;\n \tstruct rte_eth_dev_info dev_info;\n \tchar name[RTE_ETH_NAME_MAX_LEN];\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN)) {\n \t\tprint_valid_ports();\n@@ -625,7 +631,11 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)\n \t}\n \n \trte_eth_link_get_nowait(port_id, &link);\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \trte_eth_dev_get_name_by_port(port_id, name);\n \trte_eth_macaddr_get(port_id, &mac_addr);\n \n@@ -642,11 +652,14 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)\n {\n \tstruct rte_eth_dev_info dev_info;\n \tstatic const char *info_border = \"************\";\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN))\n \t\treturn;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n \n \tprintf(\"\\n%s Port %d supported offload features: %s\\n\",\n \t\tinfo_border, port_id, info_border);\n@@ -1140,10 +1153,15 @@ void print_valid_ports(void)\n {\n \tint diag;\n \tstruct rte_eth_dev_info dev_info;\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN))\n \t\treturn;\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (mtu > dev_info.max_mtu || mtu < dev_info.min_mtu) {\n \t\tprintf(\"Set MTU failed. MTU:%u is not in valid range, min:%u - max:%u\\n\",\n \t\t\tmtu, dev_info.min_mtu, dev_info.max_mtu);\n@@ -1618,13 +1636,17 @@ struct igb_ring_desc_16_bytes {\n #endif\n \t\t\t   uint16_t desc_id)\n {\n+\tint ret;\n \tstruct igb_ring_desc_16_bytes *ring =\n \t\t(struct igb_ring_desc_16_bytes *)ring_mz->addr;\n #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC\n \tstruct rte_eth_dev_info dev_info;\n \n \tmemset(&dev_info, 0, sizeof(dev_info));\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (strstr(dev_info.driver_name, \"i40e\") != NULL) {\n \t\t/* 32 bytes RX descriptor, i40e only */\n \t\tstruct igb_ring_desc_32_bytes *ring =\n@@ -1834,11 +1856,15 @@ struct igb_ring_desc_16_bytes {\n \tint diag;\n \tstruct rte_eth_dev_info dev_info;\n \tuint8_t hash_key_size;\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN))\n \t\treturn;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif (dev_info.hash_key_size > 0 &&\n \t\t\tdev_info.hash_key_size <= sizeof(rss_key))\n \t\thash_key_size = dev_info.hash_key_size;\n@@ -2796,11 +2822,15 @@ struct igb_ring_desc_16_bytes {\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t queue;\n+\tint ret;\n \n \tif (port_id_is_invalid(portid, ENABLED_WARN))\n \t\treturn;\n \n-\trte_eth_dev_info_get(portid, &dev_info);\n+\tret = eth_dev_info_get_print_err(portid, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tfor (queue = 0; queue < dev_info.nb_rx_queues; queue++)\n \t\tif (!ports[portid].rx_dump_cb[queue])\n \t\t\tports[portid].rx_dump_cb[queue] =\n@@ -2813,10 +2843,15 @@ struct igb_ring_desc_16_bytes {\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t queue;\n+\tint ret;\n \n \tif (port_id_is_invalid(portid, ENABLED_WARN))\n \t\treturn;\n-\trte_eth_dev_info_get(portid, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(portid, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tfor (queue = 0; queue < dev_info.nb_tx_queues; queue++)\n \t\tif (!ports[portid].tx_dump_cb[queue])\n \t\t\tports[portid].tx_dump_cb[queue] =\n@@ -2829,10 +2864,15 @@ struct igb_ring_desc_16_bytes {\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t queue;\n+\tint ret;\n \n \tif (port_id_is_invalid(portid, ENABLED_WARN))\n \t\treturn;\n-\trte_eth_dev_info_get(portid, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(portid, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tfor (queue = 0; queue < dev_info.nb_rx_queues; queue++)\n \t\tif (ports[portid].rx_dump_cb[queue]) {\n \t\t\trte_eth_remove_rx_callback(portid, queue,\n@@ -2846,10 +2886,15 @@ struct igb_ring_desc_16_bytes {\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t queue;\n+\tint ret;\n \n \tif (port_id_is_invalid(portid, ENABLED_WARN))\n \t\treturn;\n-\trte_eth_dev_info_get(portid, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(portid, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tfor (queue = 0; queue < dev_info.nb_tx_queues; queue++)\n \t\tif (ports[portid].tx_dump_cb[queue]) {\n \t\t\trte_eth_remove_tx_callback(portid, queue,\n@@ -3037,6 +3082,7 @@ struct igb_ring_desc_16_bytes {\n tx_vlan_set(portid_t port_id, uint16_t vlan_id)\n {\n \tstruct rte_eth_dev_info dev_info;\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN))\n \t\treturn;\n@@ -3048,7 +3094,11 @@ struct igb_ring_desc_16_bytes {\n \t\tprintf(\"Error, as QinQ has been enabled.\\n\");\n \t\treturn;\n \t}\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) == 0) {\n \t\tprintf(\"Error: vlan insert is not supported by port %d\\n\",\n \t\t\tport_id);\n@@ -3064,6 +3114,7 @@ struct igb_ring_desc_16_bytes {\n tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)\n {\n \tstruct rte_eth_dev_info dev_info;\n+\tint ret;\n \n \tif (port_id_is_invalid(port_id, ENABLED_WARN))\n \t\treturn;\n@@ -3072,7 +3123,10 @@ struct igb_ring_desc_16_bytes {\n \tif (vlan_id_is_invalid(vlan_id_outer))\n \t\treturn;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = eth_dev_info_get_print_err(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tif ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) {\n \t\tprintf(\"Error: qinq insert not supported by port %d\\n\",\n \t\t\tport_id);\ndiff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 5244872..6c78dca 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -562,6 +562,7 @@\n \tuint64_t tx_offloads = tx_mode.offloads;\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t rec_nb_pkts;\n+\tint ret;\n \n \tstatic struct option lgopts[] = {\n \t\t{ \"help\",\t\t\t0, 0, 0 },\n@@ -1050,7 +1051,12 @@\n \t\t\t\t\t * value, on the assumption that all\n \t\t\t\t\t * ports are of the same NIC model.\n \t\t\t\t\t */\n-\t\t\t\t\trte_eth_dev_info_get(0, &dev_info);\n+\t\t\t\t\tret = eth_dev_info_get_print_err(\n+\t\t\t\t\t\t\t\t0,\n+\t\t\t\t\t\t\t\t&dev_info);\n+\t\t\t\t\tif (ret != 0)\n+\t\t\t\t\t\treturn;\n+\n \t\t\t\t\trec_nb_pkts = dev_info\n \t\t\t\t\t\t.default_rxportconf.burst_size;\n \ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex e8e2a39..0117236 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -1016,7 +1016,8 @@ struct extmem_param {\n \tstruct rte_eth_dev_info dev_info;\n \n \tRTE_ETH_FOREACH_DEV(pi) {\n-\t\trte_eth_dev_info_get(pi, &dev_info);\n+\t\teth_dev_info_get_print_err(pi, &dev_info);\n+\n \t\tif (dev_info.max_rx_queues < allowed_max_rxq) {\n \t\t\tallowed_max_rxq = dev_info.max_rx_queues;\n \t\t\t*pid = pi;\n@@ -1062,7 +1063,8 @@ struct extmem_param {\n \tstruct rte_eth_dev_info dev_info;\n \n \tRTE_ETH_FOREACH_DEV(pi) {\n-\t\trte_eth_dev_info_get(pi, &dev_info);\n+\t\teth_dev_info_get_print_err(pi, &dev_info);\n+\n \t\tif (dev_info.max_tx_queues < allowed_max_txq) {\n \t\t\tallowed_max_txq = dev_info.max_tx_queues;\n \t\t\t*pid = pi;\n@@ -1109,6 +1111,7 @@ struct extmem_param {\n \tuint16_t data_size;\n \tbool warning = 0;\n \tint k;\n+\tint ret;\n \n \tmemset(port_per_socket,0,RTE_MAX_NUMA_NODES);\n \n@@ -1136,7 +1139,10 @@ struct extmem_param {\n \t\t/* Apply default TxRx configuration for all ports */\n \t\tport->dev_conf.txmode = tx_mode;\n \t\tport->dev_conf.rxmode = rx_mode;\n-\t\trte_eth_dev_info_get(pid, &port->dev_info);\n+\n+\t\tret = eth_dev_info_get_print_err(pid, &port->dev_info);\n+\t\tif (ret != 0)\n+\t\t\treturn;\n \n \t\tif (!(port->dev_info.tx_offload_capa &\n \t\t      DEV_TX_OFFLOAD_MBUF_FAST_FREE))\n@@ -1295,10 +1301,14 @@ struct extmem_param {\n reconfig(portid_t new_port_id, unsigned socket_id)\n {\n \tstruct rte_port *port;\n+\tint ret;\n \n \t/* Reconfiguration of Ethernet ports. */\n \tport = &ports[new_port_id];\n-\trte_eth_dev_info_get(new_port_id, &port->dev_info);\n+\n+\tret = eth_dev_info_get_print_err(new_port_id, &port->dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n \n \t/* set flag to initialize port/queue */\n \tport->need_reconfig = 1;\n@@ -2927,11 +2937,16 @@ struct pmd_test_command {\n {\n \tportid_t pid;\n \tstruct rte_port *port;\n+\tint ret;\n \n \tRTE_ETH_FOREACH_DEV(pid) {\n \t\tport = &ports[pid];\n \t\tport->dev_conf.fdir_conf = fdir_conf;\n-\t\trte_eth_dev_info_get(pid, &port->dev_info);\n+\n+\t\tret = eth_dev_info_get_print_err(pid, &port->dev_info);\n+\t\tif (ret != 0)\n+\t\t\treturn;\n+\n \t\tif (nb_rxq > 1) {\n \t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;\n \t\t\tport->dev_conf.rx_adv_conf.rss_conf.rss_hf =\n@@ -3106,7 +3121,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)\n \tretval = rte_eth_dev_configure(pid, nb_rxq, nb_rxq, &port_conf);\n \tif (retval < 0)\n \t\treturn retval;\n-\trte_eth_dev_info_get(pid, &rte_port->dev_info);\n+\n+\tretval = eth_dev_info_get_print_err(pid, &rte_port->dev_info);\n+\tif (retval != 0)\n+\t\treturn retval;\n \n \t/* If dev_info.vmdq_pool_base is greater than 0,\n \t * the queue id of vmdq pools is started after pf queues.\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex ce13eb8..d73955d 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -822,6 +822,9 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[],\n void setup_gro_flush_cycles(uint8_t cycles);\n void show_gro(portid_t port_id);\n void setup_gso(const char *mode, portid_t port_id);\n+int eth_dev_info_get_print_err(uint16_t port_id,\n+\t\t\tstruct rte_eth_dev_info *dev_info);\n+\n \n /* Functions to manage the set of filtered Multicast MAC addresses */\n void mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr);\ndiff --git a/app/test-pmd/util.c b/app/test-pmd/util.c\nindex 18dfdca..009d226 100644\n--- a/app/test-pmd/util.c\n+++ b/app/test-pmd/util.c\n@@ -194,10 +194,15 @@\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t queue;\n+\tint ret;\n \n \tif (port_id_is_invalid(portid, ENABLED_WARN))\n \t\treturn;\n-\trte_eth_dev_info_get(portid, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(portid, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tfor (queue = 0; queue < dev_info.nb_tx_queues; queue++)\n \t\tif (!ports[portid].tx_set_md_cb[queue])\n \t\t\tports[portid].tx_set_md_cb[queue] =\n@@ -210,10 +215,15 @@\n {\n \tstruct rte_eth_dev_info dev_info;\n \tuint16_t queue;\n+\tint ret;\n \n \tif (port_id_is_invalid(portid, ENABLED_WARN))\n \t\treturn;\n-\trte_eth_dev_info_get(portid, &dev_info);\n+\n+\tret = eth_dev_info_get_print_err(portid, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n \tfor (queue = 0; queue < dev_info.nb_tx_queues; queue++)\n \t\tif (ports[portid].tx_set_md_cb[queue]) {\n \t\t\trte_eth_remove_tx_callback(portid, queue,\n@@ -221,3 +231,17 @@\n \t\t\tports[portid].tx_set_md_cb[queue] = NULL;\n \t\t}\n }\n+\n+int\n+eth_dev_info_get_print_err(uint16_t port_id,\n+\t\t\t\t\tstruct rte_eth_dev_info *dev_info)\n+{\n+\tint ret;\n+\n+\tret = rte_eth_dev_info_get(port_id, dev_info);\n+\tif (ret != 0)\n+\t\tprintf(\"Error during getting device (port %u) info: %s\\n\",\n+\t\t\t\tport_id, strerror(-ret));\n+\n+\treturn ret;\n+}\n",
    "prefixes": [
        "02/51"
    ]
}