get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 120877,
    "url": "https://patches.dpdk.org/api/patches/120877/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1671004060-62997-1-git-send-email-andy.pei@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": "<1671004060-62997-1-git-send-email-andy.pei@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1671004060-62997-1-git-send-email-andy.pei@intel.com",
    "date": "2022-12-14T07:47:40",
    "name": "vdpa/ifc: add live migration for block device",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5cb7cc8847e01673b743479caac4c2a173fe6415",
    "submitter": {
        "id": 1185,
        "url": "https://patches.dpdk.org/api/people/1185/?format=api",
        "name": "Pei, Andy",
        "email": "andy.pei@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/1671004060-62997-1-git-send-email-andy.pei@intel.com/mbox/",
    "series": [
        {
            "id": 26122,
            "url": "https://patches.dpdk.org/api/series/26122/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26122",
            "date": "2022-12-14T07:47:40",
            "name": "vdpa/ifc: add live migration for block device",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/26122/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/120877/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/120877/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 15905A0543;\n\tWed, 14 Dec 2022 09:39:49 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F3A67400D6;\n\tWed, 14 Dec 2022 09:39:48 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id 2C2CF4003F\n for <dev@dpdk.org>; Wed, 14 Dec 2022 09:39:47 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Dec 2022 00:39:46 -0800",
            "from dpdk-dipei.sh.intel.com ([10.67.110.229])\n by orsmga002.jf.intel.com with ESMTP; 14 Dec 2022 00:39:39 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1671007187; x=1702543187;\n h=from:to:cc:subject:date:message-id;\n bh=T69brXRRI/rt4+rBfHreF1ihUedLJDTRvwkeqJBnZQU=;\n b=NnNzlro0skwcWwnlMqRuPy1LLXj/GuUip/mmJF6e5Od8eGySt7UVnm0k\n iMC2TjflT8It/1IRBnIIysWBxb8PAznszq3EK1l7fLli5VBlT6Yp16rUz\n UXJdcq7T4iFxSiVPXMX8/bxC7s6RvYROuHcmUoa9nhU9+O4miErVMy7j9\n rul4JSFqXQmyFknWSCay9QobztjA7kqpoZUhZjpGtY+6K4601ue7NlmvV\n gceUvtCDdadrQpARQbPYnTgCoImfKEGz5pVSasTIyQgD4ZrV68J6Y1WoC\n XLl8cnjYFpY72cvDiMTFNCGpyf/4iQ5owC8cBaygIsP+m8WkBaNopnFeR w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10560\"; a=\"320208775\"",
            "E=Sophos;i=\"5.96,243,1665471600\"; d=\"scan'208\";a=\"320208775\"",
            "E=McAfee;i=\"6500,9779,10560\"; a=\"648928856\"",
            "E=Sophos;i=\"5.96,243,1665471600\"; d=\"scan'208\";a=\"648928856\""
        ],
        "X-ExtLoop1": "1",
        "From": "Andy Pei <andy.pei@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com,\n\tmaxime.coquelin@redhat.com,\n\txiao.w.wang@intel.com",
        "Subject": "[PATCH] vdpa/ifc: add live migration for block device",
        "Date": "Wed, 14 Dec 2022 15:47:40 +0800",
        "Message-Id": "<1671004060-62997-1-git-send-email-andy.pei@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "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": "When we use \"sw-live-migration=1\" in arguments, we run in SW assisted \nlive migration mode.\n\nIn SW assisted live migration mode, driver will stop the device and\nsetup a mediated virtio ring to relay the communication between the\nvirtio driver and the VDPA device.\n\nFor block devices, we have to make sure that each IO is completed.\nWhen we terminate the above mediated virtio ring, we stop \nnotifying queue about new IOs, wait for all the in-flight IOs to \nbe completed.\n\nSigned-off-by: Andy Pei <andy.pei@intel.com>\n---\n drivers/vdpa/ifc/ifcvf_vdpa.c | 22 ++++++++++++++++++++++\n 1 file changed, 22 insertions(+)",
    "diff": "diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c\nindex 49d68ad..17838ac 100644\n--- a/drivers/vdpa/ifc/ifcvf_vdpa.c\n+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c\n@@ -865,8 +865,30 @@ struct rte_vdpa_dev_info {\n \tstruct ifcvf_hw *hw = &internal->hw;\n \tuint64_t m_vring_iova = IFCVF_MEDIATED_VRING;\n \tuint64_t size, 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\tusleep(10);\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",
    "prefixes": []
}