Skip to content

Commit 9f2a2a3

Browse files
Add: DPDK patch validation check
Implement DPDK version verification to ensure MTL compatibility. This prevents runtime crashes by validating that users are running properly patched DPDK versions. Known limitation: Mixed environments (e.g., patched DPDK in Docker with unpatched system drivers) can still cause crashes, as driver-level patches cannot be detected.
1 parent 488ef84 commit 9f2a2a3

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

lib/src/mt_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,13 @@ mtl_handle mtl_init(struct mtl_init_params* p) {
414414
err("%s, mt_dev_eal_init fail %d\n", __func__, ret);
415415
return NULL;
416416
}
417+
418+
const char* rte_ver = rte_version();
419+
if (!strstr(rte_ver, "mtl")) {
420+
err("%s, unpatched dpdk please use supported dpdk version: %s\n", __func__, rte_ver);
421+
goto err_exit;
422+
}
423+
417424
notice("%s, MTL version: %s, dpdk version: %s\n", __func__, mtl_version(),
418425
rte_version());
419426
#ifdef MTL_HAS_USDT
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From bfd22ef915c550775275e52f851a1e98e99978b7 Mon Sep 17 00:00:00 2001
2+
From: "Wesierski, Dawid" <[email protected]>
3+
Date: Mon, 3 Nov 2025 10:27:50 -0500
4+
Subject: [PATCH 6/6] config: add mtl version to version string
5+
6+
add verision string to tag the dpdk patched version
7+
and allow mtl to recognize if driver is patched.
8+
---
9+
config/meson.build | 4 ++--
10+
1 file changed, 2 insertions(+), 2 deletions(-)
11+
12+
diff --git a/config/meson.build b/config/meson.build
13+
index f31fef216c..4781122ce4 100644
14+
--- a/config/meson.build
15+
+++ b/config/meson.build
16+
@@ -78,10 +78,10 @@ if pver.get(2).contains('-rc')
17+
dpdk_conf.set('RTE_VER_RELEASE', rc_ver.get(1).to_int())
18+
else
19+
dpdk_conf.set('RTE_VER_MINOR', pver.get(2).to_int())
20+
- dpdk_conf.set_quoted('RTE_VER_SUFFIX', '')
21+
+ dpdk_conf.set_quoted('RTE_VER_SUFFIX', '_mtl_')
22+
# for actual, non-rc releases, set the release value to 99 to ensure releases
23+
# have higher version numbers than their respective release candidates
24+
- dpdk_conf.set('RTE_VER_RELEASE', 99)
25+
+ dpdk_conf.set('RTE_VER_RELEASE', 0)
26+
endif
27+
28+
pmd_subdir_opt = get_option('drivers_install_subdir')
29+
--
30+
2.47.3
31+

0 commit comments

Comments
 (0)