On 2/5/25 8:03 AM, Jason Xing wrote:
@@ -5574,9 +5575,9 @@ static void skb_tstamp_tx_bpf(struct sk_buff *skb, struct sock *sk,
op = BPF_SOCK_OPS_TS_SCHED_OPT_CB;
break;
case SCM_TSTAMP_SND:
- if (!sw)
- return;
- op = BPF_SOCK_OPS_TS_SW_OPT_CB;
+ op = sw ? BPF_SOCK_OPS_TS_SW_OPT_CB : BPF_SOCK_OPS_TS_HW_OPT_CB;
+ if (!sw && hwtstamps)
+ *skb_hwtstamps(skb) = *hwtstamps;
Isn't this called by drivers that have actually set skb_hwtstamps?
Oops, somehow my mind has gone blank 🙁 Will remove it. Thanks for
correcting me!
I just noticed I missed this thread when reviewing v9.
I looked at a few drivers, e.g. the mlx5e_consume_skb(). It does not necessarily
set the skb_hwtstamps(skb) before calling skb_tstamp_tx(). The __skb_tstamp_tx()
is also setting skb_hwtstamps(skb) after testing "if (hwtstamps)", so I think
this assignment is still needed here?