Re: [PATCH net-next v25 06/13] rtase: Implement .ndo_start_xmit function

From: Jakub Kicinski
Date: Mon Jul 29 2024 - 22:16:27 EST


On Mon, 29 Jul 2024 14:21:14 +0800 Justin Lai wrote:
> + stop_queue = !netif_subqueue_maybe_stop(dev, ring->index,
> + rtase_tx_avail(ring),
> + RTASE_TX_STOP_THRS,
> + RTASE_TX_START_THRS);
> +
> + if (door_bell || stop_queue)
> + rtase_w8(tp, RTASE_TPPOLL, BIT(ring->index));
> +
> + return NETDEV_TX_OK;
> +
> +err_dma_1:
> + ring->skbuff[entry] = NULL;
> + rtase_tx_clear_range(ring, ring->cur_idx + 1, frags);
> +
> +err_dma_0:
> + tp->stats.tx_dropped++;
> + dev_kfree_skb_any(skb);
> + return NETDEV_TX_OK;
> +
> +err_stop:
> + netif_stop_queue(dev);
> + tp->stats.tx_dropped++;
> + return NETDEV_TX_BUSY;

If you're dropping a packet you should somehow check that the previous
xmit didn't enqueue a packet to the ring and skip the doorbell because
door_bell was false. If that's the case you have to ring the doorbell now.

Also you shouldn't increment dropped if you return TX_BUSY.

Please fix these issues in the driver you're copying from, too.