}
}
+static void SendNoOpPacket(ThreadVars *tv, TmSlot *slot)
+{
+ Packet *p = PacketPoolGetPacket();
+ if (p == NULL) {
+ return;
+ }
+
+ p->datalink = DLT_RAW;
+ p->proto = IPPROTO_TCP;
+
+ /* So that DecodeMpipe ignores is. */
+ p->flags |= PKT_PSEUDO_STREAM_END;
+
+ p->flow = NULL;
+
+ TmThreadsSlotProcessPkt(tv, slot, p);
+}
+
/**
* \brief Receives packets from an interface via gxio mpipe.
*/
MpipeReceiveOpenIqueue(rank);
gxio_mpipe_iqueue_t* iqueue = thread_iqueue;
int update_counter = 0;
+ uint64_t last_packet_time = get_cycle_count();
for (;;) {
}
/* Move forward M packets in ingress ring. */
gxio_mpipe_iqueue_advance(iqueue, m);
+
+ last_packet_time = get_cycle_count();
}
if (update_counter-- <= 0) {
/* Only periodically update and check for termination. */
if (suricata_ctl_flags != 0) {
break;
}
+
+ // If no packet has been received for some period of time, process a NOP packet
+ // just to make sure that pseudo packets from the Flow manager get processed.
+ uint64_t now = get_cycle_count();
+ if (now - last_packet_time > 100000000) {
+ SendNoOpPacket(ptv->tv, ptv->slot);
+ last_packet_time = now;
+ }
}
}
SCReturnInt(TM_ECODE_OK);