From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE520A034E; Thu, 17 Feb 2022 17:11:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B48D41150; Thu, 17 Feb 2022 17:10:54 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id BB2CE40395 for ; Thu, 17 Feb 2022 17:06:33 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id q11-20020a17090a304b00b001b94d25eaecso5834670pjl.4 for ; Thu, 17 Feb 2022 08:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oneconvergence.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m3t6zb06BD25Hrx1X2tEreaPlBsTf2MwHF9az+lnpbs=; b=KuNxxjM8Z4fjnPevel6UQvr583Eoh1WEtDY029LH+ZBjL1Ydws43JojYqga8vWfNgN 3fwt+/NN2/Vbm8R/cY1y7jtqHj4vXi9alfsDbh46dObCo+NX8hC9wMwOfwo6ZzMDgYiQ juBIUQiSGfEa+fsAVu5zZ3Ue6qqs0jtSG3IA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m3t6zb06BD25Hrx1X2tEreaPlBsTf2MwHF9az+lnpbs=; b=cvV18u4nV4K3RoTH0yI+7q8vhhdRookajqK4c8NLEN23e5ufMqqKqaD9p4FU08C3Rn 8I4MoLcHd7teyycR+7+8mghnAlBma2hIDZ0ViiK4wIhB5ZZnJpMx3ow6X29WlNhtXZu3 UmEMbmxWT+Wb/B0RxFihUv2MFb+YjO5wSzlNZqU8xVzXh3Z+bQHYP7ebU/mgV5ENVafq UqKUVMfXppYIHG3UlgKNjgjuXs6soqL4UtVlqcxp9hYbTr6ZsNPNvmvHeP+Ejawwv0QW jiiWGid7nZWg5+4xqMUVECaznqKTuktRACHhyiycWMhidpG0hyWFgmKwd+rqIpNKdFap ruNA== X-Gm-Message-State: AOAM531TiO46+wYM684oVu1M5wdHUVxVB5hcJuOveW3ViQMaVpewu2kY rsXkn0DU/pyzW4aoSH5/mkbNvq0DiXC+/wSMbXo= X-Google-Smtp-Source: ABdhPJy6fasXRtiEt7J8MKHGC4TfJd5cUswWjJPKTeZcFD0gDCup6iMgj1t5icykcXHS9i+3rNrjOQ== X-Received: by 2002:a17:90a:3f09:b0:1b8:e615:a261 with SMTP id l9-20020a17090a3f0900b001b8e615a261mr8050953pjc.196.1645113992925; Thu, 17 Feb 2022 08:06:32 -0800 (PST) Received: from srikanth-ThinkPad-T450.. ([49.37.144.122]) by smtp.gmail.com with ESMTPSA id z14sm47807pfh.173.2022.02.17.08.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:06:32 -0800 (PST) From: Srikanth Kaka To: sthemmin@microsoft.com, longli@microsoft.com Cc: dev@dpdk.org, vag.singh@oneconvergence.com, avelu@juniper.net, Srikanth Kaka Subject: [PATCH v3 02/15] bus/vmbus: handle mapping of device resources Date: Thu, 17 Feb 2022 21:36:00 +0530 Message-Id: <20220217160613.70161-3-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> <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org All resource values are published by HV_UIO driver as sysctl key value pairs and they are read at a later point of the code flow Signed-off-by: Srikanth Kaka Signed-off-by: Vag Singh Signed-off-by: Anand Thulasiram --- drivers/bus/vmbus/freebsd/vmbus_bus.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/bus/vmbus/freebsd/vmbus_bus.c b/drivers/bus/vmbus/freebsd/vmbus_bus.c index c8583aba37..fa0f4883f7 100644 --- a/drivers/bus/vmbus/freebsd/vmbus_bus.c +++ b/drivers/bus/vmbus/freebsd/vmbus_bus.c @@ -41,6 +41,24 @@ parse_sysfs_uuid(const char *filename, rte_uuid_t uu) return 0; } +/* map the resources of a vmbus device in virtual memory */ +int +rte_vmbus_map_device(struct rte_vmbus_device *dev) +{ + if (dev->uio_num < 0) { + VMBUS_LOG(DEBUG, "Not managed by UIO driver, skipped"); + return 1; + } + + return vmbus_uio_map_resource(dev); +} + +void +rte_vmbus_unmap_device(struct rte_vmbus_device *dev) +{ + vmbus_uio_unmap_resource(dev); +} + /* Scan one vmbus entry, and fill the devices list from it. */ static int vmbus_scan_one(const char *name, unsigned int unit_num) -- 2.30.2