Skip to content

Commit 03a1200

Browse files
committed
dpdk symmetric_mp: add patched version of main.c for old versions of dpdk
1 parent 0f8d7e4 commit 03a1200

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

microsoft/testsuites/dpdk/dpdkutil.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from decimal import Decimal
66
from enum import Enum
77
from functools import partial
8+
from pathlib import PurePath
89
from typing import Any, Dict, List, Optional, Tuple, Union
910

1011
from assertpy import assert_that, fail
@@ -30,6 +31,7 @@
3031
from lisa.operating_system import OperatingSystem, Ubuntu
3132
from lisa.testsuite import TestResult
3233
from lisa.tools import (
34+
Cp,
3335
Dmesg,
3436
Echo,
3537
Firewall,
@@ -1292,6 +1294,33 @@ def get_port_info(self, nics: List[NicInfo], expect_ports: int = 1) -> str:
12921294
return self.port_mask
12931295

12941296

1297+
# TODO: remove this method in 2028 when all updated versions are LTS
1298+
def _apply_workaround_for_symmetric_mp_main(node: Node) -> None:
1299+
# workaround for unmerged code in dpdk project
1300+
# replace symmetric_mp main.c with patched version
1301+
symmetric_mp_local_dir = PurePath(__file__).parent.joinpath("symmetric_mp")
1302+
symmetric_mp_patched_main_c = "symmetric-mp-patched-main.c"
1303+
node.shell.copy(
1304+
symmetric_mp_local_dir.joinpath(symmetric_mp_patched_main_c),
1305+
node.working_path,
1306+
)
1307+
symmetric_mp_remote = (
1308+
"/usr/local/share/dpdk/examples/multi_process/symmetric_mp/main.c"
1309+
)
1310+
node.tools[Cp].run(
1311+
(
1312+
f"{str(node.working_path.joinpath(symmetric_mp_patched_main_c))} "
1313+
f"{symmetric_mp_remote}"
1314+
),
1315+
force_run=True,
1316+
sudo=True,
1317+
expected_exit_code=0,
1318+
expected_exit_code_failure_message=(
1319+
"Could not copy patched symmetric_mp main.c to examples folder."
1320+
),
1321+
)
1322+
1323+
12951324
def run_dpdk_symmetric_mp(
12961325
node: Node,
12971326
log: Logger,
@@ -1351,6 +1380,11 @@ def run_dpdk_symmetric_mp(
13511380
"DPDK symmetric_mp test is not implemented for "
13521381
" package manager installation."
13531382
)
1383+
1384+
# NOTE: apply workaround for unmerged change to main.c
1385+
# needed to run symmetric_mp on MANA for now.
1386+
_apply_workaround_for_symmetric_mp_main(node)
1387+
13541388
symmetric_mp_path = testpmd.get_example_app_path("multi_process/symmetric_mp")
13551389

13561390
# setup the DPDK EAL arguments for netvsc
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# patched symmetric_mp example app
2+
3+
The main.c file in this directory is a patched version of the multi_process/symmetric_mp example application from the DPDK project.
4+
5+
https://git.dpdk.org/dpdk/tree/examples/multi_process/symmetric_mp
6+
7+
This change in this main.c is under review, but not merged. This cached version of the main.c file for this app is a workaround for older versions of DPDK. It should build for most if not all recent versions of the project.
8+
9+
https://patches.dpdk.org/project/dpdk/list/?series=36143

microsoft/testsuites/dpdk/symmetric_mp/symmetric-mp-patched-main.c

Whitespace-only changes.

0 commit comments

Comments
 (0)