dpif-netdev: Delete packet if not able to do upcall
authorDaniele Di Proietto <ddiproietto@vmware.com>
Tue, 24 Jun 2014 23:08:34 +0000 (16:08 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Wed, 25 Jun 2014 17:54:06 +0000 (10:54 -0700)
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>
lib/dpif-netdev.c

index 4dcc268..e814645 100644 (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]);
+            }
         }
     }