Skip to contentSkip to conversation

xen-netback: get rid of old udev related code

PATCH In review Paul Durrant 5 participants 12 messages Dec 12, 2019 – Jan 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-netback: get rid of old udev related code

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes much complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional uevent()
method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns 0. Hence this patch also facilitates further cleanup.

---
Cc: Wei Liu <[email protected]>
Cc: "David S. Miller" <[email protected]>

---
 drivers/net/xen-netback/common.h |  11 ---
 drivers/net/xen-netback/xenbus.c | 125 ++++---------------------------
 2 files changed, 14 insertions(+), 122 deletions(-)
drivers/net/xen-netback/common.h +0 -11
index 05847eb91a1b..e48da004c1a3 100644
@@ -251,17 +251,6 @@ struct xenvif_hash {
 struct backend_info {
 	struct xenbus_device *dev;
 	struct xenvif *vif;
-
-	/* This is the state that will be reflected in xenstore when any
-	 * active hotplug script completes.
-	 */
-	enum xenbus_state state;
-
-	enum xenbus_state frontend_state;
-	struct xenbus_watch hotplug_status_watch;
-	u8 have_hotplug_status_watch:1;
-
-	const char *hotplug_script;
 };
 
 struct xenvif {
drivers/net/xen-netback/xenbus.c +14 -111

248 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw
Quoted 23 lines · Paul Durrant

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes much complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional uevent()
method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns 0. Hence this patch also facilitates further cleanup.

---
Cc: Wei Liu <[email protected]>
Cc: "David S. Miller" <[email protected]>

---
 drivers/net/xen-netback/common.h |  11 ---
 drivers/net/xen-netback/xenbus.c | 125 ++++---------------------------
 2 files changed, 14 insertions(+), 122 deletions(-)
drivers/net/xen-netback/common.h +0 -0
index 05847eb91a1b..e48da004c1a3 100644

<snip>

drivers/net/xen-netback/common.h

Quoted 13 lines
drivers/net/xen-netback/common.h +0 -13
-static inline void backend_switch_state(struct backend_info *be,
-                                       enum xenbus_state state)
-{
-       struct xenbus_device *dev = be->dev;
-
-       pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
-       be->state = state;
-
-       /* If we are waiting for a hotplug script then defer the
-        * actual xenbus state change.
-        */
-       if (!be->have_hotplug_status_watch)
-               xenbus_switch_state(dev, state);

have_hotplug_status_watch prevents xen-netback from switching to connected state unless the the backend scripts have written "hotplug-status" "success". I had always thought that was intentional so the frontend doesn't connect when the backend is unconnected. i.e. if the backend scripts fails, it writes "hotplug-status" "error" and the frontend doesn't connect.

That behavior is independent of using udev to run the scripts. I'm not opposed to removing it, but I think it at least warrants mentioning in the commit message.

Regards,
Jason

#2 lore raw
Quoted 61 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: 12 December 2019 16:32
To: Durrant, Paul <[email protected]>
Cc: xen-devel <[email protected]>; [email protected]; open list <[email protected]>; Wei Liu <[email protected]>; David S. Miller <[email protected]>
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 8 lines · Paul Durrant

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes much complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns

0.

drivers/net/xen-

Quoted 12 lines

Hence this patch also facilitates further cleanup.

---
Cc: Wei Liu <[email protected]>
Cc: "David S. Miller" <[email protected]>

---
 drivers/net/xen-netback/common.h |  11 ---
 drivers/net/xen-netback/xenbus.c | 125 ++++---------------------------
 2 files changed, 14 insertions(+), 122 deletions(-)
drivers/net/xen- renamed from drivers/net/xen-netback/common.h +0 -0

netback/common.h

Quoted 1 line

index 05847eb91a1b..e48da004c1a3 100644

<snip>

drivers/net/xen-

Quoted 13 lines
drivers/net/xen- renamed from drivers/net/xen-netback/common.h +0 -13
-static inline void backend_switch_state(struct backend_info *be,
-                                       enum xenbus_state state)
-{
-       struct xenbus_device *dev = be->dev;
-
-       pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
-       be->state = state;
-
-       /* If we are waiting for a hotplug script then defer the
-        * actual xenbus state change.
-        */
-       if (!be->have_hotplug_status_watch)
-               xenbus_switch_state(dev, state);

have_hotplug_status_watch prevents xen-netback from switching to connected state unless the the backend scripts have written "hotplug-status" "success". I had always thought that was intentional so the frontend doesn't connect when the backend is unconnected. i.e. if the backend scripts fails, it writes "hotplug-status" "error" and the frontend doesn't connect.

Quoted 3 lines

That behavior is independent of using udev to run the scripts. I'm not opposed to removing it, but I think it at least warrants mentioning in the commit message.

True, but it's probably related. The netback probe would previously kick udev, the hotplug script would then run, and then the state would go connected. I think, because the hotplug is invoked directly by the toolstack now, these things really ought not to be tied together. TBH I can't see any harm in the frontend seeing the network connection before the backend plumbing is done... If the frontend should have any sort of indication of whether the backend is plumbed or not then IMO it ought to be as a virtual carrier/link status, because unplumbing and re-plumbing could be done at any time really without any need for the shared ring to go away (and in fact I will be following up at some point with a patch to allow unbind and re-bind of netback).

I'll elaborate in the commit message as you suggest :-)

Cheers,

Paul

Quoted 3 lines

Regards,
Jason

maintainer
#3 lore raw
In reply to Paul Durrant

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 6 lines

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes much complexity in the interaction with the xenstore backend state.

Quoted 6 lines

NOTE: xen-netback is the only xenbus driver to have a functional uevent()
method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns 0. Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove this even if it hasn't been used in 5+ years.

Sorry.

#4 lore raw
Quoted 14 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 11 lines

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes much complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional uevent()
method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns 0. Hence this patch also facilitates further cleanup.

Quoted 4 lines
Quoted 1 line

If userspace ever used this stuff, I seriously doubt you can remove this even if it hasn't been used in 5+ years.

Hmm, depends.

This has been used by Xen tools in dom0 only. If the last usage has been in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather old version of Xen (like 3.x?).

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

Juergen

author Acked-by Ian Jackson Acked-by Wei Liu
#5 lore raw
Quoted 35 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 7 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 4 lines

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 3 lines
Quoted 3 lines

complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns

0.

Quoted 6 lines
Quoted 3 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove this even if it hasn't been used in 5+ years.

Hmm, depends.

Quoted 8 lines

This has been used by Xen tools in dom0 only. If the last usage has been in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather old version of Xen (like 3.x?).

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-backend.rules (in xen.git), and a commit from Roger removed the NIC rules in 2012:

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Author: Roger Pau Monne <[email protected]>
Date:   Thu Jul 26 16:47:35 2012 +0100

libxl: call hotplug scripts for nic devices from libxl

Since most of the needed work is already done in previous patches, this patch only contains the necessary code to call hotplug scripts for nic devices, that should be called when the device is added or removed from a guest.

Added another parameter to libxl__get_hotplug_script_info, that is used to know the number of times hotplug scripts have been called for that device. This is currently used by IOEMU nics on Linux.

The last commit I could find to that file modified its name to xen-backend.rules.in, and this was finally removed by George in 2015:

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Author: George Dunlap <[email protected]>
Date:   Mon Jul 6 11:51:39 2015 +0100

libxl: Remove linux udev rules

They are no longer needed, having been replaced by a daemon for driverdomains which will run scripts as necessary.

Worse yet, they seem to be broken for script-based block devices, such as block-iscsi. This wouldn't matter so much if they were never run by default; but if you run block-attach without having created a domain, then the appropriate node to disable running udev scripts will not have been written yet, and the attach will silently fail.

Rather than try to sort out that issue, just remove them entirely.

So, I think this means anyone using a version of the Xen tools within recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-productive, as George's commit states and as I discovered the hard way when the change was originally made).

Paul

Quoted 2 lines

Juergen

#6 lore raw
Quoted 40 lines · Paul
Quoted 40 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 7 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 4 lines

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been the case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 3 lines
Quoted 3 lines

complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply returns

0.

Quoted 6 lines
Quoted 3 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove this even if it hasn't been used in 5+ years.

Hmm, depends.

This has been used by Xen tools in dom0 only. If the last usage has been in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather old version of Xen (like 3.x?).

Quoted 7 lines
Quoted 3 lines

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-backend.rules (in xen.git), and a commit from Roger removed the NIC rules in 2012:

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Xen 4.2

Quoted 3 lines

The last commit I could find to that file modified its name to xen-backend.rules.in, and this was finally removed by George in 2015:

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Xen 4.6

Quoted 1 line

So, I think this means anyone using a version of the Xen tools within recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-productive, as George's commit states and as I discovered the hard way when the change was originally made).

The problem are systems with either old Xen versions (before Xen 4.2) or with other toolstacks (e.g. Xen 4.4 with xend) which want to use a new dom0 kernel.

And I'm not sure there aren't such systems (especially in case someone wants to stick with xend).

Juergen

#7 lore raw
Quoted 82 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 10:02
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

udev

Quoted 8 lines
Quoted 8 lines

related code

Quoted 5 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 2 lines

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been

the

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 3 lines
Quoted 3 lines

complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply

returns

Quoted 6 lines
Quoted 6 lines

0.

Quoted 5 lines
Quoted 3 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove

this

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

even if it hasn't been used in 5+ years.

Hmm, depends.

This has been used by Xen tools in dom0 only. If the last usage has

been

Quoted 2 lines
Quoted 2 lines

in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather

old

Quoted 7 lines
Quoted 5 lines

version of Xen (like 3.x?).

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-

backend.rules (in xen.git), and a commit from Roger removed the NIC rules in 2012:

Quoted 2 lines

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Xen 4.2

Quoted 1 line

The last commit I could find to that file modified its name to xen-

backend.rules.in, and this was finally removed by George in 2015:

Quoted 2 lines

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Xen 4.6

Quoted 1 line

So, I think this means anyone using a version of the Xen tools within

recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-productive, as George's commit states and as I discovered the hard way when the change was originally made).

Quoted 7 lines

The problem are systems with either old Xen versions (before Xen 4.2) or with other toolstacks (e.g. Xen 4.4 with xend) which want to use a new dom0 kernel.

And I'm not sure there aren't such systems (especially in case someone wants to stick with xend).

But would someone sticking with such an old toolstack expect to run on an unmodified upstream dom0? There has to be some way in which we can retire old code.

Aside from the udev kicks though, I still think the hotplug-status/ring state interaction is just bogus anyway. As I said in a previous thread, the hotplug-status ought to be indicated as carrier status, if at all, so I still think all that code ought to go.

Paul

Quoted 2 lines

Juergen

#8 lore raw
Quoted 86 lines · Paul
Quoted 86 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 10:02
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

udev

Quoted 8 lines
Quoted 8 lines

related code

Quoted 5 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 2 lines

In the past it used to be the case that the Xen toolstack relied upon udev to execute backend hotplug scripts. However this has not been

the

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 3 lines
Quoted 3 lines

complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply

returns

Quoted 6 lines
Quoted 6 lines

0.

Quoted 5 lines
Quoted 3 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove

this

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

even if it hasn't been used in 5+ years.

Hmm, depends.

This has been used by Xen tools in dom0 only. If the last usage has

been

Quoted 2 lines
Quoted 2 lines

in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather

old

Quoted 7 lines
Quoted 5 lines

version of Xen (like 3.x?).

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-

backend.rules (in xen.git), and a commit from Roger removed the NIC rules in 2012:

Quoted 2 lines

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Xen 4.2

Quoted 1 line

The last commit I could find to that file modified its name to xen-

backend.rules.in, and this was finally removed by George in 2015:

Quoted 2 lines

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Xen 4.6

Quoted 1 line

So, I think this means anyone using a version of the Xen tools within

recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-productive, as George's commit states and as I discovered the hard way when the change was originally made).

The problem are systems with either old Xen versions (before Xen 4.2) or with other toolstacks (e.g. Xen 4.4 with xend) which want to use a new dom0 kernel.

Quoted 5 lines
Quoted 3 lines

And I'm not sure there aren't such systems (especially in case someone wants to stick with xend).

But would someone sticking with such an old toolstack expect to run on an unmodified upstream dom0? There has to be some way in which we can retire old code.

As long as there are no hypervisor interface related issues prohibiting running dom0 unmodified I think the expectation to be able to use the kernel in that environment is fine.

Another question coming up would be: how is this handled in a driver domain running netback? Which component is starting the hotplug script there? I don't think we can assume a standard Xen toolset in this case. So I'd rather leave this code as it is instead of breaking some rare but valid use cases.

Quoted 2 lines

Aside from the udev kicks though, I still think the hotplug-status/ring state interaction is just bogus anyway. As I said in a previous thread, the hotplug-status ought to be indicated as carrier status, if at all, so I still think all that code ought to go.

I agree regarding the future interface, but with the carrier state just being in the plans to be added now, it is clearly too early to remove the code with that reasoning.

Juergen

#9 lore raw
Quoted 107 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 16 December 2019 08:10
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 10:02
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

udev

Quoted 11 lines
Quoted 11 lines

related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

Quoted 8 lines
Quoted 8 lines

udev

Quoted 7 lines
Quoted 7 lines

related code

Quoted 4 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 1 line

In the past it used to be the case that the Xen toolstack relied

upon

Quoted 28 lines
Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

udev to execute backend hotplug scripts. However this has not been

the

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 3 lines
Quoted 3 lines

complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply

returns

Quoted 6 lines
Quoted 6 lines

0.

Quoted 5 lines
Quoted 3 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove

this

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

even if it hasn't been used in 5+ years.

Hmm, depends.

This has been used by Xen tools in dom0 only. If the last usage has

been

Quoted 2 lines
Quoted 2 lines

in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather

old

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

version of Xen (like 3.x?).

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-

backend.rules (in xen.git), and a commit from Roger removed the NIC

rules

Quoted 9 lines
Quoted 9 lines

in 2012:

Quoted 2 lines

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Xen 4.2

Quoted 1 line

The last commit I could find to that file modified its name to xen-

backend.rules.in, and this was finally removed by George in 2015:

Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Xen 4.6

Quoted 1 line

So, I think this means anyone using a version of the Xen tools within

recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-

productive,

Quoted 1 line
Quoted 1 line

as George's commit states and as I discovered the hard way when the

change

Quoted 3 lines
Quoted 3 lines

was originally made).

The problem are systems with either old Xen versions (before Xen 4.2)

or

Quoted 7 lines
Quoted 6 lines

with other toolstacks (e.g. Xen 4.4 with xend) which want to use a new dom0 kernel.

And I'm not sure there aren't such systems (especially in case someone wants to stick with xend).

Quoted 8 lines
Quoted 1 line

But would someone sticking with such an old toolstack expect to run on

an unmodified upstream dom0? There has to be some way in which we can retire old code.

As long as there are no hypervisor interface related issues prohibiting running dom0 unmodified I think the expectation to be able to use the kernel in that environment is fine.

I think we need a better policy in future then otherwise we will only collect baggage.

Quoted 5 lines

Another question coming up would be: how is this handled in a driver domain running netback? Which component is starting the hotplug script there? I don't think we can assume a standard Xen toolset in this case. So I'd rather leave this code as it is instead of breaking some rare but valid use cases.

I am not sure there is a standard. Do we 'support' driver domains with any sort of tools API or do they really just have to notice things via xenstore? I agree Linux running as a driver domain could indeed use udev.

Quoted 10 lines
Quoted 3 lines

Aside from the udev kicks though, I still think the hotplug-status/ring

state interaction is just bogus anyway. As I said in a previous thread, the hotplug-status ought to be indicated as carrier status, if at all, so I still think all that code ought to go.

I agree regarding the future interface, but with the carrier state just being in the plans to be added now, it is clearly too early to remove the code with that reasoning.

I don't think so. Like I said, I think the hotplug status has nothing to do with the state of the shared ring. Even with the code as-is, nothing informs the frontend if the netif is subsequently closed or re-plumbed, so why must we continue to maintain this code? AFAICT it is just not fit for purpose.

Paul

#10 lore raw
Quoted 111 lines · Paul
Quoted 111 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 16 December 2019 08:10
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 10:02
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

udev

Quoted 11 lines
Quoted 11 lines

related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

Quoted 8 lines
Quoted 8 lines

udev

Quoted 7 lines
Quoted 7 lines

related code

Quoted 4 lines · David Miller

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 1 line

In the past it used to be the case that the Xen toolstack relied

upon

Quoted 28 lines
Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

udev to execute backend hotplug scripts. However this has not been

the

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 3 lines
Quoted 3 lines

complexity in the interaction with the xenstore backend state.

NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply

returns

Quoted 6 lines
Quoted 6 lines

0.

Quoted 5 lines
Quoted 3 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove

this

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

even if it hasn't been used in 5+ years.

Hmm, depends.

This has been used by Xen tools in dom0 only. If the last usage has

been

Quoted 2 lines
Quoted 2 lines

in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather

old

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

version of Xen (like 3.x?).

Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-

backend.rules (in xen.git), and a commit from Roger removed the NIC

rules

Quoted 9 lines
Quoted 9 lines

in 2012:

Quoted 2 lines

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Xen 4.2

Quoted 1 line

The last commit I could find to that file modified its name to xen-

backend.rules.in, and this was finally removed by George in 2015:

Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Xen 4.6

Quoted 1 line

So, I think this means anyone using a version of the Xen tools within

recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-

productive,

Quoted 1 line
Quoted 1 line

as George's commit states and as I discovered the hard way when the

change

Quoted 3 lines
Quoted 3 lines

was originally made).

The problem are systems with either old Xen versions (before Xen 4.2)

or

Quoted 8 lines
Quoted 6 lines

with other toolstacks (e.g. Xen 4.4 with xend) which want to use a new dom0 kernel.

And I'm not sure there aren't such systems (especially in case someone wants to stick with xend).

But would someone sticking with such an old toolstack expect to run on

an unmodified upstream dom0? There has to be some way in which we can retire old code.

Quoted 6 lines
Quoted 4 lines

As long as there are no hypervisor interface related issues prohibiting running dom0 unmodified I think the expectation to be able to use the kernel in that environment is fine.

I think we need a better policy in future then otherwise we will only collect baggage.

The Linux kernel policy regarding user interfaces and existing use cases is rather clear and we should not deviate without very strong reasons.

Quoted 8 lines
Quoted 6 lines

Another question coming up would be: how is this handled in a driver domain running netback? Which component is starting the hotplug script there? I don't think we can assume a standard Xen toolset in this case. So I'd rather leave this code as it is instead of breaking some rare but valid use cases.

I am not sure there is a standard. Do we 'support' driver domains with any sort of tools API or do they really just have to notice things via xenstore? I agree Linux running as a driver domain could indeed use udev.

I intend in no way to break projects like Qubes. Disaggregation is one of the very big advantages of Xen over KVM, Hyper-V and VMWare. We should not give that up "just to get rid of some code". Period.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

Aside from the udev kicks though, I still think the hotplug-status/ring

state interaction is just bogus anyway. As I said in a previous thread, the hotplug-status ought to be indicated as carrier status, if at all, so I still think all that code ought to go.

Quoted 5 lines
Quoted 3 lines

I agree regarding the future interface, but with the carrier state just being in the plans to be added now, it is clearly too early to remove the code with that reasoning.

I don't think so. Like I said, I think the hotplug status has nothing to do with the state of the shared ring. Even with the code as-is, nothing informs the frontend if the netif is subsequently closed or re-plumbed, so why must we continue to maintain this code? AFAICT it is just not fit for purpose.

If it is being used that way we need to continue supporting it.

Juergen

#11 lore raw
Quoted 104 lines · Jürgen Groß
Quoted 85 lines · Paul
Quoted 85 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 16 December 2019 08:10
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old udev related code

Quoted 9 lines · Paul
Quoted 8 lines
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 10:02
To: Durrant, Paul <[email protected]>; David Miller <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

udev

Quoted 66 lines
Quoted 10 lines

related code

Quoted 8 lines · Paul
Quoted 8 lines

-----Original Message-----
From: Jürgen Groß <[email protected]>
Sent: 13 December 2019 05:41
To: David Miller <[email protected]>; Durrant, Paul <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH net-next] xen-netback: get rid of old

Quoted 6 lines

udev

Quoted 5 lines
Quoted 5 lines

related code

Quoted 4 lines · David Miller
Quoted 3 lines

From: Paul Durrant <[email protected]>
Date: Thu, 12 Dec 2019 13:54:06 +0000

Quoted 1 line

In the past it used to be the case that the Xen toolstack relied

upon

Quoted 20 lines
Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

udev to execute backend hotplug scripts. However this has not been

the

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

case for many releases now and removal of the associated code in xen-netback shortens the source by more than 100 lines, and removes

much

Quoted 2 lines
Quoted 2 lines

complexity in the interaction with the xenstore backend state.
NOTE: xen-netback is the only xenbus driver to have a functional

uevent()

Quoted 2 lines
Quoted 2 lines

method. The only other driver to have a method at all is pvcalls-back, and currently pvcalls_back_uevent() simply

returns

Quoted 4 lines
Quoted 4 lines

0.

Quoted 3 lines
Quoted 2 lines

Hence this patch also facilitates further cleanup.

If userspace ever used this stuff, I seriously doubt you can remove

this

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

even if it hasn't been used in 5+ years.

Hmm, depends.
This has been used by Xen tools in dom0 only. If the last usage has

been

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

in a Xen version which is no longer able to run with current Linux in dom0 it could be removed. But I guess this would have to be a rather

old

Quoted 4 lines
Quoted 3 lines

version of Xen (like 3.x?).
Paul, can you give a hint since which Xen version the toolstack no longer relies on udev to start the hotplug scripts?

The udev rules were in a file called tools/hotplug/Linux/xen-

backend.rules (in xen.git), and a commit from Roger removed the NIC

rules

Quoted 10 lines
Quoted 10 lines

in 2012:

Quoted 1 line

commit 57ad6afe2a08a03c40bcd336bfb27e008e1d3e53

Xen 4.2

Quoted 1 line

The last commit I could find to that file modified its name to xen-

backend.rules.in, and this was finally removed by George in 2015:

Quoted 1 line

commit 2ba368d13893402b2f1fb3c283ddcc714659dd9b

Xen 4.6

Quoted 1 line

So, I think this means anyone using a version of the Xen tools within

recent memory will be having their hotplug scripts called directly by libxl (and having udev rules present would actually be counter-

productive,

Quoted 1 line
Quoted 1 line

as George's commit states and as I discovered the hard way when the

change

Quoted 2 lines
Quoted 2 lines

was originally made).
The problem are systems with either old Xen versions (before Xen 4.2)

or

Quoted 4 lines
Quoted 4 lines

with other toolstacks (e.g. Xen 4.4 with xend) which want to use a new dom0 kernel.
And I'm not sure there aren't such systems (especially in case someone wants to stick with xend).

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

But would someone sticking with such an old toolstack expect to run on

an unmodified upstream dom0? There has to be some way in which we can retire old code.
As long as there are no hypervisor interface related issues prohibiting running dom0 unmodified I think the expectation to be able to use the kernel in that environment is fine.

I think we need a better policy in future then otherwise we will only collect baggage.

The Linux kernel policy regarding user interfaces and existing use cases is rather clear and we should not deviate without very strong reasons.

Quoted 5 lines
Quoted 5 lines

Another question coming up would be: how is this handled in a driver domain running netback? Which component is starting the hotplug script there? I don't think we can assume a standard Xen toolset in this case. So I'd rather leave this code as it is instead of breaking some rare but valid use cases.

Quoted 5 lines
Quoted 1 line

I am not sure there is a standard. Do we 'support' driver domains with any sort of tools API or do they really just have to notice things via xenstore? I agree Linux running as a driver domain could indeed use udev.

I intend in no way to break projects like Qubes. Disaggregation is one of the very big advantages of Xen over KVM, Hyper-V and VMWare. We should not give that up "just to get rid of some code". Period.

From a quick poll of Qubes and OpenXT netback usage: neither project would be impacted by the proposed change. Qubes uses xl devd to call hotplug scripts. OpenXT uses uevent triggers, but does not rely on any script provided in the uevent. Ongoing simplification of backend drivers would be welcome.

Rich

Quoted 19 lines
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

Aside from the udev kicks though, I still think the hotplug-status/ring

state interaction is just bogus anyway. As I said in a previous thread, the hotplug-status ought to be indicated as carrier status, if at all, so I still think all that code ought to go.
I agree regarding the future interface, but with the carrier state just being in the plans to be added now, it is clearly too early to remove the code with that reasoning.

I don't think so. Like I said, I think the hotplug status has nothing to do with the state of the shared ring. Even with the code as-is, nothing informs the frontend if the netif is subsequently closed or re-plumbed, so why must we continue to maintain this code? AFAICT it is just not fit for purpose.

If it is being used that way we need to continue supporting it.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel