Re: [PATCH bpf-next v8 08/12] bpf: support hw SCM_TSTAMP_SND of SO_TIMESTAMPING

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux