get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 68804,
    "url": "https://patches.dpdk.org/api/patches/68804/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/c8083affcd01a48ac31a46368c41b88f82ca7029.1587137703.git.grive@u256.net/",
    "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": "<c8083affcd01a48ac31a46368c41b88f82ca7029.1587137703.git.grive@u256.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/c8083affcd01a48ac31a46368c41b88f82ca7029.1587137703.git.grive@u256.net",
    "date": "2020-04-17T16:42:07",
    "name": "[v1,2/2] bonding: fix PCI address comparison on non-pci ports",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ea7a83ec2cd82c180d06d599d62082410f43ff89",
    "submitter": {
        "id": 1560,
        "url": "https://patches.dpdk.org/api/people/1560/?format=api",
        "name": "Gaëtan Rivet",
        "email": "grive@u256.net"
    },
    "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/c8083affcd01a48ac31a46368c41b88f82ca7029.1587137703.git.grive@u256.net/mbox/",
    "series": [
        {
            "id": 9478,
            "url": "https://patches.dpdk.org/api/series/9478/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9478",
            "date": "2020-04-17T16:42:05",
            "name": "bonding: fix port id check and PCI addr cmp",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/9478/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/68804/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/68804/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 C30A5A0597;\n\tFri, 17 Apr 2020 18:42:38 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 916C01EAAD;\n\tFri, 17 Apr 2020 18:42:27 +0200 (CEST)",
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n [217.70.183.201]) by dpdk.org (Postfix) with ESMTP id 7AD291EA91;\n Fri, 17 Apr 2020 18:42:25 +0200 (CEST)",
            "from inocybe.home (lfbn-idf2-1-566-132.w86-246.abo.wanadoo.fr\n [86.246.31.132]) (Authenticated sender: grive@u256.net)\n by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 51BF01BF209;\n Fri, 17 Apr 2020 16:42:24 +0000 (UTC)"
        ],
        "X-Originating-IP": "86.246.31.132",
        "From": "Gaetan Rivet <grive@u256.net>",
        "To": "dev@dpdk.org",
        "Cc": "stable@dpdk.org, Chas Williams <chas3@att.com>,\n Declan Doherty <declan.doherty@intel.com>,\n Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>",
        "Date": "Fri, 17 Apr 2020 18:42:07 +0200",
        "Message-Id": "\n <c8083affcd01a48ac31a46368c41b88f82ca7029.1587137703.git.grive@u256.net>",
        "X-Mailer": "git-send-email 2.26.0",
        "In-Reply-To": "<cover.1587137703.git.grive@u256.net>",
        "References": "<cover.1587137703.git.grive@u256.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v1 2/2] bonding: fix PCI address comparison on\n\tnon-pci ports",
        "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 bonding PMD will iterate over all available ETH ports and for each,\ncompare a chunk of bytes at an offset that would correspond to the PCI\naddress in an rte_pci_device.\n\nThis is incorrect and unsafe. Also, the rte_device using this PCI\naddress is already found, no need to compare again the PCI address of\nall eth devices.\n\nRefactoring the code to fix this, the initial check to find the PCI bus\nis out of scope.\n\nFixes: c848b518bbc7 (\"net/bonding: support bifurcated driver in eal\")\nCc: stable@dpdk.org\n\nCc: Chas Williams <chas3@att.com>\nCc: Declan Doherty <declan.doherty@intel.com>\nCc: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>\n\nSigned-off-by: Gaetan Rivet <grive@u256.net>\n---\n drivers/net/bonding/rte_eth_bond_args.c | 58 +++++++++++--------------\n 1 file changed, 25 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c\nindex 35616fb8b..8c5f90dc6 100644\n--- a/drivers/net/bonding/rte_eth_bond_args.c\n+++ b/drivers/net/bonding/rte_eth_bond_args.c\n@@ -22,23 +22,37 @@ const char *pmd_bond_init_valid_arguments[] = {\n \tNULL\n };\n \n+static inline int\n+bond_pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr)\n+{\n+\tconst struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev);\n+\tconst struct rte_pci_addr *paddr = _pci_addr;\n+\n+\treturn rte_pci_addr_cmp(&pdev->addr, paddr);\n+}\n+\n static inline int\n find_port_id_by_pci_addr(const struct rte_pci_addr *pci_addr)\n {\n-\tstruct rte_pci_device *pci_dev;\n-\tstruct rte_pci_addr *eth_pci_addr;\n+\tstruct rte_bus *pci_bus;\n+\tstruct rte_device *dev;\n \tunsigned i;\n \n-\tRTE_ETH_FOREACH_DEV(i) {\n-\t\tpci_dev = RTE_ETH_DEV_TO_PCI(&rte_eth_devices[i]);\n-\t\teth_pci_addr = &pci_dev->addr;\n+\tpci_bus = rte_bus_find_by_name(\"pci\");\n+\tif (pci_bus == NULL) {\n+\t\tRTE_BOND_LOG(ERR, \"No PCI bus found\");\n+\t\treturn -1;\n+\t}\n \n-\t\tif (pci_addr->bus == eth_pci_addr->bus &&\n-\t\t\tpci_addr->devid == eth_pci_addr->devid &&\n-\t\t\tpci_addr->domain == eth_pci_addr->domain &&\n-\t\t\tpci_addr->function == eth_pci_addr->function)\n-\t\t\treturn i;\n+\tdev = pci_bus->find_device(NULL, bond_pci_addr_cmp, pci_addr);\n+\tif (dev == NULL) {\n+\t\tRTE_BOND_LOG(ERR, \"unable to find PCI device\");\n+\t\treturn -1;\n \t}\n+\n+\tRTE_ETH_FOREACH_DEV(i)\n+\t\tif (rte_eth_devices[i].device == dev)\n+\t\t\treturn i;\n \treturn -1;\n }\n \n@@ -57,15 +71,6 @@ find_port_id_by_dev_name(const char *name)\n \treturn -1;\n }\n \n-static inline int\n-bond_pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr)\n-{\n-\tconst struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev);\n-\tconst struct rte_pci_addr *paddr = _pci_addr;\n-\n-\treturn rte_pci_addr_cmp(&pdev->addr, paddr);\n-}\n-\n /**\n  * Parses a port identifier string to a port id by pci address, then by name,\n  * and finally port id.\n@@ -74,23 +79,10 @@ static inline int\n parse_port_id(const char *port_str)\n {\n \tstruct rte_pci_addr dev_addr;\n-\tstruct rte_bus *pci_bus;\n-\tstruct rte_device *dev;\n \tint port_id;\n \n-\tpci_bus = rte_bus_find_by_name(\"pci\");\n-\tif (pci_bus == NULL) {\n-\t\tRTE_BOND_LOG(ERR, \"unable to find PCI bus\\n\");\n-\t\treturn -1;\n-\t}\n-\n \t/* try parsing as pci address, physical devices */\n-\tif (pci_bus->parse(port_str, &dev_addr) == 0) {\n-\t\tdev = pci_bus->find_device(NULL, bond_pci_addr_cmp, &dev_addr);\n-\t\tif (dev == NULL) {\n-\t\t\tRTE_BOND_LOG(ERR, \"unable to find PCI device\");\n-\t\t\treturn -1;\n-\t\t}\n+\tif (rte_pci_addr_parse(port_str, &dev_addr) == 0) {\n \t\tport_id = find_port_id_by_pci_addr(&dev_addr);\n \t\tif (port_id < 0)\n \t\t\treturn -1;\n",
    "prefixes": [
        "v1",
        "2/2"
    ]
}