Skip to content

Commit df727d4

Browse files
Villemoesdavem330
authored andcommitted
net: fec: don't reset irq coalesce settings to defaults on "ip link up"
Currently, when a FEC device is brought up, the irq coalesce settings are reset to their default values (1000us, 200 frames). That's unexpected, and breaks for example use of an appropriate .link file to make systemd-udev apply the desired settings (https://www.freedesktop.org/software/systemd/man/systemd.link.html), or any other method that would do a one-time setup during early boot. Refactor the code so that fec_restart() instead uses fec_enet_itr_coal_set(), which simply applies the settings that are stored in the private data, and initialize that private data with the default values. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 32b931c commit df727d4

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
#include "fec.h"
7575

7676
static void set_multicast_list(struct net_device *ndev);
77-
static void fec_enet_itr_coal_init(struct net_device *ndev);
77+
static void fec_enet_itr_coal_set(struct net_device *ndev);
7878

7979
#define DRIVER_NAME "fec"
8080

@@ -1220,8 +1220,7 @@ fec_restart(struct net_device *ndev)
12201220
writel(0, fep->hwp + FEC_IMASK);
12211221

12221222
/* Init the interrupt coalescing */
1223-
fec_enet_itr_coal_init(ndev);
1224-
1223+
fec_enet_itr_coal_set(ndev);
12251224
}
12261225

12271226
static int fec_enet_ipc_handle_init(struct fec_enet_private *fep)
@@ -2856,19 +2855,6 @@ static int fec_enet_set_coalesce(struct net_device *ndev,
28562855
return 0;
28572856
}
28582857

2859-
static void fec_enet_itr_coal_init(struct net_device *ndev)
2860-
{
2861-
struct ethtool_coalesce ec;
2862-
2863-
ec.rx_coalesce_usecs = FEC_ITR_ICTT_DEFAULT;
2864-
ec.rx_max_coalesced_frames = FEC_ITR_ICFT_DEFAULT;
2865-
2866-
ec.tx_coalesce_usecs = FEC_ITR_ICTT_DEFAULT;
2867-
ec.tx_max_coalesced_frames = FEC_ITR_ICFT_DEFAULT;
2868-
2869-
fec_enet_set_coalesce(ndev, &ec, NULL, NULL);
2870-
}
2871-
28722858
static int fec_enet_get_tunable(struct net_device *netdev,
28732859
const struct ethtool_tunable *tuna,
28742860
void *data)
@@ -3623,6 +3609,10 @@ static int fec_enet_init(struct net_device *ndev)
36233609
fep->rx_align = 0x3;
36243610
fep->tx_align = 0x3;
36253611
#endif
3612+
fep->rx_pkts_itr = FEC_ITR_ICFT_DEFAULT;
3613+
fep->tx_pkts_itr = FEC_ITR_ICFT_DEFAULT;
3614+
fep->rx_time_itr = FEC_ITR_ICTT_DEFAULT;
3615+
fep->tx_time_itr = FEC_ITR_ICTT_DEFAULT;
36263616

36273617
/* Check mask of the streaming and coherent API */
36283618
ret = dma_set_mask_and_coherent(&fep->pdev->dev, DMA_BIT_MASK(32));

0 commit comments

Comments
 (0)