From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH 4/7] bus/vmbus: stop mapping if empty resource found Date: Thu, 7 Feb 2019 19:44:04 -0800 Message-ID: <20190208034407.7865-5-stephen@networkplumber.org> References: <20190208034407.7865-1-stephen@networkplumber.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: stable@dpdk.org, Stephen Hemminger To: dev@dpdk.org Return-path: Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 4E3661B642 for ; Fri, 8 Feb 2019 04:44:22 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id y4so952562pgc.12 for ; Thu, 07 Feb 2019 19:44:22 -0800 (PST) In-Reply-To: <20190208034407.7865-1-stephen@networkplumber.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger If vmbus is run on older kernel (without all the uio mappings), then the bus driver should stop when it hits the missing mappings rather than recording the empty values. Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Signed-off-by: Stephen Hemminger --- drivers/bus/vmbus/vmbus_common_uio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/vmbus/vmbus_common_uio.c b/drivers/bus/vmbus/vmbus_common_uio.c index 46e233d9fac3..a6545b758e36 100644 --- a/drivers/bus/vmbus/vmbus_common_uio.c +++ b/drivers/bus/vmbus/vmbus_common_uio.c @@ -98,9 +98,9 @@ vmbus_uio_map_primary(struct rte_vmbus_device *dev) /* Map the resources */ for (i = 0; i < VMBUS_MAX_RESOURCE; i++) { - /* skip empty BAR */ + /* stop at empty BAR */ if (dev->resource[i].len == 0) - continue; + break; ret = vmbus_uio_map_resource_by_index(dev, i, uio_res, 0); if (ret) -- 2.20.1