When applying the configuration to a sub-device,
fs_eth_dev_conf_apply() forces the link up or down with
rte_eth_dev_set_link_up()/rte_eth_dev_set_link_down(). Sub-devices such
as virtio-net do not support software link control and return -ENOTSUP,
which fail-safe treated as a fatal error and aborted the configuration
apply, preventing plug-in of such sub-devices.
Treat -ENOTSUP from the link control as success; the sub-device link
simply follows its physical state.
Fixes: ebea83f899d8 ("net/failsafe: add plug-in support")
Cc: [email protected]
Signed-off-by: Sandeep Penigalapati <[email protected]>
---
drivers/net/failsafe/failsafe_ether.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/failsafe/failsafe_ether.c
b/drivers/net/failsafe/failsafe_ether.c
index ea12e2722f..f23580ed37 100644
--- a/drivers/net/failsafe/failsafe_ether.c
+++ b/drivers/net/failsafe/failsafe_ether.c
@@ -115,7 +115,11 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev,
ret = rte_eth_dev_set_link_up(PORT_ID(sdev));
else
ret = rte_eth_dev_set_link_down(PORT_ID(sdev));
- if (ret) {
+ if (ret == -ENOTSUP) {
+ /* The sub-device link follows its physical state. */
+ DEBUG("link_status control not supported");
+ ret = 0;
+ } else if (ret) {
ERROR("Failed to apply link_status");
return ret;
}
--
2.34.1