Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/107741/?format=api
https://patches.dpdk.org/api/patches/107741/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220217160613.70161-5-srikanth.k@oneconvergence.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": "<20220217160613.70161-5-srikanth.k@oneconvergence.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220217160613.70161-5-srikanth.k@oneconvergence.com", "date": "2022-02-17T16:06:02", "name": "[v3,04/15] bus/vmbus: add resource by index", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a15b6fb0bf8095b52c03ea8274d5897129c21539", "submitter": { "id": 2368, "url": "https://patches.dpdk.org/api/people/2368/?format=api", "name": "Srikanth Kaka", "email": "srikanth.k@oneconvergence.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220217160613.70161-5-srikanth.k@oneconvergence.com/mbox/", "series": [ { "id": 21713, "url": "https://patches.dpdk.org/api/series/21713/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21713", "date": "2022-02-17T16:05:58", "name": "add FreeBSD support to VMBUS & NetVSC PMDs", "version": 3, "mbox": "https://patches.dpdk.org/series/21713/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/107741/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/107741/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 60C9AA034E;\n\tThu, 17 Feb 2022 17:11:20 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 37CB34115B;\n\tThu, 17 Feb 2022 17:10:56 +0100 (CET)", "from mail-pf1-f170.google.com (mail-pf1-f170.google.com\n [209.85.210.170])\n by mails.dpdk.org (Postfix) with ESMTP id A2B7D40395\n for <dev@dpdk.org>; Thu, 17 Feb 2022 17:06:39 +0100 (CET)", "by mail-pf1-f170.google.com with SMTP id u16so43308pfg.12\n for <dev@dpdk.org>; Thu, 17 Feb 2022 08:06:39 -0800 (PST)", "from srikanth-ThinkPad-T450.. ([49.37.144.122])\n by smtp.gmail.com with ESMTPSA id z14sm47807pfh.173.2022.02.17.08.06.36\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 17 Feb 2022 08:06:38 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oneconvergence.com; s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=uHdnym5iLF3hcfGOk4eFkvx+osDZQyrMuwSTtMyfJ1A=;\n b=HL8kUDuNkJNB796a6zaoVp0YziL0hpV+rBcJ1IbP1v0n6Ol4B38eSQTlB638m6InA1\n OoZDzTVtwQ4YjMlWglB46YqJpgA8FP8vicfOPqHQGeYyXQMYtceoJSrxyU8j0ExrLvAn\n FclqyTp3GO7b116mfpEnAHva/LCeu74GzD9e0=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=uHdnym5iLF3hcfGOk4eFkvx+osDZQyrMuwSTtMyfJ1A=;\n b=DTvizTzGIifU7uoAxuwxtkrP5pPsEyNtVn49C7SKmwYbtBKrXp5zKw/7fDTcJXggba\n IPX0Zx1aAecGR0WHNjloX3U7THCIaze/nLugJOmMnsTfs5hc9DrDy5TsuqbVTE0lt+Zu\n ila4Kq1RqrOgrMZXxPZxTX3HmWiTiOk1Od+WikjNvxhPH69Zf0Ae5Tm5PdUGwF6YibyN\n 6AJT17YsgOpbYsW/gWKiF7ha/MLSrNMujcUqoIEiCrLshLkA7wSxgPr/HBpx1UJyndzu\n p8jbBwMy2CseCFvKb/WCjM+J7Yjfb3fgi4S4CAGJljkbAD0R0PXtODfoApZ2HZ/9Kzh2\n +2/w==", "X-Gm-Message-State": "AOAM53101oYLm89WfLW4t3cwlxHI5K01UnKIdm3FudCDfaZ6kdqao1O/\n Cn7npuuRB6AWFqEssU3tjQJ+dw==", "X-Google-Smtp-Source": "\n ABdhPJy+/Zlut8kSJ4WuqddhyiAroBFOTj0dsqByMkfMdqF0uyTnLnKGmdixG2nrJOnehc6cWPTCcQ==", "X-Received": "by 2002:a63:105c:0:b0:36c:33aa:cb24 with SMTP id\n 28-20020a63105c000000b0036c33aacb24mr2923028pgq.221.1645113998845;\n Thu, 17 Feb 2022 08:06:38 -0800 (PST)", "From": "Srikanth Kaka <srikanth.k@oneconvergence.com>", "To": "sthemmin@microsoft.com,\n\tlongli@microsoft.com", "Cc": "dev@dpdk.org, vag.singh@oneconvergence.com, avelu@juniper.net,\n Srikanth Kaka <srikanth.k@oneconvergence.com>", "Subject": "[PATCH v3 04/15] bus/vmbus: add resource by index", "Date": "Thu, 17 Feb 2022 21:36:02 +0530", "Message-Id": "<20220217160613.70161-5-srikanth.k@oneconvergence.com>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20220217160613.70161-1-srikanth.k@oneconvergence.com>", "References": "<20210927134231.11177-1-srikanth.k@oneconvergence.com>\n <20220217160613.70161-1-srikanth.k@oneconvergence.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Thu, 17 Feb 2022 17:10:51 +0100", "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": "Map the memory region created by hv_uio driver by passing their\nindex number\n\nSigned-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>\nSigned-off-by: Vag Singh <vag.singh@oneconvergence.com>\nSigned-off-by: Anand Thulasiram <avelu@juniper.net>\n---\n drivers/bus/vmbus/freebsd/vmbus_uio.c | 70 +++++++++++++++++++++++++++\n 1 file changed, 70 insertions(+)", "diff": "diff --git a/drivers/bus/vmbus/freebsd/vmbus_uio.c b/drivers/bus/vmbus/freebsd/vmbus_uio.c\nindex 2059ab192b..41522ba2b5 100644\n--- a/drivers/bus/vmbus/freebsd/vmbus_uio.c\n+++ b/drivers/bus/vmbus/freebsd/vmbus_uio.c\n@@ -5,6 +5,7 @@\n \n #include <unistd.h>\n #include <fcntl.h>\n+#include <sys/mman.h>\n #include <sys/types.h>\n #include <sys/sysctl.h>\n #include <sys/ioctl.h>\n@@ -17,6 +18,7 @@\n #include \"private.h\"\n \n const char *driver_name = \"hv_uio\";\n+static void *vmbus_map_addr;\n \n /* Check map names with kernel names */\n static const char *map_names[VMBUS_MAX_RESOURCE] = {\n@@ -140,3 +142,71 @@ vmbus_uio_alloc_resource(struct rte_vmbus_device *dev,\n \tvmbus_uio_free_resource(dev, *uio_res);\n \treturn -1;\n }\n+\n+static int\n+find_max_end_va(const struct rte_memseg_list *msl, void *arg)\n+{\n+\tsize_t sz = msl->memseg_arr.len * msl->page_sz;\n+\tvoid *end_va = RTE_PTR_ADD(msl->base_va, sz);\n+\tvoid **max_va = arg;\n+\n+\tif (*max_va < end_va)\n+\t\t*max_va = end_va;\n+\treturn 0;\n+}\n+\n+/*\n+ * TODO: this should be part of memseg api.\n+ * code is duplicated from PCI.\n+ */\n+static void *\n+vmbus_find_max_end_va(void)\n+{\n+\tvoid *va = NULL;\n+\n+\trte_memseg_list_walk(find_max_end_va, &va);\n+\treturn va;\n+}\n+\n+int\n+vmbus_uio_map_resource_by_index(struct rte_vmbus_device *dev, int idx,\n+\t\t\t\tstruct mapped_vmbus_resource *uio_res,\n+\t\t\t\tint flags)\n+{\n+\tsize_t size = dev->resource[idx].len;\n+\tstruct vmbus_map *maps = uio_res->maps;\n+\tvoid *mapaddr;\n+\toff_t offset;\n+\tint fd;\n+\n+\t/* devname for mmap */\n+\tfd = open(uio_res->path, O_RDWR);\n+\tif (fd < 0) {\n+\t\tVMBUS_LOG(ERR, \"Cannot open %s: %s\",\n+\t\t\t uio_res->path, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\t/* try mapping somewhere close to the end of hugepages */\n+\tif (vmbus_map_addr == NULL)\n+\t\tvmbus_map_addr = vmbus_find_max_end_va();\n+\n+\t/* offset is special in uio it indicates which resource */\n+\toffset = idx * rte_mem_page_size();\n+\n+\tmapaddr = vmbus_map_resource(vmbus_map_addr, fd, offset, size, flags);\n+\tclose(fd);\n+\n+\tif (mapaddr == MAP_FAILED)\n+\t\treturn -1;\n+\n+\tdev->resource[idx].addr = mapaddr;\n+\tvmbus_map_addr = RTE_PTR_ADD(mapaddr, size);\n+\n+\t/* Record result of successful mapping for use by secondary */\n+\tmaps[idx].addr = mapaddr;\n+\tmaps[idx].size = size;\n+\n+\treturn 0;\n+}\n+\n", "prefixes": [ "v3", "04/15" ] }{ "id": 107741, "url": "