Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| netkpikbi [2009/06/30 18:17] – Missing sys table header. RobertWatson | netkpikbi [2009/08/01 11:04] (current) – Downgrade KBI status from immutable to extendable for some global structs due to removal of vinet.h RobertWatson | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| This wiki page attempts to identify kernel data structures which, if changed after a .0 release on a branch, may prevent network device drivers, firewall modules, as well as userland monitoring tools, etc, from working properly. | This wiki page attempts to identify kernel data structures which, if changed after a .0 release on a branch, may prevent network device drivers, firewall modules, as well as userland monitoring tools, etc, from working properly. | ||
| - | ===== Data structure | + | ===== Data structure |
| The following status options exist for each structure: | The following status options exist for each structure: | ||
| Line 22: | Line 22: | ||
| These data structures are used only inside of the kernel or specific modules, and the layout may be changed without (excessive) concern. | These data structures are used only inside of the kernel or specific modules, and the layout may be changed without (excessive) concern. | ||
| + | |||
| + | ===== Key to usage ===== | ||
| + | |||
| + | The following uses are of particular interest from a KPI/KBI perspective: | ||
| + | |||
| + | ^ Abbreviation ^ Description ^ | ||
| + | | MD | Module dereference: | ||
| + | | MA | Module allocation: kernel modules encode size of structure in their implementation, | ||
| + | | SE | Sysctl export: the data structure is exposed to userspace via the sysctl(2) system call, and therefore part of the ABI. | | ||
| + | | SC | System call argument: data structure is an argument to a system call. | | ||
| + | | KD | KVM dereference: | ||
| + | | KS | KVM size dependency: userspace monitoring or post-mortem analysis tools encode the length of the structure in their implementation (i.e., due to the struct being allocated in an array in the kernel). | | ||
| ===== sys ===== | ===== sys ===== | ||
| - | ^ Type ^ Status ^ Comments ^ | + | ^ Type ^ Status |
| - | | struct mbuf | Immutable | Extreme caution required. | | + | | struct mbuf | Immutable |
| - | | struct sockopt | Immutable | Allocated on the stack in kernel modules. | | + | | struct sockopt | Immutable |
| - | | struct sockaddr | Immutable | Allocated statically, embedded in kernel structures, and part of the system call ABI. | | + | | struct sockaddr | Immutable |
| - | | struct unpcb | Immutable | Allocated only by uipc_usrreq.c, | + | | struct unpcb | Immutable |
| - | | struct xsocket | Immutable | Exposed explicitly via sysctl to userspace. | | + | | struct xsocket | Immutable |
| - | | struct xunpcb | Immutable | Allocated only by uipc_usrreq.c, | + | | struct xunpcb | Immutable |
| ===== net ===== | ===== net ===== | ||
| Line 49: | Line 61: | ||
| | struct in_ifaddr | Extendable | Allocated only by in.c, but used in many places in net, netinet, netipsec. | | | struct in_ifaddr | Extendable | Allocated only by in.c, but used in many places in net, netinet, netipsec. | | ||
| | struct inpcb | Padded | Allocated from a number of zones, depending on protocol type; exposed explicitly to userspace via xinpcb, xtcpcb via sysctl. | | struct inpcb | Padded | Allocated from a number of zones, depending on protocol type; exposed explicitly to userspace via xinpcb, xtcpcb via sysctl. | ||
| - | | struct inpcbinfo | Immutable | + | | struct inpcbinfo | Extendable |
| | struct ipq | Extendable | Allocated only by ip_input.c, but some fields read by MAC policy modules. | | | struct ipq | Extendable | Allocated only by ip_input.c, but some fields read by MAC policy modules. | | ||
| + | | struct sackhint | Padded | Used only inside of TCP, but embedded in struct tcpcb so is exposed to userspace and other kernel modules with tcpcb visibility. | | ||
| | struct sockaddr_in | Immutable | Allocated statically and part of the system call ABI; embedded in other data structures. | | | struct sockaddr_in | Immutable | Allocated statically and part of the system call ABI; embedded in other data structures. | | ||
| | struct syncache | Extendable | Currently allocated/ | | struct syncache | Extendable | Currently allocated/ | ||
| Line 56: | Line 69: | ||
| | struct tcp_hostcache | Extendable | Currently allocated/ | | struct tcp_hostcache | Extendable | Currently allocated/ | ||
| | struct tcpcb | Immutable | Currently allocated only by TCP, but accessed in a number of places including NFS, and exported to userspace directly via xtcpcb in sysctl. | | struct tcpcb | Immutable | Currently allocated only by TCP, but accessed in a number of places including NFS, and exported to userspace directly via xtcpcb in sysctl. | ||
| + | | struct tcpopt | Padded | Allocated and used only within TCP -- except for TOE modules, also allocated it (on the stack) and pass it into syncache entry initialization. | | ||
| | struct tcptw | Private | Currently allocated and accessed only by TCP, but may be accessed via KVM by user monitoring tools in the future. | | | struct tcptw | Private | Currently allocated and accessed only by TCP, but may be accessed via KVM by user monitoring tools in the future. | | ||
| - | | struct tcp_syncache | Immutable | + | | struct tcp_syncache | Extendable |
| | struct udpdb | Private | Currently allocated and accessed only by UDP/UDP6, but may be accessed via KVM by user monitoring tools in the future. | | | struct udpdb | Private | Currently allocated and accessed only by UDP/UDP6, but may be accessed via KVM by user monitoring tools in the future. | | ||