ConnectX-6 Dx Zephyr Ethernet Driver
Achieving Zero MISRA C:2023 Violations
From Scan โ to Certification
Swipe or use arrows to navigate โ
Parasoft scans all source
against MISRA C:2023
Output: XML violation report
Classify each violation:
Fix ยท Deviate ยท Suppress
Amp AI generates fixes
Re-scan confirms zero violations
Generate GCS + GRP docs
MC/DC coverage โฅ 80%
cpptesttrace west build \
-b native_sim /path/to/driver \
-- -DCONFIG_ETH_CX6_DX=y \
-DUSE_CCACHE=0
cpptestcli \
-config "builtin://MISRA C 2023 \
(MISRA C 2012)" \
-bdf cx6_build.bdf \
-resource cx6_driver \
-compiler gcc_13-64
Zephyr's ccache.cmake wraps compiler calls, corrupting the BDF. Fix: always pass -DUSE_CCACHE=0.
BAD: ccache /usr/bin/gcc -DCONFIG... โ "invalid option"
FIX: west build ... -- -DUSE_CCACHE=0
HIGH
Must reach zero violations
LOW
Zephyr framework โ not our scope
Info
Excluded from metrics
10-tab PyQt6 application (5,591 lines) for complete MISRA compliance management:
โ Driver bright segments, โค RTOS dimmed with purple stripes. Delta indicators show scan-to-scan improvement.
Filter by All, Driver, or RTOS. Subsystem dropdowns dynamically update (cx6_pcie, kernel, net/ip, etc.).
/* goto-cleanup single return */
int32_t func(args) {
int32_t ret = 0;
if (error) {
ret = -EINVAL;
goto out;
}
out:
return ret;
}
/* Multiple returns */ if (x) return -1; /* Dynamic allocation */ buf = malloc(size); /* Bare types */ int count; unsigned len;
Use candlekeep to research MISRA C:2023 Rule 10.3. Fix violation in cx6_device.c line 148: "Value assigned to narrower essential type" Constraints: goto-cleanup, fixed-width types, no malloc, verify with west build.
ISO 26262 allows deviations with documented safety rationale for unavoidable patterns.
| Code | Category | Used For |
|---|---|---|
| HWI | Hardware Interface | MMIO pointer-integer casts |
| ZAP | Zephyr API Pattern | CONTAINER_OF, K_WORK_INIT |
| PER | Performance | Data-path function-like macros |
| CEX | Compiler Extension | GCC __attribute__ (aligned, section) |
| ESM | Equiv. Safety Measure | Alternative safety mechanisms |
| DRV | Driver Architecture | Static single-device instance |
| DBG | Debug Only | LOG_* stdio-like formatting |
| Rule | Cat | Justification |
|---|---|---|
| 11.4 | HWI | MMIO register access requires pointer-integer casts |
| 11.3 | ZAP | Zephyr CONTAINER_OF() uses pointer-to-struct casts |
| 20.7 | ZAP | Zephyr macros don't parenthesise all parameters |
| Dir 4.9 | PER | Data-path helpers use function-like macros |
| 21.6 | DBG | Zephyr LOG_* uses stdio internally |
Guidelines Compliance Summary โ per-rule status:
Guidelines Re-categorization Plan โ re-classify Advisory rules:
| ASIL | Method | Target |
|---|---|---|
| ASIL A | Statement Coverage | โฅ 80% |
| ASIL B | Branch / Decision Coverage | โฅ 80% |
| ASIL C | MC/DC | โฅ 80% |
| ASIL D | MC/DC | โฅ 80% |
cx6_pcie ยท cx6_device ยท cx6_queue ยท cx6_interrupt ยท cx6_eth โ with fake MMIO stubs for host testing and gcov / cpptestct coverage collection.
Code change resolves the violation
Formal permit with safety rationale
False positive โ tool limitation
๐ฏ Target: Zero Driver Violations
All flags documented ยท Coverage targets met ยท GCS/GRP generated
pip install PyQt6 cd dashboard python cx6_misra_dashboard.py # First-time: # Settings โ Project Dir # Settings โ cpptestcli path # Settings โ ZEPHYR_BASE # Overview โ โถ Run Scan
| File | Purpose |
|---|---|
dashboard/cx6_misra_dashboard.py | Main app โ 5,591 lines, 10 tabs, dark theme |
dashboard/misra_rule_data.py | MISRA rules, severities, fix strategies |
dashboard/app_logo.png | ConnectX-6 Dx / NVIDIA logo |
misra_compliance/config/ | Settings + MISRA overlay Kconfig |
misra_compliance/deviations/ | Formal deviation database (JSON) |
misra_compliance/reports/ | Parasoft XML scan results (auto) |
misra_compliance/sessions/ | Session persistence (auto) |
A complete, auditable workflow for achieving
Zero MISRA C:2023 Violations
on the ConnectX-6 Dx Zephyr Ethernet driver.
ISO 26262 Compliance Toolkit โ March 2026
Designed for automotive safety engineers and ISO 26262 auditors.