From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id D21C61B444 for ; Mon, 3 Dec 2018 07:02:58 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F21EB3082125; Mon, 3 Dec 2018 06:02:57 +0000 (UTC) Received: from ovpn-112-16.ams2.redhat.com (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBF615C23A; Mon, 3 Dec 2018 06:02:56 +0000 (UTC) Message-ID: <1543816975.5400.35.camel@redhat.com> From: Mohammed Gamal To: Stephen Hemminger , dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 03 Dec 2018 07:02:55 +0100 In-Reply-To: <20181130202457.10888-1-stephen@networkplumber.org> References: <1543575881.5400.33.camel@redhat.com> <20181130202457.10888-1-stephen@networkplumber.org> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 03 Dec 2018 06:02:58 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] bus/vmbus: fix race in sub channel creation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: mgamal@redhat.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2018 06:02:59 -0000 On Fri, 2018-11-30 at 12:24 -0800, Stephen Hemminger wrote: > When using multiple queues, there was a race with the kernel > in setting up the second channel. This is do due to a kernel change > whiche 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) { With this patch I am now getting the following error: [...] Configuring Port 0 (socket 0) hn_dev_configure():  >> hn_rndis_link_status(): link status 0x40020006 hn_subchan_configure(): open 1 subchannels hn_subchan_configure(): open subchannel failed: -2 hn_dev_configure(): subchannel configuration failed Port0 dev_configure = -2 hn_dev_rx_queue_release():  >> hn_dev_rx_queue_release():  >> hn_dev_tx_queue_release():  >> hn_dev_tx_queue_release():  >> Fail to configure port 0 EAL: Error - exiting with code: 1   Cause: Start ports failed Apparently, no subchannels were ready. Anything I may have missed or misconfigured? Regards, Mohammed