Thread (11 messages) flat view 11 messages, 3 authors, 2025-09-11

Re: [PATCH net v5 3/5] net: macb: move ring size computation to functions

From: Karumanchi, Vineeth <hidden>
Date: 2025-09-11 06:43:24
Also in: linux-devicetree, lkml

Hi Theo,


On 9/10/2025 9:45 PM, Théo Lebrun wrote:
<...>
quoted hunk ↗ jump to hunk
  #define DEFAULT_TX_RING_SIZE	512 /* must be power of 2 */
  #define MIN_TX_RING_SIZE	64
  #define MAX_TX_RING_SIZE	4096
-#define TX_RING_BYTES(bp) (macb_dma_desc_get_size(bp) \
- * (bp)->tx_ring_size)
  
  /* level of occupied TX descriptors under which we wake up TX process */
  #define MACB_TX_WAKEUP_THRESH(bp)	(3 * (bp)->tx_ring_size / 4)
@@ -2470,11 +2466,20 @@ static void macb_free_rx_buffers(struct macb *bp)
  	}
  }
  
+static unsigned int macb_tx_ring_size_per_queue(struct macb *bp)
+{
+ return macb_dma_desc_get_size(bp) * bp->tx_ring_size + bp- 
 >tx_bd_rd_prefetch;
+}
+
+static unsigned int macb_rx_ring_size_per_queue(struct macb *bp)
+{
+ return macb_dma_desc_get_size(bp) * bp->rx_ring_size + bp- 
 >rx_bd_rd_prefetch;
+}
+

it would be good to have these functions as inline.
May be as a separate patch.

<...>
-- 
🙏 Vineeth
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help