Please include the following information with your help request:
Suricata version
Suricata version 7.0.0 RELEASE
Operating system and/or Linux distribution
CentOS Linux release 7.9
How you installed Suricata (from source, packages, something else)
source
Hello there,
When I set Suricata’s af-packet autofp mode to tpacket v3, the following error is displayed: “tpacket v3 is only implemented for ‘workers’ runmode. Switching to tpacket v2”.
I would like to know the design reasons why this mode does not support tpacket v3 ?
I would like to understand the reasoning behind the logic design in the ParseAFPConfig function within the runmode-af-packet.c file of the Suricata source code. I couldn’t find any related documentation explaining it.
if (ConfGetChildValueBoolWithDefault(if_root, if_default, "tpacket-v3", (int *)&boolval) == 1) {
if (boolval) {
if (strcasecmp(RunmodeGetActive(), "workers") == 0) {
#ifdef HAVE_TPACKET_V3
SCLogConfig("%s: enabling tpacket v3", aconf->iface);
aconf->flags |= AFP_TPACKET_V3;
#else
SCLogWarning("%s: system too old for tpacket v3 switching to v2", iface);
aconf->flags &= ~AFP_TPACKET_V3;
#endif
} else {
SCLogWarning("%s: tpacket v3 is only implemented for 'workers' runmode."
" Switching to tpacket v2.",
iface);
aconf->flags &= ~AFP_TPACKET_V3;
}
} else {
aconf->flags &= ~AFP_TPACKET_V3;
}
}
Not supporting v3 for autofp allows us to avoid some threading overhead. If you use autofp, performance is clearly not a major concern, so using v2 is fine.
Yes, thank you very much. I just want to confirm whether it is technically feasible for Suricata’s af-packet autofp mode to operate based on tpacket v3.