#endif
}
+#ifdef HAVE_PACKET_EBPF
if (ConfGetChildValueBoolWithDefault(if_root, if_default, "pinned-maps", (int *)&boolval) != 1) {
if (boolval) {
SCLogConfig("Using pinned maps on iface %s",
aconf->ebpf_t_config.flags |= EBPF_PINNED_MAPS;
}
}
+#endif
#ifdef HAVE_PACKET_EBPF
/* One shot loading of the eBPF file */
#ifdef HAVE_PACKET_EBPF
SCLogConfig("af-packet will use '%s' as eBPF filter file",
ebpf_file);
-#endif
aconf->ebpf_filter_file = ebpf_file;
aconf->ebpf_t_config.mode = AFP_MODE_EBPF_BYPASS;
+#endif
ConfGetChildValueBoolWithDefault(if_root, if_default, "bypass", &conf_val);
if (conf_val) {
#ifdef HAVE_PACKET_EBPF
if (ConfGetChildValueWithDefault(if_root, if_default, "xdp-filter-file", &ebpf_file) != 1) {
aconf->xdp_filter_file = NULL;
} else {
+#ifdef HAVE_PACKET_XDP
SCLogInfo("af-packet will use '%s' as XDP filter file",
ebpf_file);
aconf->ebpf_t_config.mode = AFP_MODE_XDP_BYPASS;
/* TODO FIXME Do we really have a usage of setting XDP and not bypassing ? */
ConfGetChildValueBoolWithDefault(if_root, if_default, "bypass", &conf_val);
if (conf_val) {
-#ifdef HAVE_PACKET_XDP
SCLogConfig("Using bypass kernel functionality for AF_PACKET (iface %s)",
aconf->iface);
aconf->flags |= AFP_XDPBYPASS;
RunModeEnablesBypassManager();
BypassedFlowManagerRegisterCheckFunc(EBPFCheckBypassedFlowTimeout, (void *) &(aconf->ebpf_t_config));
BypassedFlowManagerRegisterUpdateFunc(EBPFUpdateFlow, NULL);
+ }
#else
- SCLogError(SC_ERR_UNIMPLEMENTED, "Bypass set but XDP support is not built-in");
+ SCLogError(SC_ERR_UNIMPLEMENTED, "XDP filter set but XDP support is not built-in");
#endif
- }
#ifdef HAVE_PACKET_XDP
const char *xdp_mode;
if (ConfGetChildValueWithDefault(if_root, if_default, "xdp-mode", &xdp_mode) != 1) {
aconf->ebpf_t_config.cpus_count = 1;
}
}
-
#endif
}
uint8_t xdp_mode;
+#ifdef HAVE_PACKET_EBPF
struct ebpf_timeout_config ebpf_t_config;
+#endif
} AFPThreadVars;
ptv->ebpf_lb_fd = afpconfig->ebpf_lb_fd;
ptv->ebpf_filter_fd = afpconfig->ebpf_filter_fd;
ptv->xdp_mode = afpconfig->xdp_mode;
+#ifdef HAVE_PACKET_EBPF
ptv->ebpf_t_config.cpus_count = UtilCpuGetNumProcessorsConfigured();
-#ifdef HAVE_PACKET_EBPF
if (ptv->flags & (AFP_BYPASS|AFP_XDPBYPASS)) {
ptv->v4_map_fd = EBPFGetMapFDByName(ptv->iface, "flow_table_v4");
if (ptv->v4_map_fd == -1) {