Skip to content

Commit 2801be4

Browse files
committed
Merge branch 'bcmgenet_xmit_more'
Florian Fainelli says: ==================== net: bcmgenet: xmit_more support This patch series adds xmit_more support to the GENET driver by allowing the deferal of the producer index write to the TDMA engine. Changes in v2: - move the netif_tx_stop_queue check *before* updating the producer index ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents d6707be + ddd0ca5 commit 2801be4

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,11 +1130,6 @@ static int bcmgenet_xmit_single(struct net_device *dev,
11301130

11311131
dmadesc_set(priv, tx_cb_ptr->bd_addr, mapping, length_status);
11321132

1133-
/* Decrement total BD count and advance our write pointer */
1134-
ring->free_bds -= 1;
1135-
ring->prod_index += 1;
1136-
ring->prod_index &= DMA_P_INDEX_MASK;
1137-
11381133
return 0;
11391134
}
11401135

@@ -1173,11 +1168,6 @@ static int bcmgenet_xmit_frag(struct net_device *dev,
11731168
(frag->size << DMA_BUFLENGTH_SHIFT) | dma_desc_flags |
11741169
(priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT));
11751170

1176-
1177-
ring->free_bds -= 1;
1178-
ring->prod_index += 1;
1179-
ring->prod_index &= DMA_P_INDEX_MASK;
1180-
11811171
return 0;
11821172
}
11831173

@@ -1321,15 +1311,18 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
13211311

13221312
skb_tx_timestamp(skb);
13231313

1324-
/* we kept a software copy of how much we should advance the TDMA
1325-
* producer index, now write it down to the hardware
1326-
*/
1327-
bcmgenet_tdma_ring_writel(priv, ring->index,
1328-
ring->prod_index, TDMA_PROD_INDEX);
1314+
/* Decrement total BD count and advance our write pointer */
1315+
ring->free_bds -= nr_frags + 1;
1316+
ring->prod_index += nr_frags + 1;
1317+
ring->prod_index &= DMA_P_INDEX_MASK;
13291318

13301319
if (ring->free_bds <= (MAX_SKB_FRAGS + 1))
13311320
netif_tx_stop_queue(txq);
13321321

1322+
if (!skb->xmit_more || netif_xmit_stopped(txq))
1323+
/* Packets are ready, update producer index */
1324+
bcmgenet_tdma_ring_writel(priv, ring->index,
1325+
ring->prod_index, TDMA_PROD_INDEX);
13331326
out:
13341327
spin_unlock_irqrestore(&ring->lock, flags);
13351328

0 commit comments

Comments
 (0)