Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3232157rwd; Mon, 29 May 2023 07:31:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ZrPpV/cUUIzzIh0uQpxOMN48sSX6pfIUwDpnyWZ9uUaOWqnQTk8FWJNEvxIAbhCom6Ckd X-Received: by 2002:a17:902:d2c7:b0:1ae:622c:e754 with SMTP id n7-20020a170902d2c700b001ae622ce754mr10958596plc.68.1685370711068; Mon, 29 May 2023 07:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685370711; cv=none; d=google.com; s=arc-20160816; b=MUV5aVngee9fTv/x6v1zwQRU6kNSOWSNzCnSVZGIxXMrnOxLsdgsRFc5eJICLFLbF6 5GYP5w5cA0hvYUi92rCOMLPYL6b0C5GINn2okc4E1FWDOQAsR6XFI4zTr+sWBos0taUo Zq0FHSkEALjomN2GJCZ4GIcRliEBdPjsuaRF98HKot8eM6GW2HL6iONRdlj2tOsdkkFj BOuWfNUXYft+fWy1YY0GgVJ7BBLq8+6Nv5QKkpWPClwmjfafQsUFLYfJOMvwkJhZ/X0u b9VfFtymj3/Pq/xZ8FnyFUm+nRNx9zWAksxOM1aXKyZAzOKZ6cDjOdEqJVeYcFkyere8 gmUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5yfUn5aZ5gZKP/nhY40FYtwu0ci8KYjAyPkzFYglPAY=; b=mB5khcrRV60uLNA2zr5ulfTy/M01iHFbMR2yW0q0s5TA6+7KN76IwuBiC6V8IPRDwz ChSSUfhw+L4RsHC+b0WowQkQWReC1ZRCmkAxRXG9DXE/vJEUrNmF6iVMJB62bVBh87/5 MA4BGhr0RcYQxJ+OXyjT0+LGR3miqijpFxWFJnGZYwSOku51Q/K8ApFYLwlpxLcT+IcP Vw6vilHLW0xo/lndna01+3Q/4oAbTzj0wW8nCtLrA0LSMwF07MyVXpoAczyC9uqNJ1KH DbCAzTlFIaM/V4vJdUxhQDiNFenCPYqo1v/9BlnqqyJxD1goSpLJp+3ViyiH5a8Rdvuh GQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=ocKRv9z8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a170902bd0300b001ab18790b12si6090127pls.97.2023.05.29.07.31.36; Mon, 29 May 2023 07:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=ocKRv9z8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbjE2OZV (ORCPT + 99 others); Mon, 29 May 2023 10:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjE2OZU (ORCPT ); Mon, 29 May 2023 10:25:20 -0400 Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A574BAD for ; Mon, 29 May 2023 07:25:18 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 3do5q6Lcz8SAU3do5q9HQ0; Mon, 29 May 2023 16:25:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685370311; bh=5yfUn5aZ5gZKP/nhY40FYtwu0ci8KYjAyPkzFYglPAY=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=ocKRv9z8VmqirNHXYT3ft22j4i53Wl5OzK9+JBimzQrGz8StOZ2seQUQVb3Mjx55+ eEwidnlTa7CZNj0HArLAkMHP5WrFyawvkyimebViWx4dAtGI3u/BC3O49K0uHWNNXz XVTskrcoItUxVyT6N/6/o9kxuIGMsKpb/2IHwc0nX2L7VcvhdifWlykD8/Xk32y1zy vNhHx/M9vlzkDDDrsryHxEfTvzKlf0Lg0KIzuFCOZMdRl/4p4nVKo7canxVijNs4AL NJ1VRX8R6igaagjwS38Kpwalq0Ygq83+iFXXk76sLWkFOuuLpC3OPC6UhKQH74+4Dm V/Mub43l7Fq9A== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 May 2023 16:25:11 +0200 X-ME-IP: 86.243.2.178 Message-ID: Date: Mon, 29 May 2023 16:25:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3] hv_netvsc: Allocate rx indirection table size dynamically Content-Language: fr, en-US To: Shradha Gupta Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, Eric Dumazet , Jakub Kicinski , Paolo Abeni , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Michael Kelley , "David S. Miller" , Steen Hegelund , Simon Horman References: <1685080949-18316-1-git-send-email-shradhagupta@linux.microsoft.com> <92bc6f3e-4463-e0fe-5cab-54c6c5eecd3f@wanadoo.fr> <20230529133019.GB21447@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: Christophe JAILLET In-Reply-To: <20230529133019.GB21447@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 29/05/2023 à 15:30, Shradha Gupta a écrit : > Thanks for the comment Christophe. > On Mon, May 29, 2023 at 02:49:15PM +0200, Christophe JAILLET wrote: >> Le 26/05/2023 ?? 08:02, Shradha Gupta a ??crit??: >>> Allocate the size of rx indirection table dynamically in netvsc >> >from the value of size provided by OID_GEN_RECEIVE_SCALE_CAPABILITIES >>> query instead of using a constant value of ITAB_NUM. >>> >>> Signed-off-by: Shradha Gupta >>> Tested-on: Ubuntu22 (azure VM, SKU size: Standard_F72s_v2) >>> Testcases: >>> 1. ethtool -x eth0 output >>> 2. LISA testcase:PERF-NETWORK-TCP-THROUGHPUT-MULTICONNECTION-NTTTCP-Synthetic >>> 3. LISA testcase:PERF-NETWORK-TCP-THROUGHPUT-MULTICONNECTION-NTTTCP-SRIOV >>> >>> --- >> >> [...] >> >>> @@ -1596,11 +1608,18 @@ void rndis_filter_device_remove(struct hv_device *dev, >>> struct netvsc_device *net_dev) >>> { >>> struct rndis_device *rndis_dev = net_dev->extension; >>> + struct net_device *net = hv_get_drvdata(dev); >>> + struct net_device_context *ndc = netdev_priv(net); >>> /* Halt and release the rndis device */ >>> rndis_filter_halt_device(net_dev, rndis_dev); >>> netvsc_device_remove(dev); >>> + >>> + ndc->rx_table_sz = 0; >>> + kfree(ndc->rx_table); >>> + ndc->rx_table = NULL; >>> + >> >> Nit: useless empty NL > This is to prevent any potential double free, or accessing freed memory, etc. > As requested by Haiyang in v2 patch Setting ndc->rx_table to NULL is fine, but there is a useless *newline* (NL) just after. If you have to send a v4, you can save a line of code. CJ >> >>> } >>> int rndis_filter_open(struct netvsc_device *nvdev) >