aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@freescale.com>2012-09-23 18:39:08 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-24 16:25:16 -0400
commitb98b8babd6e3370fadb7c6eaacb00eb2f6344a6c (patch)
tree84490a56fe0cbeffd6082d54d9bf3172efd1668a /drivers
parent0cf833aefaa85bbfce3ff70485e5534e09254773 (diff)
gianfar: Change default HW Tx queue scheduling mode
This is primarily to address transmission timeout occurrences, when multiple H/W Tx queues are being used concurrently. Because in the priority scheduling mode the controller does not service the Tx queues equally (but in ascending index order), Tx timeouts are being triggered rightaway for a basic test with multiple simultaneous connections like: iperf -c <server_ip> -n 100M -P 8 resulting in kernel trace: NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue <X> timed out ------------[ cut here ]------------ WARNING: at net/sched/sch_generic.c:255 ... and controller reset during intense traffic, and possibly further complications. This patch changes the default H/W Tx scheduling setting (TXSCHED) for multi-queue devices, from priority scheduling mode to a weighted round robin mode with equal weights for all H/W Tx queues, and addresses the issue above. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c11
-rw-r--r--drivers/net/ethernet/freescale/gianfar.h11
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 4d5b58ce129..a1b52ec3b93 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -394,7 +394,13 @@ static void gfar_init_mac(struct net_device *ndev)
394 if (ndev->features & NETIF_F_IP_CSUM) 394 if (ndev->features & NETIF_F_IP_CSUM)
395 tctrl |= TCTRL_INIT_CSUM; 395 tctrl |= TCTRL_INIT_CSUM;
396 396
397 tctrl |= TCTRL_TXSCHED_PRIO; 397 if (priv->prio_sched_en)
398 tctrl |= TCTRL_TXSCHED_PRIO;
399 else {
400 tctrl |= TCTRL_TXSCHED_WRRS;
401 gfar_write(&regs->tr03wt, DEFAULT_WRRS_WEIGHT);
402 gfar_write(&regs->tr47wt, DEFAULT_WRRS_WEIGHT);
403 }
398 404
399 gfar_write(&regs->tctrl, tctrl); 405 gfar_write(&regs->tctrl, tctrl);
400 406
@@ -1160,6 +1166,9 @@ static int gfar_probe(struct platform_device *ofdev)
1160 priv->rx_filer_enable = 1; 1166 priv->rx_filer_enable = 1;
1161 /* Enable most messages by default */ 1167 /* Enable most messages by default */
1162 priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1; 1168 priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
1169 /* use pritority h/w tx queue scheduling for single queue devices */
1170 if (priv->num_tx_queues == 1)
1171 priv->prio_sched_en = 1;
1163 1172
1164 /* Carrier starts down, phylib will bring it up */ 1173 /* Carrier starts down, phylib will bring it up */
1165 netif_carrier_off(dev); 1174 netif_carrier_off(dev);
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 2136c7ff5e6..4141ef2ddaf 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -301,8 +301,16 @@ extern const char gfar_driver_version[];
301#define TCTRL_TFCPAUSE 0x00000008 301#define TCTRL_TFCPAUSE 0x00000008
302#define TCTRL_TXSCHED_MASK 0x00000006 302#define TCTRL_TXSCHED_MASK 0x00000006
303#define TCTRL_TXSCHED_INIT 0x00000000 303#define TCTRL_TXSCHED_INIT 0x00000000
304/* priority scheduling */
304#define TCTRL_TXSCHED_PRIO 0x00000002 305#define TCTRL_TXSCHED_PRIO 0x00000002
306/* weighted round-robin scheduling (WRRS) */
305#define TCTRL_TXSCHED_WRRS 0x00000004 307#define TCTRL_TXSCHED_WRRS 0x00000004
308/* default WRRS weight and policy setting,
309 * tailored to the tr03wt and tr47wt registers:
310 * equal weight for all Tx Qs, measured in 64byte units
311 */
312#define DEFAULT_WRRS_WEIGHT 0x18181818
313
306#define TCTRL_INIT_CSUM (TCTRL_TUCSEN | TCTRL_IPCSEN) 314#define TCTRL_INIT_CSUM (TCTRL_TUCSEN | TCTRL_IPCSEN)
307 315
308#define IEVENT_INIT_CLEAR 0xffffffff 316#define IEVENT_INIT_CLEAR 0xffffffff
@@ -1098,7 +1106,8 @@ struct gfar_private {
1098 extended_hash:1, 1106 extended_hash:1,
1099 bd_stash_en:1, 1107 bd_stash_en:1,
1100 rx_filer_enable:1, 1108 rx_filer_enable:1,
1101 wol_en:1; /* Wake-on-LAN enabled */ 1109 wol_en:1, /* Wake-on-LAN enabled */
1110 prio_sched_en:1; /* Enable priorty based Tx scheduling in Hw */
1102 unsigned short padding; 1111 unsigned short padding;
1103 1112
1104 /* PHY stuff */ 1113 /* PHY stuff */