From dda94d6f661c4b1779cfbf9eaf9e7f07c5b71162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Thu, 15 Feb 2024 16:58:50 +0100 Subject: [PATCH] sriov: don't fail if sriov_totalvfs sysfs file is missing If sriov_totalvfs file doesn't exist we don't need to consider it a fatal failure. Try to create the required number of VFs as we were doing before. Note: at least netdevsim doesn't have sriov_totalvfs file, I don't know if there are real drivers that neither has it. (cherry picked from commit 27eaf34fcf43c4797c65db8de3a0926b2440f8d4) --- src/libnm-platform/nm-linux-platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index 7d34fa939..9ecac2d9b 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -9218,8 +9218,9 @@ link_set_sriov_params_async(NMPlatform *platform, max_vfs = sriov_read_sysctl_uint(platform, dirfd, ifname, "sriov_totalvfs", &error); if (max_vfs < 0) { - sriov_async_finish_err(async_state, g_steal_pointer(&error)); - return; + _LOGD("link: can't read max VFs (%s)", error->message); + g_clear_error(&error); + max_vfs = sriov_params.num_vfs; /* Try to create all */ } if (sriov_params.num_vfs > max_vfs) {