lkp

How to install lkp on RHEL/CentOS/Fedora git clone https://github.com/01org/lkp-tests.git cd lkp-tests && make install && cd ~ 1 2 3 4 5 6 7 8 on RHEL: # mv /etc/redhat-release /etc/centos-release # rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # yum makecache fast # yum install kernel-debuginfo on Fedora: # dnf install kernel-debug mkdir -p /lkp/benchmarks ## BENCHMARK_ROOT=/lkp/benchmarks, but lkp didn’t init it, bug? run hackbench mkdir -p /lkp/benchmarks/turbostat lkp install lkp-tests/jobs/hackbench.

netlink

Create a socket struct sockaddr_nl { sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* Zero. */ pid_t nl_pid; /* Port ID. */ __u32 nl_groups; /* Multicast groups mask. */ }; nl_pid = 0 // if the destination is in the kernel nl_pid = getpid() // For a user-space process socket(AF_NETLINK, socket_type, netlink_family) socket type: SOCK_RAW / SOCK_DGRAM netlink family: NETLINK_ROUTE Routing tables, IP addresses, link parameters, neighbor setups, traffic classes, etc.

ptp

[1] http://www.cttl.cn/tecm/dxwjs/200903/t20090312_573809.htm [2] https://segmentfault.com/a/1190000005337116 [3] http://rhelblog.redhat.com/2016/07/20/combining-ptp-with-ntp-to-get-the-best-of-both-worlds/

NetworkManager

nmcli connection show nmcli connection show eth0 nmcli device status nmcli connection add con-name eth1 type ethernet ifname eth1 nmcli connection modify eth1 ip4 192.168.1.1/24 gw4 192.168.1.254 nmcli con modify eth1 connection.lldp enable nmcli -f all device lldp nmcli device lldp list ifname eth1

code style

Ref: https://patchwork.kernel.org/patch/9368853/ There is one correct way to remove an entry from a singly linked list, and it looks like this: struct entry **pp, *p; pp = &head; while ((p = *pp) != NULL) { if (right_entry(p)) { *pp = p->next; break; } pp = &p->next; } and that’s it. Nothing else. The above code exits the loop with “p” containing the entry that was removed, or NULL if nothing was.