]> git.proxmox.com Git - mirror_ovs.git/commitdiff
dpif-netdev: Add comments to dp_netdev_input__().
authorBhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Fri, 14 Oct 2016 14:37:08 +0000 (15:37 +0100)
committerDaniele Di Proietto <diproiettod@vmware.com>
Tue, 18 Oct 2016 01:32:44 +0000 (18:32 -0700)
Add comments in dp_netdev_input__() to explain the reason behind
clearing the flow batches before packet_batch_execute().

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
lib/dpif-netdev.c

index eb9f764800d0c3eafd7be4eccc67125695bd4b24..bda9c953d291f84dd726a7aca1a5222d4f8e35ec 100644 (file)
@@ -4182,6 +4182,15 @@ dp_netdev_input__(struct dp_netdev_pmd_thread *pmd,
         fast_path_processing(pmd, packets, keys, batches, &n_batches, in_port, now);
     }
 
+    /* All the flow batches need to be reset before any call to
+     * packet_batch_per_flow_execute() as it could potentially trigger
+     * recirculation. When a packet matching flow ‘j’ happens to be
+     * recirculated, the nested call to dp_netdev_input__() could potentially
+     * classify the packet as matching another flow - say 'k'. It could happen
+     * that in the previous call to dp_netdev_input__() that same flow 'k' had
+     * already its own batches[k] still waiting to be served.  So if its
+     * ‘batch’ member is not reset, the recirculated packet would be wrongly
+     * appended to batches[k] of the 1st call to dp_netdev_input__(). */
     for (i = 0; i < n_batches; i++) {
         batches[i].flow->batch = NULL;
     }