From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753519AbdJMT3s (ORCPT ); Fri, 13 Oct 2017 15:29:48 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:50982 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751549AbdJMT3p (ORCPT ); Fri, 13 Oct 2017 15:29:45 -0400 x-originating-ip: 107.180.71.197 From: Haiyang Zhang To: davem@davemloft.net, netdev@vger.kernel.org Cc: haiyangz@microsoft.com, kys@microsoft.com, sthemmin@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH net-next,3/3] hv_netvsc: Add initialization of tx_table in netvsc_device_add() Date: Fri, 13 Oct 2017 12:28:05 -0700 Message-Id: <20171013192805.18183-4-haiyangz@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013192805.18183-1-haiyangz@exchange.microsoft.com> References: <20171013192805.18183-1-haiyangz@exchange.microsoft.com> Reply-To: haiyangz@microsoft.com X-CMAE-Envelope: MS4wfFy0NTdJ1nCbar9CL02zBniQIKuMfGOAVnpADiqhn8i1IDOvYizEddkgaR88HLniL0oEs3IatSzPjqcyXhGbFptxxNpyqJeYBbZcLQkjbZu7PKnGiUws 0OMbO3k0Ga9sdcYjBinCZJFaItURxJoZu1a1ktcdSmO5SFsjTZGlC4OFf1dH/7FTcgxrXA3u30MqTGLNh5c2IOSgRWYn4yT/rGu0EiN/Ad5afB55rVNsqEmV cb6FaVS1CivVfoTQuQDwc+u+ux05yypXav0RVWj8u1ZiwTzTsMYVS4afX2l0aqN10yNVKIMN4oVC+HciL7GLbhoaN+D+55YBdEkNRVC7vv75RQHjoFuaaK1p tRakWT+ubhu85grhRetYCrkYmXQYq3YO8hDm7VE6A5yafgEXjXtPqAXwsLRQooGhmlmag/rm Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haiyang Zhang tx_table is part of the private data of kernel net_device. It is only zero-ed out when allocating net_device. We may recreate netvsc_device w/o recreating net_device, so the private netdev data, including tx_table, are not zeroed. It may contain channel numbers for the older netvsc_device. This patch adds initialization of tx_table each time we recreate netvsc_device. Signed-off-by: Haiyang Zhang --- drivers/net/hyperv/netvsc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index d34cf37e949d..5bb6a20072dd 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -1255,6 +1255,9 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device, if (!net_device) return ERR_PTR(-ENOMEM); + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) + net_device_ctx->tx_table[i] = 0; + net_device->ring_size = ring_size; /* Because the device uses NAPI, all the interrupt batching and -- 2.14.1