netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bonding: Added -ENODEV interpret for slaves option
@ 2021-03-13 14:02 Jianlin Lv
  2021-03-13 19:50 ` Jay Vosburgh
  0 siblings, 1 reply; 2+ messages in thread
From: Jianlin Lv @ 2021-03-13 14:02 UTC (permalink / raw)
  To: j.vosburgh, vfalico, andy, davem, kuba
  Cc: Jianlin.Lv, iecedge, netdev, linux-kernel

After upgrading the kernel, the slave interface name is changed,
Systemd cannot use the original configuration to create bond interface,
thereby losing the connection with the host.

Adding log for ENODEV will make it easier to find out such problem lies.

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
---
 drivers/net/bonding/bond_options.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 77d7c38bd435..c9d3604ae129 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -640,6 +640,15 @@ static void bond_opt_error_interpret(struct bonding *bond,
 		netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n",
 			   opt->name);
 		break;
+	case -ENODEV:
+		if (val && val->string) {
+			p = strchr(val->string, '\n');
+			if (p)
+				*p = '\0';
+			netdev_err(bond->dev, "option %s: interface %s does not exist!\n",
+				   opt->name, val->string);
+		}
+		break;
 	default:
 		break;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-13 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-13 14:02 [PATCH net-next] bonding: Added -ENODEV interpret for slaves option Jianlin Lv
2021-03-13 19:50 ` Jay Vosburgh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).