Re: [PATCH net-next 5/5] net/mlx4: flush pending doorbell when dropping a TX skb

From
Paolo Abeni <pabeni@redhat.com>
Date
2026-11-12 14:49:54
Also in
linux-rdma, lkml
Reply to
Daniel Machon, 2026-11-12
On 11/12/26 14:43, Daniel Machon wrote:
quoted
diff --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.
I don't think checking `!netdev_xmit_more()` would work, as
`__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@dama.to

I think a better binary layout for `struct mlx4_en_tx_ring` is needed.

Thanks,

Paolo
Thread (15 messages) 15 messages, 4 authors, last reply 4d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help