bpf skeleton

This blog’s content is copied from: BPF skeleton and BPF app lifecycle and libbpf -bootstrap bpf skeleton theory Here is the main libbpf concepts and phases that each BPF application goes through. BPF application consists of a set of BPF programs, either cooperating or completely independent, and BPF maps and global variables, shared between all BPF programs (allowing them to cooperate on a common set of data). BPF maps and global variables are also accessible from user-space.

Makefile

Some tips Reference: https://blog.csdn.net/dlf1769/article/details/78997967 1 2 3 4 5 6 7 8 9 10 $@ 表示目标文件 $^ 表示所有的依赖文件 $< 表示第一个依赖文件 $? 表示比目标还要新的依赖文件列表 $% 仅当目标是函数库文件中,

Linux bridge features introduction

A Linux bridge behaves like a network switch. It forwards packets between interfaces that are connected to it. The Linux bridge has added basic STP, multicast, netfilter support since the 2.4 and 2.6 kernel series. And it added more features after that. e.g. Config via netlink VLAN filter VxLAN tunnel mapping IGMPv3/MLDv2 switchdev netfilter Others We will introduce all the features in this article. At the end I will also show the limits of bridge and when OVS should be used.

process context and interrupt context

Process context is its current state. We need to save the context of the current running process so it can be resumed after the interrupt is handled. Process context is basically its current state (what is in its registers). e.g. esp, ss, eip, cs, and more. We need to save the instruction pointer (EIP) and the CS (Code Segment) so that after the interrupt is handled we can continue running

linux socket

The code in this article is based on Linux kernel 5.13. This article is with reference to socket-interface-and-network-protocol and Send/Recv UDP. 1. Socket From man 2 socket 1 2 3 4 #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> int socket(int domain, int type, int protocol); domain: like AF_IENT, AF_INET6, AF_NETLINK, AF_PACKET, see more with man 7 address_families, or see all domains defined in kernel file include/linux/socket.