Skip to content

rename SOCK env var to BPF_DEVICE_PREFIX - #218

Merged
NEOatNHNG merged 4 commits into
eclipse-score:mainfrom
etas-contrib:fix-qnx-time_slave-clock-resolution
Sep 15, 2026
Merged

NEOatNHNG merged 4 commits into
eclipse-score:mainfrom
etas-contrib:fix-qnx-time_slave-clock-resolution

Conversation

@ryan-steel

Copy link
Copy Markdown
Contributor

What

This PR fixes QNX startup failure in time_slave where ClockIdentity resolution could fail on vtnet0 due to env coupling.

SOCK env was being reused for BPF path configuration.
In QNX runtime this can interfere with socket API behavior used during identity resolution.

Changes

  • time_slave init no longer writes SOCK for BPF configuration.
  • Added dedicated env variable QNX_BPF_DEVICE_PREFIX for BPF path configuration.
  • QNX raw shim updated to read dedicated BPF env variable.

Behavior change

Before:

  • Startup could fail with socket/getifaddrs errors and ClockIdentity failure.

After:

  • ClockIdentity resolves on vtnet0 in validated QNX QEMU setup.
  • time_slave initialization proceeds.

On a QNX x86_64 QEMU guest with the fixed time_slave binary:

Setting SOCK manually while running time_slave:

# SOCK=/dev/bpf ./time_slave --config etc/time_slave_config_qnx.json  
2026/09/11 12:26:11.9571611 109746206 000 ECU1 VTEX DFLT log info verbose 1 Initializing LifeCycleManager 
2026/09/11 12:26:11.9571629 109746297 000 ECU1 VTEX DFLT log info verbose 1 LifeCycleManager started 
2026/09/11 12:26:11.9571631 109746336 000 ECU1 VTEX DFLT log info verbose 1 Signal handler started 
2026/09/11 12:26:11.9571661 109746633 000 ECU1 VTEX TSAP log info verbose 7 Loaded config from  etc/time_slave_config_qnx.json  (iface= vtnet0 , phc= disabled ) 
2026/09/11 12:26:11.9571669 109746704 000 ECU1 VTEX TSAP log error verbose 2 GptpEngine: failed to resolve ClockIdentity for  vtnet0 
2026/09/11 12:26:11.9571671 109746724 000 ECU1 VTEX TSAP log error verbose 1 TimeSlave: GptpEngine initialization failed 
2026/09/11 12:26:11.9571673 109746746 000 ECU1 VTEX DFLT log error verbose 1 Error occurred during Initialize 
2026/09/11 12:26:11.9571677 109746782 000 ECU1 VTEX DFLT log error verbose 4 Application ./time_slave initialize finished with -1 
2026/09/11 12:26:11.9571681 109746822 000 ECU1 VTEX DFLT log info verbose 1 Signal SIGTERM received, requesting to stop the app 
2026/09/11 12:26:11.9571687 109746886 000 ECU1 VTEX TSAP log info verbose 1 GptpEngine deinitialized

Clean run:

# ./time_slave --config etc/time_slave_config_qnx.json  
2026/09/11 12:27:39.9659820 110628272 000 ECU1 VTEX DFLT log info verbose 1 Initializing LifeCycleManager 
2026/09/11 12:27:39.9659833 110628340 000 ECU1 VTEX DFLT log info verbose 1 LifeCycleManager started 
2026/09/11 12:27:39.9659834 110628363 000 ECU1 VTEX DFLT log info verbose 1 Signal handler started 
2026/09/11 12:27:39.9659857 110628585 000 ECU1 VTEX TSAP log info verbose 7 Loaded config from  etc/time_slave_config_qnx.json  (iface= vtnet0 , phc= disabled ) 
2026/09/11 12:27:39.9659877 110628784 000 ECU1 VTEX TSAP log info verbose 2 GptpEngine initialized on  vtnet0 
2026/09/11 12:27:39.9659883 110628847 000 ECU1 VTEX shm log warn verbose 4 Remove 359 Unexpected error while trying to remove  /gptp_ptp_info 
2026/09/11 12:27:39.9659915 110629166 000 ECU1 VTEX TSAP log info verbose 1 TimeSlave initialized 
2026/09/11 12:27:39.9659918 110629189 000 ECU1 VTEX DFLT log info verbose 1 Running Application 
2026/09/11 12:27:39.9659920 110629209 000 ECU1 VTEX DFLT log info verbose 1 Reporting kRunning to Launch Manager 
2026/09/11 12:27:39.9659925 110629268 000 ECU1 VTEX LM log error verbose 3 [Lifecycle client] FD  111  is invalid for kRunning report 
2026/09/11 12:27:39.9659928 110629291 000 ECU1 VTEX TSAP log info verbose 1 TimeSlave running 
[t1] CLOCK_RT ts=1789129660.701938180 (fallback)
[t1] CLOCK_RT ts=1789129660.807811561 (fallback)
...

Linked issue

Closes #217

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: fd116a47-6a61-4a76-baa1-d513336f1df0
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'platforms', the root module requires module version platforms@1.0.0, but got platforms@1.1.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_platform', the root module requires module version score_platform@0.7.1, but got score_platform@0.7.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_oci', the root module requires module version rules_oci@2.2.7, but got rules_oci@2.3.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (64 packages loaded, 10 targets configured)

Analyzing: target //:license-check (126 packages loaded, 464 targets configured)

Analyzing: target //:license-check (159 packages loaded, 3705 targets configured)

Analyzing: target //:license-check (164 packages loaded, 6259 targets configured)

Analyzing: target //:license-check (169 packages loaded, 6308 targets configured)

Analyzing: target //:license-check (169 packages loaded, 6308 targets configured)

Analyzing: target //:license-check (169 packages loaded, 6308 targets configured)

Analyzing: target //:license-check (172 packages loaded, 8195 targets configured)

Analyzing: target //:license-check (175 packages loaded, 11421 targets configured)

Analyzing: target //:license-check (176 packages loaded, 11429 targets configured)

Analyzing: target //:license-check (176 packages loaded, 11429 targets configured)

Analyzing: target //:license-check (176 packages loaded, 11429 targets configured)

INFO: Analyzed target //:license-check (177 packages loaded, 11555 targets configured).
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 2 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 32.778s, Critical Path: 2.46s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@ryan-steel
ryan-steel force-pushed the fix-qnx-time_slave-clock-resolution branch from 4a249bd to 8e574fc Compare September 11, 2026 12:46
@ryan-steel
ryan-steel marked this pull request as ready for review September 11, 2026 13:05
Comment thread score/time_slave/src/gptp/platform/qnx/qnx_raw_shim.cpp Outdated
Comment thread score/time_slave/src/gptp/platform/qnx/qnx_raw_shim.cpp Outdated
@ryan-steel
ryan-steel deployed to workflow-approval September 14, 2026 08:07 — with GitHub Actions Active
@ryan-steel
ryan-steel deployed to workflow-approval September 14, 2026 08:07 — with GitHub Actions Active

@BjoernAtBosch BjoernAtBosch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NEOatNHNG NEOatNHNG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content already reviewed by team.

@NEOatNHNG
NEOatNHNG merged commit 6dc811e into eclipse-score:main Sep 15, 2026
23 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in TIM - Time FT Sep 15, 2026

This branch was successfully deployed

1 active deployment
workflow-approval — 4803cb9c Deployed Sep 14, 2026 by ryan-steel via qnx-build (arm64-qnx) / approval #700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

QNX QEMU time_slave ClockIdentity fails on vtnet0

3 participants