Re: [PATCH net-next v3] net: af_packet: Use hrtimer to do the retire operation

2 messages, 2 authors, 2025-08-18 · open the first message on its own page

Re: [PATCH net-next v3] net: af_packet: Use hrtimer to do the retire operation

From: Xin Zhao <hidden>
Date: 2025-08-18 05:38:52

On Sun, 2025-08-17 at 21:28 +0800, Willem wrote:
Here we cannot use hrtimer_add_expires for the same reason you gave in
the second version of the patch:
quoted
Additionally, I think we cannot avoid using ktime_get, as the retire
timeout for each block is not fixed. When there are a lot of network packets,
a block can retire quickly, and if we do not re-fetch the time, the timeout
duration may be set incorrectly.
Is that right?

Otherwise patch LGTM.

Dear Willem,

I have adjusted the logic in the recently sent v4 version by adding a boolean variable start
to distinguish whether it is the case of prb_open_block. If it is prb_open_block, I use
hrtimer_start to (re)start the timer; otherwise, I use hrtimer_set_expires to update the
expiration time. Additionally, I have added comments explaining this branch selection before
the _prb_refresh_rx_retire_blk_timer function.

I apologize for sending three PATCH v4 emails in a row. In the first email, I forgot to include
the link to v3. In the second email, there were no blank lines between v4 and v3.
Therefore, you can just refer to the latest v4 version in the third PATCH v4 email.


Thanks
Xin Zhao

Re: [PATCH net-next v3] net: af_packet: Use hrtimer to do the retire operation

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2025-08-18 07:21:52

Xin Zhao wrote:
On Sun, 2025-08-17 at 21:28 +0800, Willem wrote:
quoted
Here we cannot use hrtimer_add_expires for the same reason you gave in
the second version of the patch:
quoted
Additionally, I think we cannot avoid using ktime_get, as the retire
timeout for each block is not fixed. When there are a lot of network packets,
a block can retire quickly, and if we do not re-fetch the time, the timeout
duration may be set incorrectly.
Is that right?

Otherwise patch LGTM.

Dear Willem,

I have adjusted the logic in the recently sent v4 version by adding a boolean variable start
to distinguish whether it is the case of prb_open_block. If it is prb_open_block, I use
hrtimer_start to (re)start the timer; otherwise, I use hrtimer_set_expires to update the
expiration time. Additionally, I have added comments explaining this branch selection before
the _prb_refresh_rx_retire_blk_timer function.

I apologize for sending three PATCH v4 emails in a row. In the first email, I forgot to include
the link to v3. In the second email, there were no blank lines between v4 and v3.
Therefore, you can just refer to the latest v4 version in the third PATCH v4 email.
For the future: do not resend a patch within 24 hours.

And do not resend a patch with the same number. Again, follow the
documentation I pointed to before.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help