Since dropped packets due to large packet size or lack of memory are unlikely, it is best to add OVS_UNLIKELY annotations to these conditions.
With DPDK fast path forwarding test, this increased throughtput from 4.12 to 4.16 million packets per second. Signed-off-by: Ryan Wilson <wr...@nicira.com> --- lib/netdev-dpdk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 0aee14e..03f1e02 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -664,7 +664,7 @@ dpdk_do_tx_copy(struct netdev *netdev, struct dpif_packet ** pkts, int cnt) for (i = 0; i < cnt; i++) { int size = ofpbuf_size(&pkts[i]->ofpbuf); - if (size > dev->max_packet_len) { + if (OVS_UNLIKELY(size > dev->max_packet_len)) { VLOG_WARN_RL(&rl, "Too big size %d max_packet_len %d", (int)size , dev->max_packet_len); @@ -688,7 +688,7 @@ dpdk_do_tx_copy(struct netdev *netdev, struct dpif_packet ** pkts, int cnt) newcnt++; } - if (dropped) { + if (OVS_UNLIKELY(dropped)) { ovs_mutex_lock(&dev->mutex); dev->stats.tx_dropped += dropped; ovs_mutex_unlock(&dev->mutex); -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev