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 F420AA00BE; Tue, 19 Apr 2022 11:34:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 311C642804; Tue, 19 Apr 2022 11:33:44 +0200 (CEST) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 6B1984014F for ; Mon, 18 Apr 2022 06:29:46 +0200 (CEST) Received: by mail-pj1-f44.google.com with SMTP id g12-20020a17090a640c00b001cb59d7a57cso11161293pjj.1 for ; Sun, 17 Apr 2022 21:29:46 -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=z1qtB1g0KQc0UonmbpNPp5xwc1yvf8OZS+J+DYWpJ0Q=; b=Mrg66hIo2TBvvNs93MuUYJ39JNRA45bgj8MkrQ3kzg3TSCB2ibYvJV0hUC7o6ZJP2S mkHCfeXqwa9Iwq5YZ7hYntdITIQ+ge8CRdOnvM24zIOVqkq4TouUX3Jq3/mgSv8la52H HM5POdSFw//RG9JVXqHueJsqIjhi8N3IO/7do= 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=z1qtB1g0KQc0UonmbpNPp5xwc1yvf8OZS+J+DYWpJ0Q=; b=kmks1eUkksAX/LLyLPq+QHeVVld31dXaV/zI0rzNcSFoJ+hP5jVKqDmZ3JyZrAgfpR rmAOoG3oIymzoGmkhzFTk9woF8Y9L0oEzsoUgP50XvyULVQupHSSv1ornV8sRAeOTSgY yprHWMC9V6LApKIkFNLHCEqTGA3ICKGPZNFrK0vYryxF5NQsUGflCMe5SXHOjmTQsWVf yR6/G0PJL7rXO8oqrosM/g2TPJIED3gPdxx8FhMdzMDL5kwZnRBnZU/W+CzmNN79gPNU D6xG5t406+uEbNoNnn4DpAaF1Um5rS6ECOBDUYQimReSHOLclfpjzRS/AtmlNvcWvPXR GrVg== X-Gm-Message-State: AOAM533zrs9VeZvxTZLip32Ba9JYl1tm/2t4X+PBlI03T2D0HzZhuNcA 4WyMlHBKF0yjQvLmclv4qVZZYQ== X-Google-Smtp-Source: ABdhPJw52ugIWlvAIDUvcrUe11lfkCietsTQc9DQunJcL8r+PE3ob7eljPfAnWjSox4v+X/jzjzxWw== X-Received: by 2002:a17:90b:3ece:b0:1d2:aee9:23c8 with SMTP id rm14-20020a17090b3ece00b001d2aee923c8mr493249pjb.112.1650256185719; Sun, 17 Apr 2022 21:29:45 -0700 (PDT) Received: from srikanth-ThinkPad-T450.. ([49.37.158.191]) by smtp.gmail.com with ESMTPSA id e14-20020aa78c4e000000b00506475da4cesm10377577pfd.49.2022.04.17.21.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Apr 2022 21:29:45 -0700 (PDT) From: Srikanth Kaka To: Stephen Hemminger , Long Li Cc: dev@dpdk.org, Vag Singh , Anand Thulasiram , Srikanth Kaka Subject: [PATCH v4 05/14] bus/vmbus: handle mapping of device resources Date: Mon, 18 Apr 2022 09:59:06 +0530 Message-Id: <20220418042915.5765-6-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220418042915.5765-1-srikanth.k@oneconvergence.com> References: <20220217160613.70161-16-srikanth.k@oneconvergence.com> <20220418042915.5765-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 19 Apr 2022 11:33:36 +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 8cf3bc5a6a..afa1e74976 100644 --- a/drivers/bus/vmbus/freebsd/vmbus_bus.c +++ b/drivers/bus/vmbus/freebsd/vmbus_bus.c @@ -28,6 +28,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