Subject: Re: [PATCH v2] net: netvsc: Update default VMBus channels

From: Jakub Kicinski <[email-masked]>
Date: Fri, 16 Aug 2024 08:52:41 -0700

On Thu, 15 Aug 2024 19:23:50 +0000 Haiyang Zhang wrote:
> Your suggestion on netif_get_num_default_rss_queues() is not ignored.
> We discussed internally on the formula we used for the num_chn, and
> chose a similar formula for higher number of vCPUs as in 
> netif_get_num_default_rss_queues().
> For lower number of vCPUs, we use the same default as Windows guests,
> because we don't want any potential regression.

Ideally you'd just use netif_get_num_default_rss_queues()
but the code is close enough to that, and I don't have enough
experience with the question of online CPUs vs physical CPUs.

I would definitely advise you to try this on real workloads.
While "iperf" looks great with a lot of rings, real workloads
suffer measurably from having more channels eating up memory
and generating interrupts.

But if you're confident with the online_cpus() / 2, that's fine.
You may be better off coding it up using max:

	dev_info->num_chn = max(DIV_ROUND_UP(num_online_cpus(), 2),
				VRSS_CHANNEL_DEFAULT);