hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
....@@ -137,20 +137,22 @@
137137 for (i = 0; i < c->num_tc; i++)
138138 busy |= mlx5e_poll_tx_cq(&c->sq[i].cq, budget);
139139
140
+ /* budget=0 means we may be in IRQ context, do as little as possible */
141
+ if (unlikely(!budget))
142
+ goto out;
143
+
140144 busy |= mlx5e_poll_xdpsq_cq(&c->xdpsq.cq);
141145
142146 if (c->xdp)
143147 busy |= mlx5e_poll_xdpsq_cq(&c->rq_xdpsq.cq);
144148
145
- if (likely(budget)) { /* budget=0 means: don't poll rx rings */
146
- if (xsk_open)
147
- work_done = mlx5e_poll_rx_cq(&xskrq->cq, budget);
149
+ if (xsk_open)
150
+ work_done = mlx5e_poll_rx_cq(&xskrq->cq, budget);
148151
149
- if (likely(budget - work_done))
150
- work_done += mlx5e_poll_rx_cq(&rq->cq, budget - work_done);
152
+ if (likely(budget - work_done))
153
+ work_done += mlx5e_poll_rx_cq(&rq->cq, budget - work_done);
151154
152
- busy |= work_done == budget;
153
- }
155
+ busy |= work_done == budget;
154156
155157 mlx5e_poll_ico_cq(&c->icosq.cq);
156158 if (mlx5e_poll_ico_cq(&c->async_icosq.cq))