get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 111314,
    "url": "http://patches.dpdk.org/api/patches/111314/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1652876035-70513-7-git-send-email-andy.pei@intel.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": "<1652876035-70513-7-git-send-email-andy.pei@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1652876035-70513-7-git-send-email-andy.pei@intel.com",
    "date": "2022-05-18T12:13:48",
    "name": "[v8,06/13] vdpa/ifc: add block device SW live-migration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aac4d103916dbc8dc0804a1e67cbd71b76419251",
    "submitter": {
        "id": 1185,
        "url": "http://patches.dpdk.org/api/people/1185/?format=api",
        "name": "Pei, Andy",
        "email": "andy.pei@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1652876035-70513-7-git-send-email-andy.pei@intel.com/mbox/",
    "series": [
        {
            "id": 22994,
            "url": "http://patches.dpdk.org/api/series/22994/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22994",
            "date": "2022-05-18T12:13:42",
            "name": "add virtio_blk device support to vdpa/ifc",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/22994/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/111314/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/111314/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 B6E86A0503;\n\tWed, 18 May 2022 15:01:18 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A06BF42B8E;\n\tWed, 18 May 2022 15:00:42 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 7D9C042B8E\n for <dev@dpdk.org>; Wed, 18 May 2022 15:00:40 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 May 2022 06:00:40 -0700",
            "from dpdk-dipei.sh.intel.com ([10.67.110.238])\n by orsmga002.jf.intel.com with ESMTP; 18 May 2022 06:00:37 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1652878840; x=1684414840;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=sz9onOMaUbJvEFJ/7VpSN4b2i/5Xag2+m6sgSvsvpxc=;\n b=MrjPTEm8Su7rBO06DQWqy9xWxrK8FPnlMynUQptQCpBdU8fubyKtgVNa\n 1rvS8UjxT4GKMp0gnLpOtK+n34Tx0lNC+oxT4ZC9dbj05+i8pthKkY7xP\n iiA8/vHNM8scFp6XS9veYtSI99SW2+O9zTgQ5xBnnRjNmCMb/fLm+Y8+g\n C0lKI0RQIQOX9Sg6s4Z5SoZVuQ/n2AAULwHIzzflJ3jb3TUzd6n93FbII\n 6dfVVWkfd962Lu+1M0tZ4oZTU8NdTZ2wWl4Z8DHeGA/TSsc3B90qZ0GIL\n m1orDczQBbujqeKSAF037wGNlHDxJdtNGfLq5gqiGp2PHL+080SqWx1Va w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10350\"; a=\"271353664\"",
            "E=Sophos;i=\"5.91,234,1647327600\"; d=\"scan'208\";a=\"271353664\"",
            "E=Sophos;i=\"5.91,234,1647327600\"; d=\"scan'208\";a=\"556312273\""
        ],
        "X-ExtLoop1": "1",
        "From": "Andy Pei <andy.pei@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com, maxime.coquelin@redhat.com, gang.cao@intel.com,\n changpeng.liu@intel.com, rosen.xu@intel.com, qimaix.xiao@intel.com",
        "Subject": "[PATCH v8 06/13] vdpa/ifc: add block device SW live-migration",
        "Date": "Wed, 18 May 2022 20:13:48 +0800",
        "Message-Id": "<1652876035-70513-7-git-send-email-andy.pei@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1652876035-70513-1-git-send-email-andy.pei@intel.com>",
        "References": "<1643093258-47258-2-git-send-email-andy.pei@intel.com>\n <1652876035-70513-1-git-send-email-andy.pei@intel.com>",
        "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": "Add SW live-migration support to block device.\nFor block device, it is critical that no packet\nshould be dropped. So when virtio blk device is\npause, make sure hardware last_avail_idx and\nlast_used_idx are the same. This indicates all\nrequests have recieved acks, and no inflight IO.\n\nSigned-off-by: Andy Pei <andy.pei@intel.com>\n---\n drivers/vdpa/ifc/base/ifcvf.h |  1 +\n drivers/vdpa/ifc/ifcvf_vdpa.c | 42 ++++++++++++++++++++++++++++++++++++++----\n 2 files changed, 39 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h\nindex 244de46..4fb1736 100644\n--- a/drivers/vdpa/ifc/base/ifcvf.h\n+++ b/drivers/vdpa/ifc/base/ifcvf.h\n@@ -65,6 +65,7 @@\n #define IFCVF_MEDIATED_VRING\t\t0x200000000000\n \n #define IFCVF_32_BIT_MASK\t\t0xffffffff\n+#define IFCVF_16_BIT_MASK\t\t0xffff\n \n \n #ifndef VHOST_USER_PROTOCOL_F_CONFIG\ndiff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c\nindex 509a1ed..3e78c7d 100644\n--- a/drivers/vdpa/ifc/ifcvf_vdpa.c\n+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c\n@@ -316,8 +316,34 @@ struct rte_vdpa_dev_info {\n \tuint64_t features = 0;\n \tuint64_t log_base = 0, log_size = 0;\n \tuint64_t len;\n+\tu32 ring_state = 0;\n \n \tvid = internal->vid;\n+\n+\t/* to make sure no packet is lost for blk device\n+\t * do not stop until last_avail_idx == last_used_idx\n+\t */\n+\tif (internal->hw.device_type == IFCVF_BLK) {\n+\t\tfor (i = 0; i < hw->nr_vring; i++) {\n+\t\t\tdo {\n+\t\t\t\tif (hw->lm_cfg != NULL)\n+\t\t\t\t\tring_state = *(u32 *)(hw->lm_cfg +\n+\t\t\t\t\t\tIFCVF_LM_RING_STATE_OFFSET +\n+\t\t\t\t\t\ti * IFCVF_LM_CFG_SIZE);\n+\t\t\t\thw->vring[i].last_avail_idx =\n+\t\t\t\t\t(u16)(ring_state & IFCVF_16_BIT_MASK);\n+\t\t\t\thw->vring[i].last_used_idx =\n+\t\t\t\t\t(u16)(ring_state >> 16);\n+\t\t\t\tif (hw->vring[i].last_avail_idx !=\n+\t\t\t\t\thw->vring[i].last_used_idx) {\n+\t\t\t\t\tifcvf_notify_queue(hw, i);\n+\t\t\t\t\tusleep(10);\n+\t\t\t\t}\n+\t\t\t} while (hw->vring[i].last_avail_idx !=\n+\t\t\t\thw->vring[i].last_used_idx);\n+\t\t}\n+\t}\n+\n \tifcvf_stop_hw(hw);\n \n \tfor (i = 0; i < hw->nr_vring; i++)\n@@ -641,8 +667,10 @@ struct rte_vdpa_dev_info {\n \t\t}\n \t\thw->vring[i].avail = gpa;\n \n-\t\t/* Direct I/O for Tx queue, relay for Rx queue */\n-\t\tif (i & 1) {\n+\t\t/* NET: Direct I/O for Tx queue, relay for Rx queue\n+\t\t * BLK: relay every queue\n+\t\t */\n+\t\tif ((internal->hw.device_type == IFCVF_NET) && (i & 1)) {\n \t\t\tgpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.used);\n \t\t\tif (gpa == 0) {\n \t\t\t\tDRV_LOG(ERR, \"Fail to get GPA for used ring.\");\n@@ -692,8 +720,12 @@ struct rte_vdpa_dev_info {\n \n \tfor (i = 0; i < hw->nr_vring; i++) {\n \t\t/* synchronize remaining new used entries if any */\n-\t\tif ((i & 1) == 0)\n+\t\tif (internal->hw.device_type == IFCVF_NET) {\n+\t\t\tif ((i & 1) == 0)\n+\t\t\t\tupdate_used_ring(internal, i);\n+\t\t} else if (internal->hw.device_type == IFCVF_BLK) {\n \t\t\tupdate_used_ring(internal, i);\n+\t\t}\n \n \t\trte_vhost_get_vhost_vring(vid, i, &vq);\n \t\tlen = IFCVF_USED_RING_LEN(vq.size);\n@@ -755,7 +787,9 @@ struct rte_vdpa_dev_info {\n \t\t}\n \t}\n \n-\tfor (qid = 0; qid < q_num; qid += 2) {\n+\tfor (qid = 0; qid < q_num; qid += 1) {\n+\t\tif ((internal->hw.device_type == IFCVF_NET) && (qid & 1))\n+\t\t\tcontinue;\n \t\tev.events = EPOLLIN | EPOLLPRI;\n \t\t/* leave a flag to mark it's for interrupt */\n \t\tev.data.u64 = 1 | qid << 1 |\n",
    "prefixes": [
        "v8",
        "06/13"
    ]
}