Skip to content

Commit 388665a

Browse files
committed
Merge branch 'pxa168_eth-perf'
Jisheng Zhang says: ==================== net: pxa168_eth: improve performance This series is to improve the pxa168_eth driver performance by using {readl|writel}_relaxed or appropriate memory barriers. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8be0cfa + b17d155 commit 388665a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/net/ethernet/marvell/pxa168_eth.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,12 @@ static int pxa168_eth_stop(struct net_device *dev);
286286

287287
static inline u32 rdl(struct pxa168_eth_private *pep, int offset)
288288
{
289-
return readl(pep->base + offset);
289+
return readl_relaxed(pep->base + offset);
290290
}
291291

292292
static inline void wrl(struct pxa168_eth_private *pep, int offset, u32 data)
293293
{
294-
writel(data, pep->base + offset);
294+
writel_relaxed(data, pep->base + offset);
295295
}
296296

297297
static void abort_dma(struct pxa168_eth_private *pep)
@@ -342,9 +342,9 @@ static void rxq_refill(struct net_device *dev)
342342
pep->rx_skb[used_rx_desc] = skb;
343343

344344
/* Return the descriptor to DMA ownership */
345-
wmb();
345+
dma_wmb();
346346
p_used_rx_desc->cmd_sts = BUF_OWNED_BY_DMA | RX_EN_INT;
347-
wmb();
347+
dma_wmb();
348348

349349
/* Move the used descriptor pointer to the next descriptor */
350350
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)
794794
rx_used_desc = pep->rx_used_desc_q;
795795
rx_desc = &pep->p_rx_desc_area[rx_curr_desc];
796796
cmd_sts = rx_desc->cmd_sts;
797-
rmb();
797+
dma_rmb();
798798
if (cmd_sts & (BUF_OWNED_BY_DMA))
799799
break;
800800
skb = pep->rx_skb[rx_curr_desc];
@@ -1287,7 +1287,7 @@ static int pxa168_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
12871287

12881288
skb_tx_timestamp(skb);
12891289

1290-
wmb();
1290+
dma_wmb();
12911291
desc->cmd_sts = BUF_OWNED_BY_DMA | TX_GEN_CRC | TX_FIRST_DESC |
12921292
TX_ZERO_PADDING | TX_LAST_DESC | TX_EN_INT;
12931293
wmb();

0 commit comments

Comments
 (0)