Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3176987rwd; Mon, 29 May 2023 06:51:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fRGi+PA7UXnoQicPhglKeX+SdXYzUSP3hdlK9/oLMLUMu8SQi0LTmBzlv4AUd6yaaVq56 X-Received: by 2002:a17:903:25d6:b0:1b0:3742:e718 with SMTP id jc22-20020a17090325d600b001b03742e718mr4606101plb.25.1685368265224; Mon, 29 May 2023 06:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685368265; cv=none; d=google.com; s=arc-20160816; b=RZqgDuJilYKvylK2Qp6Wwf35goVOAOmTUPpiRAqjw2SC4LIlY6VudErO3YoPPOt3Hs K8uyJsZ59X93ULT/h+Lng354xtbdJ3Ehexv5xGAL4nst3zOsYI3u+pl3Y4cLYln/jgLP ncVzp2yKVL6iawvBNEMzJhJboQdLIP7o7cUl27YAa5TrU/qZHdqBarpSrt1AfVTgK8gM I3uow+GYcEspGmE1PV5CV7jsCGhQgVQ9SvYBNBSNImmGY86tBdJAujgKA463rbVFJ1F7 VDbC187F1w2poLD0KDcxERbJJFoR+JYd+F+WZKnBDigXLFkcc5N3qCph/8+RuODUKvLV 1p7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=amiG+ksiMGgI5MFtUbInBQGpOXH7qxIfeuXBndczxPo=; b=Ju1pvW48erqbeeRbG2KlW2J5Cr4C+hDuW0eXcEDJUcxz85Fl6a/wgpxwmydJOwczsT wPf/9CAv32DYBVpsI5H8PoMjHAsyPekDRXyRGUDay2WCJxPTg2B+sA5c0eA1YzyNAAJF f0bjPco5TcGNe0l+X7ArO+ZYZOwsbgGAtDbKPrIuhrWNxRQR4O+ij/h/Kexuj+6puEbz yLTOH5BN5bcHtKsj38WieI5VIwEYtdyizu6d/8dQw8eozyZy/9mIMjvw7AAzfF0ZMxuG fmYJaj5DPMbY8qVT9aVzO3Xax9lsuaYjeSnE6zfsKBQ/XE/SH5S6tfOZa6eBFknZj3iF XZUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=KaTKPLtM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a170902c24600b001adf26b357bsi9120875plg.631.2023.05.29.06.50.50; Mon, 29 May 2023 06:51:05 -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=@linux.microsoft.com header.s=default header.b=KaTKPLtM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbjE2NaW (ORCPT + 99 others); Mon, 29 May 2023 09:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjE2NaV (ORCPT ); Mon, 29 May 2023 09:30:21 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 018A78E; Mon, 29 May 2023 06:30:20 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1134) id 5751420FC3CB; Mon, 29 May 2023 06:30:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5751420FC3CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1685367019; bh=amiG+ksiMGgI5MFtUbInBQGpOXH7qxIfeuXBndczxPo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KaTKPLtMqPZGOYejB3wz6za6u3crwFeJdhRNEojd1HqHnz5c6957L//Laxk/xZtPW dfezVkQymG7XXhRvFZ5uILjgXRavZ9w4/EUz4eLXR6mIOYPijiKR1ZabZIpaMC9YCo mcEpQo2RJ7X48+KskjIAhUvUKQKG/yau1pzd0Ny4= Date: Mon, 29 May 2023 06:30:19 -0700 From: Shradha Gupta To: Christophe JAILLET 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 Subject: Re: [PATCH v3] hv_netvsc: Allocate rx indirection table size dynamically Message-ID: <20230529133019.GB21447@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1685080949-18316-1-git-send-email-shradhagupta@linux.microsoft.com> <92bc6f3e-4463-e0fe-5cab-54c6c5eecd3f@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92bc6f3e-4463-e0fe-5cab-54c6c5eecd3f@wanadoo.fr> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham 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 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 > > > } > > int rndis_filter_open(struct netvsc_device *nvdev)