* [PATCH net-next]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.
@ 2015-07-26 21:19 Corcodel Marian
2015-07-26 22:55 ` David Miller
2015-07-26 22:58 ` [PATCH net-next] r8169: correct size from ... (snip) Francois Romieu
0 siblings, 2 replies; 3+ messages in thread
From: Corcodel Marian @ 2015-07-26 21:19 UTC (permalink / raw)
To: netdev; +Cc: Francois Romieu, Corcodel Marian
Signed-off-by: Corcodel Marian <corcodel.marian@gmail.com>
---
drivers/net/ethernet/realtek/r8169.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 3df51fa..561c23a 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -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:
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next]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.
2015-07-26 21:19 [PATCH net-next]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 Corcodel Marian
@ 2015-07-26 22:55 ` David Miller
2015-07-26 22:58 ` [PATCH net-next] r8169: correct size from ... (snip) Francois Romieu
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-07-26 22:55 UTC (permalink / raw)
To: corcodel.marian; +Cc: netdev, romieu
This, 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] r8169: correct size from ... (snip)
2015-07-26 21:19 [PATCH net-next]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 Corcodel Marian
2015-07-26 22:55 ` David Miller
@ 2015-07-26 22:58 ` Francois Romieu
1 sibling, 0 replies; 3+ messages in thread
From: Francois Romieu @ 2015-07-26 22:58 UTC (permalink / raw)
To: Corcodel Marian; +Cc: netdev
Corcodel Marian <corcodel.marian@gmail.com> :
[...]
> @@ -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.
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-26 22:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-26 21:19 [PATCH net-next]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 Corcodel Marian
2015-07-26 22:55 ` David Miller
2015-07-26 22:58 ` [PATCH net-next] r8169: correct size from ... (snip) Francois Romieu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).