get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 58060,
    "url": "http://patches.dpdk.org/api/patches/58060/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1566915962-5472-2-git-send-email-arybchenko@solarflare.com/",
    "project": {
        "id": 1,
        "url": "http://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-2-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1566915962-5472-2-git-send-email-arybchenko@solarflare.com",
    "date": "2019-08-27T14:25:12",
    "name": "[01/51] ethdev: change rte_eth_dev_info_get() return value to int",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a42c22689cb5e3b61767344378eba91fadd33224",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1566915962-5472-2-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 6138,
            "url": "http://patches.dpdk.org/api/series/6138/?format=api",
            "web_url": "http://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": "http://patches.dpdk.org/series/6138/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/58060/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/58060/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 D35681C230;\n\tTue, 27 Aug 2019 16:27:16 +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 7F0301C1B8\n\tfor <dev@dpdk.org>; Tue, 27 Aug 2019 16:26:38 +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-us4.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n\t42EE0140073; Tue, 27 Aug 2019 14:26:37 +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:18 -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:18 -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\tx7REQB9Y004163; Tue, 27 Aug 2019 15:26:11 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\t980541613D1; Tue, 27 Aug 2019 15:26:11 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "Neil Horman <nhorman@tuxdriver.com>, John McNamara\n\t<john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,\n\tThomas Monjalon <thomas@monjalon.net>,\n\tFerruh Yigit <ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>",
        "Date": "Tue, 27 Aug 2019 15:25:12 +0100",
        "Message-ID": "<1566915962-5472-2-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-3.573500-4.000000-10",
        "X-TMASE-MatchedRID": "x0QdpfGzjkYjdXbalIVNEomfV7NNMGm+p56t1EEQ41ps98Z8fG/6kX1p\n\ta9OL1UpKopQtjaUqZfsokSiKFlVT4FWv6mJ+J+GWnMQdNQ64xfcLKPaBHScRdT2mEJylgvfBcij\n\tMZrr2iZ2t2gtuWr1LmmiZWLI3MgipUAcCqG4Nmd4cLuEDP+gqcnvEgoSBmr8Bx6C6dcifNxialh\n\thVUOxDMBPaizmx3ifJXXdVbuABHZTHeXPIIEkWlu7KTDtx8CggqV3VmuIFNEtgDDNFig+GrOKGs\n\tm45M0E6tpwv8KkEGaO7oI/ypOeHzs/UyTuK35/3R/j040fRFpL3/H7adAffkh1rVWTdGrE4purQ\n\tOvjX+YQ08+Wg+T/5wDUjxWEQ/fv7/j8823m5HARZMZ6MZ0H1UgRryDXHx6oXR2YNIFh+clHgj+2\n\tBh6fb5RbKd91Tgz1a45Fz6YkDvMkR3RjJbq0tud+G9ND+fWcZojQrbrPpzzqnk8VVpU1FNqOIrK\n\tL+ynQk30N/9/mBFICABhmXQhuiGB8TzIzimOwPC24oEZ6SpSmb4wHqRpnaDiMFGDWJ4Z6un0N14\n\tPNVQ9yEafu3MwtaFPM5f6QRizExMH/L6UsWs782+hbcPshLM0c6dgn76bajyQnEFPJIW427oLEo\n\tGb7nBeQDw6tgd3AMZ9iVj/KhX/RSnoQc5vb5zuQdkM7ndBLCN+XOQZygrvY=",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--3.573500-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24872.005",
        "X-MDID": "1566915998-CtYHF5_7WhlJ",
        "Subject": "[dpdk-dev] [PATCH 01/51] ethdev: change rte_eth_dev_info_get()\n\treturn value to int",
        "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\nChange rte_eth_dev_info_get() return value from void to int and return\nnegative errno values in case of error conditions.\nModify rte_eth_dev_info_get() usage across the ethdev according\nto new return type.\n\nSigned-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n doc/guides/rel_notes/deprecation.rst   |  1 -\n doc/guides/rel_notes/release_19_11.rst |  5 ++-\n lib/librte_ethdev/rte_ethdev.c         | 71 ++++++++++++++++++++++++----------\n lib/librte_ethdev/rte_ethdev.h         |  6 ++-\n 4 files changed, 60 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex 0ee8533..cbb4c34 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -88,7 +88,6 @@ Deprecation Notices\n   negative errno values to indicate various error conditions (e.g.\n   invalid port ID, unsupported operation, failed operation):\n \n-  - ``rte_eth_dev_info_get``\n   - ``rte_eth_promiscuous_enable`` and ``rte_eth_promiscuous_disable``\n   - ``rte_eth_allmulticast_enable`` and ``rte_eth_allmulticast_disable``\n   - ``rte_eth_link_get`` and ``rte_eth_link_get_nowait``\ndiff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst\nindex 8490d89..5424b6a 100644\n--- a/doc/guides/rel_notes/release_19_11.rst\n+++ b/doc/guides/rel_notes/release_19_11.rst\n@@ -85,6 +85,9 @@ API Changes\n    Also, make sure to start the actual text at the margin.\n    =========================================================\n \n+* ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to\n+  ``int`` to provide a way to report various error conditions.\n+\n \n ABI Changes\n -----------\n@@ -136,7 +139,7 @@ The libraries prepended with a plus sign were incremented in this version.\n      librte_distributor.so.1\n      librte_eal.so.11\n      librte_efd.so.1\n-     librte_ethdev.so.12\n+   + librte_ethdev.so.13\n      librte_eventdev.so.7\n      librte_flow_classify.so.1\n      librte_gro.so.1\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 17d183e..4b6cbe2 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -1125,7 +1125,6 @@ struct rte_eth_dev *\n \n \tdev = &rte_eth_devices[port_id];\n \n-\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);\n \n \tif (dev->data->dev_started) {\n@@ -1144,7 +1143,9 @@ struct rte_eth_dev *\n \t */\n \tmemcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n \t/* If number of queues specified by application for both Rx and Tx is\n \t * zero, use driver preferred values. This cannot be done individually\n@@ -1406,6 +1407,7 @@ struct rte_eth_dev *\n \tstruct rte_eth_dev *dev;\n \tstruct rte_eth_dev_info dev_info;\n \tint diag;\n+\tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);\n \n@@ -1420,7 +1422,9 @@ struct rte_eth_dev *\n \t\treturn 0;\n \t}\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n \t/* Lets restore MAC now if device does not support live change */\n \tif (*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)\n@@ -1584,7 +1588,6 @@ struct rte_eth_dev *\n \t\treturn -EINVAL;\n \t}\n \n-\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_setup, -ENOTSUP);\n \n \t/*\n@@ -1592,7 +1595,10 @@ struct rte_eth_dev *\n \t * This value must be provided in the private data of the memory pool.\n \t * First check that the memory pool has a valid private data.\n \t */\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (mp->private_data_size < sizeof(struct rte_pktmbuf_pool_private)) {\n \t\tRTE_ETHDEV_LOG(ERR, \"%s private_data_size %d < %d\\n\",\n \t\t\tmp->name, (int)mp->private_data_size,\n@@ -1703,6 +1709,7 @@ struct rte_eth_dev *\n \tstruct rte_eth_dev_info dev_info;\n \tstruct rte_eth_txconf local_conf;\n \tvoid **txq;\n+\tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);\n \n@@ -1712,10 +1719,11 @@ struct rte_eth_dev *\n \t\treturn -EINVAL;\n \t}\n \n-\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_queue_setup, -ENOTSUP);\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n \t/* Use default specified by driver, if nb_tx_desc is zero */\n \tif (nb_tx_desc == 0) {\n@@ -2540,7 +2548,7 @@ struct rte_eth_dev *\n \t\t\t\t\t\t\tfw_version, fw_size));\n }\n \n-void\n+int\n rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)\n {\n \tstruct rte_eth_dev *dev;\n@@ -2558,7 +2566,7 @@ struct rte_eth_dev *\n \t */\n \tmemset(dev_info, 0, sizeof(struct rte_eth_dev_info));\n \n-\tRTE_ETH_VALID_PORTID_OR_RET(port_id);\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n \tdev_info->rx_desc_lim = lim;\n@@ -2567,13 +2575,15 @@ struct rte_eth_dev *\n \tdev_info->min_mtu = RTE_ETHER_MIN_MTU;\n \tdev_info->max_mtu = UINT16_MAX;\n \n-\tRTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);\n \t(*dev->dev_ops->dev_infos_get)(dev, dev_info);\n \tdev_info->driver_name = dev->device->driver->name;\n \tdev_info->nb_rx_queues = dev->data->nb_rx_queues;\n \tdev_info->nb_tx_queues = dev->data->nb_tx_queues;\n \n \tdev_info->dev_flags = &dev->data->dev_flags;\n+\n+\treturn 0;\n }\n \n int\n@@ -2643,7 +2653,10 @@ struct rte_eth_dev *\n \t * which relies on dev->dev_ops->dev_infos_get.\n \t */\n \tif (*dev->dev_ops->dev_infos_get != NULL) {\n-\t\trte_eth_dev_info_get(port_id, &dev_info);\n+\t\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\n \t\tif (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu)\n \t\t\treturn -EINVAL;\n \t}\n@@ -2991,10 +3004,15 @@ struct rte_eth_dev *\n {\n \tstruct rte_eth_dev *dev;\n \tstruct rte_eth_dev_info dev_info = { .flow_type_rss_offloads = 0, };\n+\tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tdev = &rte_eth_devices[port_id];\n-\trte_eth_dev_info_get(port_id, &dev_info);\n \tif ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) !=\n \t    dev_info.flow_type_rss_offloads) {\n \t\tRTE_ETHDEV_LOG(ERR,\n@@ -3100,9 +3118,13 @@ struct rte_eth_dev *\n \tstruct rte_eth_dev_info dev_info;\n \tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n \tunsigned i;\n+\tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n \tfor (i = 0; i < dev_info.max_mac_addrs; i++)\n \t\tif (memcmp(addr, &dev->data->mac_addrs[i],\n@@ -3233,8 +3255,14 @@ struct rte_eth_dev *\n \tstruct rte_eth_dev_info dev_info;\n \tstruct rte_eth_dev *dev = &rte_eth_devices[port_id];\n \tunsigned i;\n+\tint ret;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n-\trte_eth_dev_info_get(port_id, &dev_info);\n \tif (!dev->data->hash_mac_addrs)\n \t\treturn -1;\n \n@@ -3319,11 +3347,15 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,\n \tstruct rte_eth_dev *dev;\n \tstruct rte_eth_dev_info dev_info;\n \tstruct rte_eth_link link;\n+\tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tdev = &rte_eth_devices[port_id];\n-\trte_eth_dev_info_get(port_id, &dev_info);\n \tlink = dev->data->dev_link;\n \n \tif (queue_idx > dev_info.max_tx_queues) {\n@@ -4363,15 +4395,14 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,\n \t\t\t\t uint16_t *nb_rx_desc,\n \t\t\t\t uint16_t *nb_tx_desc)\n {\n-\tstruct rte_eth_dev *dev;\n \tstruct rte_eth_dev_info dev_info;\n+\tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \n-\tdev = &rte_eth_devices[port_id];\n-\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);\n-\n-\trte_eth_dev_info_get(port_id, &dev_info);\n+\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n \n \tif (nb_rx_desc != NULL)\n \t\trte_eth_dev_adjust_nb_desc(nb_rx_desc, &dev_info.rx_desc_lim);\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex dc6596b..09c278d 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -2366,8 +2366,12 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,\n  * @param dev_info\n  *   A pointer to a structure of type *rte_eth_dev_info* to be filled with\n  *   the contextual information of the Ethernet device.\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENOTSUP) if support for dev_infos_get() does not exist for the device.\n+ *   - (-ENODEV) if *port_id* invalid.\n  */\n-void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);\n+int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);\n \n /**\n  * Retrieve the firmware version of a device.\n",
    "prefixes": [
        "01/51"
    ]
}