brcm2708: add linux 4.19 support
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0548-bcmgenet-Better-coalescing-parameter-defaults.patch
1 From 8d30a996253c537f4978910aabf1e098bac8fa1a Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 27 Mar 2019 13:45:46 +0000
4 Subject: [PATCH 548/703] bcmgenet: Better coalescing parameter defaults
5
6 Set defaults for TX and RX packet coalescing to be equivalent to:
7
8 # ethtool -C eth0 tx-frames 10
9 # ethtool -C eth0 rx-usecs 50
10
11 This may be something we want to set via DT parameters in the
12 future.
13
14 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
15 ---
16 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++--
17 1 file changed, 5 insertions(+), 2 deletions(-)
18
19 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
20 +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
21 @@ -2147,7 +2147,7 @@ static void bcmgenet_init_tx_ring(struct
22
23 bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX);
24 bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX);
25 - bcmgenet_tdma_ring_writel(priv, index, 1, DMA_MBUF_DONE_THRESH);
26 + bcmgenet_tdma_ring_writel(priv, index, 10, DMA_MBUF_DONE_THRESH);
27 /* Disable rate control for now */
28 bcmgenet_tdma_ring_writel(priv, index, flow_period_val,
29 TDMA_FLOW_PERIOD);
30 @@ -3576,9 +3576,12 @@ static int bcmgenet_probe(struct platfor
31 netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1);
32
33 /* Set default coalescing parameters */
34 - for (i = 0; i < priv->hw_params->rx_queues; i++)
35 + for (i = 0; i < priv->hw_params->rx_queues; i++) {
36 priv->rx_rings[i].rx_max_coalesced_frames = 1;
37 + priv->rx_rings[i].rx_coalesce_usecs = 50;
38 + }
39 priv->rx_rings[DESC_INDEX].rx_max_coalesced_frames = 1;
40 + priv->rx_rings[DESC_INDEX].rx_coalesce_usecs = 50;
41
42 /* libphy will determine the link state */
43 netif_carrier_off(dev);