Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17926038ybl; Thu, 2 Jan 2020 14:57:50 -0800 (PST) X-Google-Smtp-Source: APXvYqw8iw09w3v7xAuimTzwtRCyptXLTIfDeJo+if3Cv2ShPA8VxIecPzHnjMoSR+qIS6FtX2Nn X-Received: by 2002:a9d:518b:: with SMTP id y11mr89951354otg.349.1578005869959; Thu, 02 Jan 2020 14:57:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005869; cv=none; d=google.com; s=arc-20160816; b=OWvnRG5l4A6/6uTb0Wwz7HnS8R9vBC6g8LZFpUgndkWh98M76iaC0WfXV7iBLzf1UD jMlkNdyTa37DaIOKDDbW5tN7uqo3t3/8QTDFjQbkuPdz9YD1TsMRocfihBFe+e04jvX7 m2WtFHpbXkxkwsCfRGFcNfSW82EFXUb72ii8oz0PUVM/NfsQpjzIHPMY/hpX+fscMkL4 Dd0WUKzMUATST8dW0tudVPXscSRrw2+OMc0wWatFAtdB/uuRTDa1G99dye+KtKOfiRLo 7CN8zqCbwPZqU3W9lEtoHGex0GymmOztllpYGwqjs6240Q6wZp/laTHY9DqSxlkV+NVE o/1w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qX0zEngA27sxb857RADyMrEZW+THTgsEvu2ADO19y2Y=; b=vcdQ9a3hAWkSLmbZN8IDhq3xcPNFWJxl5aj8CIKFgs1y2Bel92nda7UmEE7l316smr ToazIR8MFzU3ACNVqITH6klUWoSroyME8Nbgg9lryKqyM+dB4UHdXpZqKoFHfqZ3ybWP nQf1x2H8EJsZCszoDsHkLXand12JfzvvqAaiJS/lRYs/1Ko22hlW4F+4A71PwVKhlpIl bQyUMEouIwal/h1MbP6PuQgAh0vaib7wwqXqm6MeWh6CqSQEIwLEsCtIrMWnEg6J6EL6 gJA6mAzqwknyLuvseqnODZCxbJlYWoWpN9Xd0l3HzSB4Q8YYCv/7zs3eKtnVBNf7PV+C +LIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrJUWkpW; 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 i65si26915522oif.15.2020.01.02.14.57.38; Thu, 02 Jan 2020 14:57:49 -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=@kernel.org header.s=default header.b=ZrJUWkpW; 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 S1728135AbgABWSR (ORCPT + 99 others); Thu, 2 Jan 2020 17:18:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:33122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728276AbgABWSI (ORCPT ); Thu, 2 Jan 2020 17:18:08 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C43A522314; Thu, 2 Jan 2020 22:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003488; bh=hn6SkEALJClizTIH2eCblKoETrLMCQSOAV0rawGf+38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrJUWkpWoUMaCw7CstoGFO0QOYXuLGbwIIMpVuUn/deDLjBC4PtIf4C1ieiXcjVU1 eQVffI8XjDpBuKFuLPPfN6NWSHWZxmBghUB32xRqCsyDd+OWyYY6n8FcOU5cGLqymP FhiAN30wn8qz0KdLlq6XKR+MQwl9SDFVA/jAvj8g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haiyang Zhang , Jakub Kicinski Subject: [PATCH 5.4 182/191] hv_netvsc: Fix tx_table init in rndis_set_subchannel() Date: Thu, 2 Jan 2020 23:07:44 +0100 Message-Id: <20200102215848.858098357@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haiyang Zhang [ Upstream commit c39ea5cba5a2e97fc01b78c85208bf31383b399c ] 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 Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/rndis_filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -1165,6 +1165,9 @@ int rndis_set_subchannel(struct net_devi wait_event(nvdev->subchan_open, atomic_read(&nvdev->open_chn) == nvdev->num_chn); + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) + ndev_ctx->tx_table[i] = i % nvdev->num_chn; + /* ignore failures from setting rss parameters, still have channels */ if (dev_info) rndis_filter_set_rss_param(rdev, dev_info->rss_key); @@ -1174,9 +1177,6 @@ int rndis_set_subchannel(struct net_devi netif_set_real_num_tx_queues(ndev, nvdev->num_chn); netif_set_real_num_rx_queues(ndev, nvdev->num_chn); - for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) - ndev_ctx->tx_table[i] = i % nvdev->num_chn; - return 0; }