get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139687,
    "url": "http://patchwork.dpdk.org/api/patches/139687/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240426005128.148730-1-frank.du@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20240426005128.148730-1-frank.du@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240426005128.148730-1-frank.du@intel.com",
    "date": "2024-04-26T00:51:28",
    "name": "net/af_xdp: fix umem map size for zero copy",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4c175c67fd3ccdaa333b20068812087a8fdfd4c0",
    "submitter": {
        "id": 2892,
        "url": "http://patchwork.dpdk.org/api/people/2892/?format=api",
        "name": "Du, Frank",
        "email": "frank.du@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240426005128.148730-1-frank.du@intel.com/mbox/",
    "series": [
        {
            "id": 31825,
            "url": "http://patchwork.dpdk.org/api/series/31825/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31825",
            "date": "2024-04-26T00:51:28",
            "name": "net/af_xdp: fix umem map size for zero copy",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/31825/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139687/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/139687/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 30BDD43F0E;\n\tFri, 26 Apr 2024 03:05:42 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C24FE43A5C;\n\tFri, 26 Apr 2024 03:05:41 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [192.198.163.19])\n by mails.dpdk.org (Postfix) with ESMTP id DC36C43A52\n for <dev@dpdk.org>; Fri, 26 Apr 2024 03:05:39 +0200 (CEST)",
            "from fmviesa007.fm.intel.com ([10.60.135.147])\n by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Apr 2024 18:05:38 -0700",
            "from media-frankdu-kahawai-node2.sh.intel.com ([10.67.119.123])\n by fmviesa007.fm.intel.com with ESMTP; 25 Apr 2024 18:05: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=1714093540; x=1745629540;\n h=from:to:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=HUfrX+EEelDmEoxFdhoyZPlsir4bQt2vXgRmkCylX7M=;\n b=ewN/AiB4buTNEsNNMqrSupeoUTEG/Fpmt2KKLPC+Up8V5R8tNgRGnKEX\n D5mlUxRzQ+vY8L7t+N4MUqlz9BxLl2Drwx6dnABS2NRrZvzT2B1L0byJz\n 9sSwm5ENCrP+9G0e8qluNsF8XwZKMRyYyIyEY33H1GjJnwR3NEUttPc+b\n e8T4AI9fkuCvUvmVvD7rGQB9V0WrB4INlhpkaf8F3wSlRtzQJOYrNMTv7\n rLa2pFXmlOlmp5EBk/8V6dBO7RNMqi0cOsuJ0ythUOzyA5iTYZPPefWtP\n daf9NZJb/PsKCRkc/r+7VQxZykyTekNSVXp2L2y+s0HigcpNSkWIyAhGC A==;",
        "X-CSE-ConnectionGUID": [
            "6WpUlbdISL+pQw9iAWMfIQ==",
            "EmzxDuPfScCOT1msCgrRcg=="
        ],
        "X-CSE-MsgGUID": [
            "GrYIuT3MRr6u84YQQZBRQg==",
            "kNqPeq5ISFC8kkr/GhpMfg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,11055\"; a=\"9686847\"",
            "E=Sophos;i=\"6.07,231,1708416000\";\n   d=\"scan'208\";a=\"9686847\"",
            "E=Sophos;i=\"6.07,231,1708416000\"; d=\"scan'208\";a=\"25271864\""
        ],
        "X-ExtLoop1": "1",
        "From": "Frank Du <frank.du@intel.com>",
        "To": "dev@dpdk.org",
        "Subject": "[PATCH] net/af_xdp: fix umem map size for zero copy",
        "Date": "Fri, 26 Apr 2024 08:51:28 +0800",
        "Message-Id": "<20240426005128.148730-1-frank.du@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "The current calculation assumes that the mbufs are contiguous. However,\nthis assumption is incorrect when the memory spans across a huge page.\nCorrect to directly read the size from the mempool memory chunks.\n\nSigned-off-by: Frank Du <frank.du@intel.com>\n---\n drivers/net/af_xdp/rte_eth_af_xdp.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex 268a130c49..cb95d17d13 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -1039,7 +1039,7 @@ eth_link_update(struct rte_eth_dev *dev __rte_unused,\n }\n \n #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)\n-static inline uintptr_t get_base_addr(struct rte_mempool *mp, uint64_t *align)\n+static inline uintptr_t get_memhdr_info(struct rte_mempool *mp, uint64_t *align, size_t *len)\n {\n \tstruct rte_mempool_memhdr *memhdr;\n \tuintptr_t memhdr_addr, aligned_addr;\n@@ -1048,6 +1048,7 @@ static inline uintptr_t get_base_addr(struct rte_mempool *mp, uint64_t *align)\n \tmemhdr_addr = (uintptr_t)memhdr->addr;\n \taligned_addr = memhdr_addr & ~(getpagesize() - 1);\n \t*align = memhdr_addr - aligned_addr;\n+\t*len = memhdr->len;\n \n \treturn aligned_addr;\n }\n@@ -1125,6 +1126,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,\n \tvoid *base_addr = NULL;\n \tstruct rte_mempool *mb_pool = rxq->mb_pool;\n \tuint64_t umem_size, align = 0;\n+\tsize_t len = 0;\n \n \tif (internals->shared_umem) {\n \t\tif (get_shared_umem(rxq, internals->if_name, &umem) < 0)\n@@ -1156,10 +1158,8 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,\n \t\t}\n \n \t\tumem->mb_pool = mb_pool;\n-\t\tbase_addr = (void *)get_base_addr(mb_pool, &align);\n-\t\tumem_size = (uint64_t)mb_pool->populated_size *\n-\t\t\t\t(uint64_t)usr_config.frame_size +\n-\t\t\t\talign;\n+\t\tbase_addr = (void *)get_memhdr_info(mb_pool, &align, &len);\n+\t\tumem_size = (uint64_t)len + align;\n \n \t\tret = xsk_umem__create(&umem->umem, base_addr, umem_size,\n \t\t\t\t&rxq->fq, &rxq->cq, &usr_config);\n",
    "prefixes": []
}