diff mbox series

[1/3] bpf: Add BPF_SOCK_OPS_TSTAMP_COMPLETION_CB callback

Message ID 256cac73a03d6c46b81766db0a1c67cd3220b8f5.1743337403.git.pav@iki.fi
State New
Headers show
Series bpf: TSTAMP_COMPLETION_CB timestamping + enable it for Bluetooth | expand

Commit Message

Pauli Virtanen March 30, 2025, 12:23 p.m. UTC
Support SCM_TSTAMP_COMPLETION case for bpf timestamping.

Add a new sock_ops callback, BPF_SOCK_OPS_TSTAMP_SND_SW_CB. This
callback shall occur at the same timestamping point as the user
space's software SCM_TSTAMP_COMPLETION. The BPF program can use it to
get the same SCM_TSTAMP_COMPLETION timestamp without modifying the
user-space application.

Emitting BPF completion timestamps is enabled in separate patches.

Signed-off-by: Pauli Virtanen <pav@iki.fi>
---
 include/uapi/linux/bpf.h | 5 +++++
 net/core/skbuff.c        | 3 +++
 2 files changed, 8 insertions(+)

Comments

bluez.test.bot@gmail.com March 30, 2025, 1:16 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=948355

---Test result---

Test Summary:
CheckPatch                    PENDING   0.39 seconds
GitLint                       PENDING   0.37 seconds
SubjectPrefix                 FAIL      0.53 seconds
BuildKernel                   PASS      24.69 seconds
CheckAllWarning               PASS      27.05 seconds
CheckSparse                   PASS      30.91 seconds
BuildKernel32                 PASS      24.03 seconds
TestRunnerSetup               PASS      435.17 seconds
TestRunner_l2cap-tester       PASS      21.08 seconds
TestRunner_iso-tester         PASS      37.62 seconds
TestRunner_bnep-tester        PASS      5.03 seconds
TestRunner_mgmt-tester        FAIL      125.67 seconds
TestRunner_rfcomm-tester      PASS      8.08 seconds
TestRunner_sco-tester         PASS      12.76 seconds
TestRunner_ioctl-tester       PASS      8.53 seconds
TestRunner_mesh-tester        PASS      6.15 seconds
TestRunner_smp-tester         PASS      7.28 seconds
TestRunner_userchan-tester    PASS      5.04 seconds
IncrementalBuild              PENDING   0.59 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 485 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
LL Privacy - Add Device 2 (2 Devices to AL)          Failed       0.170 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index defa5bb881f4..6cd918febcb3 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -7054,6 +7054,11 @@  enum {
 					 * sendmsg timestamp with corresponding
 					 * tskey.
 					 */
+	BPF_SOCK_OPS_TSTAMP_COMPLETION_CB,	/* Called on skb completion
+						 * report from hardware when
+						 * SK_BPF_CB_TX_TIMESTAMPING
+						 * feature is on.
+						 */
 };
 
 /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6cbf77bc61fc..9b2ff115eaf5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -5552,6 +5552,9 @@  static void skb_tstamp_tx_report_bpf_timestamping(struct sk_buff *skb,
 	case SCM_TSTAMP_ACK:
 		op = BPF_SOCK_OPS_TSTAMP_ACK_CB;
 		break;
+	case SCM_TSTAMP_COMPLETION:
+		op = BPF_SOCK_OPS_TSTAMP_COMPLETION_CB;
+		break;
 	default:
 		return;
 	}