Skip to contentSkip to conversation

SMP fix for 6pack driver

PATCH Applied Ralf Baechle 7 participants 16 messages Jul 4, 2005 – Jul 31, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SMP fix for 6pack driver

Drivers really only work well in SMP if they actually can be selected. This is a leftover from the time when the 6pack drive only used to be a bitrotten variant of the slip driver.

 Kconfig |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/hamradio/Kconfig +1 -1
Index: linux-cvs/drivers/net/hamradio/Kconfig
===================================================================
@@ -17,7 +17,7 @@
 
 config 6PACK
 	tristate "Serial port 6PACK driver"
-	depends on AX25 && BROKEN_ON_SMP
+	depends on AX25
 	---help---
 	  6pack is a transmission protocol for the data exchange between your
 	  PC and your TNC (the Terminal Node Controller acts as a kind of
#1 lore raw
Quoted 14 lines · Ralf Baechle

Drivers really only work well in SMP if they actually can be selected. This is a leftover from the time when the 6pack drive only used to be a bitrotten variant of the slip driver.

 Kconfig |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-cvs/drivers/net/hamradio/Kconfig
===================================================================

drivers/net/hamradio/Kconfig 2005-07-04 18:23:17.000000000 +0100

Quoted 10 lines
drivers/net/hamradio/Kconfig 2005-07-04 18:23:17.000000000 +0100 renamed from drivers/net/hamradio/Kconfig 2005-05-20 12:29:58.000000000 +0100 +1 -2
@@ -17,7 +17,7 @@
 
 config 6PACK
        tristate "Serial port 6PACK driver"
-       depends on AX25 && BROKEN_ON_SMP
+       depends on AX25
        ---help---
          6pack is a transmission protocol for the data exchange between your
          PC and your TNC (the Terminal Node Controller acts as a kind of
 
-

Ralf,
Does 6pack still only handle 1 tnc under Linux or have you got it to do a ring of TNC's like the DOS one does? Sure would like to see that on Linux, would cut cost for us where we have multiple TNC's and want to use a simple machine.

Signature · 5 lines
Chuck Hast 
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
#2 lore raw
Quoted 4 lines · Chuck Hast

Does 6pack still only handle 1 tnc under Linux or have you got it to do a ring of TNC's like the DOS one does? Sure would like to see that on Linux, would cut cost for us where we have multiple TNC's and want to use a simple machine.

Such a limitation has never existed as far as I can tell; the sole limitation is to a single TNC per RS-232 interface. Daisy chaining multiple TNCs per interface is still not supported. If you run out of serial interfaces using for example USB serial interfaces should work just fine.

(For dare devils, attaching a remote 6pack TNC via for example ssh sort of works also ;-)

73 de DL5RB op Ralf

--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21

#3 lore raw
Quoted 7 lines · On 7/5/05, Ralf Baechle DL5RB <[email protected]> wrote:
Quoted 4 lines · Chuck Hast

Does 6pack still only handle 1 tnc under Linux or have you got it to do a ring of TNC's like the DOS one does? Sure would like to see that on Linux, would cut cost for us where we have multiple TNC's and want to use a simple machine.

Quoted 6 lines

Such a limitation has never existed as far as I can tell; the sole limitation is to a single TNC per RS-232 interface. Daisy chaining multiple TNCs per interface is still not supported. If you run out of serial interfaces using for example USB serial interfaces should work just fine.

Ralf,
What is lacking that would allow 6pack TNC's to be daisy chained? By doing so we would be able to use a single serial port to support multiple TNC's I have the documentation on how to wire the hardware and that is no big deal.

I have USB running on a laptop, it works well most of the time but at times when the machine boots one or other ports generates the "trying to synch tnc" message. The serial port always works.

I think that at times the USB part is slow to get totally initialized so I have gone in and added sleeps to slow things down a bit at init.

Quoted 3 lines

(For dare devils, attaching a remote 6pack TNC via for example ssh sort of works also ;-)

Ahh a subversive TNC to spy on a remote network???

Signature · 5 lines
Chuck Hast 
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
#4 lore raw
Quoted 5 lines · Chuck Hast

Ralf,
What is lacking that would allow 6pack TNC's to be daisy chained? By doing so we would be able to use a single serial port to support multiple TNC's I have the documentation on how to wire the hardware and that is no big deal.

Well, by the time I was writing that driver I didn't have a 6pack TNC at all, so I wrote a 6pack TNC emulator that is capable of simulating a single TNC. I still don't have multiple TNCs, unfortunately, so I'm planning on extending that emulator for my work :-)

You could try EB6EBU's m6pack which is an application level solution to the problem. I'm undecieded, maybe it's even preferable over a kernel solution.

Quoted 6 lines

I have USB running on a laptop, it works well most of the time but at times when the machine boots one or other ports generates the "trying to synch tnc" message. The serial port always works.

I think that at times the USB part is slow to get totally initialized so I have gone in and added sleeps to slow things down a bit at init.

Mine seems to be ok as long as the machine survives plugging in the USB device and open()ing the device file. Never really looked into it, blaming the driver for now.

Quoted 5 lines
Quoted 3 lines

(For dare devils, attaching a remote 6pack TNC via for example ssh sort of works also ;-)

Ahh a subversive TNC to spy on a remote network???

It's a strategy that allows attaching the TNC to any UNIX machine, even without AX.25 support. It's a hack but I was playing with it for a while when I ran out of interfaces.

73 de DL5RB op Ralf

--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21

#5 lore raw
Quoted 4 lines

It's a strategy that allows attaching the TNC to any UNIX machine, even without AX.25 support. It's a hack but I was playing with it for a while when I ran out of interfaces.

That could be VERY userful... Any more details available?

Thanks,
Bill - WA7NWP

#6 lore raw
Quoted 5 lines · Bill Vodall
Quoted 3 lines

It's a strategy that allows attaching the TNC to any UNIX machine, even without AX.25 support. It's a hack but I was playing with it for a while when I ran out of interfaces.

That could be VERY userful... Any more details available?

6pack is implemented as a line discipline, so any tty, including a pseudo tty can be turned into a 6pack interface. So all it takes is a network connection, let's say through ssh, an application on the remote side that transfers data on the remote side between that connecton and the /dev/tty... character device to which the TNC is connected. Same thing also on the local side, just between the pseudo-tty and the filedescriptor. Pretty much a nobrainer to implement but latency could be a slight problem.

(And if you don't truncate the cc list of email you even have a chance to getting answers in time ...)

Ralf

#8 lore raw

mkiss driver patch applied ?

Hi,

I tried to apply Ralf's patch to mkiss.c without success.

Did someone succeed ?

I would like very much to test this version with 2.6.11mdksmp kernel.

Could someone send me privately the full modified mkiss.c ?

73 de Bernard, f6bvp

-----------------
From: Ralf Baechle <[email protected]>
Date: Thu Jul 07 2005 - 22:27:01 EEST

This is an almost complete rewrite of the mkiss driver trying to fix all the issues this driver was having such as SMP, preemption etc. Basically this makes this driver more of a descendant of PPP than of the old slip code, as it used to be.

73 de DL5RB op Ralf

--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21

 mkiss.c | 1052 
++++++++++++++++++++++++++++++----------------------------------
 1 files changed, 507 insertions(+), 545 deletions(-)
drivers/net/hamradio/mkiss.c +0 -0
Index: linux-cvs/drivers/net/hamradio/mkiss.c
===================================================================
#9 lore raw

Re: mkiss driver patch applied ?

Quoted 7 lines · Bernard Pidoux

I tried to apply Ralf's patch to mkiss.c without success.

Did someone succeed ?

I would like very much to test this version with 2.6.11mdksmp kernel.

Could someone send me privately the full modified mkiss.c ?

the patch is only for 2.6.12.x kernels

Signature · 1 line
Stephen - vk3heg
#10 lore raw

Re: mkiss driver patch applied ?

Hi Stephen,

Thank you.

But I tried to apply it on different mkiss.c up to the last kernel 2.6.12.2 without success.

I really need some more info about the source of mkiss.c repository or to receive the full patched mkiss.c

73 de Bernard, f6bvp

-----------

Quoted 15 lines · Stephen
Quoted 7 lines · Bernard Pidoux

I tried to apply Ralf's patch to mkiss.c without success.

Did someone succeed ?

I would like very much to test this version with 2.6.11mdksmp kernel.

Could someone send me privately the full modified mkiss.c ?

the patch is only for 2.6.12.x kernels

#11 lore raw

Re: mkiss driver patch applied ?

In reply to Stephen
Quoted 10 lines · Stephen
Quoted 8 lines

I tried to apply Ralf's patch to mkiss.c without success.

Did someone succeed ?

I would like very much to test this version with 2.6.11mdksmp kernel.

Could someone send me privately the full modified mkiss.c ?

the patch is only for 2.6.12.x kernels

Or more accurately, it should work for 2.6.12-rc4 or newer. The sympthom for kernels older than this is this warning:

CC drivers/net/hamradio/mkiss.o
drivers/net/hamradio/mkiss.c: In function `ax_bump':
drivers/net/hamradio/mkiss.c:267: warning: implicit declaration of function `ax25_type_trans'

The warning unfortunately is the sympthom of a serious problem ...

Ralf

#12 lore raw
In reply to Ralf Baechle
Quoted 3 lines · * Ralf Baechle ([email protected]) wrote:

Drivers really only work well in SMP if they actually can be selected. This is a leftover from the time when the 6pack drive only used to be a bitrotten variant of the slip driver.

Hmm, it's been this way for quite a while, and users can still build w/ CONFIG_CLEAN_COMPILE=n. So, obligatory questions... I suspect it was orignally marked broken for cli/sti abuse, quick grep suggests this has been dealt with. Have the reasons it was marked broken been addressed?

thanks,
-chris

#13 lore raw
Quoted 9 lines · Chris Wright
Quoted 3 lines · * Ralf Baechle ([email protected]) wrote:

Drivers really only work well in SMP if they actually can be selected. This is a leftover from the time when the 6pack drive only used to be a bitrotten variant of the slip driver.

Hmm, it's been this way for quite a while, and users can still build w/ CONFIG_CLEAN_COMPILE=n. So, obligatory questions... I suspect it was orignally marked broken for cli/sti abuse, quick grep suggests this has been dealt with. Have the reasons it was marked broken been addressed?

Obviously, otherwise I'd not send such a patch :-) cli/sti abuse etc. 6pack was pretty much 2.0 or even pre-2.0 code before I started.

Somehow I managed to strip the BROKEN_ON_SMP patch bit from the last set of 6pack patches I sent, it was supposed to be in there.

I got a similar near-rewrite for mkiss in the queue but that certainly isn't something for -stable, way too large.

73 de DL5RB op Ralf

--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21

#14 lore raw
Quoted 1 line · * Ralf Baechle DL5RB ([email protected]) wrote:

Obviously, otherwise I'd not send such a patch :-)

;-)

Quoted 5 lines

cli/sti abuse etc.
6pack was pretty much 2.0 or even pre-2.0 code before I started.

Somehow I managed to strip the BROKEN_ON_SMP patch bit from the last set of 6pack patches I sent, it was supposed to be in there.

Thanks Ralf, I've no issue with this, esp. since it's so trivial. -chris