[Oisf-devel] PKT_ALLOC usage

Kenneth Steele ken at tilera.com
Wed May 8 19:46:52 UTC 2013

I have a question about the PKT_ALLOC flag. It is set in PacketGetFromAlloc() and not in PacketPoolInit() when putting packets in the ring buffer. The PKT_ALLOC flag is then checked when releasing a packet to either free the Packet or return it to the ring buffer. This makes sense.

My concern is that PACKET_RECYCLE() clears all flags, include PKT_ALLOC. The function FlowForceReassemblyForHash() creates a packet with PacketGetFromAlloc(), thus setting PKT_ALLOC, and then calls PACKET_RECYCLE() on the same packet, thus clearing the PKT_ALLOC flag. This seems inconsistent.

Also, many of the Unit Tests directly call SCMalloc(SIZE_OF_PACKET) to create a new packet, thus not setting PKT_ALLOC and implying returning the Packet to the ring buffer.

Would it be better to have an explicit PKT_RING_BUFFER flag?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openinfosecfoundation.org/pipermail/oisf-devel/attachments/20130508/ca5bc67a/attachment.html>

More information about the Oisf-devel mailing list