platform: sriov: write new values when we can't read old ones
Fixes: 7df3333879
This commit is contained in:
@@ -5741,8 +5741,9 @@ link_set_sriov_params (NMPlatform *platform,
|
|||||||
{
|
{
|
||||||
nm_auto_pop_netns NMPNetns *netns = NULL;
|
nm_auto_pop_netns NMPNetns *netns = NULL;
|
||||||
nm_auto_close int dirfd = -1;
|
nm_auto_close int dirfd = -1;
|
||||||
gboolean current_autoprobe;
|
int current_autoprobe;
|
||||||
guint total, current_num;
|
guint total;
|
||||||
|
gint64 current_num;
|
||||||
char ifname[IFNAMSIZ];
|
char ifname[IFNAMSIZ];
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
@@ -5775,12 +5776,12 @@ link_set_sriov_params (NMPlatform *platform,
|
|||||||
NMP_SYSCTL_PATHID_NETDIR (dirfd,
|
NMP_SYSCTL_PATHID_NETDIR (dirfd,
|
||||||
ifname,
|
ifname,
|
||||||
"device/sriov_numvfs"),
|
"device/sriov_numvfs"),
|
||||||
10, 0, G_MAXUINT, 0);
|
10, 0, G_MAXUINT, -1);
|
||||||
current_autoprobe = nm_platform_sysctl_get_int_checked (platform,
|
current_autoprobe = nm_platform_sysctl_get_int_checked (platform,
|
||||||
NMP_SYSCTL_PATHID_NETDIR (dirfd,
|
NMP_SYSCTL_PATHID_NETDIR (dirfd,
|
||||||
ifname,
|
ifname,
|
||||||
"device/sriov_drivers_autoprobe"),
|
"device/sriov_drivers_autoprobe"),
|
||||||
10, 0, G_MAXUINT, 0);
|
10, 0, 1, -1);
|
||||||
if ( current_num == num_vfs
|
if ( current_num == num_vfs
|
||||||
&& (autoprobe == NM_TERNARY_DEFAULT || current_autoprobe == autoprobe))
|
&& (autoprobe == NM_TERNARY_DEFAULT || current_autoprobe == autoprobe))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user