Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2024764pja; Thu, 26 Mar 2020 08:29:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vslr0ddbiCytmmNQbHOMXFTeJOR9cBGCSBtqi6AG2bhukTO79wb2BXQuJqOWKjBlpTsc9wR X-Received: by 2002:aca:fc88:: with SMTP id a130mr372611oii.89.1585236598472; Thu, 26 Mar 2020 08:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585236598; cv=none; d=google.com; s=arc-20160816; b=EGIFdDu5joDYRP6T4WiTGbW/f90OiaJtwJysWc9hQqYwBmiGnptg+YHeDvRjfaquQY xOTRquCAEUFfMb4y5fXb+Mp2/9vQFYj3Uw1dDkjrC/mVC7abNXnY/N2Z/rlaz2OtD/Dz o4W5Ebbuh13E0r72wqTehyGlaKco4aa1aQuR1zHopRF2CtSmSITV1V9f//oxvq41oez2 2R5a1r8bWVCI+4gCeCnJc2plKAcKFfubKAhxxii0Y7bxS5srtyWAdBjd0h+B4I5GliU1 MLx1bbN9AJOcQ98E/XzFKVKxvwsGFDuOoKO3XCQDnOYkBrX0Cc25+E+9zk8iAuzbJNfj flIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=NxQYW/nnrzb7W5073+0iMTEQJ++9sTJN5W/GMW2FN1I=; b=osRIdBG6TNIs8135U/KhJSeZxE+xpqO7zEgrS/Bu3kTwbcbJTetsqxO3p0m4FX5fgg OJQ/oAnbjYDCsIqTYJHP7h7Bqw+Oeij4B5HzVJPKyFOQa0tiUwMJSWOTc6NUHZASz2y2 ooZkgM5mnjJ5zVNlhyosV72c+U67b0mDjbrDg0qG1tm4TS19oyxhW09xbXwZSF5+yvPt jd0hzbley7LJvBgP0H1L4+tLyMZ015P/p2YirmRqvY0WomM6m5Tj3nDqjWy89kNLsHtw Vkl+Y2gbCoRLSTZ9xab3JR7gpTJmlNTwjTOx4KaFf2R2y3f60TF+D/Rgb9PowvORX3YS ESVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=AFFIqAWn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si1145611oib.255.2020.03.26.08.29.44; Thu, 26 Mar 2020 08:29:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=AFFIqAWn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728446AbgCZP0s (ORCPT + 99 others); Thu, 26 Mar 2020 11:26:48 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:36895 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgCZP0s (ORCPT ); Thu, 26 Mar 2020 11:26:48 -0400 Received: by mail-pj1-f66.google.com with SMTP id o12so2543890pjs.2 for ; Thu, 26 Mar 2020 08:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NxQYW/nnrzb7W5073+0iMTEQJ++9sTJN5W/GMW2FN1I=; b=AFFIqAWnDRv4folqfy/T/Ljb8pr8zkAnlgorZ67c5raMz+ejCcNcMmAahXPdj/uh2i mY8LRxN7UYP/Nsu4fTizjCYnYjDs2sM3gFqBGP3gFdUkxK+ZS94XtunXIKxoNq8I86Q9 3misuD83KFRzr2MVGM1sU3D/VM5rJnj1zNNhlHde/GxONLu9PvKiesD319uX27Aeu5UK mpjEAjjjFbCbG8mlun/UW+MYkjqBuKyz8WaSk4Q9IqnYYk+FvRspJ9pSKuT0lvQ2H7pa X0HvLrd/Z7s3jTPxdKEHoLPbajwwgmIxlQxgXbGDEMiG92Hkm4eEtvZGaZb3IJwPS5X4 O6uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxQYW/nnrzb7W5073+0iMTEQJ++9sTJN5W/GMW2FN1I=; b=dJ5Dkxi1hhYAlAqyNKidnqg57ugjftyac85hIYZM0UAPmPlspLc3BIn0ubq36O5IP7 BquUepxCK4nPJoKMuV+C1jUhkICJYHS+yqvVx5++TGm5NXy5d6NQuaG4EdqmlwW+h+X3 Ib56qzq2r9olKbZYMb6X+9ejwGWUuyE95cIGvfcjypiC7xoKaz0lrCSJlVQdWff/2umI 9LCNwMPFicaQIDHti8b3k5qP/JqYtEczY9dbGs3AesTX5rnN0n0RFE/0zTGUFW6JI+L6 0LmmLtvWTjMumv7bjsxJJeqhUeYLjKuhBTqlFFeSLkYa6htH05CEy95enliEPtU9fdbI JDKg== X-Gm-Message-State: ANhLgQ18vThkpk5DTi0y7iPDFn2wV2TzmH+qEiPN3362oypnwgfXdl5K xUUDcGPBuTc0OmYqnRAGNWiX3A== X-Received: by 2002:a17:902:b115:: with SMTP id q21mr8292519plr.337.1585236407290; Thu, 26 Mar 2020 08:26:47 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id bo12sm1853269pjb.16.2020.03.26.08.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 08:26:46 -0700 (PDT) Date: Thu, 26 Mar 2020 08:26:36 -0700 From: Stephen Hemminger To: "Andrea Parri (Microsoft)" Cc: linux-kernel@vger.kernel.org, "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , linux-hyperv@vger.kernel.org, Michael Kelley , Dexuan Cui , Boqun Feng , Vitaly Kuznetsov , "David S. Miller" , netdev@vger.kernel.org Subject: Re: [RFC PATCH 04/11] hv_netvsc: Disable NAPI before closing the VMBus channel Message-ID: <20200326082636.1d777921@hermes.lan> In-Reply-To: <20200325225505.23998-5-parri.andrea@gmail.com> References: <20200325225505.23998-1-parri.andrea@gmail.com> <20200325225505.23998-5-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Mar 2020 23:54:58 +0100 "Andrea Parri (Microsoft)" wrote: > vmbus_chan_sched() might call the netvsc driver callback function that > ends up scheduling NAPI work. This "work" can access the channel ring > buffer, so we must ensure that any such work is completed and that the > ring buffer is no longer being accessed before freeing the ring buffer > data structure in the channel closure path. To this end, disable NAPI > before calling vmbus_close() in netvsc_device_remove(). > > Suggested-by: Michael Kelley > Signed-off-by: Andrea Parri (Microsoft) > Cc: "David S. Miller" > Cc: Do you have a test that reproduces this issue? The netvsc device is somewhat unique in that it needs NAPI enabled on the primary channel to interact with the host. Therefore it can't call napi_disable in the normal dev->stop() place. Acked-by: Stephen Hemminger