netlink: move docs to README

This commit is contained in:
Ciro Santilli
2018-07-06 08:56:22 +01:00
parent 3d4e0c095d
commit e05eb91add
7 changed files with 72 additions and 29 deletions

View File

@@ -3920,6 +3920,42 @@ Reads to that inode return the sequence: `1`, `10`, `100`, ... `10000000`, `1`,
Bibliography: https://stackoverflow.com/questions/4508998/what-is-an-anonymous-inode-in-linux
==== netlink sockets
Netlink sockets offer a socket API for kernel / userland communication:
....
/netlink.sh
echo $?
....
Outcome: the test passes:
....
0
....
Sources:
* link:kernel_module/netlink.c[]
* link:kernel_module/netlink.h[]
* link:kernel_module/user/netlink.c[]
* link:rootfs_overlay/netlink.sh[]
Launch multiple user requests in parallel to stress our socket:
....
insmod /netlink.ko sleep=1
for i in `seq 16`; do /netlink.out & done
....
TODO: what is the advantage over `read`, `write` and `poll`? https://stackoverflow.com/questions/16727212/how-netlink-socket-in-linux-kernel-is-different-from-normal-polling-done-by-appl
Bibliography:
* https://stackoverflow.com/questions/3299386/how-to-use-netlink-socket-to-communicate-with-a-kernel-module
* https://en.wikipedia.org/wiki/Netlink
=== Linux kernel asynchronous APIs
In this section we will document asynchronous APIs of Linux kernel, especially kthread-related scheduled events.