suricata
source-af-xdp.h
Go to the documentation of this file.
1 /* Copyright (C) 2022 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Richard McConnell <richard_mcconnell@rapid7.com>
22  */
23 
24 #ifndef SURICATA_SOURCE_AFXDP_H
25 #define SURICATA_SOURCE_AFXDP_H
26 
27 #define AFXDP_IFACE_NAME_LENGTH 48
28 
29 typedef struct AFXDPIfaceConfig {
31  /* number of threads */
32  int threads;
33  int promisc;
34 
35  /* misc use flags */
36  uint32_t mode;
37  uint32_t bind_flags;
40  uint32_t busy_poll_time;
41  uint32_t busy_poll_budget;
44 
45  SC_ATOMIC_DECLARE(unsigned int, ref);
46  void (*DerefFunc)(void *);
48 
49 /**
50  * \brief per packet AF_XDP vars
51  *
52  * This structure is used by the release data system
53  */
54 typedef struct AFXDPPacketVars_ {
55  /* Fill queue used by kernel for inbound packets */
56  void *fq;
57  /* Indexed location within queue to release */
58  uint32_t fq_idx;
59  /* Origin address of packet */
60  uint64_t orig;
62 
65 
67 void AFXDPMutexClean(void);
68 
69 #endif /* SURICATA_SOURCE_AFXDP_H */
AFXDPIfaceConfig
struct AFXDPIfaceConfig AFXDPIfaceConfig
AFXDPIfaceConfig::mode
uint32_t mode
Definition: source-af-xdp.h:36
AFXDPIfaceConfig::iface
char iface[AFXDP_IFACE_NAME_LENGTH]
Definition: source-af-xdp.h:30
AFXDPIfaceConfig::mem_alignment
int mem_alignment
Definition: source-af-xdp.h:38
AFXDPIfaceConfig::gro_flush_timeout
uint32_t gro_flush_timeout
Definition: source-af-xdp.h:42
AFXDPIfaceConfig::DerefFunc
void(* DerefFunc)(void *)
Definition: source-af-xdp.h:46
AFXDP_IFACE_NAME_LENGTH
#define AFXDP_IFACE_NAME_LENGTH
Definition: source-af-xdp.h:27
AFXDPIfaceConfig::napi_defer_hard_irqs
uint32_t napi_defer_hard_irqs
Definition: source-af-xdp.h:43
AFXDPQueueProtectionInit
TmEcode AFXDPQueueProtectionInit(void)
AFXDPIfaceConfig::enable_busy_poll
bool enable_busy_poll
Definition: source-af-xdp.h:39
AFXDPIfaceConfig::busy_poll_budget
uint32_t busy_poll_budget
Definition: source-af-xdp.h:41
AFXDPPacketVars_::fq_idx
uint32_t fq_idx
Definition: source-af-xdp.h:58
AFXDPIfaceConfig::promisc
int promisc
Definition: source-af-xdp.h:33
AFXDPIfaceConfig::bind_flags
uint32_t bind_flags
Definition: source-af-xdp.h:37
AFXDPIfaceConfig::threads
int threads
Definition: source-af-xdp.h:32
AFXDPIfaceConfig::busy_poll_time
uint32_t busy_poll_time
Definition: source-af-xdp.h:40
TmEcode
TmEcode
Definition: tm-threads-common.h:83
AFXDPPacketVars_::fq
void * fq
Definition: source-af-xdp.h:56
AFXDPPacketVars_
per packet AF_XDP vars
Definition: source-af-xdp.h:54
TmModuleDecodeAFXDPRegister
void TmModuleDecodeAFXDPRegister(void)
Registration Function for DecodeAFXDP.
Definition: source-af-xdp.c:92
AFXDPPacketVars
struct AFXDPPacketVars_ AFXDPPacketVars
per packet AF_XDP vars
TmModuleReceiveAFXDPRegister
void TmModuleReceiveAFXDPRegister(void)
Definition: source-af-xdp.c:78
AFXDPIfaceConfig::SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, ref)
AFXDPPacketVars_::orig
uint64_t orig
Definition: source-af-xdp.h:60
AFXDPIfaceConfig
Definition: source-af-xdp.h:29
AFXDPMutexClean
void AFXDPMutexClean(void)