get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88935,
    "url": "http://patches.dpdk.org/api/patches/88935/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210311110325.3291203-3-andrew.rybchenko@oktetlabs.ru/",
    "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": "<20210311110325.3291203-3-andrew.rybchenko@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210311110325.3291203-3-andrew.rybchenko@oktetlabs.ru",
    "date": "2021-03-11T11:03:19",
    "name": "[2/8] common/sfc_efx/base: add API to get VirtQ doorbell offset",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "159601f66c35a0dfb6ffc8cbdc01a2110152fad7",
    "submitter": {
        "id": 2013,
        "url": "http://patches.dpdk.org/api/people/2013/?format=api",
        "name": "Andrew Rybchenko",
        "email": "Andrew.Rybchenko@oktetlabs.ru"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210311110325.3291203-3-andrew.rybchenko@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 15608,
            "url": "http://patches.dpdk.org/api/series/15608/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15608",
            "date": "2021-03-11T11:03:17",
            "name": "common/sfc_efx: prepare to introduce vDPA driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/15608/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/88935/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/88935/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 4D5EDA056A;\n\tThu, 11 Mar 2021 12:04:04 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 539DB22A3D4;\n\tThu, 11 Mar 2021 12:03:45 +0100 (CET)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 21DCD22A3BC\n for <dev@dpdk.org>; Thu, 11 Mar 2021 12:03:44 +0100 (CET)",
            "by shelob.oktetlabs.ru (Postfix, from userid 122)\n id B6A1D7F593; Thu, 11 Mar 2021 14:03:43 +0300 (MSK)",
            "from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17])\n by shelob.oktetlabs.ru (Postfix) with ESMTP id 06B007F593;\n Thu, 11 Mar 2021 14:03:36 +0300 (MSK)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.8 required=5.0 tests=ALL_TRUSTED,\n DKIM_ADSP_DISCARD,\n URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2",
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 06B007F593",
        "Authentication-Results": "shelob.oktetlabs.ru/06B007F593; dkim=none;\n dkim-atps=neutral",
        "From": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "To": "dev@dpdk.org",
        "Cc": "Vijay Kumar Srivastava <vsrivast@xilinx.com>",
        "Date": "Thu, 11 Mar 2021 14:03:19 +0300",
        "Message-Id": "<20210311110325.3291203-3-andrew.rybchenko@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.30.1",
        "In-Reply-To": "<20210311110325.3291203-1-andrew.rybchenko@oktetlabs.ru>",
        "References": "<20210311110325.3291203-1-andrew.rybchenko@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/8] common/sfc_efx/base: add API to get VirtQ\n doorbell offset",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Vijay Kumar Srivastava <vsrivast@xilinx.com>\n\nAdd an API to query the virtqueue doorbell offset in the BAR for a VI.\nFor vDPA, the virtio net driver notifies the device directly by writing\ndoorbell. This API would be invoked from vDPA client driver.\n\nSigned-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>\nSigned-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\n drivers/common/sfc_efx/base/efx.h          | 12 +++\n drivers/common/sfc_efx/base/efx_impl.h     |  2 +\n drivers/common/sfc_efx/base/efx_virtio.c   | 41 ++++++++++\n drivers/common/sfc_efx/base/rhead_impl.h   |  6 ++\n drivers/common/sfc_efx/base/rhead_virtio.c | 93 ++++++++++++++++++++++\n drivers/common/sfc_efx/version.map         |  1 +\n 6 files changed, 155 insertions(+)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex f9004ae2a4..733ef4a115 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4475,6 +4475,18 @@ extern\t\t\tvoid\n efx_virtio_qdestroy(\n \t__in\t\tefx_virtio_vq_t *evvp);\n \n+/*\n+ * Get the offset in the BAR of the doorbells for a VI.\n+ * net device : doorbell offset of RX & TX queues\n+ * block device : request doorbell offset in the BAR.\n+ * For further details refer section of 4 of SF-119689\n+ */\n+LIBEFX_API\n+extern\t__checkReturn\tefx_rc_t\n+efx_virtio_get_doorbell_offset(\n+\t__in\t\tefx_virtio_vq_t *evvp,\n+\t__out\t\tuint32_t *offsetp);\n+\n #endif /* EFSYS_OPT_VIRTIO */\n \n #ifdef\t__cplusplus\ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex 374b14d253..dee9d936df 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -316,6 +316,8 @@ typedef struct efx_virtio_ops_s {\n \t\t\t\tefx_virtio_vq_dyncfg_t *);\n \tefx_rc_t\t(*evo_virtio_qstop)(efx_virtio_vq_t *,\n \t\t\t\tefx_virtio_vq_dyncfg_t *);\n+\tefx_rc_t\t(*evo_get_doorbell_offset)(efx_virtio_vq_t *,\n+\t\t\t\tuint32_t *);\n } efx_virtio_ops_t;\n #endif /* EFSYS_OPT_VIRTIO */\n \ndiff --git a/drivers/common/sfc_efx/base/efx_virtio.c b/drivers/common/sfc_efx/base/efx_virtio.c\nindex 1b7b01556e..de998fcad9 100644\n--- a/drivers/common/sfc_efx/base/efx_virtio.c\n+++ b/drivers/common/sfc_efx/base/efx_virtio.c\n@@ -12,6 +12,7 @@\n static const efx_virtio_ops_t\t__efx_virtio_rhead_ops = {\n \trhead_virtio_qstart,\t\t\t/* evo_virtio_qstart */\n \trhead_virtio_qstop,\t\t\t/* evo_virtio_qstop */\n+\trhead_virtio_get_doorbell_offset,\t/* evo_get_doorbell_offset */\n };\n #endif /* EFSYS_OPT_RIVERHEAD */\n \n@@ -213,4 +214,44 @@ efx_virtio_qdestroy(\n \t}\n }\n \n+\t__checkReturn\tefx_rc_t\n+efx_virtio_get_doorbell_offset(\n+\t__in\t\tefx_virtio_vq_t *evvp,\n+\t__out\t\tuint32_t *offsetp)\n+{\n+\tefx_nic_t *enp;\n+\tconst efx_virtio_ops_t *evop;\n+\tefx_rc_t rc;\n+\n+\tif ((evvp == NULL) || (offsetp == NULL)) {\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\tenp = evvp->evv_enp;\n+\tevop = enp->en_evop;\n+\n+\tEFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);\n+\tEFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VIRTIO);\n+\n+\tif (evop == NULL) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif ((rc = evop->evo_get_doorbell_offset(evvp, offsetp)) != 0)\n+\t\tgoto fail3;\n+\n+\treturn (0);\n+\n+fail3:\n+\tEFSYS_PROBE(fail3);\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn (rc);\n+}\n+\n #endif /* EFSYS_OPT_VIRTIO */\ndiff --git a/drivers/common/sfc_efx/base/rhead_impl.h b/drivers/common/sfc_efx/base/rhead_impl.h\nindex e22c3e9b1a..4601e491fd 100644\n--- a/drivers/common/sfc_efx/base/rhead_impl.h\n+++ b/drivers/common/sfc_efx/base/rhead_impl.h\n@@ -492,6 +492,12 @@ rhead_virtio_qstop(\n \t__in\t\t\t\tefx_virtio_vq_t *evvp,\n \t__out_opt\t\t\tefx_virtio_vq_dyncfg_t *evvdp);\n \n+LIBEFX_INTERNAL\n+extern\t__checkReturn\t\t\tefx_rc_t\n+rhead_virtio_get_doorbell_offset(\n+\t__in\t\t\t\tefx_virtio_vq_t *evvp,\n+\t__out\t\t\t\tuint32_t *offsetp);\n+\n #endif /* EFSYS_OPT_VIRTIO */\n \n #ifdef\t__cplusplus\ndiff --git a/drivers/common/sfc_efx/base/rhead_virtio.c b/drivers/common/sfc_efx/base/rhead_virtio.c\nindex d1719f834e..147460c95c 100644\n--- a/drivers/common/sfc_efx/base/rhead_virtio.c\n+++ b/drivers/common/sfc_efx/base/rhead_virtio.c\n@@ -187,4 +187,97 @@ rhead_virtio_qstop(\n \treturn (rc);\n }\n \n+\t__checkReturn\tefx_rc_t\n+rhead_virtio_get_doorbell_offset(\n+\t__in\t\tefx_virtio_vq_t *evvp,\n+\t__out\t\tuint32_t *offsetp)\n+{\n+\tefx_nic_t *enp = evvp->evv_enp;\n+\tefx_mcdi_req_t req;\n+\tuint32_t type;\n+\tEFX_MCDI_DECLARE_BUF(payload, MC_CMD_VIRTIO_GET_DOORBELL_OFFSET_REQ_LEN,\n+\t\tMC_CMD_VIRTIO_GET_NET_DOORBELL_OFFSET_RESP_LEN);\n+\tefx_rc_t rc;\n+\n+\treq.emr_cmd = MC_CMD_VIRTIO_GET_DOORBELL_OFFSET;\n+\treq.emr_in_buf = payload;\n+\treq.emr_in_length = MC_CMD_VIRTIO_GET_DOORBELL_OFFSET_REQ_LEN;\n+\treq.emr_out_buf = payload;\n+\treq.emr_out_length = MC_CMD_VIRTIO_GET_NET_DOORBELL_OFFSET_RESP_LEN;\n+\n+\tswitch (evvp->evv_type) {\n+\tcase EFX_VIRTIO_VQ_TYPE_NET_RXQ:\n+\tcase EFX_VIRTIO_VQ_TYPE_NET_TXQ:\n+\t\ttype = MC_CMD_VIRTIO_GET_FEATURES_IN_NET;\n+\t\tbreak;\n+\tcase EFX_VIRTIO_VQ_TYPE_BLOCK:\n+\t\ttype = MC_CMD_VIRTIO_GET_FEATURES_IN_BLOCK;\n+\t\tbreak;\n+\tdefault:\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\tMCDI_IN_SET_BYTE(req, VIRTIO_GET_DOORBELL_OFFSET_REQ_DEVICE_ID,\n+\t\ttype);\n+\tMCDI_IN_SET_WORD(req, VIRTIO_GET_DOORBELL_OFFSET_REQ_TARGET_VF,\n+\t\tevvp->evv_target_vf);\n+\tMCDI_IN_SET_DWORD(req, VIRTIO_GET_DOORBELL_OFFSET_REQ_INSTANCE,\n+\t\tevvp->evv_vi_index);\n+\n+\tefx_mcdi_execute(enp, &req);\n+\n+\tif (req.emr_rc != 0) {\n+\t\trc = req.emr_rc;\n+\t\tgoto fail2;\n+\t}\n+\n+\tswitch (type) {\n+\tcase MC_CMD_VIRTIO_GET_FEATURES_IN_NET:\n+\t\tif (req.emr_out_length_used <\n+\t\t    MC_CMD_VIRTIO_GET_NET_DOORBELL_OFFSET_RESP_LEN) {\n+\t\t\trc = EMSGSIZE;\n+\t\t\tgoto fail3;\n+\t\t}\n+\n+\t\tif (evvp->evv_type == EFX_VIRTIO_VQ_TYPE_NET_RXQ) {\n+\t\t\t*offsetp = MCDI_OUT_DWORD(req,\n+\t\t\t    VIRTIO_GET_NET_DOORBELL_OFFSET_RESP_RX_DBL_OFFSET);\n+\t\t} else if (evvp->evv_type == EFX_VIRTIO_VQ_TYPE_NET_TXQ) {\n+\t\t\t*offsetp = MCDI_OUT_DWORD(req,\n+\t\t\t    VIRTIO_GET_NET_DOORBELL_OFFSET_RESP_TX_DBL_OFFSET);\n+\t\t}\n+\t\tbreak;\n+\tcase MC_CMD_VIRTIO_GET_FEATURES_IN_BLOCK:\n+\t\tif (req.emr_out_length_used <\n+\t\t    MC_CMD_VIRTIO_GET_BLOCK_DOORBELL_OFFSET_RESP_LEN) {\n+\t\t\trc = EMSGSIZE;\n+\t\t\tgoto fail4;\n+\t\t}\n+\n+\t\t*offsetp = MCDI_OUT_DWORD(req,\n+\t\t\tVIRTIO_GET_BLOCK_DOORBELL_OFFSET_RESP_DBL_OFFSET);\n+\t\tbreak;\n+\tdefault:\n+\t\tEFSYS_ASSERT(0);\n+\t\trc = EINVAL;\n+\t\tgoto fail5;\n+\t}\n+\n+\treturn (0);\n+\n+fail5:\n+\tEFSYS_PROBE(fail5);\n+fail4:\n+\tEFSYS_PROBE(fail4);\n+fail3:\n+\tEFSYS_PROBE(fail3);\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn (rc);\n+}\n+\n #endif\t/* EFSYS_OPT_RIVERHEAD && EFSYS_OPT_VIRTIO */\ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex b4da2ee5e6..0e41fd84fe 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -222,6 +222,7 @@ INTERNAL {\n \tefx_txq_size;\n \n \tefx_virtio_fini;\n+\tefx_virtio_get_doorbell_offset;\n \tefx_virtio_init;\n \tefx_virtio_qcreate;\n \tefx_virtio_qdestroy;\n",
    "prefixes": [
        "2/8"
    ]
}