From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933734AbdKPBuk (ORCPT ); Wed, 15 Nov 2017 20:50:40 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:37942 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933677AbdKPBuY (ORCPT ); Wed, 15 Nov 2017 20:50:24 -0500 Date: Thu, 16 Nov 2017 10:50:20 +0900 (KST) Message-Id: <20171116.105020.531343456067273262.davem@davemloft.net> To: vkuznets@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, mmorsy@redhat.com Subject: Re: [PATCH net v2] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes From: David Miller In-Reply-To: <20171115141255.24103-1-vkuznets@redhat.com> References: <20171115141255.24103-1-vkuznets@redhat.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 15 Nov 2017 17:50:24 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov Date: Wed, 15 Nov 2017 15:12:55 +0100 > rndis_filter_device_add() is called both from netvsc_probe() when we > initially create the device and from set channels/mtu/ringparam > routines where we basically remove the device and add it back. > > hw_features is reset in rndis_filter_device_add() and filled with > host data. However, we lose all additional flags which are set outside > of the driver, e.g. register_netdevice() adds NETIF_F_SOFT_FEATURES and > many others. > > Unfortunately, calls to rndis_{query_hwcaps(), _set_offload_params()} > calls cannot be avoided on every RNDIS reset: host expects us to set > required features explicitly. Moreover, in theory hardware capabilities > can change and we need to reflect the change in hw_features. > > Reset net->hw_features bits according to host data in > rndis_netdev_set_hwcaps(), clear corresponding feature bits > from net->features in case some features went missing (will never happen > in real life I guess but let's be consistent). > > Signed-off-by: Vitaly Kuznetsov Applied.