* [PATCH 0/4] Calxeda xgmac fixes and performance improvements
@ 2012-07-10 0:16 Rob Herring
2012-07-10 0:16 ` [PATCH 1/4] net: calxedaxgmac: fix net timeout recovery Rob Herring
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Rob Herring @ 2012-07-10 0:16 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David S. Miller, Rob Herring
From: Rob Herring <rob.herring@calxeda.com>
A few fixes and performance improvements for the Calxeda xgmac driver for
3.6. It would be nice to get the 2 fixes into 3.5, but since it is a bit
late in the cycle they can wait.
Rob
Rob Herring (4):
net: calxedaxgmac: fix net timeout recovery
net: calxedaxgmac: fix hang on rx refill
net: calxedaxgmac: set outstanding AXI bus transactions to 8
net: calxedaxgmac: enable rx cut-thru mode
drivers/net/ethernet/calxeda/xgmac.c | 35 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 18 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] net: calxedaxgmac: fix net timeout recovery
2012-07-10 0:16 [PATCH 0/4] Calxeda xgmac fixes and performance improvements Rob Herring
@ 2012-07-10 0:16 ` Rob Herring
2012-07-10 0:16 ` [PATCH 2/4] net: calxedaxgmac: fix hang on rx refill Rob Herring
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2012-07-10 0:16 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David S. Miller, Rob Herring
From: Rob Herring <rob.herring@calxeda.com>
Fix net tx watchdog timeout recovery. The descriptor ring was reset,
but the DMA engine was not reset to the beginning of the ring.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 11f667f..c4fd2e3 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -933,6 +933,7 @@ static void xgmac_tx_err(struct xgmac_priv *priv)
desc_init_tx_desc(priv->dma_tx, DMA_TX_RING_SZ);
priv->tx_tail = 0;
priv->tx_head = 0;
+ writel(priv->dma_tx_phy, priv->base + XGMAC_DMA_TX_BASE_ADDR);
writel(reg | DMA_CONTROL_ST, priv->base + XGMAC_DMA_CONTROL);
writel(DMA_STATUS_TU | DMA_STATUS_TPS | DMA_STATUS_NIS | DMA_STATUS_AIS,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] net: calxedaxgmac: fix hang on rx refill
2012-07-10 0:16 [PATCH 0/4] Calxeda xgmac fixes and performance improvements Rob Herring
2012-07-10 0:16 ` [PATCH 1/4] net: calxedaxgmac: fix net timeout recovery Rob Herring
@ 2012-07-10 0:16 ` Rob Herring
2012-07-10 0:16 ` [PATCH 3/4] net: calxedaxgmac: set outstanding AXI bus transactions to 8 Rob Herring
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2012-07-10 0:16 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David S. Miller, Rob Herring
From: Rob Herring <rob.herring@calxeda.com>
Fix intermittent hangs in xgmac_rx_refill. If a ring buffer entry already
had an skb allocated, then xgmac_rx_refill would get stuck in a loop. This
can happen on a rx error when we just leave the skb allocated to the entry.
[ 7884.510000] INFO: rcu_preempt detected stall on CPU 0 (t=727315 jiffies)
[ 7884.510000] [<c0010a59>] (unwind_backtrace+0x1/0x98) from [<c006fd93>] (__rcu_pending+0x11b/0x2c4)
[ 7884.510000] [<c006fd93>] (__rcu_pending+0x11b/0x2c4) from [<c0070b95>] (rcu_check_callbacks+0xed/0x1a8)
[ 7884.510000] [<c0070b95>] (rcu_check_callbacks+0xed/0x1a8) from [<c0036abb>] (update_process_times+0x2b/0x48)
[ 7884.510000] [<c0036abb>] (update_process_times+0x2b/0x48) from [<c004e8fd>] (tick_sched_timer+0x51/0x94)
[ 7884.510000] [<c004e8fd>] (tick_sched_timer+0x51/0x94) from [<c0045527>] (__run_hrtimer+0x4f/0x1e8)
[ 7884.510000] [<c0045527>] (__run_hrtimer+0x4f/0x1e8) from [<c0046003>] (hrtimer_interrupt+0xd7/0x1e4)
[ 7884.510000] [<c0046003>] (hrtimer_interrupt+0xd7/0x1e4) from [<c00101d3>] (twd_handler+0x17/0x24)
[ 7884.510000] [<c00101d3>] (twd_handler+0x17/0x24) from [<c006be39>] (handle_percpu_devid_irq+0x59/0x114)
[ 7884.510000] [<c006be39>] (handle_percpu_devid_irq+0x59/0x114) from [<c0069aab>] (generic_handle_irq+0x17/0x2c)
[ 7884.510000] [<c0069aab>] (generic_handle_irq+0x17/0x2c) from [<c000cc8d>] (handle_IRQ+0x35/0x7c)
[ 7884.510000] [<c000cc8d>] (handle_IRQ+0x35/0x7c) from [<c033b153>] (__irq_svc+0x33/0xb8)
[ 7884.510000] [<c033b153>] (__irq_svc+0x33/0xb8) from [<c0244b06>] (xgmac_rx_refill+0x3a/0x140)
[ 7884.510000] [<c0244b06>] (xgmac_rx_refill+0x3a/0x140) from [<c02458ed>] (xgmac_poll+0x265/0x3bc)
[ 7884.510000] [<c02458ed>] (xgmac_poll+0x265/0x3bc) from [<c029fcbf>] (net_rx_action+0xc3/0x200)
[ 7884.510000] [<c029fcbf>] (net_rx_action+0xc3/0x200) from [<c0030cab>] (__do_softirq+0xa3/0x1bc)
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index c4fd2e3..3ca1d79 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -671,26 +671,23 @@ static void xgmac_rx_refill(struct xgmac_priv *priv)
p = priv->dma_rx + entry;
- if (priv->rx_skbuff[entry] != NULL)
- continue;
-
- skb = __skb_dequeue(&priv->rx_recycle);
- if (skb == NULL)
- skb = netdev_alloc_skb(priv->dev, priv->dma_buf_sz);
- if (unlikely(skb == NULL))
- break;
-
- priv->rx_skbuff[entry] = skb;
- paddr = dma_map_single(priv->device, skb->data,
- priv->dma_buf_sz, DMA_FROM_DEVICE);
- desc_set_buf_addr(p, paddr, priv->dma_buf_sz);
+ if (priv->rx_skbuff[entry] == NULL) {
+ skb = __skb_dequeue(&priv->rx_recycle);
+ if (skb == NULL)
+ skb = netdev_alloc_skb(priv->dev, priv->dma_buf_sz);
+ if (unlikely(skb == NULL))
+ break;
+
+ priv->rx_skbuff[entry] = skb;
+ paddr = dma_map_single(priv->device, skb->data,
+ priv->dma_buf_sz, DMA_FROM_DEVICE);
+ desc_set_buf_addr(p, paddr, priv->dma_buf_sz);
+ }
netdev_dbg(priv->dev, "rx ring: head %d, tail %d\n",
priv->rx_head, priv->rx_tail);
priv->rx_head = dma_ring_incr(priv->rx_head, DMA_RX_RING_SZ);
- /* Ensure descriptor is in memory before handing to h/w */
- wmb();
desc_set_rx_owner(p);
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] net: calxedaxgmac: set outstanding AXI bus transactions to 8
2012-07-10 0:16 [PATCH 0/4] Calxeda xgmac fixes and performance improvements Rob Herring
2012-07-10 0:16 ` [PATCH 1/4] net: calxedaxgmac: fix net timeout recovery Rob Herring
2012-07-10 0:16 ` [PATCH 2/4] net: calxedaxgmac: fix hang on rx refill Rob Herring
@ 2012-07-10 0:16 ` Rob Herring
2012-07-10 0:16 ` [PATCH 4/4] net: calxedaxgmac: enable rx cut-thru mode Rob Herring
2012-07-11 6:27 ` [PATCH 0/4] Calxeda xgmac fixes and performance improvements David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2012-07-10 0:16 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David S. Miller, Rob Herring
From: Rob Herring <rob.herring@calxeda.com>
Increase the number of outstanding read and write AXI transactions from 1
to 8 for better performance.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 3ca1d79..abb8f40 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -970,7 +970,7 @@ static int xgmac_hw_init(struct net_device *dev)
writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_INTR_ENA);
/* XGMAC requires AXI bus init. This is a 'magic number' for now */
- writel(0x000100E, ioaddr + XGMAC_DMA_AXI_BUS);
+ writel(0x0077000E, ioaddr + XGMAC_DMA_AXI_BUS);
ctrl |= XGMAC_CONTROL_DDIC | XGMAC_CONTROL_JE | XGMAC_CONTROL_ACS |
XGMAC_CONTROL_CAR;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] net: calxedaxgmac: enable rx cut-thru mode
2012-07-10 0:16 [PATCH 0/4] Calxeda xgmac fixes and performance improvements Rob Herring
` (2 preceding siblings ...)
2012-07-10 0:16 ` [PATCH 3/4] net: calxedaxgmac: set outstanding AXI bus transactions to 8 Rob Herring
@ 2012-07-10 0:16 ` Rob Herring
2012-07-11 6:27 ` [PATCH 0/4] Calxeda xgmac fixes and performance improvements David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2012-07-10 0:16 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: David S. Miller, Rob Herring
From: Rob Herring <rob.herring@calxeda.com>
Enabling RX cut-thru mode yields better performance as received frames
start getting written to memory before a whole frame is received.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index abb8f40..2b4b4f5 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -264,7 +264,7 @@
#define XGMAC_OMR_FEF 0x00000080 /* Forward Error Frames */
#define XGMAC_OMR_DT 0x00000040 /* Drop TCP/IP csum Errors */
#define XGMAC_OMR_RSF 0x00000020 /* RX FIFO Store and Forward */
-#define XGMAC_OMR_RTC 0x00000010 /* RX Threshhold Ctrl */
+#define XGMAC_OMR_RTC_256 0x00000018 /* RX Threshhold Ctrl */
#define XGMAC_OMR_RTC_MASK 0x00000018 /* RX Threshhold Ctrl MASK */
/* XGMAC HW Features Register */
@@ -982,7 +982,8 @@ static int xgmac_hw_init(struct net_device *dev)
writel(value, ioaddr + XGMAC_DMA_CONTROL);
/* Set the HW DMA mode and the COE */
- writel(XGMAC_OMR_TSF | XGMAC_OMR_RSF | XGMAC_OMR_RFD | XGMAC_OMR_RFA,
+ writel(XGMAC_OMR_TSF | XGMAC_OMR_RFD | XGMAC_OMR_RFA |
+ XGMAC_OMR_RTC_256,
ioaddr + XGMAC_OMR);
/* Reset the MMC counters */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] Calxeda xgmac fixes and performance improvements
2012-07-10 0:16 [PATCH 0/4] Calxeda xgmac fixes and performance improvements Rob Herring
` (3 preceding siblings ...)
2012-07-10 0:16 ` [PATCH 4/4] net: calxedaxgmac: enable rx cut-thru mode Rob Herring
@ 2012-07-11 6:27 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-07-11 6:27 UTC (permalink / raw)
To: robherring2; +Cc: netdev, linux-kernel, rob.herring
From: Rob Herring <robherring2@gmail.com>
Date: Mon, 9 Jul 2012 19:16:06 -0500
> From: Rob Herring <rob.herring@calxeda.com>
>
> A few fixes and performance improvements for the Calxeda xgmac driver for
> 3.6. It would be nice to get the 2 fixes into 3.5, but since it is a bit
> late in the cycle they can wait.
All applied to net-nex, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-11 6:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 0:16 [PATCH 0/4] Calxeda xgmac fixes and performance improvements Rob Herring
2012-07-10 0:16 ` [PATCH 1/4] net: calxedaxgmac: fix net timeout recovery Rob Herring
2012-07-10 0:16 ` [PATCH 2/4] net: calxedaxgmac: fix hang on rx refill Rob Herring
2012-07-10 0:16 ` [PATCH 3/4] net: calxedaxgmac: set outstanding AXI bus transactions to 8 Rob Herring
2012-07-10 0:16 ` [PATCH 4/4] net: calxedaxgmac: enable rx cut-thru mode Rob Herring
2012-07-11 6:27 ` [PATCH 0/4] Calxeda xgmac fixes and performance improvements David Miller
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).