diff mbox series

[net-next,v2,3/6] bcm63xx_enet: add xmit_more support

Message ID 20201224142421.32350-4-liew.s.piaw@gmail.com
State New
Headers show
Series bcm63xx_enet: major makeover of driver | expand

Commit Message

Sieng Piaw Liew Dec. 24, 2020, 2:24 p.m. UTC
Support bulking hardware TX queue by using netdev_xmit_more().

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Jakub Kicinski Dec. 28, 2020, 8:40 p.m. UTC | #1
On Thu, 24 Dec 2020 22:24:18 +0800 Sieng Piaw Liew wrote:
> Support bulking hardware TX queue by using netdev_xmit_more().

> 

> Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>

> ---

>  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 11 +++++++----

>  1 file changed, 7 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c

> index 90f8214b4d22..452968f168ed 100644

> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c

> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c

> @@ -633,14 +633,17 @@ bcm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)

>  

>  	netdev_sent_queue(dev, skb->len);

>  

> -	/* kick tx dma */

> -	enet_dmac_writel(priv, priv->dma_chan_en_mask,

> -				 ENETDMAC_CHANCFG, priv->tx_chan);

> -

>  	/* stop queue if no more desc available */

>  	if (!priv->tx_desc_count)

>  		netif_stop_queue(dev);

>  

> +	/* kick tx dma */

> +        if (!netdev_xmit_more() || !priv->tx_desc_count)

> +                enet_dmac_writel(priv, priv->dma_chan_en_mask,

> +                                 ENETDMAC_CHANCFG, priv->tx_chan);

> +

> +

> +

>  	dev->stats.tx_bytes += skb->len;

>  	dev->stats.tx_packets++;

>  	ret = NETDEV_TX_OK;


Please address checkpatch --strict issues throughout the series:

ERROR: code indent should use tabs where possible
#31: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:641:
+        if (!netdev_xmit_more() || !priv->tx_desc_count)$

WARNING: please, no spaces at the start of a line
#31: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:641:
+        if (!netdev_xmit_more() || !priv->tx_desc_count)$

ERROR: code indent should use tabs where possible
#32: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:642:
+                enet_dmac_writel(priv, priv->dma_chan_en_mask,$

WARNING: please, no spaces at the start of a line
#32: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:642:
+                enet_dmac_writel(priv, priv->dma_chan_en_mask,$

ERROR: code indent should use tabs where possible
#33: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:643:
+                                 ENETDMAC_CHANCFG, priv->tx_chan);$

WARNING: please, no spaces at the start of a line
#33: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:643:
+                                 ENETDMAC_CHANCFG, priv->tx_chan);$

CHECK: Please don't use multiple blank lines
#35: FILE: drivers/net/ethernet/broadcom/bcm63xx_enet.c:645:
+
+
Florian Fainelli Dec. 29, 2020, 3:13 a.m. UTC | #2
On 12/24/2020 6:24 AM, Sieng Piaw Liew wrote:
> Support bulking hardware TX queue by using netdev_xmit_more().

> 

> Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>


Acked-by: Florian Fainelli <f.fainelli@gmail.com>

-- 
Florian
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 90f8214b4d22..452968f168ed 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -633,14 +633,17 @@  bcm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	netdev_sent_queue(dev, skb->len);
 
-	/* kick tx dma */
-	enet_dmac_writel(priv, priv->dma_chan_en_mask,
-				 ENETDMAC_CHANCFG, priv->tx_chan);
-
 	/* stop queue if no more desc available */
 	if (!priv->tx_desc_count)
 		netif_stop_queue(dev);
 
+	/* kick tx dma */
+        if (!netdev_xmit_more() || !priv->tx_desc_count)
+                enet_dmac_writel(priv, priv->dma_chan_en_mask,
+                                 ENETDMAC_CHANCFG, priv->tx_chan);
+
+
+
 	dev->stats.tx_bytes += skb->len;
 	dev->stats.tx_packets++;
 	ret = NETDEV_TX_OK;