Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-08-16 00:48:56
Also in
bpf, dri-devel, linux-alpha, linux-arch, linux-doc, linux-kselftest, linux-media, linux-mips, lkml, netdev, sparclinux
Reply to
Mina Almasry, 2024-08-13
On Tue, 13 Aug 2024 21:13:05 +0000 Mina Almasry wrote:
quoted hunk ↗ jump to hunk
+int dev_get_max_mp_channel(const struct net_device *dev)
+{
+	int i, max = -1;
I presume the bug from yesterday is self evident once reported? :)
quoted hunk ↗ jump to hunk
+	ASSERT_RTNL();
+
+	for (i = 0; i < dev->real_num_rx_queues; i++)
+		if (dev->_rx[i].mp_params.mp_priv)
+			/* The number of queues is the idx plus 1. */
+			max = i + 1;
The +1 is odd. The function as it stands reports min channel count.
Not max_mp_channel, if you ask me. And if you renamed it, you don't
have to use -1 as "not installed".
+	return max;
Thread (14 messages) 14 messages, 3 authors, last reply 2024-08-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help