Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <davem@davemloft.net>

+8 -15
+8 -15
drivers/net/ethernet/broadcom/genet/bcmgenet.c
··· 1130 1130 1131 1131 dmadesc_set(priv, tx_cb_ptr->bd_addr, mapping, length_status); 1132 1132 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 - 1138 1133 return 0; 1139 1134 } 1140 1135 ··· 1167 1172 dmadesc_set(priv, tx_cb_ptr->bd_addr, mapping, 1168 1173 (frag->size << DMA_BUFLENGTH_SHIFT) | dma_desc_flags | 1169 1174 (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT)); 1170 - 1171 - 1172 - ring->free_bds -= 1; 1173 - ring->prod_index += 1; 1174 - ring->prod_index &= DMA_P_INDEX_MASK; 1175 1175 1176 1176 return 0; 1177 1177 } ··· 1311 1321 1312 1322 skb_tx_timestamp(skb); 1313 1323 1314 - /* we kept a software copy of how much we should advance the TDMA 1315 - * producer index, now write it down to the hardware 1316 - */ 1317 - bcmgenet_tdma_ring_writel(priv, ring->index, 1318 - ring->prod_index, TDMA_PROD_INDEX); 1324 + /* Decrement total BD count and advance our write pointer */ 1325 + ring->free_bds -= nr_frags + 1; 1326 + ring->prod_index += nr_frags + 1; 1327 + ring->prod_index &= DMA_P_INDEX_MASK; 1319 1328 1320 1329 if (ring->free_bds <= (MAX_SKB_FRAGS + 1)) 1321 1330 netif_tx_stop_queue(txq); 1322 1331 1332 + if (!skb->xmit_more || netif_xmit_stopped(txq)) 1333 + /* Packets are ready, update producer index */ 1334 + bcmgenet_tdma_ring_writel(priv, ring->index, 1335 + ring->prod_index, TDMA_PROD_INDEX); 1323 1336 out: 1324 1337 spin_unlock_irqrestore(&ring->lock, flags); 1325 1338