2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

dpif-netdev: Delete packet if not able to do upcall

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 <ddiproietto@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
Daniele Di Proietto
2014-06-24 16:08:34 -07:00
committed by Pravin B Shelar
parent 9477751009
commit 72d96679c1

View File

@@ -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]);
}
}
}