get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91567,
    "url": "https://patches.dpdk.org/api/patches/91567/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1618484959-4360-1-git-send-email-humin29@huawei.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": "<1618484959-4360-1-git-send-email-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618484959-4360-1-git-send-email-humin29@huawei.com",
    "date": "2021-04-15T11:09:19",
    "name": "[v5] ethdev: add sanity checks in control APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "49389d42318031f169c98bd7afd7aee037bf2d71",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.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/1618484959-4360-1-git-send-email-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 16410,
            "url": "https://patches.dpdk.org/api/series/16410/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16410",
            "date": "2021-04-15T11:09:19",
            "name": "[v5] ethdev: add sanity checks in control APIs",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/16410/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91567/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/91567/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 38F6DA0C3F;\n\tThu, 15 Apr 2021 13:09:11 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1BE5E1621D2;\n\tThu, 15 Apr 2021 13:09:11 +0200 (CEST)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by mails.dpdk.org (Postfix) with ESMTP id 59AE61621D2\n for <dev@dpdk.org>; Thu, 15 Apr 2021 13:09:09 +0200 (CEST)",
            "from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FLc3r5f7Bz9yGs;\n Thu, 15 Apr 2021 19:06:48 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id\n 14.3.498.0; Thu, 15 Apr 2021 19:09:02 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <andrew.rybchenko@oktetlabs.ru>,\n <thomas@monjalon.net>",
        "Date": "Thu, 15 Apr 2021 19:09:19 +0800",
        "Message-ID": "<1618484959-4360-1-git-send-email-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1618046334-39857-1-git-send-email-humin29@huawei.com>",
        "References": "<1618046334-39857-1-git-send-email-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v5] ethdev: add sanity checks in control APIs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds more sanity checks in control path APIs.\n\nFixes: 214ed1acd125 (\"ethdev: add iterator to match devargs input\")\nFixes: 3d98f921fbe9 (\"ethdev: unify prefix for static functions and variables\")\nFixes: 0366137722a0 (\"ethdev: check for invalid device name\")\nFixes: d948f596fee2 (\"ethdev: fix port data mismatched in multiple process model\")\nFixes: 5b7ba31148a8 (\"ethdev: add port ownership\")\nFixes: f8244c6399d9 (\"ethdev: increase port id range\")\nCc: stable@dpdk.org\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\nReviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\nv5:\n* Keep \"RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV)\"\n  and \"dev = &rte_eth_devices[port_id]\" together.\n\nv4:\n* add error logging.\n* delete check in control path API.\n\nv3:\n* set port_id checked first.\n* add error logging.\n\nv2:\n* Removed unnecessary checks.\n* Deleted checks in internal API.\n* Added documentation in the header file.\n---\n lib/librte_ethdev/rte_ethdev.c | 313 ++++++++++++++++++++++++++++++++++++-----\n lib/librte_ethdev/rte_ethdev.h |  20 ++-\n 2 files changed, 293 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 3059aa5..95115a5 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -199,6 +199,16 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)\n \tchar *cls_str = NULL;\n \tint str_size;\n \n+\tif (iter == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to iterator init for NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (devargs_str == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to iterate matching NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \tmemset(iter, 0, sizeof(*iter));\n \n \t/*\n@@ -293,6 +303,11 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)\n uint16_t\n rte_eth_iterator_next(struct rte_dev_iterator *iter)\n {\n+\tif (iter == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to iterate next for NULL\\n\");\n+\t\treturn RTE_MAX_ETHPORTS;\n+\t}\n+\n \tif (iter->cls == NULL) /* invalid ethdev iterator */\n \t\treturn RTE_MAX_ETHPORTS;\n \n@@ -322,6 +337,11 @@ rte_eth_iterator_next(struct rte_dev_iterator *iter)\n void\n rte_eth_iterator_cleanup(struct rte_dev_iterator *iter)\n {\n+\tif (iter == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to iterator clear up for NULL\\n\");\n+\t\treturn;\n+\t}\n+\n \tif (iter->bus_str == NULL)\n \t\treturn; /* nothing to free in pure class filter */\n \tfree(RTE_CAST_FIELD(iter, bus_str, char *)); /* workaround const */\n@@ -622,6 +642,11 @@ rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id)\n int\n rte_eth_dev_owner_new(uint64_t *owner_id)\n {\n+\tif (owner_id == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get owner id by NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \teth_dev_shared_data_prepare();\n \n \trte_spinlock_lock(&eth_dev_shared_data->ownership_lock);\n@@ -645,6 +670,12 @@ eth_dev_owner_set(const uint16_t port_id, const uint64_t old_owner_id,\n \t\treturn -ENODEV;\n \t}\n \n+\tif (new_owner == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set ethdev port %u owner to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (!eth_is_valid_owner_id(new_owner->id) &&\n \t    !eth_is_valid_owner_id(old_owner_id)) {\n \t\tRTE_ETHDEV_LOG(ERR,\n@@ -738,23 +769,30 @@ rte_eth_dev_owner_delete(const uint64_t owner_id)\n int\n rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)\n {\n-\tint ret = 0;\n-\tstruct rte_eth_dev *ethdev = &rte_eth_devices[port_id];\n-\n-\teth_dev_shared_data_prepare();\n+\tstruct rte_eth_dev *ethdev;\n \n-\trte_spinlock_lock(&eth_dev_shared_data->ownership_lock);\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1);\n \n-\tif (port_id >= RTE_MAX_ETHPORTS || !eth_dev_is_allocated(ethdev)) {\n+\tethdev = &rte_eth_devices[port_id];\n+\tif (!eth_dev_is_allocated(ethdev)) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Port id %\"PRIu16\" is not allocated\\n\",\n \t\t\tport_id);\n-\t\tret = -ENODEV;\n-\t} else {\n-\t\trte_memcpy(owner, &ethdev->data->owner, sizeof(*owner));\n+\t\treturn -ENODEV;\n \t}\n \n+\tif (owner == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u owner by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\teth_dev_shared_data_prepare();\n+\n+\trte_spinlock_lock(&eth_dev_shared_data->ownership_lock);\n+\trte_memcpy(owner, &ethdev->data->owner, sizeof(*owner));\n \trte_spinlock_unlock(&eth_dev_shared_data->ownership_lock);\n-\treturn ret;\n+\n+\treturn 0;\n }\n \n int\n@@ -820,7 +858,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id)\n {\n \tuint16_t pid;\n \n-\tif (name == NULL) {\n+\tif (name == NULL || port_id == NULL) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Null pointer is specified\\n\");\n \t\treturn -EINVAL;\n \t}\n@@ -1298,9 +1336,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \tuint16_t old_mtu;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (dev_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to configure ethdev port %u to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);\n \n \tif (dev->data->dev_started) {\n@@ -2138,8 +2181,14 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id,\n \tint count;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to setup ethdev port %u Rx hairpin queue to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (rx_queue_id >= dev->data->nb_rx_queues) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Invalid RX queue_id=%u\\n\", rx_queue_id);\n \t\treturn -EINVAL;\n@@ -2311,6 +2360,13 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id,\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to setup ethdev port %u Tx hairpin queue to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (tx_queue_id >= dev->data->nb_tx_queues) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Invalid TX queue_id=%u\\n\", tx_queue_id);\n \t\treturn -EINVAL;\n@@ -2459,6 +2515,11 @@ int\n rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,\n \t\tbuffer_tx_error_fn cbfn, void *userdata)\n {\n+\tif (buffer == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set error callback for NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \tbuffer->error_callback = cbfn;\n \tbuffer->error_userdata = userdata;\n \treturn 0;\n@@ -2609,6 +2670,12 @@ rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (eth_link == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u link by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (dev->data->dev_conf.intr_conf.lsc &&\n \t    dev->data->dev_started)\n \t\trte_eth_linkstatus_get(dev, eth_link);\n@@ -2629,6 +2696,12 @@ rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (eth_link == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u nowait link by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (dev->data->dev_conf.intr_conf.lsc &&\n \t    dev->data->dev_started)\n \t\trte_eth_linkstatus_get(dev, eth_link);\n@@ -2667,6 +2740,16 @@ rte_eth_link_speed_to_str(uint32_t link_speed)\n int\n rte_eth_link_to_str(char *str, size_t len, const struct rte_eth_link *eth_link)\n {\n+\tif (str == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to convert link to NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (eth_link == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to convert NULL to string\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (eth_link->link_status == ETH_LINK_DOWN)\n \t\treturn snprintf(str, len, \"Link down\");\n \telse\n@@ -2684,8 +2767,14 @@ rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (stats == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u stats by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tmemset(stats, 0, sizeof(*stats));\n \n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);\n@@ -3260,6 +3349,12 @@ rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (fw_version == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u fw version by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fw_version_get, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev,\n \t\t\t\t\t\t\tfw_version, fw_size));\n@@ -3278,16 +3373,21 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)\n \t};\n \tint diag;\n \n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (dev_info == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u info by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/*\n \t * Init dev_info before port_id check since caller does not have\n \t * return status and does not know if get is successful or not.\n \t */\n \tmemset(dev_info, 0, sizeof(struct rte_eth_dev_info));\n \tdev_info->switch_info.domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID;\n-\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 \tdev_info->tx_desc_lim = lim;\n \tdev_info->device = dev->device;\n@@ -3327,6 +3427,13 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (ptypes == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u supported ptypes by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);\n \tall_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);\n \n@@ -3436,6 +3543,13 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (mac_addr == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u MAC address by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \trte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr);\n \n \treturn 0;\n@@ -3447,8 +3561,14 @@ rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (mtu == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u MTU by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \t*mtu = dev->data->mtu;\n \treturn 0;\n }\n@@ -3697,6 +3817,13 @@ rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf)\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (fc_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u flow conf by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->flow_ctrl_get, -ENOTSUP);\n \tmemset(fc_conf, 0, sizeof(*fc_conf));\n \treturn eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf));\n@@ -3708,12 +3835,19 @@ rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf)\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (fc_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set ethdev port %u flow conf to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif ((fc_conf->send_xon != 0) && (fc_conf->send_xon != 1)) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Invalid send_xon, only 0/1 allowed\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\tdev = &rte_eth_devices[port_id];\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->flow_ctrl_set, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf));\n }\n@@ -3725,12 +3859,19 @@ rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (pfc_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set ethdev port %u priority flow conf to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (pfc_conf->priority > (ETH_DCB_NUM_USER_PRIORITIES - 1)) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Invalid priority, only 0-7 allowed\\n\");\n \t\treturn -EINVAL;\n \t}\n \n-\tdev = &rte_eth_devices[port_id];\n \t/* High water, low water validation are device specific */\n \tif  (*dev->dev_ops->priority_flow_ctrl_set)\n \t\treturn eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set)\n@@ -3744,9 +3885,6 @@ eth_check_reta_mask(struct rte_eth_rss_reta_entry64 *reta_conf,\n {\n \tuint16_t i, num;\n \n-\tif (!reta_conf)\n-\t\treturn -EINVAL;\n-\n \tnum = (reta_size + RTE_RETA_GROUP_SIZE - 1) / RTE_RETA_GROUP_SIZE;\n \tfor (i = 0; i < num; i++) {\n \t\tif (reta_conf[i].mask)\n@@ -3763,9 +3901,6 @@ eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf,\n {\n \tuint16_t i, idx, shift;\n \n-\tif (!reta_conf)\n-\t\treturn -EINVAL;\n-\n \tif (max_rxq == 0) {\n \t\tRTE_ETHDEV_LOG(ERR, \"No receive queue is available\\n\");\n \t\treturn -EINVAL;\n@@ -3796,13 +3931,19 @@ rte_eth_dev_rss_reta_update(uint16_t port_id,\n \tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (reta_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to update ethdev port %u rss reta to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/* Check mask bits */\n \tret = eth_check_reta_mask(reta_conf, reta_size);\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tdev = &rte_eth_devices[port_id];\n-\n \t/* Check entry value */\n \tret = eth_check_reta_entry(reta_conf, reta_size,\n \t\t\t\tdev->data->nb_rx_queues);\n@@ -3823,13 +3964,19 @@ rte_eth_dev_rss_reta_query(uint16_t port_id,\n \tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (reta_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to query ethdev port %u rss reta by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n \n \t/* Check mask bits */\n \tret = eth_check_reta_mask(reta_conf, reta_size);\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tdev = &rte_eth_devices[port_id];\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->reta_query, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf,\n \t\t\t\t\t\t\t    reta_size));\n@@ -3844,14 +3991,19 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,\n \tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (rss_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to update ethdev port %u rss hash to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n \n \tret = rte_eth_dev_info_get(port_id, &dev_info);\n \tif (ret != 0)\n \t\treturn ret;\n \n \trss_conf->rss_hf = rte_eth_rss_hf_refine(rss_conf->rss_hf);\n-\n-\tdev = &rte_eth_devices[port_id];\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@@ -3873,6 +4025,13 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (rss_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u rss hash conf by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,\n \t\t\t\t\t\t\t\t   rss_conf));\n@@ -4028,6 +4187,13 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr,\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (addr == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to add ethdev port %u MAC address to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_add, -ENOTSUP);\n \n \tif (rte_is_zero_ether_addr(addr)) {\n@@ -4078,6 +4244,13 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr)\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (addr == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to remove ethdev port %u MAC address by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_remove, -ENOTSUP);\n \n \tindex = eth_dev_get_mac_addr_index(port_id, addr);\n@@ -4108,11 +4281,17 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr)\n \tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (addr == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set ethdev port %u default MAC address to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n \n \tif (!rte_is_valid_assigned_ether_addr(addr))\n \t\treturn -EINVAL;\n \n-\tdev = &rte_eth_devices[port_id];\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_set, -ENOTSUP);\n \n \tret = (*dev->dev_ops->mac_addr_set)(dev, addr);\n@@ -4163,8 +4342,14 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (addr == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set ethdev port %u uc hash table to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (rte_is_zero_ether_addr(addr)) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Port %u: Cannot add NULL MAC address\\n\",\n \t\t\tport_id);\n@@ -4265,6 +4450,14 @@ rte_eth_mirror_rule_set(uint16_t port_id,\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (mirror_conf == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to set ethdev port %u mirror rule to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (mirror_conf->rule_type == 0) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Mirror rule type can not be 0\\n\");\n \t\treturn -EINVAL;\n@@ -4291,7 +4484,6 @@ rte_eth_mirror_rule_set(uint16_t port_id,\n \t\treturn -EINVAL;\n \t}\n \n-\tdev = &rte_eth_devices[port_id];\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mirror_rule_set, -ENOTSUP);\n \n \treturn eth_err(port_id, (*dev->dev_ops->mirror_rule_set)(dev,\n@@ -5210,6 +5402,12 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp,\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (timestamp == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to read ethdev port %u Rx timestamp by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_read_rx_timestamp, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp)\n \t\t\t\t(dev, timestamp, flags));\n@@ -5224,6 +5422,12 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id,\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (timestamp == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to read ethdev port %u Tx timestamp by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_read_tx_timestamp, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp)\n \t\t\t\t(dev, timestamp));\n@@ -5250,6 +5454,12 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (timestamp == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to read ethdev port %u time by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_read_time, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev,\n \t\t\t\t\t\t\t\ttimestamp));\n@@ -5263,6 +5473,12 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (timestamp == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to write ethdev port %u time to NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_write_time, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev,\n \t\t\t\t\t\t\t\ttimestamp));\n@@ -5276,6 +5492,12 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tif (clock == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to read ethdev port %u clock by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->read_clock, -ENOTSUP);\n \treturn eth_err(port_id, (*dev->dev_ops->read_clock)(dev, clock));\n }\n@@ -5361,8 +5583,14 @@ rte_eth_dev_get_dcb_info(uint16_t port_id,\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (dcb_info == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u dcb info by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tmemset(dcb_info, 0, sizeof(struct rte_eth_dcb_info));\n \n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_dcb_info, -ENOTSUP);\n@@ -5412,8 +5640,14 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id,\n \tstruct rte_eth_dev *dev;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n-\n \tdev = &rte_eth_devices[port_id];\n+\n+\tif (cap == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get ethdev port %u hairpin capability by NULL\\n\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->hairpin_cap_get, -ENOTSUP);\n \tmemset(cap, 0, sizeof(*cap));\n \treturn eth_err(port_id, (*dev->dev_ops->hairpin_cap_get)(dev, cap));\n@@ -5619,6 +5853,11 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,\n \tstruct rte_eth_representor_info *info = NULL;\n \tsize_t size;\n \n+\tif (ethdev == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Failed to get device representor info from NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (type == RTE_ETH_REPRESENTOR_NONE)\n \t\treturn 0;\n \tif (repr_id == NULL)\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 6c7c728..29f69ed 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -2702,6 +2702,7 @@ int rte_eth_allmulticast_get(uint16_t port_id);\n  *   - (0) if successful.\n  *   - (-ENOTSUP) if the function is not supported in PMD driver.\n  *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link);\n \n@@ -2717,6 +2718,7 @@ int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link);\n  *   - (0) if successful.\n  *   - (-ENOTSUP) if the function is not supported in PMD driver.\n  *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link);\n \n@@ -2752,7 +2754,7 @@ const char *rte_eth_link_speed_to_str(uint32_t link_speed);\n  * @param eth_link\n  *   Link status returned by rte_eth_link_get function\n  * @return\n- *   Number of bytes written to str array.\n+ *   Number of bytes written to str array or -EINVAL if bad parameter.\n  */\n __rte_experimental\n int rte_eth_link_to_str(char *str, size_t len,\n@@ -2997,6 +2999,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,\n  * @return\n  *   - (0) if successful\n  *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);\n \n@@ -3041,6 +3044,7 @@ int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);\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+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);\n \n@@ -3060,6 +3064,7 @@ int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);\n  *   - (-ENOTSUP) if operation is not supported.\n  *   - (-ENODEV) if *port_id* invalid.\n  *   - (-EIO) if device is removed.\n+ *   - (-EINVAL) if bad parameter.\n  *   - (>0) if *fw_size* is not enough to store firmware version, return\n  *          the size of the non truncated string.\n  */\n@@ -3103,6 +3108,7 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,\n  *           only num entries will be filled into the ptypes array, but the full\n  *           count of supported ptypes will be returned.\n  *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,\n \t\t\t\t     uint32_t *ptypes, int num);\n@@ -3153,6 +3159,7 @@ int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,\n  * @return\n  *   - (0) if successful.\n  *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu);\n \n@@ -3347,7 +3354,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);\n  * @param userdata\n  *   Arbitrary parameter to be passed to the callback function\n  * @return\n- *   0 on success, or -1 on error with rte_errno set appropriately\n+ *   0 on success, or -EINVAL if bad parameter\n  */\n int\n rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,\n@@ -3774,6 +3781,7 @@ int rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa);\n  *   - (-ENOTSUP) if hardware doesn't support flow control.\n  *   - (-ENODEV)  if *port_id* invalid.\n  *   - (-EIO)  if device is removed.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_dev_flow_ctrl_get(uint16_t port_id,\n \t\t\t      struct rte_eth_fc_conf *fc_conf);\n@@ -3845,7 +3853,8 @@ int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr,\n  *   - (0) if successful, or *mac_addr* didn't exist.\n  *   - (-ENOTSUP) if hardware doesn't support.\n  *   - (-ENODEV) if *port* invalid.\n- *   - (-EADDRINUSE) if attempting to remove the default MAC address\n+ *   - (-EADDRINUSE) if attempting to remove the default MAC address.\n+ *   - (-EINVAL) if MAC address is invalid.\n  */\n int rte_eth_dev_mac_addr_remove(uint16_t port_id,\n \t\t\t\tstruct rte_ether_addr *mac_addr);\n@@ -4044,6 +4053,7 @@ int rte_eth_dev_rss_hash_update(uint16_t port_id,\n  *   - (-ENODEV) if port identifier is invalid.\n  *   - (-EIO) if device is removed.\n  *   - (-ENOTSUP) if hardware doesn't support RSS.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int\n rte_eth_dev_rss_hash_conf_get(uint16_t port_id,\n@@ -4112,6 +4122,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,\n  *   - (-ENODEV) if port identifier is invalid.\n  *   - (-EIO) if device is removed.\n  *   - (-ENOTSUP) if hardware doesn't support.\n+ *   - (-EINVAL) if bad parameter.\n  */\n int rte_eth_dev_get_dcb_info(uint16_t port_id,\n \t\t\t     struct rte_eth_dcb_info *dcb_info);\n@@ -4623,6 +4634,7 @@ int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);\n  *\n  * @return\n  *   - 0: Success.\n+ *   - -EINVAL: Bad parameter.\n  */\n int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);\n \n@@ -4689,6 +4701,7 @@ int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);\n  *   - 0: Success.\n  *   - -ENODEV: The port ID is invalid.\n  *   - -ENOTSUP: The function is not supported by the Ethernet driver.\n+ *   - -EINVAL: if bad parameter.\n  */\n __rte_experimental\n int\n@@ -4792,6 +4805,7 @@ rte_eth_dev_get_sec_ctx(uint16_t port_id);\n  * @return\n  *   - (0) if successful.\n  *   - (-ENOTSUP) if hardware doesn't support.\n+ *   - (-EINVAL) if bad parameter.\n  */\n __rte_experimental\n int rte_eth_dev_hairpin_capability_get(uint16_t port_id,\n",
    "prefixes": [
        "v5"
    ]
}