Skip to contentSkip to conversation

net: x25_asy: Delete the x25_asy driver

PATCH Applied Xie He 5 participants 12 messages Nov 5, 2020 – Nov 7, 2020

Subsystems (8)
lore
Share & tools
lore

Xie He

author
#0 lore raw

PATCH 1/1 net: x25_asy: Delete the x25_asy driver

This driver transports LAPB (X.25 link layer) frames over TTY links.

I can safely say that this driver has no actual user because it was not working at all until:
commit 8fdcabeac398 ("drivers/net/wan/x25_asy: Fix to make it work")

The code in its current state still has problems:

1.
The uses of "struct x25_asy" in x25_asy_unesc (when receiving) and in x25_asy_write_wakeup (when sending) are not protected by locks against x25_asy_change_mtu's changing of the transmitting/receiving buffers. Also, all "netif_running" checks in this driver are not protected by locks against the ndo_stop function.

2.
The driver stops all TTY read/write when the netif is down. I think this is not right because this may cause the last outgoing frame before the netif goes down to be incompletely transmitted, and the first incoming frame after the netif goes up to be incompletely received.

And there may also be other problems.

I was planning to fix these problems but after recent discussions about deleting other old networking code, I think we may just delete this driver, too.

---
 Documentation/process/magic-number.rst        |   1 -
 .../it_IT/process/magic-number.rst            |   1 -
 .../zh_CN/process/magic-number.rst            |   1 -
 arch/mips/configs/gpr_defconfig               |   1 -
 arch/mips/configs/mtx1_defconfig              |   1 -
 drivers/net/wan/Kconfig                       |  15 -
 drivers/net/wan/Makefile                      |   1 -
 drivers/net/wan/x25_asy.c                     | 836 ------------------
 drivers/net/wan/x25_asy.h                     |  46 -
 9 files changed, 903 deletions(-)
 delete mode 100644 drivers/net/wan/x25_asy.c
 delete mode 100644 drivers/net/wan/x25_asy.h
Documentation/process/magic-number.rst +0 -1
index eee9b44553b3..e02ff5ffb653 100644
@@ -84,7 +84,6 @@ PPP_MAGIC             0x5002           ppp                      ``include/linux/
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
-X25_ASY_MAGIC         0x5303           x25_asy                  ``drivers/net/x25_asy.h``
 SIXPACK_MAGIC         0x5304           sixpack                  ``drivers/net/hamradio/6pack.h``
 AX25_MAGIC            0x5316           ax_disp                  ``drivers/net/mkiss.h``
 TTY_MAGIC             0x5401           tty_struct               ``include/linux/tty.h``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index 783e0de314a0..0243d32a0b59 100644
@@ -90,7 +90,6 @@ PPP_MAGIC             0x5002           ppp                      ``include/linux/
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
-X25_ASY_MAGIC         0x5303           x25_asy                  ``drivers/net/x25_asy.h``
 SIXPACK_MAGIC         0x5304           sixpack                  ``drivers/net/hamradio/6pack.h``
 AX25_MAGIC            0x5316           ax_disp                  ``drivers/net/mkiss.h``
 TTY_MAGIC             0x5401           tty_struct               ``include/linux/tty.h``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index e4c225996af0..de182bf4191c 100644
@@ -73,7 +73,6 @@ PPP_MAGIC             0x5002           ppp                      ``include/linux/
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
-X25_ASY_MAGIC         0x5303           x25_asy                  ``drivers/net/x25_asy.h``
 SIXPACK_MAGIC         0x5304           sixpack                  ``drivers/net/hamradio/6pack.h``
 AX25_MAGIC            0x5316           ax_disp                  ``drivers/net/mkiss.h``
 TTY_MAGIC             0x5401           tty_struct               ``include/linux/tty.h``
arch/mips/configs/gpr_defconfig +0 -1
index 9085f4d6c698..599d5604aabe 100644
@@ -230,7 +230,6 @@ CONFIG_DSCC4_PCISYNC=y
 CONFIG_DSCC4_PCI_RST=y
 CONFIG_DLCI=m
 CONFIG_LAPBETHER=m
-CONFIG_X25_ASY=m
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
arch/mips/configs/mtx1_defconfig +0 -1
index 914af125a7fa..dc69b054181c 100644
@@ -380,7 +380,6 @@ CONFIG_DSCC4_PCISYNC=y
 CONFIG_DSCC4_PCI_RST=y
 CONFIG_DLCI=m
 CONFIG_LAPBETHER=m
-CONFIG_X25_ASY=m
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
drivers/net/wan/Kconfig +0 -15
index 39e5ab261d7c..2cf98a732a26 100644
@@ -383,21 +383,6 @@ config LAPBETHER
 
 	  If unsure, say N.
 
-config X25_ASY
-	tristate "X.25 async driver"
-	depends on LAPB && X25 && TTY
-	help
-	  Send and receive X.25 frames over regular asynchronous serial
-	  lines such as telephone lines equipped with ordinary modems.
-
-	  Experts should note that this driver doesn't currently comply with
-	  the asynchronous HDLS framing protocols in CCITT recommendation X.25.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called x25_asy.
-
-	  If unsure, say N.
-
 config SBNI
 	tristate "Granch SBNI12 Leased Line adapter support"
 	depends on X86
drivers/net/wan/Makefile +0 -1
index 380271a011e4..5b9dc85eae34 100644
@@ -18,7 +18,6 @@ obj-$(CONFIG_HOSTESS_SV11)	+= z85230.o	hostess_sv11.o
 obj-$(CONFIG_SEALEVEL_4021)	+= z85230.o	sealevel.o
 obj-$(CONFIG_COSA)		+= cosa.o
 obj-$(CONFIG_FARSYNC)		+= farsync.o
-obj-$(CONFIG_X25_ASY)		+= x25_asy.o
 
 obj-$(CONFIG_LANMEDIA)		+= lmc/
 
drivers/net/wan/x25_asy.c deleted +0 -836

836 lines not on this page · raw message

drivers/net/wan/x25_asy.h deleted +0 -46

46 lines not on this page · raw message

Signature · 1 line
2.27.0
#1 lore raw

From: Xie He

Quoted 3 lines

Sent: 05 November 2020 07:35

This driver transports LAPB (X.25 link layer) frames over TTY links.

I don't remember any requests to run LAPB over anything other than synchronous links when I was writing LAPB implementation(s) back in the mid 1980's.

If you need to run 'comms over async uart links' there are better options.

I wonder what the actual use case was?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

author
#2 lore raw
Quoted 11 lines · David Laight
Quoted 2 lines

This driver transports LAPB (X.25 link layer) frames over TTY links.

I don't remember any requests to run LAPB over anything other than synchronous links when I was writing LAPB implementation(s) back in the mid 1980's.

If you need to run 'comms over async uart links' there are better options.

I wonder what the actual use case was?

I think this driver was just for experimental purposes. According to the author's comment at the beginning of x25_asy.c, this driver didn't implement FCS (frame check sequence), which was required by CCITT's standard. So I think this driver was not suitable for real-world use anyway.

#3 lore raw

From: Xie He

Quoted 13 lines

Sent: 05 November 2020 19:35

Quoted 10 lines · David Laight
Quoted 2 lines

This driver transports LAPB (X.25 link layer) frames over TTY links.

I don't remember any requests to run LAPB over anything other than synchronous links when I was writing LAPB implementation(s) back in the mid 1980's.

If you need to run 'comms over async uart links' there are better options.

Quoted 7 lines
Quoted 1 line

I wonder what the actual use case was?

I think this driver was just for experimental purposes. According to the author's comment at the beginning of x25_asy.c, this driver didn't implement FCS (frame check sequence), which was required by CCITT's standard. So I think this driver was not suitable for real-world use anyway.

Yes, you could get transparency by sending 0x7f bytes twice (a bit like bisync) but you'd want the CRC to check for lost bytes.

I bet this was only ever used by the author and only to talk to itself.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

#4 lore raw
In reply to Xie He
Quoted 29 lines · Xie He

This driver transports LAPB (X.25 link layer) frames over TTY links.

I can safely say that this driver has no actual user because it was not working at all until:
commit 8fdcabeac398 ("drivers/net/wan/x25_asy: Fix to make it work")

The code in its current state still has problems:

1.
The uses of "struct x25_asy" in x25_asy_unesc (when receiving) and in x25_asy_write_wakeup (when sending) are not protected by locks against x25_asy_change_mtu's changing of the transmitting/receiving buffers. Also, all "netif_running" checks in this driver are not protected by locks against the ndo_stop function.

2.
The driver stops all TTY read/write when the netif is down. I think this is not right because this may cause the last outgoing frame before the netif goes down to be incompletely transmitted, and the first incoming frame after the netif goes up to be incompletely received.

And there may also be other problems.

I was planning to fix these problems but after recent discussions about deleting other old networking code, I think we may just delete this driver, too.

Quoted 13 lines
---
 Documentation/process/magic-number.rst        |   1 -
 .../it_IT/process/magic-number.rst            |   1 -
 .../zh_CN/process/magic-number.rst            |   1 -
 arch/mips/configs/gpr_defconfig               |   1 -
 arch/mips/configs/mtx1_defconfig              |   1 -
 drivers/net/wan/Kconfig                       |  15 -
 drivers/net/wan/Makefile                      |   1 -
 drivers/net/wan/x25_asy.c                     | 836 ------------------
 drivers/net/wan/x25_asy.h                     |  46 -
 9 files changed, 903 deletions(-)
 delete mode 100644 drivers/net/wan/x25_asy.c
 delete mode 100644 drivers/net/wan/x25_asy.h

Adding Martin Schiller and Andrew Hendry, plus the linux-x25 mailing list to Cc. When I last looked at the wan drivers, I think I concluded that this should still be kept around, but I do not remember why. OTOH if it was broken for a long time, that is a clear indication that it was in fact unused.

Since you did the bugfix mentioned above, do you have an idea when it could have last worked? I see it was originally merged in linux-2.3.21, and Stephen Hemminger did a cleanup for linux-2.6.0-rc3 that he apparently tested but also said "Not sure if anyone ever uses this.".

Hopefully Martin or Andrew can provide a definite Ack or Nack on this.

Arnd

author
#5 lore raw
Quoted 3 lines · Arnd Bergmann

Adding Martin Schiller and Andrew Hendry, plus the linux-x25 mailing list to Cc.

The linux-x25 mail list has stopped working for a long time.

Quoted 2 lines

When I last looked at the wan drivers, I think I concluded that this should still be kept around, but I do not remember why.

I think we only decided that X.25 as a whole was still needed. We didn't decide that this particular driver was necessary.

Quoted 5 lines

Since you did the bugfix mentioned above, do you have an idea when it could have last worked? I see it was originally merged in linux-2.3.21, and Stephen Hemminger did a cleanup for linux-2.6.0-rc3 that he apparently tested but also said "Not sure if anyone ever uses this.".

I think this driver never worked. Looking at the original code in Linux 2.1.31, it already has the problems I fixed in commit 8fdcabeac398.

I guess when people (or bots) say they "tested", they have not necessarily used this driver to actually try transporting data. They may just have tested open/close, etc. to confirm that the particular problem/issue they saw had been fixed.

#6 lore raw
Quoted 6 lines · Xie He
Quoted 3 lines · Arnd Bergmann

Adding Martin Schiller and Andrew Hendry, plus the linux-x25 mailing list to Cc.

Quoted 7 lines

The linux-x25 mail list has stopped working for a long time.

Quoted 2 lines

When I last looked at the wan drivers, I think I concluded that this should still be kept around, but I do not remember why.

I think we only decided that X.25 as a whole was still needed. We didn't decide that this particular driver was necessary.

Right, I agree that would be the most likely case given the state of the driver.

Quoted 6 lines
Quoted 5 lines

Since you did the bugfix mentioned above, do you have an idea when it could have last worked? I see it was originally merged in linux-2.3.21, and Stephen Hemminger did a cleanup for linux-2.6.0-rc3 that he apparently tested but also said "Not sure if anyone ever uses this.".

Quoted 8 lines

I think this driver never worked. Looking at the original code in Linux 2.1.31, it already has the problems I fixed in commit 8fdcabeac398.

I guess when people (or bots) say they "tested", they have not necessarily used this driver to actually try transporting data. They may just have tested open/close, etc. to confirm that the particular problem/issue they saw had been fixed.

It didn't sound like that from the commit message, but it could be. For reference:
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit?id=aa2b4427c355acaf86d2c7e6faea3472005e3cff

Arnd

author
#7 lore raw
Quoted 5 lines · Arnd Bergmann
Quoted 5 lines

I think this driver never worked. Looking at the original code in Linux 2.1.31, it already has the problems I fixed in commit 8fdcabeac398.

Quoted 8 lines
Quoted 4 lines

I guess when people (or bots) say they "tested", they have not necessarily used this driver to actually try transporting data. They may just have tested open/close, etc. to confirm that the particular problem/issue they saw had been fixed.

It didn't sound like that from the commit message, but it could be. For reference:
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit?id=aa2b4427c355acaf86d2c7e6faea3472005e3cff

I see. The author of this commit said "I tested by bringing up an x.25 async line using a modified version of slattach." Maybe he only switched TTY ports from the N_TTY line discipline to the N_X25 line discipline. To actually test transporting data, we need to either use AF_PACKET sockets, or use AF_X25 sockets with the X.25 routing table properly set up. The author of this commit didn't clearly indicate that he did these.

#8 lore raw

From: Xie He

Quoted 19 lines

Sent: 05 November 2020 22:47

Quoted 5 lines · Arnd Bergmann
Quoted 5 lines

I think this driver never worked. Looking at the original code in Linux 2.1.31, it already has the problems I fixed in commit 8fdcabeac398.

Quoted 8 lines
Quoted 4 lines

I guess when people (or bots) say they "tested", they have not necessarily used this driver to actually try transporting data. They may just have tested open/close, etc. to confirm that the particular problem/issue they saw had been fixed.

It didn't sound like that from the commit message, but it could be. For reference:

https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit?id=aa2b4427c355acaf86d2c7e6fae
a3472005e3cff

Quoted 7 lines

I see. The author of this commit said "I tested by bringing up an x.25 async line using a modified version of slattach." Maybe he only switched TTY ports from the N_TTY line discipline to the N_X25 line discipline. To actually test transporting data, we need to either use AF_PACKET sockets, or use AF_X25 sockets with the X.25 routing table properly set up. The author of this commit didn't clearly indicate that he did these.

Hmmm.... LAPB would expect to have an X.25 level 3 and maybe ISO transport (class 0, 2 or 3) sat on top of it.
The ISO networking service would normally be absent (more likely to be used with class 4 transport over ethernet - but still optional). Nothing at all like SLIP.

You could use LAPB unnumbered (UI) frames to carry IP frames (as SLIP does) - but that is really just using HDLC instead of async. Doing that using async is just silly.

Looks like this code should have been removed for 2.2 :-)

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

author
#9 lore raw
Quoted 3 lines · David Laight

Hmmm.... LAPB would expect to have an X.25 level 3 and maybe ISO transport (class 0, 2 or 3) sat on top of it.

I actually used AF_PACKET sockets to transport data directly over LAPB and it worked.

LAPB doesn't need anything from layer 3. It just sees the layer 3 packets as a sequence of packets, numbers them and reliably transports them in order. It doesn't read the internal contents of the packets.

maintainer Acked-by
#10 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

...
Adding Martin Schiller and Andrew Hendry, plus the linux-x25 mailing list to Cc. When I last looked at the wan drivers, I think I concluded that this should still be kept around, but I do not remember why. OTOH if it was broken for a long time, that is a clear indication that it was in fact unused.

As Xie has already mentioned, the linux-x25 mailing list unfortunately is broken for a long time. Maybe David could have a look at this.

I still use the X.25 subsystem together with the hdlc-x25 driver and as I wrote some time ago this will continue for some time.

I'm also still contributing patches for it (even if only drop by drop).

But I have never used the x25_asy driver.

Quoted 4 lines

...

Hopefully Martin or Andrew can provide a definite Ack or Nack on this.

ACK from my side, even if I'm a bit sorry about the work of Xie.

maintainer Applied
#11 lore raw
Quoted 16 lines · On Fri, 06 Nov 2020 06:43:53 +0100 Martin Schiller wrote:
Quoted 6 lines · Arnd Bergmann

...
Adding Martin Schiller and Andrew Hendry, plus the linux-x25 mailing list to Cc. When I last looked at the wan drivers, I think I concluded that this should still be kept around, but I do not remember why. OTOH if it was broken for a long time, that is a clear indication that it was in fact unused.

As Xie has already mentioned, the linux-x25 mailing list unfortunately is broken for a long time. Maybe David could have a look at this.

I still use the X.25 subsystem together with the hdlc-x25 driver and as I wrote some time ago this will continue for some time.

I'm also still contributing patches for it (even if only drop by drop).

Quoted 8 lines

But I have never used the x25_asy driver.

Quoted 2 lines

Hopefully Martin or Andrew can provide a definite Ack or Nack on this.

ACK from my side, even if I'm a bit sorry about the work of Xie.

Applied to net-next, thanks!