From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755955AbdKNQ6f (ORCPT ); Tue, 14 Nov 2017 11:58:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754190AbdKNQ61 (ORCPT ); Tue, 14 Nov 2017 11:58:27 -0500 From: Vitaly Kuznetsov To: Stephen Hemminger Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Mohammed Gamal Subject: Re: [PATCH net] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes References: <20171114152205.10943-1-vkuznets@redhat.com> <20171114083457.5ec8c4f0@xeon-e3> Date: Tue, 14 Nov 2017 17:58:23 +0100 In-Reply-To: <20171114083457.5ec8c4f0@xeon-e3> (Stephen Hemminger's message of "Tue, 14 Nov 2017 08:34:57 -0800") Message-ID: <871sl0u79s.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (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.38]); Tue, 14 Nov 2017 16:58:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stephen Hemminger writes: > On Tue, 14 Nov 2017 16:22:05 +0100 > Vitaly Kuznetsov wrote: > > Yes, this looks like a real issue. > >> + /* Query hardware capabilities if we're called from netvsc_probe() */ >> + if (!net->hw_features) { >> + ret = rndis_netdev_set_hwcaps(net_device, rndis_device); >> + if (ret != 0) >> + goto err_dev_remv; >> + } >> + > > Rather than conditional behavior in rndis_filter_device_add, it would be cleaner > to make the call to get hardware capabilities there. > > Please respin and make the query of host a separate function. You mean call rndis_netdev_set_hwcaps() from netvsc_probe()? Will do. One question though: in case we'll be avoiding rndis_filter_set_offload_params() call on mtu/channels/ringparam changes -- can we trust the host to preserve what was there before the RNDIS reset? In case not we'll have to untangle what is rndis_netdev_set_hwcaps() in my patch splitting it into two: hw_features setup and rndis_filter_set_offload_params() and leaving the later in rndis_filter_device_add(). Thanks, -- Vitaly