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:
quoted
+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
quoted
+ 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.
quoted
+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.
quoted
+ dev_kfree_skb_any(skb);
+
+ /* error */
+ ndev->stats.tx_dropped++;
+ netdev_err(ndev, "tx: error: %d\n", ret);
+
+ return ret;
--
Thanks and Regards,
Danish.