From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D79E199D9; Mon, 30 Oct 2023 21:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g/oYgCeN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D3F5C433C7; Mon, 30 Oct 2023 21:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698701144; bh=+b0YC2uQr6Lu6xgNwJdj0UnPpjDCBGsTQO6PZ1T3PWY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g/oYgCeNvrQ+caweHyevJAr7jN2Lt2kIc0lD3tiZBcWyxUqYhCAk4ETl32LBLt9R/ 4EYJj7jcvKJgAgsTg7nShwfTlAnd3GONwDEM5HGvu/LfTmdIrjs4Td0ze50ti4IUa+ 15fVLZ8GjGn9QZMIGxu+p6A3XoJWGUTjVVmFtWtKXg+np0DkEjGUh/lQs4MDqTHqJM oiSUvv8U5XOLSRrKxQOcX3nvjmTkSwsT6Arrr6hFsmQnVA+ODctbZaKlW2V4Snh3F6 RvKiSn+jVUtfMaa13F5Njsm0Tnp51qcxApx+dw/pa3cQeRdsOEJNpLvKGsr1+PqF7x 4LncKzFYsGizQ== Date: Mon, 30 Oct 2023 14:25:42 -0700 From: Jakub Kicinski To: longli@linuxonhyperv.com Cc: "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Long Li Subject: Re: [Patch v2] hv_netvsc: Mark VF as slave before exposing it to user-mode Message-ID: <20231030142542.6640190b@kernel.org> In-Reply-To: <1698440390-13719-1-git-send-email-longli@linuxonhyperv.com> References: <1698440390-13719-1-git-send-email-longli@linuxonhyperv.com> Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 27 Oct 2023 13:59:50 -0700 longli@linuxonhyperv.com wrote: > When a VF is being exposed form the kernel, it should be marked as "slave" > before exposing to the user-mode. The VF is not usable without netvsc running > as master. The user-mode should never see a VF without the "slave" flag. > > This commit moves the code of setting the slave flag to the time before VF is > exposed to user-mode. Can you give a real example in the commit message of a flow in user space which would get confused by seeing the VF netdev without IFF_SLAVE? You're only moving setting IFF_SLAVE but not linking the master, is there no code which would assume that if SLAVE is set there is a master?