From 4550b6475456b7b2e44ab464434f03aacdb9f33d Mon Sep 17 00:00:00 2001 From: Mehak Mahajan Date: Tue, 26 Jun 2012 12:30:26 -0700 Subject: [PATCH] Setting miss_send_len on receiving NXT_SET_ASYNC_CONFIG message. For the service controllers to receive any asynchronous messages, the miss_send_len must be set to a non-zero value (refer to DESIGN). On receiving the NXT_SET_ASYNC_CONFIG message, the miss_send_len is set to the default value unless it is set to a non-zero value earlier by the OFPT_SET_CONFIG message. Signed-off-by: Mehak Mahajan --- DESIGN | 10 ++++++++-- include/openflow/nicira-ext.h | 3 +++ ofproto/ofproto.c | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/DESIGN b/DESIGN index f9345d16e..a3a62b2ee 100644 --- a/DESIGN +++ b/DESIGN @@ -17,8 +17,14 @@ given controller receives OpenFlow asynchronous messages. This section describes how all of these features interact. First, a service controller never receives any asynchronous messages -unless it explicitly configures a miss_send_len greater than zero with -an OFPT_SET_CONFIG message. +unless it changes its miss_send_len from the service controller +default of zero in one of the following ways: + + - Sending an OFPT_SET_CONFIG message with nonzero miss_send_len. + + - Sending any NXT_SET_ASYNC_CONFIG message: as a side effect, this + message changes the miss_send_len to + OFP_DEFAULT_MISS_SEND_LEN (128) for service controllers. Second, OFPT_FLOW_REMOVED and NXT_FLOW_REMOVED messages are generated only if the flow that was removed had the OFPFF_SEND_FLOW_REM flag diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 2f46311f0..72cbb24b2 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -305,6 +305,9 @@ enum nx_role { * with value 1<<2 == 4 in port_status_mask[1] determines whether the * controller will receive OFPT_PORT_STATUS messages with reason OFPPR_MODIFY * (value 2) when the controller has a "slave" role. + * + * As a side effect, for service controllers, this message changes the + * miss_send_len from default of zero to OFP_DEFAULT_MISS_SEND_LEN (128). */ struct nx_async_config { struct nicira_header nxh; diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 38430abf1..1a2f71257 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -3315,6 +3315,10 @@ handle_nxt_set_async_config(struct ofconn *ofconn, const struct ofp_header *oh) slave[OAM_FLOW_REMOVED] = ntohl(msg->flow_removed_mask[1]); ofconn_set_async_config(ofconn, master, slave); + if (ofconn_get_type(ofconn) == OFCONN_SERVICE && + !ofconn_get_miss_send_len(ofconn)) { + ofconn_set_miss_send_len(ofconn, OFP_DEFAULT_MISS_SEND_LEN); + } return 0; } -- 2.43.0