On Tue, Feb 25, 2014 at 03:25:35PM -0800, Ben Pfaff wrote:
> On Tue, Feb 11, 2014 at 01:55:34PM -0800, Joe Stringer wrote:
> > This splits out functions for re-use by later patches, and compacts the
> > udump revalidation code.
> > 
> > Co-authored-by: Ethan Jackson <et...@nicira.com>
> > Signed-off-by: Joe Stringer <joestrin...@nicira.com>
> 
> I have this queued up to apply, thanks!

It looks like we can avoid more code duplication in the following
patch by folding in the following.  I'm tentatively doing that.

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index b576729..1bced67 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1414,8 +1414,15 @@ dump_op_init(struct dump_op *op, const struct nlattr 
*key, size_t key_len,
 static void
 push_dump_ops(struct udpif *udpif, struct dump_op *ops, size_t n_ops)
 {
+    struct dpif_op *opsp[REVALIDATE_MAX_BATCH];
     size_t i;
 
+    ovs_assert(n_ops <= REVALIDATE_MAX_BATCH);
+    for (i = 0; i < n_ops; i++) {
+        opsp[i] = &ops[i].op;
+    }
+    dpif_operate(udpif->dpif, opsp, n_ops);
+
     for (i = 0; i < n_ops; i++) {
         struct dump_op *op = &ops[i];
         struct dpif_flow_stats *push, *stats, push_buf;
@@ -1464,7 +1471,6 @@ revalidate_udumps(struct revalidator *revalidator, struct 
list *udumps)
     struct udpif *udpif = revalidator->udpif;
 
     struct dump_op ops[REVALIDATE_MAX_BATCH];
-    struct dpif_op *opsp[REVALIDATE_MAX_BATCH];
     struct udpif_flow_dump *udump, *next_udump;
     size_t n_ops, i, n_flows;
     unsigned int flow_limit;
@@ -1518,10 +1524,6 @@ revalidate_udumps(struct revalidator *revalidator, 
struct list *udumps)
         free(udump);
     }
 
-    for (i = 0; i < n_ops; i++) {
-        opsp[i] = &ops[i].op;
-    }
-    dpif_operate(udpif->dpif, opsp, n_ops);
     push_dump_ops(udpif, ops, n_ops);
     for (i = 0; i < n_ops; i++) {
         struct udpif_key *ukey = ops[i].ukey;
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to