connmgr: Drop 'flow' parameter from connmgr_send_packet_in().
authorBen Pfaff <blp@nicira.com>
Mon, 12 Mar 2012 21:09:37 +0000 (14:09 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 15 Mar 2012 17:23:03 +0000 (10:23 -0700)
Only 'flow->in_port' was used, which was redundant with pin->fmd.in_port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/connmgr.c
ofproto/connmgr.h
ofproto/ofproto-dpif.c

index 55b0306fd0b3a0d7c87e561aad87dda411603b91..43436221725aa542de240cb388d1935f1b676f77 100644 (file)
@@ -1230,8 +1230,7 @@ ofconn_send(const struct ofconn *ofconn, struct ofpbuf *msg,
 \f
 /* Sending asynchronous messages. */
 
-static void schedule_packet_in(struct ofconn *, struct ofputil_packet_in,
-                               const struct flow *);
+static void schedule_packet_in(struct ofconn *, struct ofputil_packet_in);
 
 /* Sends an OFPT_PORT_STATUS message with 'opp' and 'reason' to appropriate
  * controllers managed by 'mgr'. */
@@ -1282,15 +1281,14 @@ connmgr_send_flow_removed(struct connmgr *mgr,
  * necessary according to their individual configurations. */
 void
 connmgr_send_packet_in(struct connmgr *mgr,
-                       const struct ofputil_packet_in *pin,
-                       const struct flow *flow)
+                       const struct ofputil_packet_in *pin)
 {
     struct ofconn *ofconn;
 
     LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
         if (ofconn_receives_async_msg(ofconn, OAM_PACKET_IN, pin->reason)
             && ofconn->controller_id == pin->controller_id) {
-            schedule_packet_in(ofconn, *pin, flow);
+            schedule_packet_in(ofconn, *pin);
         }
     }
 }
@@ -1305,12 +1303,10 @@ do_send_packet_in(struct ofpbuf *ofp_packet_in, void *ofconn_)
                           ofconn->packet_in_counter, 100);
 }
 
-/* Takes 'pin', whose packet has the flow specified by 'flow', composes an
- * OpenFlow packet-in message from it, and passes it to 'ofconn''s packet
- * scheduler for sending. */
+/* Takes 'pin', composes an OpenFlow packet-in message from it, and passes it
+ * to 'ofconn''s packet scheduler for sending. */
 static void
-schedule_packet_in(struct ofconn *ofconn, struct ofputil_packet_in pin,
-                   const struct flow *flow)
+schedule_packet_in(struct ofconn *ofconn, struct ofputil_packet_in pin)
 {
     struct connmgr *mgr = ofconn->connmgr;
 
@@ -1323,7 +1319,7 @@ schedule_packet_in(struct ofconn *ofconn, struct ofputil_packet_in pin,
         pin.buffer_id = UINT32_MAX;
     } else {
         pin.buffer_id = pktbuf_save(ofconn->pktbuf, pin.packet, pin.packet_len,
-                                    flow->in_port);
+                                    pin.fmd.in_port);
     }
 
     /* Figure out how much of the packet to send. */
@@ -1341,7 +1337,7 @@ schedule_packet_in(struct ofconn *ofconn, struct ofputil_packet_in pin,
      * immediately call into do_send_packet_in() or it might buffer it for a
      * while (until a later call to pinsched_run()). */
     pinsched_send(ofconn->schedulers[pin.reason == OFPR_NO_MATCH ? 0 : 1],
-                  flow->in_port,
+                  pin.fmd.in_port,
                   ofputil_encode_packet_in(&pin, ofconn->packet_in_format),
                   do_send_packet_in, ofconn);
 }
index 2869ba7880cd6a477d36ef9e4426d17fee232140..6d404cf9b38d399832992b1045dd8a912043d8d1 100644 (file)
@@ -128,8 +128,8 @@ void connmgr_send_port_status(struct connmgr *,
                               const struct ofputil_phy_port *, uint8_t reason);
 void connmgr_send_flow_removed(struct connmgr *,
                                const struct ofputil_flow_removed *);
-void connmgr_send_packet_in(struct connmgr *, const struct ofputil_packet_in *,
-                            const struct flow *);
+void connmgr_send_packet_in(struct connmgr *,
+                            const struct ofputil_packet_in *);
 
 /* Fail-open settings. */
 enum ofproto_fail_mode connmgr_get_fail_mode(const struct connmgr *);
index ac14feefd447144c9738e23d499c81a9b779db83..d4c7fd877dc7b016a90e8ce29694ec0309b72c81 100644 (file)
@@ -2486,7 +2486,7 @@ send_packet_in_miss(struct ofproto_dpif *ofproto, const struct ofpbuf *packet,
     /* Registers aren't meaningful on a miss. */
     memset(pin.fmd.reg_masks, 0, sizeof pin.fmd.reg_masks);
 
-    connmgr_send_packet_in(ofproto->up.connmgr, &pin, flow);
+    connmgr_send_packet_in(ofproto->up.connmgr, &pin);
 }
 
 static bool
@@ -4540,7 +4540,7 @@ execute_controller_action(struct action_xlate_ctx *ctx, int len,
     pin.total_len = packet->size;
     flow_get_metadata(&ctx->flow, &pin.fmd);
 
-    connmgr_send_packet_in(ctx->ofproto->up.connmgr, &pin, &ctx->flow);
+    connmgr_send_packet_in(ctx->ofproto->up.connmgr, &pin);
     ofpbuf_delete(packet);
 }