From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: Problems running netvsc multiq Date: Fri, 7 Dec 2018 11:18:40 -0800 Message-ID: <20181207111841.29450b51@xeon-e3> References: <1543575881.5400.33.camel@redhat.com> <20181130102756.41332fc2@xeon-e3> <1879110132.59852748.1543604812639.JavaMail.zimbra@redhat.com> <20181204084858.03ecdf98@shemminger-XPS-13-9360> <1543942571.5400.38.camel@redhat.com> <20181205143238.5b4b1ae7@xeon-e3> <1544181343.5629.1.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, maxime coquelin , Yuhui Jiang , Wei Shi To: Mohammed Gamal Return-path: Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id A9A1A5B40 for ; Fri, 7 Dec 2018 20:18:44 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id w73so2372883pfk.10 for ; Fri, 07 Dec 2018 11:18:44 -0800 (PST) In-Reply-To: <1544181343.5629.1.camel@redhat.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 07 Dec 2018 13:15:43 +0200 Mohammed Gamal wrote: > On Wed, 2018-12-05 at 14:32 -0800, Stephen Hemminger wrote: > > The problem is a regression in 4.20 kernel. Bisecting now. =20 >=20 > I was bisecting the kernel and the change that seems to introduce this > regression is this one: >=20 > commit ae6935ed7d424ffa74d634da00767e7b03c98fd3 > Author: Stephen Hemminger > Date:=C2=A0=C2=A0=C2=A0Fri Sep 14 09:10:17 2018 -0700 >=20 > =C2=A0=C2=A0=C2=A0=C2=A0vmbus: split ring buffer allocation from open > =C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0The UIO driver needs the ring buffer to be persis= tent(reused) > =C2=A0=C2=A0=C2=A0=C2=A0across open/close. Split the allocation and setup= of ring buffer > =C2=A0=C2=A0=C2=A0=C2=A0out of vmbus_open. For normal usage vmbus_open/vm= bus_close there > =C2=A0=C2=A0=C2=A0=C2=A0are no changes; only impacts uio_hv_generic which= needs to keep > =C2=A0=C2=A0=C2=A0=C2=A0ring buffer memory and reuse when application res= tarts. > =C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0Signed-off-by: Stephen Hemminger > =C2=A0=C2=A0=C2=A0=C2=A0Signed-off-by: Greg Kroah-Hartman >=20 Patch posted:=20 =46rom stephen@networkplumber.org Fri Dec 7 10:58:47 2018 From: Stephen Hemminger Subject: [PATCH] vmbus: fix subchannel removal The changes to split ring allocation from open/close, broke the cleanup of subchannels. This resulted in problems using uio on network devices because the subchannel was left behind when the network device was unbound. The cause was in the disconnect logic which used list splice to move the subchannel list into a local variable. This won't work because the subchannel list is needed later during the process of the rescind messages (relid2channel). The fix is to just leave the subchannel list in place which is what the original code did. The list is cleaned up later when the host rescind is processed. Fixes: ae6935ed7d42 ("vmbus: split ring buffer allocation from open") Signed-off-by: Stephen Hemminger --- drivers/hv/channel.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index fe00b12e4417..bea4c9850247 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -701,20 +701,12 @@ static int vmbus_close_internal(struct vmbus_channel = *channel) int vmbus_disconnect_ring(struct vmbus_channel *channel) { struct vmbus_channel *cur_channel, *tmp; - unsigned long flags; - LIST_HEAD(list); int ret; =20 if (channel->primary_channel !=3D NULL) return -EINVAL; =20 - /* Snapshot the list of subchannels */ - spin_lock_irqsave(&channel->lock, flags); - list_splice_init(&channel->sc_list, &list); - channel->num_sc =3D 0; - spin_unlock_irqrestore(&channel->lock, flags); - - list_for_each_entry_safe(cur_channel, tmp, &list, sc_list) { + list_for_each_entry_safe(cur_channel, tmp, &channel->sc_list, sc_list) { if (cur_channel->rescind) wait_for_completion(&cur_channel->rescind_event); =20 --=20 2.19.2