Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400738 > unrolled thread

[PATCH 0/2] net: pxa168_eth: improve performance

Started byJisheng Zhang <jszhang@marvell.com>
First post2016-05-13 14:10 +0200
Last post2016-05-16 19:50 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] net: pxa168_eth: improve performance Jisheng Zhang <jszhang@marvell.com> - 2016-05-13 14:10 +0200
    [PATCH 1/2] net: pxa168_eth: use {readl|writel}_relaxed instead of readl/writel Jisheng Zhang <jszhang@marvell.com> - 2016-05-13 14:10 +0200
    [PATCH 2/2] net: pxa168_eth: Use dma_wmb/rmb where appropriate Jisheng Zhang <jszhang@marvell.com> - 2016-05-13 14:10 +0200
    Re: [PATCH 0/2] net: pxa168_eth: improve performance David Miller <davem@davemloft.net> - 2016-05-16 19:50 +0200

#1400738 — [PATCH 0/2] net: pxa168_eth: improve performance

FromJisheng Zhang <jszhang@marvell.com>
Date2016-05-13 14:10 +0200
Subject[PATCH 0/2] net: pxa168_eth: improve performance
Message-ID<ryk4N-2Yo-1@gated-at.bofh.it>
This series is to improve the pxa168_eth driver performance by using
{readl|writel}_relaxed or appropriate memory barriers.

Jisheng Zhang (2):
  net: pxa168_eth: use {readl|writel}_relaxed instead of readl/writel
  net: pxa168_eth: Use dma_wmb/rmb where appropriate

 drivers/net/ethernet/marvell/pxa168_eth.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.8.1

[toc] | [next] | [standalone]


#1400743 — [PATCH 1/2] net: pxa168_eth: use {readl|writel}_relaxed instead of readl/writel

FromJisheng Zhang <jszhang@marvell.com>
Date2016-05-13 14:10 +0200
Subject[PATCH 1/2] net: pxa168_eth: use {readl|writel}_relaxed instead of readl/writel
Message-ID<ryk4O-2Yo-15@gated-at.bofh.it>
In reply to#1400738
Since appropriate memory barriers are already there, use the relaxed
version to improve performance a bit.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/net/ethernet/marvell/pxa168_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index c442f6a..db774e3 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -286,12 +286,12 @@ static int pxa168_eth_stop(struct net_device *dev);
 
 static inline u32 rdl(struct pxa168_eth_private *pep, int offset)
 {
-	return readl(pep->base + offset);
+	return readl_relaxed(pep->base + offset);
 }
 
 static inline void wrl(struct pxa168_eth_private *pep, int offset, u32 data)
 {
-	writel(data, pep->base + offset);
+	writel_relaxed(data, pep->base + offset);
 }
 
 static void abort_dma(struct pxa168_eth_private *pep)
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1400748 — [PATCH 2/2] net: pxa168_eth: Use dma_wmb/rmb where appropriate

FromJisheng Zhang <jszhang@marvell.com>
Date2016-05-13 14:10 +0200
Subject[PATCH 2/2] net: pxa168_eth: Use dma_wmb/rmb where appropriate
Message-ID<ryk4P-2Yo-39@gated-at.bofh.it>
In reply to#1400738
Update the pxa168_eth driver to use the dma_rmb/wmb calls instead of the
full barriers in order to improve performance: reduced 97ns/39ns on
average in tx/rx path on Marvell BG4CT platform.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/net/ethernet/marvell/pxa168_eth.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index db774e3..728a115 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -342,9 +342,9 @@ static void rxq_refill(struct net_device *dev)
 		pep->rx_skb[used_rx_desc] = skb;
 
 		/* Return the descriptor to DMA ownership */
-		wmb();
+		dma_wmb();
 		p_used_rx_desc->cmd_sts = BUF_OWNED_BY_DMA | RX_EN_INT;
-		wmb();
+		dma_wmb();
 
 		/* Move the used descriptor pointer to the next descriptor */
 		pep->rx_used_desc_q = (used_rx_desc + 1) % pep->rx_ring_size;
@@ -794,7 +794,7 @@ static int rxq_process(struct net_device *dev, int budget)
 		rx_used_desc = pep->rx_used_desc_q;
 		rx_desc = &pep->p_rx_desc_area[rx_curr_desc];
 		cmd_sts = rx_desc->cmd_sts;
-		rmb();
+		dma_rmb();
 		if (cmd_sts & (BUF_OWNED_BY_DMA))
 			break;
 		skb = pep->rx_skb[rx_curr_desc];
@@ -1289,7 +1289,7 @@ static int pxa168_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	skb_tx_timestamp(skb);
 
-	wmb();
+	dma_wmb();
 	desc->cmd_sts = BUF_OWNED_BY_DMA | TX_GEN_CRC | TX_FIRST_DESC |
 			TX_ZERO_PADDING | TX_LAST_DESC | TX_EN_INT;
 	wmb();
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1401663

FromDavid Miller <davem@davemloft.net>
Date2016-05-16 19:50 +0200
Message-ID<rzuOu-1B1-5@gated-at.bofh.it>
In reply to#1400738
From: Jisheng Zhang <jszhang@marvell.com>
Date: Fri, 13 May 2016 19:57:28 +0800

> This series is to improve the pxa168_eth driver performance by using
> {readl|writel}_relaxed or appropriate memory barriers.

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web