Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPDK MANA CentOS 7 changes #3373

Open
wants to merge 9 commits into
base: mcgov/dpdk-mana-merge
Choose a base branch
from
Prev Previous commit
Next Next commit
dpdk: control kernel update via dpdk_kernel_update
Signed-off-by: Pavel Boldin <pboldin@cloudlinux.com>
  • Loading branch information
paboldin committed Aug 10, 2024
commit 7edabb1bf5b311bf0b33d9db91cec3d98736e21d
28 changes: 16 additions & 12 deletions microsoft/testsuites/dpdk/dpdktestpmd.py
Original file line number Diff line number Diff line change
@@ -488,6 +488,8 @@ def get_dpdk_portmask(self, ports: List[int]) -> str:

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
# do not update kernel on backporting
self.update_kernel = kwargs.pop("update_kernel", True)
# set source args for builds if needed, first for dpdk
self.dpdk_build_path: Optional[PurePath] = None
self._dpdk_source: str = kwargs.pop("dpdk_source", PACKAGE_MANAGER_SOURCE)
@@ -499,6 +501,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
node=self.node,
rdma_core_source=rdma_core_source,
rdma_core_ref=rdma_core_ref,
update_kernel=self.update_kernel,
)
self._sample_apps_to_build = kwargs.pop("sample_apps", list())
self._dpdk_version_info = VersionInfo(0, 0)
@@ -885,7 +888,7 @@ def _load_drivers_for_dpdk(self) -> None:
if isinstance(self.node.os, (Ubuntu, Suse)):
# Ubuntu shouldn't need any special casing, skip to loading rdma/ib
pass
elif isinstance(self.node.os, Debian):
elif self.update_kernel and isinstance(self.node.os, Debian):
# NOTE: debian buster doesn't include rdma and ib drivers
# on 5.4 specifically for linux-image-cloud:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012639
@@ -984,8 +987,9 @@ def _install_ubuntu_dependencies(self) -> None:
return # appease the type checker

# apply update to latest first
ubuntu.update_packages("linux-azure")
node.reboot()
if self.update_kernel:
ubuntu.update_packages("linux-azure")
node.reboot()
if ubuntu.information.version < "18.4.0":
raise SkippedException(
f"Ubuntu {str(ubuntu.information.version)} is not supported. "
@@ -1004,9 +1008,8 @@ def _install_ubuntu_dependencies(self) -> None:
extra_args=self._backport_repo_args,
)
# MANA tests use linux-modules-extra-azure, install if it's available.
if self.vf_helper.is_mana() and ubuntu.is_package_in_repo(
"linux-modules-extra-azure"
):
if self.update_kernel and self.vf_helper.is_mana() and \
ubuntu.is_package_in_repo("linux-modules-extra-azure"):
ubuntu.install_packages("linux-modules-extra-azure")

def _install_fedora_dependencies(self) -> None:
@@ -1021,12 +1024,13 @@ def _install_fedora_dependencies(self) -> None:

# DPDK is very sensitive to rdma-core/kernel mismatches
# update to latest kernel before installing dependencies
rhel.install_packages(["kernel", "kernel-modules-extra", "kernel-headers"])
node.reboot()
try:
rhel.install_packages("kernel-devel")
except MissingPackagesException:
node.log.debug("Fedora: kernel-devel not found, attempting to continue")
if self.update_kernel:
rhel.install_packages(["kernel", "kernel-modules-extra", "kernel-headers"])
node.reboot()
try:
rhel.install_packages("kernel-devel")
except MissingPackagesException:
node.log.debug("Fedora: kernel-devel not found, attempting to continue")

if rhel.information.version.major == 7:
# Add packages for rhel7
2 changes: 2 additions & 0 deletions microsoft/testsuites/dpdk/dpdkutil.py
Original file line number Diff line number Diff line change
@@ -333,6 +333,7 @@ def initialize_node_resources(
dpdk_branch = variables.get("dpdk_branch", "")
rdma_core_source = variables.get("rdma_core_source", "")
rdma_core_ref = variables.get("rdma_core_git_ref", "")
update_kernel = variables.get("dpdk_update_kernel", True)
force_net_failsafe_pmd = variables.get("dpdk_force_net_failsafe_pmd", False)
enforce_strict_threshold = variables.get("dpdk_enforce_strict_threshold", False)
log.info(
@@ -374,6 +375,7 @@ def initialize_node_resources(
rdma_core_ref=rdma_core_ref,
enforce_strict_threshold=enforce_strict_threshold,
build_release=build_release,
update_kernel=update_kernel,
)

# init and enable hugepages (required by dpdk)
20 changes: 12 additions & 8 deletions microsoft/testsuites/dpdk/rdma_core.py
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@


class RdmaCoreManager:
def __init__(self, node: Node, rdma_core_source: str, rdma_core_ref: str) -> None:
def __init__(self, node: Node, rdma_core_source: str, rdma_core_ref: str,
update_kernel: bool) -> None:
self.is_installed_from_source = False
self.node = node
self._rdma_core_source = rdma_core_source
@@ -27,6 +28,8 @@ def __init__(self, node: Node, rdma_core_source: str, rdma_core_ref: str) -> Non
assert build_location, "Could not find a location to build rdma-core"
self._build_location = node.get_pure_path(build_location).joinpath("rdma")

self.update_kernel = update_kernel

def get_missing_distro_packages(self) -> str:
distro = self.node.os
package = ""
@@ -186,13 +189,14 @@ def do_source_install(self) -> None:
"libbpf-devel",
]
)
distro.install_packages(
[
"kernel-devel",
"kernel-modules-extra",
"kernel-headers",
]
)
if self.update_kernel:
distro.install_packages(
[
"kernel-devel",
"kernel-modules-extra",
"kernel-headers",
]
)
else:
# no-op, throw for invalid distro is before this function
return