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

From: Xin Zhao
Date: Thu Aug 14 2025 - 22:55:23 EST


On Fri, 2025-08-15 at 1:29 +0800, Willem wrote:

> > - p1->tov_in_jiffies = msecs_to_jiffies(p1->retire_blk_tov);
> > + p1->tov_in_msecs = p1->retire_blk_tov;
>
> Can probably drop this field as it's the same as retire_blk_tov.
>
> Or convert to ktime_t next_timer, to be able to replace ktime_get()
> with ktime_add_ms when rearming when calling hrtimer_set_expires.

Dear Willem,

Thank you for your suggestion.
I will drop the tov_in_msecs field in PATCH v2.
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.

Thanks
Xin Zhao