Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3409492ybl; Sun, 15 Dec 2019 09:12:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxNTLZOoAEP19o3cnAYx2O8t3RHjuoOtSHO784UlyJ6pzj/bm1WkHCcXNdNsb1plXVKsSqO X-Received: by 2002:a9d:518b:: with SMTP id y11mr25992505otg.349.1576429940624; Sun, 15 Dec 2019 09:12:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576429940; cv=none; d=google.com; s=arc-20160816; b=tMe9BTrJvFAr0kAZ0Bvu+0h4ftAqqcoEOhcS3aFqliFrut+HlxiNgizzv4KZyy2OSA /U4Z4leambIrDzzjJQf6nGcGwnxlcBFJrtqXp57BUTiK/IMzFZ6AFT3m1zxuaQ8TWcEB 5iS/mbHbI82GKebyC68AZb033KFxgyFwJ4xT2/xuLm/2zzID03ombXwuR3av1pemkTeR +hbBp9eXo5yak9ZP4/PjlGAVv6UtxpF4QDyOZmrfBkLEa7ml6Hue/ZCyQR80nkloHp12 IetXq6Hr4XFONKieI7MnBFM6rjMCjet2EcgoPneuwcLHgm86aYS8iJev348UFOx86Hhs trcg== 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=gIhKjqXFZFihOuTqCYQ9SMFzjz9Xta5r8J8lgbXYpgY=; b=lGWPsAm9ByJmk6fN3JAtPBcpcOCzMWdntDLG1N2QVRI2pgIHUoWivD24756qBmdgBr Nixk5uZZgqFBqt1Dyw40k/O6TdXrvhL0eBf5i3RVQqXsFj8P2MWD4ux0Z+mX6C37olT0 PeA2Cje/UgLz7pPVRBE24NlK2575JzqJa0l039DpN22+vR6Cg5Lr6cAhSpPESyxCEYu/ OMwuyrI3jZqg1abyiXnN7cnSgrUkDLqgcl36UaWEH0AI7vhKdWQspT17YYQ4uUA8c1yN ju8pGt7i/jW8mJ32fj0ea2fKnO14T5e4hJ0s1wvIDY4NiQ6nU7Q05gvgUQKRrtKOio9T 9N3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=SKPoVh4m; 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 d6si8292489otq.41.2019.12.15.09.12.08; Sun, 15 Dec 2019 09:12:20 -0800 (PST) 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=SKPoVh4m; 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 S1726219AbfLORLa (ORCPT + 99 others); Sun, 15 Dec 2019 12:11:30 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43243 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbfLORLa (ORCPT ); Sun, 15 Dec 2019 12:11:30 -0500 Received: by mail-pg1-f195.google.com with SMTP id k197so2288982pga.10 for ; Sun, 15 Dec 2019 09:11:29 -0800 (PST) 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=gIhKjqXFZFihOuTqCYQ9SMFzjz9Xta5r8J8lgbXYpgY=; b=SKPoVh4mDvHViOs7XKg3U0rBm8HOrt5iWnSjK1E83GV7RiEfUC8/+gB00diouZlOTc +WpLcbbcWKfnp7dXFYm16Q7hRaMvQyDBUlT2G7MVbb/lt56UOHp6RXPtbwmjPQMtwVdI Al4WgZdcw4ME/icYtaPl9/OjsnyPPLrhfHIcPLHH3qm9GA5UWqEN08O3pJHanvvsIiQ9 Y88bHL5nAOwHkWz/WZIq2g0Ge6PArgBtxSlbCAKYoCBi/VV5WWHjhGt76s273FGhaE+R BGwoVdmAd1yQrakfrgtoFTtlIlzuoas/uuPOkdP7OkUfiDUS6//zkhqfJwWDVleZlW72 edAw== 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=gIhKjqXFZFihOuTqCYQ9SMFzjz9Xta5r8J8lgbXYpgY=; b=MtxX4NtCDBvhSoPUMRBwMt8QW8QbIUCG02xaWdx2+nChhfnl0DnnMu23br122l8lbJ ZQIIxBAH8DA+8BiSVgzXQa4cl8iZ6ikR/sNFFd4GaQmnIo5803EcPnoDjzxfxhc4MdeW n0qGH0jpAB2+yWR27AdNn/oepi8+uF06Suu2zU90is/EW53Iyhka/QaGYUKTjdEJKNfx xGZKLnlhk6/Dg8dNOut4twr7RrWMP5mc4et+YqoYuzmf7XcQQTTLi97UlCUmxzwD4lU/ qoeoH6AEv4jL4BXQHH1Sa/RsizJMrP7cOTMo+I2JH5mmlCCtxF1lD79QAN05XzFS0K4K XvUg== X-Gm-Message-State: APjAAAXqfXQ+a0xrWxF4Sv/ggBgYfBtapriAaYufmQUbrnNLzougCsNL 3O7+0gFvp4om5Qe92u5CnsNFmg== X-Received: by 2002:a62:e50d:: with SMTP id n13mr11209412pff.201.1576429889133; Sun, 15 Dec 2019 09:11:29 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id in6sm15877804pjb.8.2019.12.15.09.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Dec 2019 09:11:28 -0800 (PST) Date: Sun, 15 Dec 2019 09:11:20 -0800 From: Stephen Hemminger To: Haiyang Zhang Cc: Jakub Kicinski , "sashal@kernel.org" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , KY Srinivasan , Stephen Hemminger , "olaf@aepfle.de" , vkuznets , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2,net] hv_netvsc: Fix tx_table init in rndis_set_subchannel() Message-ID: <20191215091120.24e581e1@hermes.lan> In-Reply-To: References: <1576103187-2681-1-git-send-email-haiyangz@microsoft.com> <20191214113025.363f21e2@cakuba.netronome.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 Sun, 15 Dec 2019 16:38:00 +0000 Haiyang Zhang wrote: > > -----Original Message----- > > From: Jakub Kicinski > > Sent: Saturday, December 14, 2019 2:30 PM > > To: Haiyang Zhang > > Cc: sashal@kernel.org; linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; > > KY Srinivasan ; Stephen Hemminger > > ; olaf@aepfle.de; vkuznets > > ; davem@davemloft.net; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH v2,net] hv_netvsc: Fix tx_table init in rndis_set_subchannel() > > > > On Wed, 11 Dec 2019 14:26:27 -0800, Haiyang Zhang wrote: > > > Host can provide send indirection table messages anytime after RSS is > > > enabled by calling rndis_filter_set_rss_param(). So the host provided > > > table values may be overwritten by the initialization in > > > rndis_set_subchannel(). > > > > > > To prevent this problem, move the tx_table initialization before calling > > > rndis_filter_set_rss_param(). > > > > > > Fixes: a6fb6aa3cfa9 ("hv_netvsc: Set tx_table to equal weight after > > subchannels open") > > > Signed-off-by: Haiyang Zhang > > > > Applied, but there are two more problems with this code: > > - you should not reset the indirection table if it was configured by > > the user to something other than the default (use the > > netif_is_rxfh_configured() helper to check for that) > > For Send indirection table (tx_table) ethtool doesn't have the option > to set it, and it's usually provided by the host. So we always initialize > it... > But, yes, for Receive indirection table (rx_table), I will make a fix, so > it will be set to default only for new devices, or changing the number > of channels; otherwise it will remain the same during operations like > changing MTU, ringparam. > > > > - you should use the ethtool_rxfh_indir_default() wrapper > For rx_table, we already use it: > rndis_device->rx_table[i] = ethtool_rxfh_indir_default( > For tx_table, I know it's the same operation (%, mod), but this wrapper > function's name is for rx_table. Should we use it for tx_table too? > > > > > Please fix the former problem in the net tree, and after net is merged > > into linux/master and net-next in a week or two please follow up with > > the fix for the latter for net-next. > > Sure. > > Thanks, > - Haiyang > As Haiyang said, this send indirection table is unique to Hyper-V it is not part of any of the other device models. It is not supported by ethtool. It would not be appropriate to repurpose the existing indirection tool; the device already uses the receive indirection table for RSS.