From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752441AbcHKMJ6 (ORCPT ); Thu, 11 Aug 2016 08:09:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909AbcHKMJ5 (ORCPT ); Thu, 11 Aug 2016 08:09:57 -0400 From: Vitaly Kuznetsov To: Yuval Mintz Cc: netdev , "devel\@linuxdriverproject.org" , linux-kernel , Haiyang Zhang , "K. Y. Srinivasan" Subject: Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal References: <1470913137-29167-1-git-send-email-vkuznets@redhat.com> <1470913137-29167-3-git-send-email-vkuznets@redhat.com> Date: Thu, 11 Aug 2016 14:09:53 +0200 In-Reply-To: (Yuval Mintz's message of "Thu, 11 Aug 2016 11:46:18 +0000") Message-ID: <87lh038q26.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 11 Aug 2016 12:09:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yuval Mintz writes: >> +static void netvsc_inject_enable(struct net_device_context >> +*net_device_ctx) { >> + net_device_ctx->vf_inject = true; >> +} >> + >> +static void netvsc_inject_disable(struct net_device_context >> +*net_device_ctx) { >> + net_device_ctx->vf_inject = false; >> + >> + /* Wait for currently active users to drain out. */ >> + while (atomic_read(&net_device_ctx->vf_use_cnt) != 0) >> + udelay(50); >> +} > > That was already the behavior before, but are you certain you > want to unconditionally block without any possible timeout? Yes, this is OK. After PATCH4 of this series there is only one place which takes the vf_use_cnt (netvsc_recv_callback()) and it is an interrupt handler, there are no sleepable operations there. -- Vitaly