[ovs-dev,1/2] conntrack: Use DP_PACKET_BATCH_FOR_EACH macro.

Message ID 1505240705-28120-1-git-send-email-bhanuprakash.bodireddy@intel.com
State Superseded
Delegated to: Darrell Ball
Headers show
Series
  • [ovs-dev,1/2] conntrack: Use DP_PACKET_BATCH_FOR_EACH macro.
Related show

Commit Message

Bodireddy, Bhanuprakash Sept. 12, 2017, 6:25 p.m.
Use DP_PACKET_BATCH_FOR_EACH macro in conntrack_execute(). No change in
functionality.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
---
 lib/conntrack.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index 419cb1d..019092e 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1141,17 +1141,16 @@  conntrack_execute(struct conntrack *ct, struct dp_packet_batch *pkt_batch,
                   long long now)
 {
 
-    struct dp_packet **pkts = pkt_batch->packets;
-    size_t cnt = pkt_batch->count;
+    struct dp_packet *packet;
     struct conn_lookup_ctx ctx;
 
-    for (size_t i = 0; i < cnt; i++) {
-        if (!conn_key_extract(ct, pkts[i], dl_type, &ctx, zone)) {
-            pkts[i]->md.ct_state = CS_INVALID;
-            write_ct_md(pkts[i], zone, NULL, NULL, NULL);
+    DP_PACKET_BATCH_FOR_EACH (packet, pkt_batch) {
+        if (!conn_key_extract(ct, packet, dl_type, &ctx, zone)) {
+            packet->md.ct_state = CS_INVALID;
+            write_ct_md(packet, zone, NULL, NULL, NULL);
             continue;
         }
-        process_one(ct, pkts[i], &ctx, zone, force, commit,
+        process_one(ct, packet, &ctx, zone, force, commit,
                     now, setmark, setlabel, nat_action_info, helper);
     }