[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ddb8233c-ad3b-ef2a-36c0-5986d0f1696c@ti.com>
Date: Mon, 31 Jul 2023 10:27:37 +0530
From: Md Danish Anwar <a0501179@...com>
To: Jakub Kicinski <kuba@...nel.org>,
MD Danish Anwar <danishanwar@...com>
CC: Randy Dunlap <rdunlap@...radead.org>,
Roger Quadros <rogerq@...nel.org>,
Simon Horman <simon.horman@...igine.com>,
Vignesh Raghavendra <vigneshr@...com>,
Andrew Lunn <andrew@...n.ch>,
Richard Cochran <richardcochran@...il.com>,
Conor Dooley <conor+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>, <nm@...com>, <srk@...com>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<netdev@...r.kernel.org>, <linux-omap@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [EXTERNAL] Re: [PATCH v12 06/10] net: ti: icssg-prueth: Add ICSSG
ethernet driver
Hi Jakub,
On 29/07/23 5:54 am, Jakub Kicinski wrote:
> On Thu, 27 Jul 2023 16:58:23 +0530 MD Danish Anwar wrote:
>> +static int emac_tx_complete_packets(struct prueth_emac *emac, int chn,
>> + int budget)
>> +{
>> + struct net_device *ndev = emac->ndev;
>> + struct cppi5_host_desc_t *desc_tx;
>> + struct netdev_queue *netif_txq;
>> + struct prueth_tx_chn *tx_chn;
>> + unsigned int total_bytes = 0;
>> + struct sk_buff *skb;
>> + dma_addr_t desc_dma;
>> + int res, num_tx = 0;
>> + void **swdata;
>> +
>> + tx_chn = &emac->tx_chns[chn];
>> +
>> + while (budget) {
>> + res = k3_udma_glue_pop_tx_chn(tx_chn->tx_chn, &desc_dma);
>> + if (res == -ENODATA)
>> + break;
>
> You shouldn't limit the number of serviced packets to budget for Tx
> NAPI.
>
> https://docs.kernel.org/next/networking/napi.html#driver-api
>
>> + skb->dev = ndev;
>> + if (!netif_running(skb->dev)) {
>> + dev_kfree_skb_any(skb);
>> + return 0;
>> + }
>
> why do you check if the interface is running?
> If a packet arrives, it means the interface is running..
>
Sure, I will drop this if condition.
>> +drop_free_descs:
>> + prueth_xmit_free(tx_chn, first_desc);
>> +drop_stop_q:
>> + netif_tx_stop_queue(netif_txq);
>
> Do not stop the queue on DMA errors. If the queue is empty nothing
> will wake it up. Queue should only be stopped based on occupancy.
>
Sure, I will try to make sure we only stop queue based on occupancy.
>> + dev_kfree_skb_any(skb);
>> +
>> + /* error */
>> + ndev->stats.tx_dropped++;
>> + netdev_err(ndev, "tx: error: %d\n", ret);
>> +
>> + return ret;
--
Thanks and Regards,
Danish.
Powered by blists - more mailing lists