diff mbox

[net,v3.16] r8169: Keep minimum barrier on coherent allocation

Message ID 1456849931-9533-1-git-send-email-asd@marian1000.go.ro
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Corcodel Marian March 1, 2016, 4:32 p.m. UTC
This patch add 256 Bytes barrier on rx/tx coherent allocations.

Signed-off-by: Corcodel Marian <asd@marian1000.go.ro>
---
 drivers/net/ethernet/realtek/r8169.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Francois Romieu March 1, 2016, 8:50 p.m. UTC | #1
Corcodel Marian <asd@marian1000.go.ro> :
> This patch add 256 Bytes barrier on rx/tx coherent allocations.

It does not make much sense unless you want to use a non power of two
value for NUM_.._DESC or a value < 16 with some strange kernel where
dma_alloc_coherent does not provide page alignment.
diff mbox

Patch

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 5fd3fca..aeca4fb 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -86,8 +86,8 @@  static const int multicast_filter_limit = 32;
 #define R8169_NAPI_WEIGHT	64
 #define NUM_TX_DESC	1024	/* Number of Tx descriptor registers */
 #define NUM_RX_DESC	1024U	/* Number of Rx descriptor registers */
-#define R8169_TX_RING_BYTES	(NUM_TX_DESC * sizeof(struct TxDesc))
-#define R8169_RX_RING_BYTES	(NUM_RX_DESC * sizeof(struct RxDesc))
+#define R8169_TX_RING_BYTES	ALIGN((NUM_TX_DESC * sizeof(struct TxDesc)), 256)
+#define R8169_RX_RING_BYTES	ALIGN((NUM_RX_DESC * sizeof(struct RxDesc)), 256)
 
 #define RTL8169_TX_TIMEOUT	(6*HZ)
 #define RTL8169_PHY_TIMEOUT	(10*HZ)