mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
3627d9702d
Introduce a sample program to demonstrate the control and data plane split. For the control plane part a new program called xdpsock_ctrl_proc is introduced. For the data plane part, some code was added to xdpsock_user.c to act as the data plane entity. Application xdpsock_ctrl_proc works as control entity with sudo privileges (CAP_SYS_ADMIN and CAP_NET_ADMIN are sufficient) and the extended xdpsock as data plane entity with CAP_NET_RAW capability only. Usage example: sudo ./samples/bpf/xdpsock_ctrl_proc -i <interface> sudo ./samples/bpf/xdpsock -i <interface> -q <queue_id> -n <interval> -N -l -R Signed-off-by: Mariusz Dudek <mariuszx.dudek@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/bpf/20201203090546.11976-3-mariuszx.dudek@intel.com
20 lines
298 B
C
20 lines
298 B
C
/* SPDX-License-Identifier: GPL-2.0
|
|
*
|
|
* Copyright(c) 2019 Intel Corporation.
|
|
*/
|
|
|
|
#ifndef XDPSOCK_H_
|
|
#define XDPSOCK_H_
|
|
|
|
#define MAX_SOCKS 4
|
|
|
|
#define SOCKET_NAME "sock_cal_bpf_fd"
|
|
#define MAX_NUM_OF_CLIENTS 10
|
|
|
|
#define CLOSE_CONN 1
|
|
|
|
typedef __u64 u64;
|
|
typedef __u32 u32;
|
|
|
|
#endif /* XDPSOCK_H */
|