Skip to content

Commit

Permalink
dpif-netdev: Delete packet if not able to do upcall
Browse files Browse the repository at this point in the history
In dp_netdev_input() we nevered fully covered the case where handler queues are
not there.
With this change we increment the stat counter and free the packet.

Signed-off-by: Daniele Di Proietto <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
  • Loading branch information
ddiproietto authored and Pravin B Shelar committed Jun 25, 2014
1 parent 9477751 commit 72d9667
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2094,12 +2094,20 @@ dp_netdev_input(struct dp_netdev *dp, struct dpif_packet **packets, int cnt,
packet_batch_init(&batch, netdev_flow, packets[i], md,
&key.flow);
}
} else if (dp->handler_queues) {
} else {
/* Packet's flow not in datapath */
dp_netdev_count_packet(dp, DP_STAT_MISS, 1);
dp_netdev_output_userspace(dp, &buf, 1,
miniflow_hash_5tuple(&key.flow, 0)
% dp->n_handlers,
DPIF_UC_MISS, &key.flow, NULL);

if (dp->handler_queues) {
/* Upcall */
dp_netdev_output_userspace(dp, &buf, 1,
miniflow_hash_5tuple(&key.flow, 0)
% dp->n_handlers,
DPIF_UC_MISS, &key.flow, NULL);
} else {
/* No upcall queue. Freeing the packet */
dpif_packet_delete(packets[i]);
}
}
}

Expand Down

0 comments on commit 72d9667

Please sign in to comment.