Re: [PATCH] io_uring/cmd_net: prevent infinite retry loop on unextractable timestamp skb

From: Pavel Begunkov

Date: Tue Oct 13 2026 - 21:14:34 EST


n 10/8/26 15:59, Bui Viet Dung wrote:
On Thu, Oct 8, 2026 at 3:43 PM Pavel Begunkov <asml.silence@xxxxxxxxx> wrote:
Sounds fine since there are only timestamp skbs in this list, do
you have a test case?

Hi Pavel,

Thanks for the review.

The issue was spotted during code inspection of the error handling path
in io_uring_cmd_timestamp(): specifically when skb_get_tx_timestamp() returns
a negative error (e.g. -ENOENT due to missing PHC bindings with
SOF_TIMESTAMPING_BIND_PHC or unavailable timestamp data). Since the
multishot apoll remains armed on EPOLLERR and the unhandled skb is spliced
back onto the head of sk_error_queue, it immediately re-triggers the command
in a tight busy-loop.

Below is a standalone test program demonstrating the TX_TIMESTAMP command
setup and execution with CQE32:

Did you actually reproduce it? This program doesn't for me, nor does
fault injection. Taking a look at the code, io_uring_cmd_timestamp()
returns -EAGAIN, and the request will wait for the next wake up in the
polling code. There are bits to improve, but that's not an infinite loop.

--
Pavel Begunkov