get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121479,
    "url": "http://patches.dpdk.org/api/patches/121479/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221230095853.1323616-1-nipun.gupta@amd.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": "<20221230095853.1323616-1-nipun.gupta@amd.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221230095853.1323616-1-nipun.gupta@amd.com",
    "date": "2022-12-30T09:58:53",
    "name": "vfio: do not coalesce DMA mappings",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ac113b36e878fde028e352035b12ec334d053eb6",
    "submitter": {
        "id": 2928,
        "url": "http://patches.dpdk.org/api/people/2928/?format=api",
        "name": "Gupta, Nipun",
        "email": "nipun.gupta@amd.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221230095853.1323616-1-nipun.gupta@amd.com/mbox/",
    "series": [
        {
            "id": 26332,
            "url": "http://patches.dpdk.org/api/series/26332/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26332",
            "date": "2022-12-30T09:58:53",
            "name": "vfio: do not coalesce DMA mappings",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/26332/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/121479/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/121479/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 6A9A1A0032;\n\tFri, 30 Dec 2022 10:59:05 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 136DA40DD8;\n\tFri, 30 Dec 2022 10:59:05 +0100 (CET)",
            "from NAM04-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam04on2068.outbound.protection.outlook.com [40.107.101.68])\n by mails.dpdk.org (Postfix) with ESMTP id 03AE74067B\n for <dev@dpdk.org>; Fri, 30 Dec 2022 10:59:03 +0100 (CET)",
            "from CY5PR04CA0004.namprd04.prod.outlook.com (2603:10b6:930:1e::26)\n by SJ0PR12MB5439.namprd12.prod.outlook.com (2603:10b6:a03:3ae::18)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Fri, 30 Dec\n 2022 09:59:01 +0000",
            "from CY4PEPF0000C979.namprd02.prod.outlook.com\n (2603:10b6:930:1e:cafe::39) by CY5PR04CA0004.outlook.office365.com\n (2603:10b6:930:1e::26) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.17 via Frontend\n Transport; Fri, 30 Dec 2022 09:59:01 +0000",
            "from SATLEXMB03.amd.com (165.204.84.17) by\n CY4PEPF0000C979.mail.protection.outlook.com (10.167.241.137) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.20.5944.10 via Frontend Transport; Fri, 30 Dec 2022 09:59:00 +0000",
            "from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com\n (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 30 Dec\n 2022 03:58:59 -0600",
            "from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com\n (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 30 Dec\n 2022 01:58:59 -0800",
            "from xhdipdslab49.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com\n (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via\n Frontend Transport; Fri, 30 Dec 2022 03:58:57 -0600"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=E6uVmQ7y3wmO+D/VQKTasdPe2cZWXkdXO9jUljCgTWcGsTCs8o2ZdnvtAyfVvddUwQBpKIJ1ZrGrNewIYsMaYA+5hoXaKtUGoMt0LP4F/KcYwEaR8zbDnUMdxF/3jMNnu3iRXodyFxvx2sMh5PZ11XFqd0vVfJDF2KXn4Yzo2AynDXo9Rfkr3XADsCVUFAShD1tdhH+yyy3zIKI8bf5A2BndJiw84FUFk/FWAPR3Es+AVnIkF1POXFiUE/KN94kBamDAWwTrJod3uXE3Znr0H35TvYCoT13qsyLpQ90Ls92aj9FGLrQgSTV1gZ3yG7i8sNdnt8ySVSpgQYkJBnnCmw==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=CLSbebH20rrqspeCSgRKDl2OO5fbuLRNZd1IZgMCwHk=;\n b=TdJIVkxHB5V78Uc2aMP1EuryxNG0VJS2MDIOOa5566J7GhOKQCOBkux4hwL1VdRYtwySebB4uHETnqo81UDE66UqAC6DOiOqZOHDy9j9WdOAAUpYbqfmqAR6uEQanv7YJA4H2k4TCd1knOsknxhY24P3oK8rm/aHjhz1sbLj4Fykx/2+/x9h4y/1m5ms2eniIa943ni3wbNnRNUqWqFfcB08K4vF74nc7MgtCP9MIKl381ftOD4MGRuMqAdGJN/AoOBR3JGL2JBrpk6ASh3Su6BuoOBgHu4oYPh1qxXY4yw3dbO7ercXOol0NnBxN4kJE2FrTXFYkn6lxi1NnSH40Q==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=temperror (sender ip\n is 165.204.84.17) smtp.rcpttodomain=dpdk.org\n smtp.mailfrom=amd.com;\n dmarc=temperror action=none header.from=amd.com; dkim=none (message not\n signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=CLSbebH20rrqspeCSgRKDl2OO5fbuLRNZd1IZgMCwHk=;\n b=1uP9BCEh4YXc9nsY5DJFeG8/crY4dO/kWK5XKUIHzTdePuGhQusdSGdccq1AY6hnbQ1OgqARpSXxxuZrDeyipnZMkVAwxgPeqwR/J+cfHiVh40Wp8Ouf6VXacSemT7ikbD3/bOToL6XM5sDvS7VMAfT6eAJir6oBu8eUvbrhHQA=",
        "X-MS-Exchange-Authentication-Results": "spf=temperror (sender IP is\n 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed)\n header.d=none;dmarc=temperror action=none header.from=amd.com;",
        "Received-SPF": "TempError (protection.outlook.com: error in processing during\n lookup of amd.com: DNS Timeout)",
        "From": "Nipun Gupta <nipun.gupta@amd.com>",
        "To": "<dev@dpdk.org>, <thomas@monjalon.net>, <anatoly.burakov@intel.com>,\n <ferruh.yigit@amd.com>",
        "CC": "<nikhil.agarwal@amd.com>, Nipun Gupta <nipun.gupta@amd.com>",
        "Subject": "[PATCH] vfio: do not coalesce DMA mappings",
        "Date": "Fri, 30 Dec 2022 15:28:53 +0530",
        "Message-ID": "<20221230095853.1323616-1-nipun.gupta@amd.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "CY4PEPF0000C979:EE_|SJ0PR12MB5439:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "cf577b14-e109-41cc-418d-08daea4c79a6",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n z3p+pybk6ArNSzrBehtVx6hlLl/rny3/Nr7TkxwHmd4evnzolmF1SC+j9S1DxXbsNLbQqfFHYSvH1v08RkIArLNwvAF6d5HgHpH47NGbG/TyTBQ8fFqh30c8oFfLS8iWjy4PqsHaItzcwTlhvtGmCqAyo3ilbXfVX/zwvOY8OQXpKCa5sVoK9khjBLuJiL2gse5SmhPzGc5A2MhY2bVNSSsULFj5WjIBcvSHdvM2QeKj4HZm/uwdQmdRTYB1PoBlia5GoLUHQxsVxWCDB6bt0O7sXSl1X29QCstQMSo1GWUNXz83yEh4l8yW/dyuYj1PHr3Ov+2KIwto4AXraAVEHp88GRm0rlkX4BfkjBm3M6hENSJQXzrMwJqayG5nuFGVkrVN5nIPeJwMs6To7j/2UUvocF8cwGrL3+jg+h3qR+z3xa9yCAw+rBGqsXyb4fD+r3h7diqSyJ2dgV20JKppFJfF0y4uQQtMeCTS2KtcDJeDPsQSh/k0TuB28A9kWZzXVOD+YDx1W8KQgVJwE3VTVq9QkfiJkrxOQbf9fzjQZylha+UhYWFWfetVBY1m8SOMsKaI3qO9yZMo7REfnLg3KAgLoKcnt+qZfwxMYsweExjb26mqfa961W56/Am3Bd2yO6o/v7C2j0DrYxq9wxmrWbU1MbdJRmDP8sAK/rd34PzxX0brZ9RNZqRjw1RiGWu9n0QglczICqgSaLrzQ6KNY4lE5anNzz1Iw+8p/qVD8FZpj7flphA3x46pLiq0ArxMzH+eZeUBd7aWDg3WwBSn6GHS0kwCsHwsIwZj8F1XIuNQcEaub67DwIXGpRIGdKZU",
        "X-Forefront-Antispam-Report": "CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230022)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199015)(40470700004)(46966006)(36840700001)(4326008)(8676002)(70206006)(356005)(8936002)(70586007)(5660300002)(41300700001)(110136005)(2906002)(82310400005)(316002)(36756003)(40460700003)(54906003)(44832011)(86362001)(6636002)(82740400003)(6666004)(478600001)(336012)(966005)(81166007)(186003)(26005)(2616005)(40480700001)(36860700001)(1076003)(426003)(63370400001)(83380400001)(63350400001)(47076005)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "amd.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "30 Dec 2022 09:59:00.4605 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n cf577b14-e109-41cc-418d-08daea4c79a6",
        "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17];\n Helo=[SATLEXMB03.amd.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CY4PEPF0000C979.namprd02.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "SJ0PR12MB5439",
        "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": "At the cleanup time when dma unmap is done, linux kernel\ndoes not allow unmap of individual segments which were\ncoalesced together while creating the DMA map for type1 IOMMU\nmappings. So, this change updates the mapping of the memory\nsegments(hugepages) on a per-page basis.\n\nSigned-off-by: Nipun Gupta <nipun.gupta@amd.com>\n---\n\nWhen hotplug of devices is used, multiple pages gets colaeced\nand a single mapping gets created for these pages (using APIs\nrte_memseg_contig_walk() and type1_map_contig(). On the cleanup\ntime when the memory is released, the VFIO does not cleans up\nthat memory and following error is observed in the eal for 2MB\nhugepages:\nEAL: Unexpected size 0 of DMA remapping cleared instead of 2097152\n\nThis is because VFIO does not clear the DMA (refer API\nvfio_dma_do_unmap() -\nhttps://elixir.bootlin.com/linux/latest/source/drivers/vfio/vfio_iommu_type1.c#L1330),\nwhere it checks the dma mapping where it checks for IOVA to free:\nhttps://elixir.bootlin.com/linux/latest/source/drivers/vfio/vfio_iommu_type1.c#L1418.\n\nThus this change updates the mapping to be created individually\ninstead of colaecing them.\n\n lib/eal/linux/eal_vfio.c | 29 -----------------------------\n 1 file changed, 29 deletions(-)",
    "diff": "diff --git a/lib/eal/linux/eal_vfio.c b/lib/eal/linux/eal_vfio.c\nindex 549b86ae1d..56edccb0db 100644\n--- a/lib/eal/linux/eal_vfio.c\n+++ b/lib/eal/linux/eal_vfio.c\n@@ -1369,19 +1369,6 @@ rte_vfio_get_group_num(const char *sysfs_base,\n \treturn 1;\n }\n \n-static int\n-type1_map_contig(const struct rte_memseg_list *msl, const struct rte_memseg *ms,\n-\t\tsize_t len, void *arg)\n-{\n-\tint *vfio_container_fd = arg;\n-\n-\tif (msl->external)\n-\t\treturn 0;\n-\n-\treturn vfio_type1_dma_mem_map(*vfio_container_fd, ms->addr_64, ms->iova,\n-\t\t\tlen, 1);\n-}\n-\n static int\n type1_map(const struct rte_memseg_list *msl, const struct rte_memseg *ms,\n \t\tvoid *arg)\n@@ -1396,10 +1383,6 @@ type1_map(const struct rte_memseg_list *msl, const struct rte_memseg *ms,\n \tif (ms->iova == RTE_BAD_IOVA)\n \t\treturn 0;\n \n-\t/* if IOVA mode is VA, we've already mapped the internal segments */\n-\tif (!msl->external && rte_eal_iova_mode() == RTE_IOVA_VA)\n-\t\treturn 0;\n-\n \treturn vfio_type1_dma_mem_map(*vfio_container_fd, ms->addr_64, ms->iova,\n \t\t\tms->len, 1);\n }\n@@ -1464,18 +1447,6 @@ vfio_type1_dma_mem_map(int vfio_container_fd, uint64_t vaddr, uint64_t iova,\n static int\n vfio_type1_dma_map(int vfio_container_fd)\n {\n-\tif (rte_eal_iova_mode() == RTE_IOVA_VA) {\n-\t\t/* with IOVA as VA mode, we can get away with mapping contiguous\n-\t\t * chunks rather than going page-by-page.\n-\t\t */\n-\t\tint ret = rte_memseg_contig_walk(type1_map_contig,\n-\t\t\t\t&vfio_container_fd);\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t\t/* we have to continue the walk because we've skipped the\n-\t\t * external segments during the config walk.\n-\t\t */\n-\t}\n \treturn rte_memseg_walk(type1_map, &vfio_container_fd);\n }\n \n",
    "prefixes": []
}