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:34:01 +0000 (10:34 -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 6aff94c..55127f7 100644 (file)
@@ -1235,8 +1235,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'. */
@@ -1287,14 +1286,13 @@ 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)) {
-            schedule_packet_in(ofconn, *pin, flow);
+            schedule_packet_in(ofconn, *pin);
         }
     }
 }
@@ -1309,12 +1307,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;
 
@@ -1327,7 +1323,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. */
@@ -1345,7 +1341,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 5f9ac70..48a4c12 100644 (file)
@@ -128,8 +128,8 @@ void connmgr_send_port_status(struct connmgr *, const struct ofp_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 066277d..705ad4d 100644 (file)
@@ -2474,7 +2474,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
@@ -4526,7 +4526,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);
 }