'rte_kni_update_link()' updates virtual KNI interface link using kernel
sysfs interface.
If the requested link status is same as interface link status, do not
update the link status but return with success.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
}
old_linkup = (old_carrier[0] == '1');
+ if (old_linkup == (int)linkup)
+ goto out;
+
new_carrier = linkup ? "1" : "0";
ret = write(fd, new_carrier, 1);
if (ret < 1) {
close(fd);
return -1;
}
-
+out:
close(fd);
return old_linkup;
}
EXPERIMENTAL {
global:
+ # updated in v21.08
rte_kni_update_link;
};