Skip to contentSkip to conversation

r8169:Fill with zero Tx descriptors

PATCH In review Corcodel Marian 3 participants 3 messages Aug 5, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169:Fill with zero Tx descriptors

This patch fill with zero Tx descriptors before use.Is only
on part by more patches but is critical.(critical)

drivers/net/ethernet/realtek/r8169.c +1 -1
index 3df51fa..bf78f94 100644
@@ -7589,7 +7589,7 @@ static int rtl_open(struct net_device *dev)
 	 * Rx and Tx descriptors needs 256 bytes alignment.
 	 * dma_alloc_coherent provides more.
 	 */
-	tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
+	tp->TxDescArray = dma_zalloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
 					     &tp->TxPhyAddr, GFP_KERNEL);
 	if (!tp->TxDescArray)
 		goto err_pm_runtime_put;
Signature · 1 line
2.1.4
#1 lore raw

Hello.

Quoted 11 lines · Corcodel Marian

This patch fill with zero Tx descriptors before use.Is only
on part by more patches but is critical.(critical)

drivers/net/ethernet/realtek/r8169.c +0 -0
index 3df51fa..bf78f94 100644

drivers/net/ethernet/realtek/r8169.c static int rtl_open(struct net_device *dev) · line 7593

Quoted 6 lines
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -7589,7 +7589,7 @@ static int rtl_open(struct net_device *dev)
  	 * Rx and Tx descriptors needs 256 bytes alignment.
  	 * dma_alloc_coherent provides more.
  	 */
-	tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
+	tp->TxDescArray = dma_zalloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
  					     &tp->TxPhyAddr, GFP_KERNEL);

Please re-align the continuation line.

[...]

MBR, Sergei

#2 lore raw
In reply to Corcodel Marian
Quoted 12 lines · Corcodel Marian

This patch fill with zero Tx descriptors before use.Is only
on part by more patches but is critical.(critical)

drivers/net/ethernet/realtek/r8169.c +0 -0
index 3df51fa..bf78f94 100644

drivers/net/ethernet/realtek/r8169.c static int rtl_open(struct net_device *dev) · line 7595

Quoted 8 lines
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -7589,7 +7589,7 @@ static int rtl_open(struct net_device *dev)
  	 * Rx and Tx descriptors needs 256 bytes alignment.
  	 * dma_alloc_coherent provides more.
  	 */
-	tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
+	tp->TxDescArray = dma_zalloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
  					     &tp->TxPhyAddr, GFP_KERNEL);
  	if (!tp->TxDescArray)
  		goto err_pm_runtime_put;

Why? Why is zero-filling of tx-ring critical???

Ivan