> On 11/19/26 04:05, [email protected] wrote:
> > +static void netc_port_tstamp_timeout_work(struct work_struct *work)
> > +{
> > +   struct netc_port *np = container_of(work, struct netc_port,
> > +                                       tstamp_timeout_work.work);
> > +   struct sk_buff_head free_list;
> > +   struct sk_buff *skb, *skb_tmp;
> > +
> > +   __skb_queue_head_init(&free_list);
> > +
> > +   spin_lock_bh(&np->tstamp_lock);
> > +   skb_queue_walk_safe(&np->tstamp_queue, skb, skb_tmp) {
> > +           if (time_is_after_jiffies64(NETC_SKB_CB(skb)->ptp_tx_time +
> > +                                       NETC_TSTAMP_TIMEOUT))
> > +                   continue;
> 
> Not a blocker, but I think that starting from the tail would be better:
> the loop can be stop as soon as non expired skb is seen.
> 
> In the hopefully common scenario of no timeouts, the worker will peek
> a single skb, instead of traversing a possibly long list.
> 
> Can be a follow-up.

Thanks, I will prepare a separate patch to improve the logic.

Reply via email to