From: Shradha Gupta <shradhagupta@linux.microsoft.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Long Li <longli@microsoft.com>,
Michael Kelley <mikelley@microsoft.com>,
"David S. Miller" <davem@davemloft.net>,
Steen Hegelund <steen.hegelund@microchip.com>,
Simon Horman <simon.horman@corigine.com>
Subject: Re: [PATCH v3] hv_netvsc: Allocate rx indirection table size dynamically
Date: Mon, 29 May 2023 06:30:19 -0700 [thread overview]
Message-ID: <20230529133019.GB21447@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <92bc6f3e-4463-e0fe-5cab-54c6c5eecd3f@wanadoo.fr>
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 <shradhagupta@linux.microsoft.com>
> >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)
next prev parent reply other threads:[~2023-05-29 13:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 6:02 [PATCH v3] hv_netvsc: Allocate rx indirection table size dynamically Shradha Gupta
2023-05-26 8:15 ` Simon Horman
2023-05-29 9:39 ` Praveen Kumar
2023-05-29 11:17 ` Shradha Gupta
2023-06-07 7:19 ` Praveen Kumar
2023-05-29 12:49 ` Christophe JAILLET
2023-05-29 13:30 ` Shradha Gupta [this message]
2023-05-29 14:25 ` Christophe JAILLET
2023-05-30 20:57 ` Haiyang Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230529133019.GB21447@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=shradhagupta@linux.microsoft.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=mikelley@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=simon.horman@corigine.com \
--cc=steen.hegelund@microchip.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).