diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-07-28 15:11:46 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-08-05 21:49:27 +0900 |
commit | e33232d4058f96f6228f7fcba59bcaf1ee015de1 (patch) | |
tree | 5d21c7354edfcba832596dbdf59139b72cfcd0bf /src/network/netdev | |
parent | b0ff6dea38cfea4b83d4f134cf50d39a87d1e059 (diff) | |
download | systemd-e33232d4058f96f6228f7fcba59bcaf1ee015de1.tar.gz |
network: also check SR-IOV PF port and other VF ports before configuring
When a PF port becomes down (this can happens e.g. the PF port is joining
a bond interface), some drivers make its VF ports also become down, and
may cause failures in configuring VF ports.
Similary, when a VF port become down, some drivers make its PF port and
other VF ports down.
Let's configure SR-IOV ports (both PF and VFs) after all link-layer
settings of all ports being applied.
Fixes #23315.
Diffstat (limited to 'src/network/netdev')
-rw-r--r-- | src/network/netdev/netdev.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c index 7882cbc364..e9fadfddde 100644 --- a/src/network/netdev/netdev.c +++ b/src/network/netdev/netdev.c @@ -31,6 +31,7 @@ #include "networkd-manager.h" #include "networkd-queue.h" #include "networkd-setlink.h" +#include "networkd-sriov.h" #include "nlmon.h" #include "path-lookup.h" #include "siphash24.h" @@ -604,12 +605,15 @@ static int stacked_netdev_create(NetDev *netdev, Link *link, Request *req) { return 0; } -static bool link_is_ready_to_create_stacked_netdev(Link *link) { +static bool link_is_ready_to_create_stacked_netdev_one(Link *link, bool allow_unmanaged) { assert(link); - if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) + if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED, LINK_STATE_UNMANAGED)) return false; + if (!link->network) + return allow_unmanaged; + if (link->set_link_messages > 0) return false; @@ -621,6 +625,11 @@ static bool link_is_ready_to_create_stacked_netdev(Link *link) { return true; } +static bool link_is_ready_to_create_stacked_netdev(Link *link) { + return check_ready_for_all_sr_iov_ports(link, /* allow_unmanaged = */ false, + link_is_ready_to_create_stacked_netdev_one); +} + static int netdev_is_ready_to_create(NetDev *netdev, Link *link) { assert(netdev); |