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 64B59A00C4; Tue, 26 Apr 2022 10:33:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3438842813; Tue, 26 Apr 2022 10:32:44 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 5FD1440042 for ; Sat, 23 Apr 2022 06:30:02 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d15so15057594pll.10 for ; Fri, 22 Apr 2022 21:30:02 -0700 (PDT) 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=vyVw1g6TkkFNBfNOTh+lg5U2wJgJNRf1u/eY8Kt+ANE=; b=F87ClA2ocF3EgKMmLm8kKw52JKwM8q95BNl9V/xG+w/TzTn22YmqQTSlA5HjNo786z vo9TCGwCTikD2+k0Gc7IFNno1Almto94dAtgcpKdPewRYv6PRCcMGZQN1kpInqyWhPTb ixbOmYC7GJRtlebfzx1DRZMgKG55n8PtWdNlw= 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=vyVw1g6TkkFNBfNOTh+lg5U2wJgJNRf1u/eY8Kt+ANE=; b=YmyuZ7/M1tSwa0HvJwa5GsDV3Yq63S6Zql6DD1YrvvCnNyGVQ1N9+vrG1pZk/pMFQT M87nPlG9QZOKZaQ1VMHwaljT/TaYsm1sLMJ6VVA82YGYoVx+FusxsXFsMI+BPXIgYugI 7A9REaZucLEVlSpjn7ClKfDkDxQkOxw10iVB3VSZXh4NykagTmtaihI0dV64voQgcuSU n58V6ievEWENKW5ygWZO7Lqr4Em1pe4RIYqBycmdaZChm0zgEpx9Z66m0jGbD50Ehw7x aQf/QQk/XQTaCQ6jmxqu10Vod6GYx1b8C7vUX9eHWq0wBBn0HjED22/Ek9crb3ZEO8+p klgw== X-Gm-Message-State: AOAM533UQW7DnxJDpT3BsqR/qKy+/yjw+cG8rKzBJxB3FOeD0RIOYsBv r8GNfHH4wMIIU23BB1x1N1lUp9H4fGU79ZRY X-Google-Smtp-Source: ABdhPJxEGWtFdq9UmajBP/HVA1fdM18rITcFQTA8nk7mFz04oByTkagn0l+IrR6tPFA/Y2V3emje5A== X-Received: by 2002:a17:90a:410a:b0:1cb:a279:6679 with SMTP id u10-20020a17090a410a00b001cba2796679mr19755621pjf.211.1650688201638; Fri, 22 Apr 2022 21:30:01 -0700 (PDT) Received: from home-desktop.localdomain ([49.37.158.191]) by smtp.gmail.com with ESMTPSA id g6-20020a17090a714600b001d7f3bb11d7sm4056438pjs.53.2022.04.22.21.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 21:30:01 -0700 (PDT) From: Srikanth Kaka To: Stephen Hemminger , Long Li Cc: dev@dpdk.org, Vag Singh , Anand Thulasiram , Srikanth Kaka Subject: [PATCH v5 05/14] bus/vmbus: handle mapping of device resources Date: Sat, 23 Apr 2022 09:58:40 +0530 Message-Id: <20220423042849.7718-6-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220423042849.7718-1-srikanth.k@oneconvergence.com> References: <20220418042915.5765-1-srikanth.k@oneconvergence.com> <20220423042849.7718-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 26 Apr 2022 10:32:34 +0200 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 c1a3a5f..28f5ff4 100644 --- a/drivers/bus/vmbus/freebsd/vmbus_bus.c +++ b/drivers/bus/vmbus/freebsd/vmbus_bus.c @@ -28,6 +28,24 @@ 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) -- 1.8.3.1