stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Claudiu Manoil <claudiu.manoil@freescale.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [ 03/48] gianfar: Change default HW Tx queue scheduling mode
Date: Fri, 11 Oct 2013 12:36:10 -0700	[thread overview]
Message-ID: <20131011193637.658080063@linuxfoundation.org> (raw)
In-Reply-To: <20131011193637.253208688@linuxfoundation.org>

3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Claudiu Manoil <claudiu.manoil@freescale.com>

commit b98b8babd6e3370fadb7c6eaacb00eb2f6344a6c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/freescale/gianfar.c |   11 ++++++++++-
 drivers/net/ethernet/freescale/gianfar.h |   11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

--- 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_dev
 	if (ndev->features & NETIF_F_IP_CSUM)
 		tctrl |= TCTRL_INIT_CSUM;
 
-	tctrl |= TCTRL_TXSCHED_PRIO;
+	if (priv->prio_sched_en)
+		tctrl |= TCTRL_TXSCHED_PRIO;
+	else {
+		tctrl |= TCTRL_TXSCHED_WRRS;
+		gfar_write(&regs->tr03wt, DEFAULT_WRRS_WEIGHT);
+		gfar_write(&regs->tr47wt, DEFAULT_WRRS_WEIGHT);
+	}
 
 	gfar_write(&regs->tctrl, tctrl);
 
@@ -1153,6 +1159,9 @@ static int gfar_probe(struct platform_de
 	priv->rx_filer_enable = 1;
 	/* Enable most messages by default */
 	priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
+	/* use pritority h/w tx queue scheduling for single queue devices */
+	if (priv->num_tx_queues == 1)
+		priv->prio_sched_en = 1;
 
 	/* Carrier starts down, phylib will bring it up */
 	netif_carrier_off(dev);
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -301,8 +301,16 @@ extern const char gfar_driver_version[];
 #define TCTRL_TFCPAUSE		0x00000008
 #define TCTRL_TXSCHED_MASK	0x00000006
 #define TCTRL_TXSCHED_INIT	0x00000000
+/* priority scheduling */
 #define TCTRL_TXSCHED_PRIO	0x00000002
+/* weighted round-robin scheduling (WRRS) */
 #define TCTRL_TXSCHED_WRRS	0x00000004
+/* default WRRS weight and policy setting,
+ * tailored to the tr03wt and tr47wt registers:
+ * equal weight for all Tx Qs, measured in 64byte units
+ */
+#define DEFAULT_WRRS_WEIGHT	0x18181818
+
 #define TCTRL_INIT_CSUM		(TCTRL_TUCSEN | TCTRL_IPCSEN)
 
 #define IEVENT_INIT_CLEAR	0xffffffff
@@ -1098,7 +1106,8 @@ struct gfar_private {
 		extended_hash:1,
 		bd_stash_en:1,
 		rx_filer_enable:1,
-		wol_en:1; /* Wake-on-LAN enabled */
+		wol_en:1, /* Wake-on-LAN enabled */
+		prio_sched_en:1; /* Enable priorty based Tx scheduling in Hw */
 	unsigned short padding;
 
 	/* PHY stuff */



  parent reply	other threads:[~2013-10-11 19:36 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 19:36 [ 00/48] 3.4.66-stable review Greg Kroah-Hartman
2013-10-11 19:36 ` [ 01/48] cpqarray: fix info leak in ida_locked_ioctl() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 02/48] cciss: fix info leak in cciss_ioctl32_passthru() Greg Kroah-Hartman
2013-10-11 19:36 ` Greg Kroah-Hartman [this message]
2013-10-11 19:36 ` [ 04/48] caif: Add missing braces to multiline if in cfctrl_linkup_request Greg Kroah-Hartman
2013-10-11 19:36 ` [ 05/48] net: sctp: fix smatch warning in sctp_send_asconf_del_ip Greg Kroah-Hartman
2013-10-11 19:36 ` [ 06/48] net: flow_dissector: fix thoff for IPPROTO_AH Greg Kroah-Hartman
2013-10-11 19:36 ` [ 07/48] netpoll: fix NULL pointer dereference in netpoll_cleanup Greg Kroah-Hartman
2013-10-11 19:36 ` [ 08/48] net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit Greg Kroah-Hartman
2013-10-11 19:36 ` [ 09/48] resubmit bridge: fix message_age_timer calculation Greg Kroah-Hartman
2013-10-11 19:36 ` [ 10/48] bridge: Clamp forward_delay when enabling STP Greg Kroah-Hartman
2013-10-11 19:36 ` [ 11/48] ip: use ip_hdr() in __ip_make_skb() to retrieve IP header Greg Kroah-Hartman
2013-10-11 19:36 ` [ 12/48] ip: generate unique IP identificator if local fragmentation is allowed Greg Kroah-Hartman
2013-10-11 19:36 ` [ 13/48] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO Greg Kroah-Hartman
2013-10-11 19:36 ` [ 14/48] via-rhine: fix VLAN priority field (PCP, IEEE 802.1p) Greg Kroah-Hartman
2013-10-11 19:36 ` [ 15/48] dm9601: fix IFF_ALLMULTI handling Greg Kroah-Hartman
2013-10-11 19:36 ` [ 16/48] bonding: Fix broken promiscuity reference counting issue Greg Kroah-Hartman
2013-10-11 19:36 ` [ 17/48] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put Greg Kroah-Hartman
2013-10-11 19:36 ` [ 18/48] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put Greg Kroah-Hartman
2013-10-11 19:36 ` [ 19/48] ll_temac: Reset dma descriptors indexes on ndo_open Greg Kroah-Hartman
2013-10-11 19:36 ` [ 20/48] ASoC: max98095: a couple array underflows Greg Kroah-Hartman
2013-10-11 19:36 ` [ 21/48] ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 22/48] powerpc/iommu: Use GFP_KERNEL instead of GFP_ATOMIC in iommu_init_table() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 23/48] powerpc/vio: Fix modalias_show return values Greg Kroah-Hartman
2013-10-11 19:36 ` [ 24/48] powerpc: Fix parameter clobber in csum_partial_copy_generic() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 25/48] powerpc: Restore registers on error exit from csum_partial_copy_generic() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 26/48] Bluetooth: Fix security level for peripheral role Greg Kroah-Hartman
2013-10-11 19:36 ` [ 27/48] Bluetooth: Fix encryption key size " Greg Kroah-Hartman
2013-10-11 19:36 ` [ 28/48] esp_scsi: Fix tag state corruption when autosensing Greg Kroah-Hartman
2013-10-11 19:36 ` [ 29/48] sparc64: Fix ITLB handler of null page Greg Kroah-Hartman
2013-10-11 19:36 ` [ 30/48] sparc64: Remove RWSEM export leftovers Greg Kroah-Hartman
2013-10-11 19:36 ` [ 31/48] sparc64: Fix off by one in trampoline TLB mapping installation loop Greg Kroah-Hartman
2013-10-11 19:36 ` [ 32/48] sparc64: Fix not SRAed %o5 in 32-bit traced syscall Greg Kroah-Hartman
2013-10-11 19:36 ` [ 33/48] sparc32: Fix exit flag passed from traced sys_sigreturn Greg Kroah-Hartman
2013-10-11 19:36 ` [ 34/48] kernel/kmod.c: check for NULL in call_usermodehelper_exec() Greg Kroah-Hartman
2013-10-11 22:36   ` Tetsuo Handa
2013-10-13 21:50     ` Greg KH
2013-10-11 19:36 ` [ 35/48] USB: serial: option: Ignore card reader interface on Huawei E1750 Greg Kroah-Hartman
2013-10-11 19:36 ` [ 36/48] ib_srpt: Destroy cm_id before destroying QP Greg Kroah-Hartman
2013-10-11 19:36 ` [ 37/48] ib_srpt: always set response for task management Greg Kroah-Hartman
2013-10-11 19:36 ` [ 38/48] rtlwifi: Align private space in rtl_priv struct Greg Kroah-Hartman
2013-10-11 19:36 ` [ 39/48] p54usb: add USB ID for Corega WLUSB2GTST USB adapter Greg Kroah-Hartman
2013-10-11 19:36 ` [ 40/48] dmaengine: imx-dma: fix lockdep issue between irqhandler and tasklet Greg Kroah-Hartman
2013-10-11 19:36 ` [ 41/48] dmaengine: imx-dma: fix callback path in tasklet Greg Kroah-Hartman
2013-10-11 19:36 ` [ 42/48] dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic Greg Kroah-Hartman
2013-10-11 19:36 ` [ 43/48] staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice Greg Kroah-Hartman
2013-10-11 19:36 ` [ 44/48] mm, show_mem: suppress page counts in non-blockable contexts Greg Kroah-Hartman
2013-10-11 19:36 ` [ 45/48] ACPI / IPMI: Fix atomic context requirement of ipmi_msg_handler() Greg Kroah-Hartman
2013-10-11 19:36 ` [ 46/48] tile: use a more conservative __my_cpu_offset in CONFIG_PREEMPT Greg Kroah-Hartman
2013-10-11 19:36 ` [ 47/48] Btrfs: change how we queue blocks for backref checking Greg Kroah-Hartman
2013-10-11 19:36 ` [ 48/48] ext4: avoid hang when mounting non-journal filesystems with orphan list Greg Kroah-Hartman
2013-10-11 21:56 ` [ 00/48] 3.4.66-stable review Guenter Roeck
2013-10-11 22:12   ` Greg Kroah-Hartman
2013-10-12  0:50     ` Guenter Roeck
2013-10-13 16:04       ` Greg Kroah-Hartman
2013-10-17 13:16   ` Ben Hutchings
2013-10-11 22:15 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131011193637.658080063@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=claudiu.manoil@freescale.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).