get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81576,
    "url": "https://patches.dpdk.org/api/patches/81576/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201020100248.761693-2-conor.walsh@intel.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": "<20201020100248.761693-2-conor.walsh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201020100248.761693-2-conor.walsh@intel.com",
    "date": "2020-10-20T10:02:47",
    "name": "[v2,1/2] net/ixgbe: fix unchecked return value",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e5ea4bc26f0382530268c7e9e4e40cdfc79ba841",
    "submitter": {
        "id": 1935,
        "url": "https://patches.dpdk.org/api/people/1935/?format=api",
        "name": "Conor Walsh",
        "email": "conor.walsh@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201020100248.761693-2-conor.walsh@intel.com/mbox/",
    "series": [
        {
            "id": 13140,
            "url": "https://patches.dpdk.org/api/series/13140/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13140",
            "date": "2020-10-20T10:02:46",
            "name": "net/ixgbe fix unchecked return value and rte_panic",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/13140/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/81576/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/81576/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 21BC5A04DD;\n\tTue, 20 Oct 2020 12:03:25 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 16486C8F4;\n\tTue, 20 Oct 2020 12:03:08 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 144D1C31B;\n Tue, 20 Oct 2020 12:03:02 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Oct 2020 03:03:01 -0700",
            "from silpixa00400466.ir.intel.com ([10.237.213.98])\n by fmsmga004.fm.intel.com with ESMTP; 20 Oct 2020 03:02:59 -0700"
        ],
        "IronPort-SDR": [
            "\n 4+EBozHmh6BydMgwT/tEO5S6lR5snXAOc8JgTjiNUg4BxA81eSdsv+lnZjtwfFHR+XgWJUEXxM\n co9QSo4HLFDw==",
            "\n DHZ3IA/CaRO79TBDHM579ODVaLGx666pnrEXzg8fo1ltL3UG7sZ5cy3894FCExBqFS0inBPKu8\n 9wcUmEFfqYzg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9779\"; a=\"154127035\"",
            "E=Sophos;i=\"5.77,396,1596524400\"; d=\"scan'208\";a=\"154127035\"",
            "E=Sophos;i=\"5.77,396,1596524400\"; d=\"scan'208\";a=\"347806795\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Conor Walsh <conor.walsh@intel.com>",
        "To": "jia.guo@intel.com, haiyue.wang@intel.com, ferruh.yigit@intel.com,\n mohammad.abdul.awal@intel.com, declan.doherty@intel.com, stable@dpdk.org",
        "Cc": "dev@dpdk.org,\n\tConor Walsh <conor.walsh@intel.com>",
        "Date": "Tue, 20 Oct 2020 10:02:47 +0000",
        "Message-Id": "<20201020100248.761693-2-conor.walsh@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20201020100248.761693-1-conor.walsh@intel.com>",
        "References": "<20201019122620.749625-1-conor.walsh@intel.com>\n <20201020100248.761693-1-conor.walsh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] net/ixgbe: fix unchecked return value",
        "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 <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": "The return value of rte_eth_switch_domain_alloc() was not being checked\nwithin ixgbe_pf_host_init() which caused a coverity issue. If the call\nfails a warning is logged using PMD_INIT_LOG() and *vfinfo is free'd.\nixgbe_pf_host_init() now has a return value which is checked in\neth_ixgbe_dev_init()\n\nCoverity issue: 362795\nFixes: cf80ba6e2038 (\"net/ixgbe: add support for representor ports\")\n\nSigned-off-by: Conor Walsh <conor.walsh@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 11 +++++++++--\n drivers/net/ixgbe/ixgbe_ethdev.h |  2 +-\n drivers/net/ixgbe/ixgbe_pf.c     | 16 +++++++++++++---\n 3 files changed, 23 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 14a254ab74..f094c8d150 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -1077,7 +1077,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \t\tIXGBE_DEV_PRIVATE_TO_BW_CONF(eth_dev->data->dev_private);\n \tuint32_t ctrl_ext;\n \tuint16_t csum;\n-\tint diag, i;\n+\tint diag, i, ret;\n \n \tPMD_INIT_FUNC_TRACE();\n \n@@ -1256,7 +1256,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \tmemset(hwstrip, 0, sizeof(*hwstrip));\n \n \t/* initialize PF if max_vfs not zero */\n-\tixgbe_pf_host_init(eth_dev);\n+\tret = ixgbe_pf_host_init(eth_dev);\n+\tif (ret) {\n+\t\trte_free(eth_dev->data->mac_addrs);\n+\t\teth_dev->data->mac_addrs = NULL;\n+\t\trte_free(eth_dev->data->hash_mac_addrs);\n+\t\teth_dev->data->hash_mac_addrs = NULL;\n+\t\treturn ret;\n+\t}\n \n \tctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);\n \t/* let hardware know driver is loaded */\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h\nindex 9bdef87fbd..89fa472356 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.h\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.h\n@@ -717,7 +717,7 @@ void ixgbe_vlan_hw_filter_disable(struct rte_eth_dev *dev);\n \n void ixgbe_vlan_hw_strip_config(struct rte_eth_dev *dev);\n \n-void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev);\n+int ixgbe_pf_host_init(struct rte_eth_dev *eth_dev);\n \n void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev);\n \ndiff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c\nindex ed5f96b1a4..4e25b1e72e 100644\n--- a/drivers/net/ixgbe/ixgbe_pf.c\n+++ b/drivers/net/ixgbe/ixgbe_pf.c\n@@ -66,7 +66,7 @@ ixgbe_mb_intr_setup(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n-void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)\n+int ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct ixgbe_vf_info **vfinfo =\n \t\tIXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);\n@@ -78,19 +78,27 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)\n \t\tIXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n \tuint16_t vf_num;\n \tuint8_t nb_queue;\n+\tint ret = 0;\n \n \tPMD_INIT_FUNC_TRACE();\n \n \tRTE_ETH_DEV_SRIOV(eth_dev).active = 0;\n \tvf_num = dev_num_vf(eth_dev);\n \tif (vf_num == 0)\n-\t\treturn;\n+\t\treturn ret;\n \n \t*vfinfo = rte_zmalloc(\"vf_info\", sizeof(struct ixgbe_vf_info) * vf_num, 0);\n \tif (*vfinfo == NULL)\n \t\trte_panic(\"Cannot allocate memory for private VF data\\n\");\n \n-\trte_eth_switch_domain_alloc(&(*vfinfo)->switch_domain_id);\n+\tret = rte_eth_switch_domain_alloc(&(*vfinfo)->switch_domain_id);\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR,\n+\t\t\t\"failed to allocate switch domain for device %d\", ret);\n+\t\trte_free(*vfinfo);\n+\t\t*vfinfo = NULL;\n+\t\treturn ret;\n+\t}\n \n \tmemset(mirror_info, 0, sizeof(struct ixgbe_mirror_info));\n \tmemset(uta_info, 0, sizeof(struct ixgbe_uta_info));\n@@ -118,6 +126,8 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)\n \n \t/* set mb interrupt mask */\n \tixgbe_mb_intr_setup(eth_dev);\n+\n+\treturn ret;\n }\n \n void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}