Project

General

Profile

Actions

Optimization #6928

open

source-netmap: improve netmap receive loop packet processing performance

Added by Bill Meeks 7 months ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Effort:
low
Difficulty:
low
Label:
Needs backport to 7.0

Description

The packet receive processing loop in the source-netmap module can benefit from changing how it obtains Packet structures from the Packet pool. Currently it uses a call to PacketPoolGetPacket() . This function will only return a Packet structure if an empty one is available. Otherwise, it returns NULL and thus the netmap packet capture loop can stall until a Packet becomes available in the pool. Here is the current function call:

https://github.com/OISF/suricata/blob/b224209f45317abfbea1a1f43f17fa63ae904745/src/source-netmap.c#L676

Recieve packet processing will be enhanced if the receive processing loop calls PacketGetFromQueueOrAlloc() instead. This function call will return an available Packet from the pool same as the former function, but it will allocate new Packet for the pool if one is not currently available. This should prevent the netmap receive processing loop from having to wait for a Packet to become available.

No data to display

Actions

Also available in: Atom PDF