From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MpiYCMsFaEOjli1KVAU43+G7aYNgTfotKzBILh6TIdk=; b=qizOtV0Ao/dBZXBBfe8fIJil5FMKXytavr1jSmtx4wWrdhZUDKVVChTBwsxTWr/CsQ eeBxPirSCjQ7RI8NfHl4Sb7noYS6JsplKmRYOwuwslKyDh2w8y3kRNdDHcPFcEUcnRgo j6W/IEMB2CNfOtj23QRnsX7UFUvxoYP7JyR4ZjtPY6QtUWEeJz0suqyYeNo3WEuaR0v2 d0aNTICBOPWnpya42rphs2KTMR4MlhZx6nQxl4CCbV0KHpfOCHZAuih6fb8prJGM1QM0 Si+L7fQb1arQx+zp4/FcltdDnZFsvvy/93PE6hBU91XhIQWiG/tjbxM7KaYOEuFOa0+M 4k9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MpiYCMsFaEOjli1KVAU43+G7aYNgTfotKzBILh6TIdk=; b=PSJiBJDEn3vGv7l2AI8vEKm9fFP6Dw0i37GCdHnuIdfKU++3cFgQfS76+p6mVRWL4n 737Zquji9sxmphuduw0nW6k7naakhTeU4h7l7ijHyBjwHM7vE9NQS++dpY45pndzyQC9 ZAthfuy8RDIicw8TBWO0dXV5UpxmR08lEn2NXq1c+drkDYbKZq3Ewhl4E0+1gHYt9bOp l5X+MfSNYLijf7VTn2+voqeEdTsjTPV52RfaEN/Yv931jXZFrMONrUj5Y2LH+wvqtjGn Od3fAAOEKa787taMMeUyfnEX2kGzVYMfk8LsrlCBjy2DEOWJYtRewTHJlbwVn/pIG3V7 aRvw== X-Gm-Message-State: AHQUAuYh+13Ux6DCacQ9rWXhjV9v0CI09ecd5DqOafloL4X5myFvh1CC P4QhkdyQBVusGCYYvIXBFTBGgQAle+0= X-Google-Smtp-Source: AHgI3IYdhRFGZ3644m3WvtCAiu6xBjt29VF8ZqL+f1iNdC/x3LvGNVvzY4qav1okVVa2ESq9r5UaRw== X-Received: by 2002:a62:5301:: with SMTP id h1mr19772218pfb.17.1549597461180; Thu, 07 Feb 2019 19:44:21 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i4sm873275pfj.82.2019.02.07.19.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 19:44:19 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: stable@dpdk.org, Stephen Hemminger Date: Thu, 7 Feb 2019 19:44:04 -0800 Message-Id: <20190208034407.7865-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208034407.7865-1-stephen@networkplumber.org> References: <20190208034407.7865-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 4/7] bus/vmbus: stop mapping if empty resource found X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2019 03:44:22 -0000 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