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.
This commit is contained in:
Íñigo Huguet 2024-02-15 16:58:50 +01:00
parent 4669f01eb0
commit 27eaf34fcf

View file

@ -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) {