r8169:Correct size from dma_alloc_coherent Maximum size register with size argument from dma_alloc_coherent old variable R8169_RX_RING_BYTES return to much value 17000 instead of value of rx_buf_sz, another issue is on rtl8169_init_ring func, Tx buffer and Rx buffer have same number off descriptors NUM_RX_DESC, not others values.
PATCH 1/1 r8169:Correct size from dma_alloc_coherent Maximum size register with size argument from dma_alloc_coherent old variable R8169_RX_RING_BYTES return to much value 17000 instead of value of rx_buf_sz, another issue is on rtl8169_init_ring func, Tx buffer and Rx buffer have same number off descriptors NUM_RX_DESC, not others values.
--- drivers/net/ethernet/realtek/r8169.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/realtek/r8169.c +6 -5
@@ -5200,6 +5200,7 @@ static void rtl_set_rx_tx_desc_registers(struct rtl8169_private *tp,* register to be written before TxDescAddrLow to work. * Switching from MMIO to I/O access fixes the issue as well. */ +RTL_W32 (TxDescStartAddrHigh, ((u64 ) tp->TxPhyAddr) >>32 );RTL_W32 (TxDescStartAddrLow, ((u64 ) tp->TxPhyAddr) &DMA_BIT_MASK (32 ));RTL_W32 (RxDescAddrHigh, ((u64 ) tp->RxPhyAddr) >>32 );
@@ -6724,8 +6725,8 @@ static int rtl8169_init_ring(struct net_device *dev)rtl8169_init_ring_indexes (tp); -memset (tp->tx_skb,0x0 ,NUM_TX_DESC *sizeof (struct ring_info )); -memset (tp->Rx_databuff,0x0 ,NUM_RX_DESC *sizeof (void *)); +memset (tp->tx_skb,0x0 ,NUM_RX_DESC ); +memset (tp->Rx_databuff,0x0 ,NUM_RX_DESC );return rtl8169_rx_fill (tp); }
@@ -7555,7 +7556,7 @@ static int rtl8169_close(struct net_device *dev)free_irq (pdev->irq, dev); -dma_free_coherent (&pdev->dev,R8169_RX_RING_BYTES , tp->RxDescArray, +dma_free_coherent (&pdev->dev, rx_buf_sz, tp->RxDescArray, tp->RxPhyAddr);dma_free_coherent (&pdev->dev,R8169_TX_RING_BYTES , tp->TxDescArray, tp->TxPhyAddr);
@@ -7594,7 +7595,7 @@ static int rtl_open(struct net_device *dev)if (!tp->TxDescArray) goto err_pm_runtime_put; - tp->RxDescArray =dma_alloc_coherent (&pdev->dev,R8169_RX_RING_BYTES , + tp->RxDescArray =dma_alloc_coherent (&pdev->dev, rx_buf_sz, &tp->RxPhyAddr,GFP_KERNEL );if (!tp->RxDescArray) goto err_free_tx_0;
@@ -7644,7 +7645,7 @@ err_release_fw_2:rtl_release_firmware (tp);rtl8169_rx_clear (tp); err_free_rx_1: -dma_free_coherent (&pdev->dev,R8169_RX_RING_BYTES , tp->RxDescArray, +dma_free_coherent (&pdev->dev, rx_buf_sz, tp->RxDescArray, tp->RxPhyAddr); tp->RxDescArray =NULL ; err_free_tx_0:
Signature · 1 line
2.1.4
David Miller
maintainerThis, again, is improperly submitted.
Again, your entire commit message is in the subject line and this is not what we want.
This constant wave of badly formed patch submissions is extremely frustrating, and whether you realise it or not your improper submissions are consuming a large amount of valuable developer time.
Re: [PATCH net-next] r8169: correct size from ... (snip)
In reply to Corcodel MarianCorcodel Marian <[email protected]> :
[...]
drivers/net/ethernet/realtek/r8169.c static int rtl_open(struct net_device *dev) · line 7599
Quoted 7 lines
drivers/net/ethernet/realtek/r8169.c +1
-1@@ -7594,7 +7595,7 @@ static int rtl_open(struct net_device *dev)if (!tp->TxDescArray) goto err_pm_runtime_put; - tp->RxDescArray =dma_alloc_coherent (&pdev->dev,R8169_RX_RING_BYTES , + tp->RxDescArray =dma_alloc_coherent (&pdev->dev, rx_buf_sz, &tp->RxPhyAddr,GFP_KERNEL );
1. RxDescArray is the descriptor ring. It does not care about rx_buf_sz.
2. I don't see how R8169_RX_RING_BYTES could reach 17000:
#define NUM_RX_DESC 256U /* Number of Rx descriptor registers */
[...]
#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc))
[...]
struct RxDesc {
__le32 opts1;
__le32 opts2;
__le64 addr;
};256 * 16 = 4096
3. The Subject: field should not include the verbose change description.
Signature · 1 line
Ueimor