From: Ben Pfaff Date: Mon, 12 Mar 2012 21:35:35 +0000 (-0700) Subject: ofproto: connmgr_send_packet_in() doesn't need buffer_id and total_len. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c7ae835ac2f4fe7b45b6761e9b1e8d4e5a95f39c;p=sliver-openvswitch.git ofproto: connmgr_send_packet_in() doesn't need buffer_id and total_len. Trying to add a new caller for connmgr_send_packet_in(), I wasn't sure what to put in these members. Investigating, I saw that the function didn't really need them, so this commit clears that up. Signed-off-by: Ben Pfaff --- diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 55127f749..395e6bbf6 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -1283,7 +1283,9 @@ connmgr_send_flow_removed(struct connmgr *mgr, } /* Given 'pin', sends an OFPT_PACKET_IN message to each OpenFlow controller as - * necessary according to their individual configurations. */ + * necessary according to their individual configurations. + * + * The caller doesn't need to fill in pin->buffer_id or pin->total_len. */ void connmgr_send_packet_in(struct connmgr *mgr, const struct ofputil_packet_in *pin) @@ -1314,6 +1316,8 @@ schedule_packet_in(struct ofconn *ofconn, struct ofputil_packet_in pin) { struct connmgr *mgr = ofconn->connmgr; + pin.total_len = pin.packet_len; + /* Get OpenFlow buffer_id. */ if (pin.reason == OFPR_ACTION) { pin.buffer_id = UINT32_MAX; diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 705ad4dfd..d6f31c958 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -2460,13 +2460,11 @@ send_packet_in_miss(struct ofproto_dpif *ofproto, const struct ofpbuf *packet, pin.packet = packet->data; pin.packet_len = packet->size; - pin.total_len = packet->size; pin.reason = OFPR_NO_MATCH; pin.table_id = 0; pin.cookie = 0; - pin.buffer_id = 0; /* not yet known */ pin.send_len = 0; /* not used for flow table misses */ flow_get_metadata(flow, &pin.fmd); @@ -4521,9 +4519,7 @@ execute_controller_action(struct action_xlate_ctx *ctx, int len, pin.table_id = ctx->table_id; pin.cookie = ctx->rule ? ctx->rule->up.flow_cookie : 0; - pin.buffer_id = 0; pin.send_len = len; - pin.total_len = packet->size; flow_get_metadata(&ctx->flow, &pin.fmd); connmgr_send_packet_in(ctx->ofproto->up.connmgr, &pin);