History

netlink: mmaped netlink: ring setup

Add support for mmap'ed RX and TX ring setup and teardown based on the af_packet.c code. The following patches will use this to add the real mmap'ed receive and transmit functionality.

Patrick McHardy committed 13 years ago

Commit ccdfcc31 parent cf0a0184 files · +327 −2Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/netlink.h+32−0
@@ -1,6 +1,7 @@
11 #ifndef _UAPI__LINUX_NETLINK_H
22 #define _UAPI__LINUX_NETLINK_H
33
4+#include <linux/kernel.h>
45 #include <linux/socket.h> /* for __kernel_sa_family_t */
56 #include <linux/types.h>
67
@@ -105,11 +106,42 @@ struct nlmsgerr { · 98 unmodified lines
105106 #define NETLINK_PKTINFO 3
106107 #define NETLINK_BROADCAST_ERROR 4
107108 #define NETLINK_NO_ENOBUFS 5
109+#define NETLINK_RX_RING 6
110+#define NETLINK_TX_RING 7
108111
109112 struct nl_pktinfo {
110113 __u32 group;
111114 };
112115
116+struct nl_mmap_req {
117+ unsigned int nm_block_size;
118+ unsigned int nm_block_nr;
119+ unsigned int nm_frame_size;
120+ unsigned int nm_frame_nr;
121+};
122+
123+struct nl_mmap_hdr {
124+ unsigned int nm_status;
125+ unsigned int nm_len;
126+ __u32 nm_group;
127+ /* credentials */
128+ __u32 nm_pid;
129+ __u32 nm_uid;
130+ __u32 nm_gid;
131+};
132+
133+enum nl_mmap_status {
134+ NL_MMAP_STATUS_UNUSED,
135+ NL_MMAP_STATUS_RESERVED,
136+ NL_MMAP_STATUS_VALID,
137+ NL_MMAP_STATUS_COPY,
138+ NL_MMAP_STATUS_SKIP,
139+};
140+
141+#define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
142+#define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
143+#define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
144+
113145 #define NET_MAJOR 36 /* Major 36 is reserved for networking */
114146
115147 enum {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t