Skip to content

Conversation

@Teufelchen1
Copy link
Contributor

@Teufelchen1 Teufelchen1 commented Nov 21, 2025

Contribution description

Hey hey 🦭

This refactors the current slipdev driver heavily and also renames it to slipmux.

The networking aspect (plain slip) is no longer the default but a submodule: slipmux_net.
The "configuration" aspect (coap via uart) is no longer called slipdev_config but slipmux_coap. That moves it further from the slipmux draft but (I hope) closer to the average developer and sets the expectations clearer.
Same for diagnostic but there it was already called _stdio which was retained.

There is a new "overall" module called slipmux which enables all three modes (slipmux_stdio, _coap and _net) for full slipmux functionality.

The parser behavior got a slight change and differentiates between unknown frame types and IPv4/6 frames now. This should make it more robust when interfacing slipmux instead of slip. (Worry not, our slip tools still work as expected)

In addition, the coap handling got reworked to be ready for plug & play action with unicoap once #21582 is merged.

Testing procedure

Pick one of our examples that offer slip e.g. examples/networking/gnrc/border_router/ and see that it still behaves as advertised in the README. tl;dr:

cd examples/networking/gnrc/border_router/
BOARD=nrf52840dk UPLINK=slip make all flash -j9 term
Building application "gnrc_border_router" for "nrf52840dk" with CPU "nrf52".
[...]
> 
> ifconfig
Iface  2 
          MTU:65535  HL:64  RTR  
          
          Link type: wired
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1:ff00:2
          
Iface  6  HWaddr: 35:3F  Channel: 26  NID: 0x23  PHY: O-QPSK 
         [...]
          inet6 group: ff02::1:ff22:b53f
          
ps
> ps
	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
	  - | isr_stack            | -        - |   - |    512 (  224) (  288) | 0x20000000 | 0x200001c8
	  1 | main                 | running  Q |   7 |   1536 (  904) (  632) | 0x200002f0 | 0x2000062c 
	  2 | slipdev              | bl anyfl _ |   2 |    896 (  284) (  612) | 0x20004af4 | 0x20004db4 
	 [...]
	  7 | uhcp                 | bl mutex _ |   6 |   1536 (  944) (  592) | 0x200040bc | 0x200044d4 
	    | SUM                  |            |     |   7744 ( 3388) ( 4356)

See the slipdev thread running (pid 2) and then try to ping the border router from your linux console:

 ~> ping fe80::2%sl0
PING fe80::2%sl0 (fe80::2%sl0) 56 data bytes
64 bytes from fe80::2%sl0: icmp_seq=1 ttl=64 time=20.1 ms
64 bytes from fe80::2%sl0: icmp_seq=2 ttl=64 time=20.5 ms
^C
--- fe80::2%sl0 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 20.108/20.287/20.466/0.179 ms

@github-actions github-actions bot added Area: network Area: Networking Area: build system Area: Build system Area: pkg Area: External package ports Area: drivers Area: Device drivers Area: tools Area: Supplementary tools Area: boards Area: Board ports Area: sys Area: System Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration labels Nov 21, 2025
Comment on lines +88 to +109
while (1) {
event_t *event = event_wait(&queue);
event->handler(event);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole event queue contraption is rather odd but it will fit nicely with unicoap, trust me bro.

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 21, 2025
@riot-ci
Copy link

riot-ci commented Nov 21, 2025

Murdock results

FAILED

27af9a1 unfinished Kconf

Build failures (14)
Application Target Toolchain Runtime (s) Worker
tests/net/slip native64 gnu 0.29 alien
tests/net/slip samr21-xpro llvm 0.80 alien
tests/net/slip native64 llvm 0.53 alien
tests/net/slip msb-430 gnu 0.37 alien
tests/net/slip native32 gnu 1.22 mobi6
tests/net/slip msba2 gnu 1.26 mobi6
tests/net/slip samr21-xpro gnu 0.54 alien
tests/net/slip frdm-k64f gnu 1.79 mobi6
tests/net/slip adafruit-itsybitsy-m4 gnu 1.86 mobi6
tests/net/slip qn9080dk gnu 1.83 mobi6
tests/net/slip stm32f429i-disc1 gnu 0.84 alien
tests/net/slip native32 llvm 3.98 skyleaf
tests/net/slip nrf52840dk gnu 2.67 tatooine
tests/net/slip stk3200 gnu 3.08 mobi6

Artifacts

Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some basic style and nitpick comments for now.

Also the static test has some ideas and you sometimes added yourself in the Copyright and sometimes in the Doxygen authorship, but not really consistently yet 🤔

Comment on lines -456 to -458
PSEUDOMODULES += slipdev_stdio
PSEUDOMODULES += slipdev_config
PSEUDOMODULES += slipdev_l2addr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these modules as slipmux_ PSEUDOMODULES anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still do! And this actually one of the major reasons for this rewrite/refactoring: The ability to select _stdio or _coap (used to be _config) without having to use _net (used to not exist and was always included in the base slipdev)

The definitions moved into Makefile.include. I can't remember why I decided to move them out of the global pseudomodules.inc.mk. Either a mistake or some deeper reasoning? Will see in a bit.

@Teufelchen1
Copy link
Contributor Author

Just some basic style and nitpick comments for now.

Way too early :p but thanks anyways, I adopted the fixes.

Also the static test has some ideas

Probably. I wasn't done-enough yet, to look at them.

[..] and you sometimes added yourself in the Copyright and sometimes in the Doxygen authorship, but not really consistently yet 🤔

No care was given to that yet.

@crasbe crasbe added the CI: no fast fail don't abort PR build after first error label Nov 24, 2025
@github-actions github-actions bot added Area: doc Area: Documentation Area: tests Area: tests and testing framework labels Nov 24, 2025
@Teufelchen1 Teufelchen1 force-pushed the slipmux_event_based branch 2 times, most recently from 9e542dd to 33e529a Compare November 24, 2025 15:07
@Teufelchen1 Teufelchen1 changed the title DRAFT: Rework SLIPDEV driver in preparation for Unicoap Rework SLIPDEV driver in preparation for Unicoap Nov 24, 2025
@Teufelchen1
Copy link
Contributor Author

I think this is ready for actual review now. I would appreciate feedback specifically on the mutex handling. I am not super proud of it.

@crasbe
Copy link
Contributor

crasbe commented Nov 24, 2025

If you want to, you can squash before the reviews start pouring in 🤔

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! ❤️ Unfortunately it was a bit hard to review since Github didn't properly display the file renames (separate commit would have helped).

I've got mostly nitpicky things and haven't tested this yet.

Also Murdock fails because you probably have to change the Kconfig include from slipdev to slipmux somewhere.

Comment on lines +187 to +192
#if IS_USED(MODULE_SLIPMUX_NET_L2ADDR)
case NETOPT_ADDRESS_LONG:
assert(max_len == sizeof(eui64_t));
netdev_eui64_get(netdev, value);
return sizeof(eui64_t);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this is slipmux-specific? why not use a generic l2addr module? I have the feeling there was some, maybe I'm wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, I honestly didn't question it. It works tho! Tested it! :P

Comment on lines 85 to 86
/drivers/si70xx/ @basilfx
/drivers/slipdev/ @miri64
/drivers/sx127x/ @aabadie @jia200x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/drivers/si70xx/ @basilfx
/drivers/slipdev/ @miri64
/drivers/sx127x/ @aabadie @jia200x
/drivers/si70xx/ @basilfx
/drivers/slipmux/ @Teufelchen1
/drivers/sx127x/ @aabadie @jia200x

:P

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot the most important file :P

Comment on lines +80 to +81
if (len <= 0) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some DEBUG messages wouldn't harm :)

@mguetschow mguetschow changed the title Rework SLIPDEV driver in preparation for Unicoap drivers/slipmux: Rework SLIPDEV driver in preparation for Unicoap Nov 26, 2025
@mguetschow
Copy link
Contributor

Btw, while editing the title I was thinking: does this really belong to drivers and not rather sys/net?

@Teufelchen1
Copy link
Contributor Author

Great stuff! ❤️

Thanks!

Unfortunately it was a bit hard to review since Github didn't properly display the file renames (separate commit would have helped).

Yes, I realized too late that this approach was shit (sorry!).

does this really belong to drivers and not rather sys/net?

I don't know. 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: build system Area: Build system Area: doc Area: Documentation Area: drivers Area: Device drivers Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework Area: tools Area: Supplementary tools CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants