get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139448,
    "url": "https://patches.dpdk.org/api/patches/139448/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240417091250.187218-1-udav@mts.ru/",
    "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": "<20240417091250.187218-1-udav@mts.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240417091250.187218-1-udav@mts.ru",
    "date": "2024-04-17T09:15:04",
    "name": "[v2] lib/vhost: add flag for async connection in client mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "1bf9795ec68e2a71a039286ca37433c8d779444c",
    "submitter": {
        "id": 3315,
        "url": "https://patches.dpdk.org/api/people/3315/?format=api",
        "name": "Ушков Даниил",
        "email": "udav@mts.ru"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240417091250.187218-1-udav@mts.ru/mbox/",
    "series": [
        {
            "id": 31769,
            "url": "https://patches.dpdk.org/api/series/31769/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31769",
            "date": "2024-04-17T09:15:04",
            "name": "[v2] lib/vhost: add flag for async connection in client mode",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/31769/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139448/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139448/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A56D643E90;\n\tWed, 17 Apr 2024 11:15:07 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2A6134029E;\n\tWed, 17 Apr 2024 11:15:07 +0200 (CEST)",
            "from mx4.mts.ru (mx4.mts.ru [213.87.44.6])\n by mails.dpdk.org (Postfix) with ESMTP id BB25B4028B\n for <dev@dpdk.org>; Wed, 17 Apr 2024 11:15:05 +0200 (CEST)",
            "from mx-v6.msk.mts.ru (unknown [10.73.8.205])\n by mx4.mts.ru (Postfix) with ESMTP id 53BAA16199;\n Wed, 17 Apr 2024 12:15:05 +0300 (MSK)",
            "from 0001EX19MBX15.msk.mts.ru (0001EX19MBX15.msk.mts.ru\n [10.73.16.232])\n by mx-v6.msk.mts.ru (Postfix) with ESMTP id 4VKFc92D3wzCy;\n Wed, 17 Apr 2024 12:15:05 +0300 (MSK)",
            "from 0001EX19MBX15.msk.mts.ru (10.73.16.232) by\n 0001EX19MBX15.msk.mts.ru (10.73.16.232) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1258.25; Wed, 17 Apr 2024 12:15:05 +0300",
            "from 0001EX19MBX15.msk.mts.ru ([10.73.16.232]) by\n 0001EX19MBX15.msk.mts.ru ([10.73.16.232]) with mapi id 15.02.1258.025; Wed,\n 17 Apr 2024 12:15:05 +0300"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 mx4.mts.ru 53BAA16199",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mts.ru; s=mail;\n t=1713345305; bh=8H9bnToB0e4Ig0qqeTZ63jAlyMwV0uETJ/qz5BjSJho=;\n h=From:To:CC:Subject:Date:References:In-Reply-To:From;\n b=O/ED8vK3KhqjE+DHpGJ/j+Nzj/waz11ffEDC/4an+2EzsfP6xujD8xTWSJad1pnZr\n 5/zmTypPwM5vFXECsZzQpQ/zKtc3+0XTA4REMaJiVvkGbneXFTczhRzEXU2II0o1Xe\n i+qM+aThqm8W97ozebUt2ETjidABRH0riFr/PGng=",
        "From": "=?utf-8?b?0KPRiNC60L7QsiDQlNCw0L3QuNC40Ls=?= <udav@mts.ru>",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "CC": "=?utf-8?b?0KPRiNC60L7QsiDQlNCw0L3QuNC40Ls=?= <udav@mts.ru>,\n \"Maxime Coquelin\" <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbox@nvidia.com>",
        "Subject": "[PATCH v2] lib/vhost: add flag for async connection in client mode",
        "Thread-Topic": "[PATCH v2] lib/vhost: add flag for async connection in client\n mode",
        "Thread-Index": "AQHakKe7cZ91zLHm00iwKAOMAugPIA==",
        "Date": "Wed, 17 Apr 2024 09:15:04 +0000",
        "Message-ID": "<20240417091250.187218-1-udav@mts.ru>",
        "References": "<20240417083835.164456-1-udav@mts.ru>",
        "In-Reply-To": "<20240417083835.164456-1-udav@mts.ru>",
        "Accept-Language": "ru-RU, en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-mailer": "git-send-email 2.34.1",
        "x-originating-ip": "[10.75.216.11]",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-ID": "<7925C0028C05CB4FA12AF41F8E09A047@mts.ru>",
        "Content-Transfer-Encoding": "base64",
        "MIME-Version": "1.0",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "This patch introduces a new flag RTE_VHOST_USER_ASYNC_CONNECT,\nwhich in combination with the flag RTE_VHOST_USER_CLIENT makes\nrte_vhost_driver_start connect asynchronously to the vhost server.\n\nSigned-off-by: Ушков Даниил <udav@mts.ru>\n---\nFixes:\n1. Fix warning about the name in signature.\n2. Fix warning about coding style.\n\nP.S.\nIs it ok that name is not in ascii?\nSorry, it could be hard to change it now.\n\n lib/vhost/rte_vhost.h |  1 +\n lib/vhost/socket.c    | 28 ++++++++++++++++------------\n 2 files changed, 17 insertions(+), 12 deletions(-)\n\n-- \n2.34.1",
    "diff": "diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h\r\nindex db92f05344..b0434c4b8d 100644\r\n--- a/lib/vhost/rte_vhost.h\r\n+++ b/lib/vhost/rte_vhost.h\r\n@@ -41,6 +41,7 @@ extern \"C\" {\r\n #define RTE_VHOST_USER_ASYNC_COPY\t(1ULL << 7)\r\n #define RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS\t(1ULL << 8)\r\n #define RTE_VHOST_USER_NET_STATS_ENABLE\t(1ULL << 9)\r\n+#define RTE_VHOST_USER_ASYNC_CONNECT\t(1ULL << 10)\r\n \r\n /* Features. */\r\n #ifndef VIRTIO_NET_F_GUEST_ANNOUNCE\r\ndiff --git a/lib/vhost/socket.c b/lib/vhost/socket.c\r\nindex 96b3ab5595..c681d53abb 100644\r\n--- a/lib/vhost/socket.c\r\n+++ b/lib/vhost/socket.c\r\n@@ -45,6 +45,7 @@ struct vhost_user_socket {\r\n \tbool async_copy;\r\n \tbool net_compliant_ol_flags;\r\n \tbool stats_enabled;\r\n+\tbool async_connect;\r\n \r\n \t/*\r\n \t * The \"supported_features\" indicates the feature bits the\r\n@@ -533,21 +534,23 @@ vhost_user_start_client(struct vhost_user_socket *vsocket)\r\n \tconst char *path = vsocket->path;\r\n \tstruct vhost_user_reconnect *reconn;\r\n \r\n-\tret = vhost_user_connect_nonblock(vsocket->path, fd, (struct sockaddr *)&vsocket->un,\r\n-\t\t\t\t\t  sizeof(vsocket->un));\r\n-\tif (ret == 0) {\r\n-\t\tvhost_user_add_connection(fd, vsocket);\r\n-\t\treturn 0;\r\n-\t}\r\n+\tif (!vsocket->async_connect || !vsocket->reconnect) {\r\n+\t\tret = vhost_user_connect_nonblock(vsocket->path, fd,\r\n+\t\t\t(struct sockaddr *)&vsocket->un, sizeof(vsocket->un));\r\n+\t\tif (ret == 0) {\r\n+\t\t\tvhost_user_add_connection(fd, vsocket);\r\n+\t\t\treturn 0;\r\n+\t\t}\r\n \r\n-\tVHOST_CONFIG_LOG(path, WARNING, \"failed to connect: %s\", strerror(errno));\r\n+\t\tVHOST_CONFIG_LOG(path, WARNING, \"failed to connect: %s\", strerror(errno));\r\n \r\n-\tif (ret == -2 || !vsocket->reconnect) {\r\n-\t\tclose(fd);\r\n-\t\treturn -1;\r\n-\t}\r\n+\t\tif (ret == -2 || !vsocket->reconnect) {\r\n+\t\t\tclose(fd);\r\n+\t\t\treturn -1;\r\n+\t\t}\r\n \r\n-\tVHOST_CONFIG_LOG(path, INFO, \"reconnecting...\");\r\n+\t\tVHOST_CONFIG_LOG(path, INFO, \"reconnecting...\");\r\n+\t}\r\n \treconn = malloc(sizeof(*reconn));\r\n \tif (reconn == NULL) {\r\n \t\tVHOST_CONFIG_LOG(path, ERR, \"failed to allocate memory for reconnect\");\r\n@@ -930,6 +933,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\r\n \tvsocket->async_copy = flags & RTE_VHOST_USER_ASYNC_COPY;\r\n \tvsocket->net_compliant_ol_flags = flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;\r\n \tvsocket->stats_enabled = flags & RTE_VHOST_USER_NET_STATS_ENABLE;\r\n+\tvsocket->async_connect = flags & RTE_VHOST_USER_ASYNC_CONNECT;\r\n \tif (vsocket->is_vduse)\r\n \t\tvsocket->iommu_support = true;\r\n \telse\r\n",
    "prefixes": [
        "v2"
    ]
}