Re: [PATCH net-next 5/5] net/mlx4: flush pending doorbell when dropping a TX skb
From: Paolo Abeni
Date: Thu Nov 12 2026 - 10:00:27 EST
On 11/12/26 14:43, Daniel Machon wrote:
I don't think checking `!netdev_xmit_more()` would work, asdiff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 123071a47bed..3166837711be 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -1135,6 +1135,9 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
tx_drop_count:
ring->tx_dropped++;
+ /* an earlier skb in this batch may have deferred the doorbell */
+ if (ring->doorbell_pending)
I think checking !netdev_xmit_more() here would let you ditch the new ring
state, but it seems bnxt does it the same way, so fine by me.
`__netdev_tx_sent_queue()` adds more logic to it.
Still I think that the cacheline alignment comment by sashiko
on patch 4 is relevant:
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261110231304.1859217-1-joe@xxxxxxx
I think a better binary layout for `struct mlx4_en_tx_ring` is needed.
Thanks,
Paolo