get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79550,
    "url": "https://patches.dpdk.org/api/patches/79550/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201002153601.84097-3-roy.fan.zhang@intel.com/",
    "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": "<20201002153601.84097-3-roy.fan.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201002153601.84097-3-roy.fan.zhang@intel.com",
    "date": "2020-10-02T15:36:01",
    "name": "[v2,2/2] vhost/crypto: fix feature negotiation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8be0364bbf3951c4db7efe380c12388a68a54e77",
    "submitter": {
        "id": 304,
        "url": "https://patches.dpdk.org/api/people/304/?format=api",
        "name": "Fan Zhang",
        "email": "roy.fan.zhang@intel.com"
    },
    "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/20201002153601.84097-3-roy.fan.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 12670,
            "url": "https://patches.dpdk.org/api/series/12670/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12670",
            "date": "2020-10-02T15:36:00",
            "name": "vhost/crypto: fix initialization",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/12670/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/79550/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/79550/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 563DFA04BA;\n\tFri,  2 Oct 2020 17:36:57 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CE9E41D992;\n\tFri,  2 Oct 2020 17:36:16 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id C987D1D970;\n Fri,  2 Oct 2020 17:36:12 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Oct 2020 08:36:12 -0700",
            "from silpixa00398673.ir.intel.com (HELO\n silpixa00398673.ger.corp.intel.com) ([10.237.223.136])\n by fmsmga006.fm.intel.com with ESMTP; 02 Oct 2020 08:36:08 -0700"
        ],
        "IronPort-SDR": [
            "\n OhYx11x8tDTLTrXCaAvRrVdH+X5Uduvg18oYFr1XB0GL+rEEf5MT0cFwjJj2zXBlIoiPjCjRsV\n sezpQR+3SnCQ==",
            "\n G7CmaDQBrgnTEp1KrT3nil2v2QnQqS+QSsjlJBaX1rD0NDH6YTIwDsnaxQRWNYW2DDRuiGlAQl\n uyIg73l37WrA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9762\"; a=\"247754236\"",
            "E=Sophos;i=\"5.77,328,1596524400\"; d=\"scan'208\";a=\"247754236\"",
            "E=Sophos;i=\"5.77,328,1596524400\"; d=\"scan'208\";a=\"515193808\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Fan Zhang <roy.fan.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com, maxime.coquelin@redhat.com, changpeng.liu@intel.com,\n ferruh.yigit@intel.com, stable@dpdk.org,\n Fan Zhang <roy.fan.zhang@intel.com>",
        "Date": "Fri,  2 Oct 2020 16:36:01 +0100",
        "Message-Id": "<20201002153601.84097-3-roy.fan.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20201002153601.84097-1-roy.fan.zhang@intel.com>",
        "References": "<20201002083615.45470-1-roy.fan.zhang@intel.com>\n <20201002153601.84097-1-roy.fan.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [dpdk-dev v2 2/2] vhost/crypto: fix feature negotiation",
        "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": "This patch fixes the feature negotiation for vhost crypto during\ninitialization. The patch uses the newly created driver start\nfunction to inform the driver type with the fixed vhost features.\nIn addtion the patch provides a new API specifically used by\nthe application to start a vhost-crypto driver.\n\nFixes: 939066d96563 (\"vhost/crypto: add public function implementation\")\nCc: roy.fan.zhang@intel.com\n\nSigned-off-by: Fan Zhang <roy.fan.zhang@intel.com>\n---\n examples/vhost_crypto/main.c           |  3 +-\n lib/librte_vhost/rte_vhost_crypto.h    | 12 ++++++++\n lib/librte_vhost/rte_vhost_version.map |  1 +\n lib/librte_vhost/vhost_crypto.c        | 41 +++++++++++++++++---------\n 4 files changed, 42 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c\nindex d78fd9b81..11ad49159 100644\n--- a/examples/vhost_crypto/main.c\n+++ b/examples/vhost_crypto/main.c\n@@ -598,7 +598,8 @@ main(int argc, char *argv[])\n \t\t\trte_vhost_driver_callback_register(lo->socket_files[j],\n \t\t\t\t&virtio_crypto_device_ops);\n \n-\t\t\tret = rte_vhost_driver_start(lo->socket_files[j]);\n+\t\t\tret = rte_vhost_crypto_driver_start(\n+\t\t\t\t\tlo->socket_files[j]);\n \t\t\tif (ret < 0)  {\n \t\t\t\tRTE_LOG(ERR, USER1, \"failed to start vhost.\\n\");\n \t\t\t\tgoto error_exit;\ndiff --git a/lib/librte_vhost/rte_vhost_crypto.h b/lib/librte_vhost/rte_vhost_crypto.h\nindex b54d61db6..c809c46a2 100644\n--- a/lib/librte_vhost/rte_vhost_crypto.h\n+++ b/lib/librte_vhost/rte_vhost_crypto.h\n@@ -20,6 +20,18 @@ enum rte_vhost_crypto_zero_copy {\n \tRTE_VHOST_CRYPTO_MAX_ZERO_COPY_OPTIONS\n };\n \n+/**\n+ * Start vhost crypto driver\n+ *\n+ * @param path\n+ *  The vhost-user socket file path\n+ * @return\n+ *  0 on success, -1 on failure\n+ */\n+__rte_experimental\n+int\n+rte_vhost_crypto_driver_start(const char *path);\n+\n /**\n  *  Create Vhost-crypto instance\n  *\ndiff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map\nindex 55e98e557..9183d6f2f 100644\n--- a/lib/librte_vhost/rte_vhost_version.map\n+++ b/lib/librte_vhost/rte_vhost_version.map\n@@ -55,6 +55,7 @@ EXPERIMENTAL {\n \trte_vhost_driver_get_protocol_features;\n \trte_vhost_driver_get_queue_num;\n \trte_vhost_crypto_create;\n+\trte_vhost_crypto_driver_start;\n \trte_vhost_crypto_free;\n \trte_vhost_crypto_fetch_requests;\n \trte_vhost_crypto_finalize_requests;\ndiff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c\nindex e08f9c6d7..6195958d2 100644\n--- a/lib/librte_vhost/vhost_crypto.c\n+++ b/lib/librte_vhost/vhost_crypto.c\n@@ -35,13 +35,12 @@\n #define VC_LOG_DBG(fmt, args...)\n #endif\n \n-#define VIRTIO_CRYPTO_FEATURES ((1 << VIRTIO_F_NOTIFY_ON_EMPTY) |\t\\\n-\t\t(1 << VIRTIO_RING_F_INDIRECT_DESC) |\t\t\t\\\n-\t\t(1 << VIRTIO_RING_F_EVENT_IDX) |\t\t\t\\\n-\t\t(1 << VIRTIO_CRYPTO_SERVICE_CIPHER) |\t\t\t\\\n-\t\t(1 << VIRTIO_CRYPTO_SERVICE_MAC) |\t\t\t\\\n-\t\t(1 << VIRTIO_NET_F_CTRL_VQ) |\t\t\t\t\\\n-\t\t(1 << VHOST_USER_PROTOCOL_F_CONFIG))\n+#define VIRTIO_CRYPTO_FEATURES ((1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |\t\\\n+\t\t(1ULL << VIRTIO_RING_F_INDIRECT_DESC) |\t\t\t\\\n+\t\t(1ULL << VIRTIO_RING_F_EVENT_IDX) |\t\t\t\\\n+\t\t(1ULL << VIRTIO_NET_F_CTRL_VQ) |\t\t\t\\\n+\t\t(1ULL << VIRTIO_F_VERSION_1) |\t\t\t\t\\\n+\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES))\n \n #define IOVA_TO_VVA(t, r, a, l, p)\t\t\t\t\t\\\n \t((t)(uintptr_t)vhost_iova_to_vva(r->dev, r->vq, a, l, p))\n@@ -1400,6 +1399,27 @@ vhost_crypto_complete_one_vm_requests(struct rte_crypto_op **ops,\n \treturn processed;\n }\n \n+int\n+rte_vhost_crypto_driver_start(const char *path)\n+{\n+\tuint64_t protocol_features;\n+\tint ret;\n+\n+\tret = rte_vhost_driver_set_features(path, VIRTIO_CRYPTO_FEATURES);\n+\tif (ret)\n+\t\treturn -1;\n+\n+\tret = rte_vhost_driver_get_protocol_features(path, &protocol_features);\n+\tif (ret)\n+\t\treturn -1;\n+\tprotocol_features |= (1ULL << VHOST_USER_PROTOCOL_F_CONFIG);\n+\tret = rte_vhost_driver_set_protocol_features(path, protocol_features);\n+\tif (ret)\n+\t\treturn -1;\n+\n+\treturn vhost_driver_start(path, VIRTIO_DEV_BUILTIN_CRYPTO);\n+}\n+\n int\n rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,\n \t\tstruct rte_mempool *sess_pool,\n@@ -1417,13 +1437,6 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,\n \t\treturn -EINVAL;\n \t}\n \n-\tret = rte_vhost_driver_set_features(dev->ifname,\n-\t\t\tVIRTIO_CRYPTO_FEATURES);\n-\tif (ret < 0) {\n-\t\tVC_LOG_ERR(\"Error setting features\");\n-\t\treturn -1;\n-\t}\n-\n \tvcrypto = rte_zmalloc_socket(NULL, sizeof(*vcrypto),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (!vcrypto) {\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}