get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 70748,
    "url": "http://patchwork.dpdk.org/api/patches/70748/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1591113208-79169-2-git-send-email-matan@mellanox.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1591113208-79169-2-git-send-email-matan@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1591113208-79169-2-git-send-email-matan@mellanox.com",
    "date": "2020-06-02T15:53:28",
    "name": "[2/2] vdpa/mlx5: support MTU feature",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0a684618fb76d7ac39f85670df8f4ca1f2ede204",
    "submitter": {
        "id": 796,
        "url": "http://patchwork.dpdk.org/api/people/796/?format=api",
        "name": "Matan Azrad",
        "email": "matan@mellanox.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patchwork.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1591113208-79169-2-git-send-email-matan@mellanox.com/mbox/",
    "series": [
        {
            "id": 10297,
            "url": "http://patchwork.dpdk.org/api/series/10297/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10297",
            "date": "2020-06-02T15:53:27",
            "name": "[1/2] common/mlx5: share kernel interface name getter",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/10297/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/70748/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/70748/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 6369FA0514;\n\tTue,  2 Jun 2020 17:53:44 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 18AA51BF5E;\n\tTue,  2 Jun 2020 17:53:44 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id B3C362BAA\n for <dev@dpdk.org>; Tue,  2 Jun 2020 17:53:41 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n matan@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 2 Jun 2020 18:53:36 +0300",
            "from pegasus25.mtr.labs.mlnx. (pegasus25.mtr.labs.mlnx\n [10.210.16.10])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 052FrW5u015577;\n Tue, 2 Jun 2020 18:53:36 +0300"
        ],
        "From": "Matan Azrad <matan@mellanox.com>",
        "To": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "Cc": "dev@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue,  2 Jun 2020 15:53:28 +0000",
        "Message-Id": "<1591113208-79169-2-git-send-email-matan@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1591113208-79169-1-git-send-email-matan@mellanox.com>",
        "References": "<1591113208-79169-1-git-send-email-matan@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] vdpa/mlx5: support MTU feature",
        "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 guest virtio device may request MTU updating when the vhost backend\ndevice exposes a capability to support it.\n\nExspose the MTU feature capability.\n\nIn configuration time, check the requested MTU and update it in the HW\ndevice.\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\n---\n doc/guides/rel_notes/release_20_08.rst |  1 +\n doc/guides/vdpadevs/features/mlx5.ini  |  1 +\n drivers/vdpa/mlx5/mlx5_vdpa.c          | 67 ++++++++++++++++++++++++++++++++--\n 3 files changed, 65 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst\nindex 25a1563..543a064 100644\n--- a/doc/guides/rel_notes/release_20_08.rst\n+++ b/doc/guides/rel_notes/release_20_08.rst\n@@ -67,6 +67,7 @@ New Features\n      Updated Mellanox mlx5 vDPA driver with new features, including:\n \n      * Added support for virtio queue statistics.\n+     * Added support for MTU update.\n \n \n \ndiff --git a/doc/guides/vdpadevs/features/mlx5.ini b/doc/guides/vdpadevs/features/mlx5.ini\nindex 788d4e0..8bb9977 100644\n--- a/doc/guides/vdpadevs/features/mlx5.ini\n+++ b/doc/guides/vdpadevs/features/mlx5.ini\n@@ -10,6 +10,7 @@ host tso4            = Y\n host tso6            = Y\n version 1            = Y\n log all              = Y\n+mtu                  = Y\n any layout           = Y\n guest announce       = Y\n mq                   = Y\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c\nindex 94cac66..2a2018b 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c\n@@ -2,6 +2,11 @@\n  * Copyright 2019 Mellanox Technologies, Ltd\n  */\n #include <unistd.h>\n+#include <net/if.h>\n+#include <sys/socket.h>\n+#include <sys/ioctl.h>\n+#include <fcntl.h>\n+#include <netinet/in.h>\n \n #include <rte_malloc.h>\n #include <rte_log.h>\n@@ -25,14 +30,19 @@\n \t\t\t    (1ULL << VIRTIO_NET_F_MQ) | \\\n \t\t\t    (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | \\\n \t\t\t    (1ULL << VIRTIO_F_ORDER_PLATFORM) | \\\n-\t\t\t    (1ULL << VHOST_F_LOG_ALL))\n+\t\t\t    (1ULL << VHOST_F_LOG_ALL) | \\\n+\t\t\t    (1ULL << VIRTIO_NET_F_MTU))\n \n #define MLX5_VDPA_PROTOCOL_FEATURES \\\n \t\t\t    ((1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \\\n \t\t\t     (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \\\n \t\t\t     (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \\\n \t\t\t     (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \\\n-\t\t\t     (1ULL << VHOST_USER_PROTOCOL_F_MQ))\n+\t\t\t     (1ULL << VHOST_USER_PROTOCOL_F_MQ) | \\\n+\t\t\t     (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU))\n+\n+#define MLX5_VDPA_MAX_RETRIES 20\n+#define MLX5_VDPA_USEC 1000\n \n TAILQ_HEAD(mlx5_vdpa_privs, mlx5_vdpa_priv) priv_list =\n \t\t\t\t\t      TAILQ_HEAD_INITIALIZER(priv_list);\n@@ -223,6 +233,55 @@\n }\n \n static int\n+mlx5_vdpa_mtu_set(struct mlx5_vdpa_priv *priv)\n+{\n+\tstruct ifreq request;\n+\tuint16_t vhost_mtu = 0;\n+\tuint16_t kern_mtu = 0;\n+\tint ret = rte_vhost_get_mtu(priv->vid, &vhost_mtu);\n+\tint sock;\n+\tint retries = MLX5_VDPA_MAX_RETRIES;\n+\n+\tif (ret) {\n+\t\tDRV_LOG(DEBUG, \"Cannot get vhost MTU - %d.\", ret);\n+\t\treturn ret;\n+\t}\n+\tif (!vhost_mtu) {\n+\t\tDRV_LOG(DEBUG, \"Vhost MTU is 0.\");\n+\t\treturn ret;\n+\t}\n+\tret = mlx5_get_ifname_sysfs(priv->ctx->device->ibdev_path,\n+\t\t\t\t    &request.ifr_name);\n+\tif (ret) {\n+\t\tDRV_LOG(DEBUG, \"Cannot get kernel IF name - %d.\", ret);\n+\t\treturn ret;\n+\t}\n+\tsock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);\n+\tif (sock == -1) {\n+\t\tDRV_LOG(DEBUG, \"Cannot open IF socket.\");\n+\t\treturn sock;\n+\t}\n+\twhile (retries--) {\n+\t\tret = ioctl(sock, SIOCGIFMTU, &request);\n+\t\tif (ret == -1)\n+\t\t\tbreak;\n+\t\tkern_mtu = request.ifr_mtu;\n+\t\tDRV_LOG(DEBUG, \"MTU: current %d requested %d.\", (int)kern_mtu,\n+\t\t\t(int)vhost_mtu);\n+\t\tif (kern_mtu == vhost_mtu)\n+\t\t\tbreak;\n+\t\trequest.ifr_mtu = vhost_mtu;\n+\t\tret = ioctl(sock, SIOCSIFMTU, &request);\n+\t\tif (ret == -1)\n+\t\t\tbreak;\n+\t\trequest.ifr_mtu = 0;\n+\t\tusleep(MLX5_VDPA_USEC);\n+\t}\n+\tclose(sock);\n+\treturn kern_mtu == vhost_mtu ? 0 : -1;\n+}\n+\n+static int\n mlx5_vdpa_dev_close(int vid)\n {\n \tint did = rte_vhost_get_vdpa_device_id(vid);\n@@ -265,6 +324,8 @@\n \t\treturn -1;\n \t}\n \tpriv->vid = vid;\n+\tif (mlx5_vdpa_mtu_set(priv))\n+\t\tDRV_LOG(WARNING, \"MTU cannot be set on device %d.\", did);\n \tif (mlx5_vdpa_pd_create(priv) || mlx5_vdpa_mem_register(priv) ||\n \t    mlx5_vdpa_direct_db_prepare(priv) ||\n \t    mlx5_vdpa_virtqs_prepare(priv) || mlx5_vdpa_steer_setup(priv) ||\n@@ -513,8 +574,6 @@\n \treturn ret;\n }\n \n-#define MLX5_VDPA_MAX_RETRIES 20\n-#define MLX5_VDPA_USEC 1000\n static int\n mlx5_vdpa_roce_disable(struct rte_pci_addr *addr, struct ibv_device **ibv)\n {\n",
    "prefixes": [
        "2/2"
    ]
}