Skip to content

Commit 9fb9251

Browse files
committed
Handle PF_RING_FLOW_UPDATE_CAUSE_PERIODIC
1 parent 018f6eb commit 9fb9251

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

userland/examples/pfflow_offload.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ void sigproc(int sig) {
178178
void processFlow(pfring_flow_update *flow){
179179
if (verbose) {
180180
switch (flow->cause) {
181+
/* Flow stats update (periodic) */
182+
case PF_RING_FLOW_UPDATE_CAUSE_PERIODIC:
183+
printf("Flow #%lu periodic update\n", flow->flow_id);
184+
break;
185+
/* Flow unlearned */
181186
case PF_RING_FLOW_UPDATE_CAUSE_SW:
182187
printf("Flow #%lu removed (by FlowWrite)\n", flow->flow_id);
183188
break;
@@ -266,12 +271,12 @@ void packet_consumer() {
266271

267272
while(!do_shutdown) {
268273

269-
#if 0
270-
while (!do_shutdown && pfring_recv_flow(pd, &flow, 0) > 0) {
271-
/* Process flow */
272-
processFlow(&flow);
274+
if (verbose) {
275+
while (!do_shutdown && pfring_recv_flow(pd, &flow, 0) > 0) {
276+
/* Process flow */
277+
processFlow(&flow);
278+
}
273279
}
274-
#endif
275280

276281
if (pfring_recv(pd, &buffer_p, NO_ZC_BUFFER_LEN, &hdr, 0) > 0) {
277282
/* Process packet */

0 commit comments

Comments
 (0)