get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 23312,
    "url": "http://patches.dpdk.org/api/patches/23312/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1491551860-15005-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": "<1491551860-15005-1-git-send-email-jianfeng.tan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1491551860-15005-1-git-send-email-jianfeng.tan@intel.com",
    "date": "2017-04-07T07:57:40",
    "name": "[dpdk-dev] net/virtio-user: fix cannot get initialized",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fcabb31ff44439b563691502baba78c978cb26f5",
    "submitter": {
        "id": 313,
        "url": "http://patches.dpdk.org/api/people/313/?format=api",
        "name": "Jianfeng Tan",
        "email": "jianfeng.tan@intel.com"
    },
    "delegate": {
        "id": 355,
        "url": "http://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1491551860-15005-1-git-send-email-jianfeng.tan@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/23312/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/23312/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 36752376F;\n\tFri,  7 Apr 2017 09:56:57 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 7F6922FDD\n\tfor <dev@dpdk.org>; Fri,  7 Apr 2017 09:56:55 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Apr 2017 00:56:54 -0700",
            "from dpdk06.sh.intel.com ([10.239.129.195])\n\tby fmsmga005.fm.intel.com with ESMTP; 07 Apr 2017 00:56:53 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1491551815; x=1523087815;\n\th=from:to:cc:subject:date:message-id;\n\tbh=/A9yAM5wrt3g1hJQVeQAnl54cVT3gSs3ihhjJt/Hksw=;\n\tb=Zy3BB2xP+GeLqw80jQuAsFpem+/iCZBru+O44Nuq4EdrIfGwEOHcCpak\n\tlH5HNPUBqFT/+6lqm5CxRBwUWhVsrA==;",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.37,164,1488873600\"; d=\"scan'208\";a=\"85824826\"",
        "From": "Jianfeng Tan <jianfeng.tan@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Jianfeng Tan <jianfeng.tan@intel.com>,\n\tMaxime Coquelin <maxime.coquelin@redhat.com>,\n\tYuanhan Liu <yuanhan.liu@linux.intel.com>",
        "Date": "Fri,  7 Apr 2017 07:57:40 +0000",
        "Message-Id": "<1491551860-15005-1-git-send-email-jianfeng.tan@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "Subject": "[dpdk-dev] [PATCH] net/virtio-user: fix cannot get initialized",
        "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": "After the introduction of vhost MTU, VIRTIO_NET_F_MTU is enabled\nby default. However, virtio-user vtpci does not support to get\nMTU from device yet, i.e., vtpci_read_dev_config(MTU) fails.\nPlus, struct virtio_net_config is defined as a uninitialized\nvariable, and could be different values in\nvirtio_negotiate_features() and virtio_init_device().\n\nIn some cases, it passes the check in virtio_negotiate_features()\nbut fails the check in virtio_init_device(). As a result,\nvirtio-user canno be initialized.\n\nTo fix it, (1) accessing uninitialized variable is not a good\npractice, so initialize it as zero; (2) explicitly disable MTU\nfeature in virtio-user.\n\nFixes: 49d26d9e3f47 (\"net/virtio: support MTU feature\")\nCc: Maxime Coquelin <maxime.coquelin@redhat.com>\nCc: Yuanhan Liu <yuanhan.liu@linux.intel.com>\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c               | 4 ++--\n drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 ++++++\n 2 files changed, 8 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 78cb3e8..4c43784 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -1163,7 +1163,7 @@ virtio_negotiate_features(struct virtio_hw *hw, uint64_t req_features)\n \n \t/* If supported, ensure MTU value is valid before acknowledging it. */\n \tif (host_features & req_features & (1ULL << VIRTIO_NET_F_MTU)) {\n-\t\tstruct virtio_net_config config;\n+\t\tstruct virtio_net_config config = {0};\n \n \t\tvtpci_read_dev_config(hw,\n \t\t\toffsetof(struct virtio_net_config, mtu),\n@@ -1332,7 +1332,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n {\n \tstruct virtio_hw *hw = eth_dev->data->dev_private;\n \tstruct virtio_net_config *config;\n-\tstruct virtio_net_config local_config;\n+\tstruct virtio_net_config local_config = {0};\n \tstruct rte_pci_device *pci_dev = NULL;\n \tint ret;\n \ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 6871cd4..529b3d7 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -362,6 +362,12 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t/* The backend will not report this feature, we add it explicitly */\n \tdev->device_features |= (1ull << VIRTIO_NET_F_STATUS);\n \n+\t/* TODO: VIRTIO_NET_F_MTU is for QEMU to advertise MTU to both frontend\n+\t * and backend driver. For virtio-user, disable it for now, until we\n+\t * have a parameter to specify the MTU.\n+\t */\n+\tdev->device_features &= ~(1ull << VIRTIO_NET_F_MTU);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "dpdk-dev"
    ]
}