Simplify code by using rconn_send_with_limit() helper function.
authorBen Pfaff <blp@nicira.com>
Thu, 4 Sep 2008 16:48:27 +0000 (09:48 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 4 Sep 2008 16:48:27 +0000 (09:48 -0700)
switch/datapath.c

index 7382d4c6d87fcb45ddf545bab9e141d68c5c1d87..953a30ba4433eb3a85e03595d591750ab33ca75f 100644 (file)
@@ -609,13 +609,10 @@ send_openflow_buffer(struct datapath *dp, struct buffer *buffer,
     int retval;
 
     update_openflow_length(buffer);
-    retval = (remote->n_txq < TXQ_LIMIT
-              ? rconn_send(rconn, buffer, &remote->n_txq)
-              : EAGAIN);
+    retval = rconn_send_with_limit(rconn, buffer, &remote->n_txq, TXQ_LIMIT);
     if (retval) {
         VLOG_WARN_RL(&rl, "send to %s failed: %s",
                      rconn_get_name(rconn), strerror(retval));
-        buffer_delete(buffer);
     }
     return retval;
 }