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 1143C6833 for ; Wed, 5 Dec 2018 23:12:21 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id t13so9626479pgr.11 for ; Wed, 05 Dec 2018 14:12:20 -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=dz0Ibotat1ekfWDIMh+K5fL1dzaIAi+KjIo2gCz/hls=; b=I1MyH8K3F2MiOn8PYSoK7v8c8E3J8dsO0p6lmEofdE/tZ4XE/GJBI5txOrrbM3GYnE UbhZxZaPaBkbPR0ku5DxCqDKUjrBDWrdR+WEQEKK8cCAw+LccZN6o+mGv6nk7a/maBdI EFh6gGvbqkd8mTgG0pbTiiH/W+mMOaaBS7rA/hT/s0kK0+cqZlZUdWYMwhWx/bGowA4m 7NS4O0IVto/Juv+ZmJY8dVKnpIf/ouWkqZnS1rnqyIms+qGWe232Kjkk08y8Sr1hAHDc ffpiORGGNQRBatCY71pJ1mho3p9e2X1K+vFjDlHan95QTx8x4IJVXMQMxf9abXohhKKI RRRQ== 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=dz0Ibotat1ekfWDIMh+K5fL1dzaIAi+KjIo2gCz/hls=; b=m/hOk00mBVZJrwbAkNOq05kZZ6TKKT1ijnmoGwbMmz4tWGVdQ98wc8rfX7q8SYAaQj YNsgWknI6pNFU9QPzXGQh5t4+DKd30WejORJHFCNZdXF+7kRfoJSsAgiACkZqWxa4yfL hYnM4WxMOfS6ERHfgxH244K38eULMvwt8q0YiUTGA2h1WKsicPYzYZEr60jUaZi24Rms xmBEIE2s52N6YYBnvjcBkIkrHHHDijoydBuuZtmyUDLik1pEaPZEJlnQaRInf1JjNtQ5 83QwrayoxbfolYXCI2a211HkWTSqV/cVovs6AbkontYqet2yLIRpsMQ0PVKScYbhht28 KiKw== X-Gm-Message-State: AA+aEWY2An2o/swMm1YjdDZFbi8yK+ymRIJfhMROQ/PMwtmt3gwFoJ2C 89BDMVQkUYgdn28JUEBdcmFUr0e3Szw= X-Google-Smtp-Source: AFSGD/X52bjjqStuc6/C0CaseedkhJnoGwosms6EQ/TiuHdhIz9YorYosLZS11c2tIgn10ydU9fJyA== X-Received: by 2002:a63:e5c:: with SMTP id 28mr9251095pgo.369.1544047939586; Wed, 05 Dec 2018 14:12:19 -0800 (PST) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j14sm27704578pfn.175.2018.12.05.14.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 14:12:18 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: mgamal@redhat.com, Stephen Hemminger , Stephen Hemminger Date: Wed, 5 Dec 2018 14:11:56 -0800 Message-Id: <20181205221159.6336-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <1543575881.5400.33.camel@redhat.com> References: <1543575881.5400.33.camel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/4] bus/vmbus: fix race in sub channel creation 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: Wed, 05 Dec 2018 22:12:21 -0000 When using multiple queues, there was a race with the kernel in setting up the second channel. This regression is due to a kernel change which does not allow accessing sysfs files for Hyper-V channels that are not opened. The fix is simple, just move the logic to detect not ready sub channels earlier in the existing loop. Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Reported-by:Mohammed Gamal Signed-off-by: Stephen Hemminger --- drivers/bus/vmbus/linux/vmbus_uio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c index 12e97e3a420a..38df4d724ed5 100644 --- a/drivers/bus/vmbus/linux/vmbus_uio.c +++ b/drivers/bus/vmbus/linux/vmbus_uio.c @@ -357,6 +357,12 @@ int vmbus_uio_get_subchan(struct vmbus_channel *primary, continue; } + if (!vmbus_isnew_subchannel(primary, relid)) + continue; /* Already know about you */ + + if (!vmbus_uio_ring_present(dev, relid)) + continue; /* Ring may not be ready yet */ + snprintf(subchan_path, sizeof(subchan_path), "%s/%lu", chan_path, relid); err = vmbus_uio_sysfs_read(subchan_path, "subchannel_id", @@ -370,12 +376,6 @@ int vmbus_uio_get_subchan(struct vmbus_channel *primary, if (subid == 0) continue; /* skip primary channel */ - if (!vmbus_isnew_subchannel(primary, relid)) - continue; - - if (!vmbus_uio_ring_present(dev, relid)) - continue; /* Ring may not be ready yet */ - err = vmbus_uio_sysfs_read(subchan_path, "monitor_id", &monid, UINT8_MAX); if (err) { -- 2.19.2