Thread (7 messages) 7 messages, 4 authors, 2024-07-16

Re: [PATCH net-next] net: mana: Implement get_ringparam/set_ringparam for mana

From: Shradha Gupta <hidden>
Date: 2024-07-16 05:52:38
Also in: linux-hyperv, linux-rdma, lkml

On Mon, Jul 15, 2024 at 06:45:51AM -0700, Jakub Kicinski wrote:
On Sun, 14 Jul 2024 20:40:20 -0700 Shradha Gupta wrote:
quoted
+	if (ring->rx_jumbo_pending) {
+		netdev_err(ndev, "%s: rx_jumbo_pending not supported\n", __func__);
+		return -EINVAL;
+	}
+	if (ring->rx_mini_pending) {
+		netdev_err(ndev, "%s: rx_mini_pending not supported\n", __func__);
+		return -EINVAL;
+	}
I think that core already checks this
quoted
+	if (!apc)
+		return -EINVAL;
Provably impossible, apc is netdev + sizeof(netdev) so it'd have to
wrap a 64b integer to be NULL :|
quoted
+	old_tx = apc->tx_queue_size;
+	old_rx = apc->rx_queue_size;
+	new_tx = clamp_t(u32, ring->tx_pending, MIN_TX_BUFFERS_PER_QUEUE, MAX_TX_BUFFERS_PER_QUEUE);
+	new_rx = clamp_t(u32, ring->rx_pending, MIN_RX_BUFFERS_PER_QUEUE, MAX_RX_BUFFERS_PER_QUEUE);
+
+	if (new_tx == old_tx && new_rx == old_rx)
+		return 0;
Pretty sure core will also not call you if there's no change.
If it does please update core instead of catching this in the driver.
Thanks for the comments Jakub. I'll verify these and make the relevant changes in the next version
Please keep in mind that net-next will be closed for the duration
of the merge window.
Noted, Thanks.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help