get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 32261,
    "url": "http://patches.dpdk.org/api/patches/32261/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1513251494-9980-1-git-send-email-muziding001@163.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": "<1513251494-9980-1-git-send-email-muziding001@163.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1513251494-9980-1-git-send-email-muziding001@163.com",
    "date": "2017-12-14T11:38:14",
    "name": "[dpdk-dev] net/virtio-user: specify MAC address for tap port",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3ad1f2401a631cdabceb729ce8d17d5344a9767c",
    "submitter": {
        "id": 927,
        "url": "http://patches.dpdk.org/api/people/927/?format=api",
        "name": "Ning Li",
        "email": "muziding001@163.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/1513251494-9980-1-git-send-email-muziding001@163.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/32261/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/32261/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7B1A01B018;\n\tThu, 14 Dec 2017 12:38:46 +0100 (CET)",
            "from proxy90-5.mail.163.com (mail-proxy905.ym.163.com\n\t[43.230.90.5]) by dpdk.org (Postfix) with ESMTP id 6C9201B012\n\tfor <dev@dpdk.org>; Thu, 14 Dec 2017 12:38:44 +0100 (CET)",
            "from localhost.localdomain (unknown [221.226.39.82])\n\tby smtp9 (Coremail) with SMTP id DcCowABXa72pYjJa1h4+Aw--.15779S3;\n\tThu, 14 Dec 2017 19:38:22 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n\ts=s110527; h=From:Subject:Date:Message-Id; bh=dnHuRTcGD34ZA+ho8C\n\tnlGRCJgIpvCz4nrHXmOO+V6Zk=; b=qESfKq2T0N1PfhHDEP7Cws9WZKBzFRV2pB\n\tUerfmDBYe/r6kIm713EOFKntvpPOSNS0uYRLNSfeYvTKjmARwO0tzmbMfFLsgFWv\n\t9ffRmS471/SjC3Arao0tjvb/yA8rvRCpVqagEdXOffLr3GoPjDCzs86662Q2GPNs\n\tWHp4MqCOs=",
        "From": "Ning Li <muziding001@163.com>",
        "To": "Yuanhan Liu <yliu@fridaylinux.org>,\n\tMaxime Coquelin <maxime.coquelin@redhat.com>",
        "Cc": "dev@dpdk.org,\n\tNing Li <muziding001@163.com>",
        "Date": "Thu, 14 Dec 2017 19:38:14 +0800",
        "Message-Id": "<1513251494-9980-1-git-send-email-muziding001@163.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "X-CM-TRANSID": "DcCowABXa72pYjJa1h4+Aw--.15779S3",
        "X-Coremail-Antispam": "1Uf129KBjvJXoWxJw1fuFWkCF1xXFWUWF48WFg_yoW5Gryrpw\n\t4DArZxZr13tr4xAa1rJF18ury5Z3Z3JrW7Kr9xW3Wrur4vvFnrCrWUua4Ygr47tFWUGF4I\n\tyFy09F9Ig3s8uw7anT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UD-PUUUUUU=",
        "X-Originating-IP": "[221.226.39.82]",
        "X-CM-SenderInfo": "ppx2xvhlqjiiqr6rljoofrz/xtbB0BOu0lUMB-qpWwABso",
        "Subject": "[dpdk-dev] [PATCH] net/virtio-user: specify MAC address for tap port",
        "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://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": "<https://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": "When use virtio_user as exception path, we need to specify a MAC\naddress for the tap port.\n\nSigned-off-by: Ning Li <muziding001@163.com>\n---\n drivers/net/virtio/virtio_user/vhost_kernel.c     |  3 ++-\n drivers/net/virtio/virtio_user/vhost_kernel_tap.c |  8 ++++++++\n drivers/net/virtio/virtio_user/vhost_kernel_tap.h | 12 +++++++++++-\n 3 files changed, 21 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c\nindex 68d28b1..dd24b6b 100644\n--- a/drivers/net/virtio/virtio_user/vhost_kernel.c\n+++ b/drivers/net/virtio/virtio_user/vhost_kernel.c\n@@ -380,7 +380,8 @@ struct vhost_memory_kernel {\n \telse\n \t\thdr_size = sizeof(struct virtio_net_hdr);\n \n-\ttapfd = vhost_kernel_open_tap(&dev->ifname, hdr_size, req_mq);\n+\ttapfd = vhost_kernel_open_tap(&dev->ifname, hdr_size, req_mq,\n+\t\t\t (char *)dev->mac_addr);\n \tif (tapfd < 0) {\n \t\tPMD_DRV_LOG(ERR, \"fail to open tap for vhost kernel\");\n \t\treturn -1;\ndiff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c\nindex 689a5cf..756fde2 100644\n--- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c\n+++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c\n@@ -123,6 +123,14 @@\n \t\tPMD_DRV_LOG(ERR, \"TUNSETOFFLOAD ioctl() failed: %s\",\n \t\t\t   strerror(errno));\n \n+\tmemset(&ifr, 0, sizeof(ifr));\n+\tifr.ifr_hwaddr.sa_family = ARPHRD_ETHER;\n+\tmemcpy(ifr.ifr_hwaddr.sa_data, mac, ETH_ALEN);\n+\tif (ioctl(tapfd, SIOCSIFHWADDR, (void *)&ifr) == -1) {\n+\t\tPMD_DRV_LOG(ERR, \"SIOCSIFHWADDR failed: %s\", strerror(errno));\n+\t\tgoto error;\n+\t}\n+\n \tif (!(*p_ifname))\n \t\t*p_ifname = strdup(ifr.ifr_name);\n \ndiff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.h b/drivers/net/virtio/virtio_user/vhost_kernel_tap.h\nindex eae340c..f59b1ac 100644\n--- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.h\n+++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.h\n@@ -64,4 +64,14 @@\n /* Constants */\n #define PATH_NET_TUN\t\"/dev/net/tun\"\n \n-int vhost_kernel_open_tap(char **p_ifname, int hdr_size, int req_mq);\n+/* Socket configuration controls. */\n+#define SIOCSIFHWADDR   0x8924          /* set hardware address */\n+\n+/* ARP protocol HARDWARE identifiers. */\n+#define ARPHRD_ETHER    1               /* Ethernet             */\n+\n+/* Length of Ethernet address. */\n+#define ETH_ALEN  6\n+\n+int vhost_kernel_open_tap(char **p_ifname, int hdr_size, int req_mq,\n+\t\t\t const char *mac);\n",
    "prefixes": [
        "dpdk-dev"
    ]
}