kernel: backport rest of bgmac patches to 4.0
[openwrt.git] / target / linux / generic / patches-4.0 / 072-09-bgmac-increase-rx-ring-size-from-511-to-512.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Sun, 12 Apr 2015 22:36:16 +0200
3 Subject: [PATCH] bgmac: increase rx ring size from 511 to 512
4
5 Limiting it to 511 looks like a failed attempt at leaving one descriptor
6 empty to allow the hardware to stop processing a buffer that has not
7 been prepared yet. However, this doesn't work because this affects the
8 total ring size as well
9
10 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 ---
12
13 --- a/drivers/net/ethernet/broadcom/bgmac.h
14 +++ b/drivers/net/ethernet/broadcom/bgmac.h
15 @@ -356,7 +356,7 @@
16  #define BGMAC_MAX_RX_RINGS                     1
17  
18  #define BGMAC_TX_RING_SLOTS                    128
19 -#define BGMAC_RX_RING_SLOTS                    512 - 1         /* Why -1? Well, Broadcom does that... */
20 +#define BGMAC_RX_RING_SLOTS                    512
21  
22  #define BGMAC_RX_HEADER_LEN                    28              /* Last 24 bytes are unused. Well... */
23  #define BGMAC_RX_FRAME_OFFSET                  30              /* There are 2 unused bytes between header and real data */