Code clean up to reduce code duplication.

Signed-off-by: Andy Zhou <[email protected]>
---
 lib/dpif-netdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index a7e15aa..8d72e27 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3178,13 +3178,11 @@ dp_netdev_queue_batches(struct dp_packet *pkt,
 {
     struct packet_batch *batch = flow->batch;
 
-    if (OVS_LIKELY(batch)) {
-        packet_batch_update(batch, pkt, mf);
-        return;
+    if (OVS_UNLIKELY(!batch)) {
+        batch = &batches[(*n_batches)++];
+        packet_batch_init(batch, flow);
     }
 
-    batch = &batches[(*n_batches)++];
-    packet_batch_init(batch, flow);
     packet_batch_update(batch, pkt, mf);
 }
 
-- 
1.9.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to