get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 26232,
    "url": "http://patches.dpdk.org/api/patches/26232/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1499063851-10209-1-git-send-email-jianfeng.tan@intel.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": "<1499063851-10209-1-git-send-email-jianfeng.tan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1499063851-10209-1-git-send-email-jianfeng.tan@intel.com",
    "date": "2017-07-03T06:37:31",
    "name": "[dpdk-dev,v2] eal: fix secondary process segfault on multipe virtio devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f3100d57f7cf1566a7e8d8c31463d31437f237b6",
    "submitter": {
        "id": 313,
        "url": "http://patches.dpdk.org/api/people/313/?format=api",
        "name": "Jianfeng Tan",
        "email": "jianfeng.tan@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1499063851-10209-1-git-send-email-jianfeng.tan@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/26232/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/26232/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 41BA3374F;\n\tMon,  3 Jul 2017 08:36:41 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 083372E83;\n\tMon,  3 Jul 2017 08:36:38 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Jul 2017 23:36:36 -0700",
            "from dpdk06.sh.intel.com ([10.67.111.82])\n\tby fmsmga006.fm.intel.com with ESMTP; 02 Jul 2017 23:36:34 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.40,301,1496127600\"; d=\"scan'208\";a=\"122121417\"",
        "From": "Jianfeng Tan <jianfeng.tan@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, yuanhan.liu@linux.intel.com,\n\tmaxime.coquelin@redhat.com, Jianfeng Tan <jianfeng.tan@intel.com>,\n\tstable@dpdk.org",
        "Date": "Mon,  3 Jul 2017 06:37:31 +0000",
        "Message-Id": "<1499063851-10209-1-git-send-email-jianfeng.tan@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1496420451-104928-1-git-send-email-jianfeng.tan@intel.com>",
        "References": "<1496420451-104928-1-git-send-email-jianfeng.tan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] eal: fix secondary process segfault on\n\tmultipe virtio devices",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Suppose we have 2 virtio devices for a VM, with only the first one,\nvirtio0, binding to igb_uio. Start a primary DPDK process, driving\nonly virtio0. Then start a secondary DPDK process, it encounters\nsegfault at eth_virtio_dev_init() because hw is NULL, when trying\nto initialize the 2nd virtio devices.\n    1539                    if (!hw->virtio_user_dev) {\n\nWe could add a precheck to return error when hw is NULL. But the\nroot cause is that virtio devices which are not driven by the primary\nprocess are not exluded by secondary eal probe function.\n\nTo support legacy virtio devices bound to none kernel driver, we\nremoved RTE_PCI_DRV_NEED_MAPPING in\ncommit 962cf902e6eb (\"pci: export device mapping functions\").\nAt the boot of primary process, ether dev is allocated in rte_eth_devices\narray, rte_eth_dev_data is also allocated in rte_eth_dev_data array; then\nprobe function fails; and ether dev is released. However, the entry in\nrte_eth_dev_data array is not cleared. Then we start secondary process,\nand try to attach the virtio device that not used in primary process,\nthe field, dev_private (or hw), in rte_eth_dev_data, is NULL.\n\nTo fail the dev attach, we need to clear the field, name, when we\nrelease any ether devices in primary, so that below loop in\nrte_eth_dev_attach_secondary() will not find any matched names.\n        for (i = 0; i < RTE_MAX_ETHPORTS; i++) {\n                if (strcmp(rte_eth_dev_data[i].name, name) == 0)\n                        break;\n        }\n\nFixes: 6d890f8ab512 (\"Fixes: net/virtio: fix multiple process support\")\nCc: stable@dpdk.org\n\nReported-by: Reshma Pattan <reshma.pattan@intel.com>\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\nv2:\n  - Assign '\\0' to first char of name instead of memset as per Thomas's advice.\n lib/librte_ether/rte_ethdev_pci.h | 6 ++++++\n 1 file changed, 6 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h\nindex 69aab03..0e7d7a9 100644\n--- a/lib/librte_ether/rte_ethdev_pci.h\n+++ b/lib/librte_ether/rte_ethdev_pci.h\n@@ -133,6 +133,12 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)\n \n \teth_dev->data->dev_private = NULL;\n \n+\t/* Secondary process will use the field, name, for secondary\n+\t * attach, clear this field to avoid attaching any released\n+\t * ports in secondary processes.\n+\t */\n+\teth_dev->data->name[0] = '\\0';\n+\n \teth_dev->device = NULL;\n \teth_dev->intr_handle = NULL;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}