get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 48754,
    "url": "https://patches.dpdk.org/api/patches/48754/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181213100910.13087-8-xiao.w.wang@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": "<20181213100910.13087-8-xiao.w.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181213100910.13087-8-xiao.w.wang@intel.com",
    "date": "2018-12-13T10:09:08",
    "name": "[v3,7/9] net/ifc: use lib API for used ring logging",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "246752a1d2cb68373b880915fb0d571115758125",
    "submitter": {
        "id": 281,
        "url": "https://patches.dpdk.org/api/people/281/?format=api",
        "name": "Xiao Wang",
        "email": "xiao.w.wang@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/20181213100910.13087-8-xiao.w.wang@intel.com/mbox/",
    "series": [
        {
            "id": 2755,
            "url": "https://patches.dpdk.org/api/series/2755/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2755",
            "date": "2018-12-13T10:09:01",
            "name": "support SW assisted VDPA live migration",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/2755/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/48754/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/48754/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9982C1B4EA;\n\tThu, 13 Dec 2018 11:19:32 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 4977D1B500\n\tfor <dev@dpdk.org>; Thu, 13 Dec 2018 11:19:31 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Dec 2018 02:19:30 -0800",
            "from dpdk-xiao-1.sh.intel.com ([10.67.111.145])\n\tby orsmga008.jf.intel.com with ESMTP; 13 Dec 2018 02:19:29 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,348,1539673200\"; d=\"scan'208\";a=\"101210451\"",
        "From": "Xiao Wang <xiao.w.wang@intel.com>",
        "To": "alejandro.lucero@netronome.com,\n\ttiwei.bie@intel.com",
        "Cc": "maxime.coquelin@redhat.com, dev@dpdk.org, zhihong.wang@intel.com,\n\txiaolong.ye@intel.com, Xiao Wang <xiao.w.wang@intel.com>",
        "Date": "Thu, 13 Dec 2018 18:09:08 +0800",
        "Message-Id": "<20181213100910.13087-8-xiao.w.wang@intel.com>",
        "X-Mailer": "git-send-email 2.15.1",
        "In-Reply-To": "<20181213100910.13087-1-xiao.w.wang@intel.com>",
        "References": "<20181213011014.110089-3-xiao.w.wang@intel.com>\n\t<20181213100910.13087-1-xiao.w.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 7/9] net/ifc: use lib API for used ring logging",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Vhost lib has already provided a helper for used ring logging, driver\ncould use it to reduce code.\n\nSigned-off-by: Xiao Wang <xiao.w.wang@intel.com>\n---\n drivers/net/ifc/ifcvf_vdpa.c | 27 ++++++++-------------------\n 1 file changed, 8 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c\nindex 395c5112f..f181c5a6e 100644\n--- a/drivers/net/ifc/ifcvf_vdpa.c\n+++ b/drivers/net/ifc/ifcvf_vdpa.c\n@@ -31,6 +31,9 @@\n #define PAGE_SIZE 4096\n #endif\n \n+#define IFCVF_USED_RING_LEN(size) \\\n+\t((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3)\n+\n #define IFCVF_VDPA_MODE\t\t\"vdpa\"\n #define IFCVF_SW_FALLBACK_LM\t\"swlm\"\n \n@@ -288,21 +291,6 @@ vdpa_ifcvf_start(struct ifcvf_internal *internal)\n \treturn ifcvf_start_hw(&internal->hw);\n }\n \n-static void\n-ifcvf_used_ring_log(struct ifcvf_hw *hw, uint32_t queue, uint8_t *log_buf)\n-{\n-\tuint32_t i, size;\n-\tuint64_t pfn;\n-\n-\tpfn = hw->vring[queue].used / PAGE_SIZE;\n-\tsize = hw->vring[queue].size * sizeof(struct vring_used_elem) +\n-\t\t\tsizeof(uint16_t) * 3;\n-\n-\tfor (i = 0; i <= size / PAGE_SIZE; i++)\n-\t\t__sync_fetch_and_or_8(&log_buf[(pfn + i) / 8],\n-\t\t\t\t1 << ((pfn + i) % 8));\n-}\n-\n static void\n vdpa_ifcvf_stop(struct ifcvf_internal *internal)\n {\n@@ -311,7 +299,7 @@ vdpa_ifcvf_stop(struct ifcvf_internal *internal)\n \tint vid;\n \tuint64_t features;\n \tuint64_t log_base, log_size;\n-\tuint8_t *log_buf;\n+\tuint64_t len;\n \n \tvid = internal->vid;\n \tifcvf_stop_hw(hw);\n@@ -330,9 +318,10 @@ vdpa_ifcvf_stop(struct ifcvf_internal *internal)\n \t\t * IFCVF marks dirty memory pages for only packet buffer,\n \t\t * SW helps to mark the used ring as dirty after device stops.\n \t\t */\n-\t\tlog_buf = (uint8_t *)(uintptr_t)log_base;\n-\t\tfor (i = 0; i < hw->nr_vring; i++)\n-\t\t\tifcvf_used_ring_log(hw, i, log_buf);\n+\t\tfor (i = 0; i < hw->nr_vring; i++) {\n+\t\t\tlen = IFCVF_USED_RING_LEN(hw->vring[i].size);\n+\t\t\trte_vhost_log_used_vring(vid, i, 0, len);\n+\t\t}\n \t}\n }\n \n",
    "prefixes": [
        "v3",
        "7/9"
    ]
}