#include "openvswitch/dynamic-string.h"
#include "openvswitch/ofp-actions.h"
#include "openvswitch/ofp-msgs.h"
-#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofp-monitor.h"
#include "openvswitch/ofpbuf.h"
#include "openvswitch/vconn.h"
#include "openvswitch/vlog.h"
#include "ovs-atomic.h"
#include "pinsched.h"
-#include "poll-loop.h"
-#include "rconn.h"
+#include "openvswitch/poll-loop.h"
+#include "openvswitch/rconn.h"
#include "openvswitch/shash.h"
#include "simap.h"
#include "stream.h"
if (!mgr->in_band) {
in_band_create(mgr->ofproto, mgr->local_port_name, &mgr->in_band);
}
- in_band_set_queue(mgr->in_band, mgr->in_band_queue);
} else {
/* in_band_run() needs a chance to delete any existing in-band flows.
* We will destroy mgr->in_band after it's done with that. */
}
if (mgr->in_band) {
+ in_band_set_queue(mgr->in_band, mgr->in_band_queue);
in_band_set_remotes(mgr->in_band, addrs, n_addrs);
}
}
}
-/* Sends 'error' on 'ofconn', as a reply to 'request'. Only at most the
- * first 64 bytes of 'request' are used. */
+/* Sends 'error' on 'ofconn', as a reply to 'request'. */
void
ofconn_send_error(const struct ofconn *ofconn,
const struct ofp_header *request, enum ofperr error)
return NULL;
}
-enum ofperr
+void
ofconn_insert_bundle(struct ofconn *ofconn, struct ofp_bundle *bundle)
{
hmap_insert(&ofconn->bundles, &bundle->node, bundle_hash(bundle->id));
-
- return 0;
}
-enum ofperr
+void
ofconn_remove_bundle(struct ofconn *ofconn, struct ofp_bundle *bundle)
{
hmap_remove(&ofconn->bundles, &bundle->node);
-
- return 0;
}
static void
HMAP_FOR_EACH_SAFE (b, next, node, &ofconn->bundles) {
if (b->used <= limit) {
- ofconn_send_error(ofconn, &b->ofp_msg, OFPERR_OFPBFC_TIMEOUT);
+ ofconn_send_error(ofconn, b->msg, OFPERR_OFPBFC_TIMEOUT);
ofp_bundle_remove__(ofconn, b);
}
}
if (protocol == OFPUTIL_P_NONE || !rconn_is_connected(ofconn->rconn)
|| ofconn->controller_id != am->controller_id
|| !ofconn_receives_async_msg(ofconn, am->oam,
- am->pin.up.public.reason)) {
+ am->pin.up.base.reason)) {
continue;
}
&am->pin.up, protocol, ofconn->packet_in_format);
struct ovs_list txq;
- bool is_miss = (am->pin.up.public.reason == OFPR_NO_MATCH ||
- am->pin.up.public.reason == OFPR_EXPLICIT_MISS ||
- am->pin.up.public.reason == OFPR_IMPLICIT_MISS);
+ bool is_miss = (am->pin.up.base.reason == OFPR_NO_MATCH ||
+ am->pin.up.base.reason == OFPR_EXPLICIT_MISS ||
+ am->pin.up.base.reason == OFPR_IMPLICIT_MISS);
pinsched_send(ofconn->schedulers[is_miss],
- am->pin.up.public.flow_metadata.flow.in_port.ofp_port,
+ am->pin.up.base.flow_metadata.flow.in_port.ofp_port,
msg, &txq);
do_send_packet_ins(ofconn, &txq);
}
LIST_FOR_EACH_POP (pin, list_node, txq) {
if (rconn_send_with_limit(ofconn->rconn, pin,
ofconn->packet_in_counter, 100) == EAGAIN) {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(5, 5);
- VLOG_INFO_RL(&rl, "%s: dropping packet-in due to queue overflow",
+ VLOG_INFO_RL(&rll, "%s: dropping packet-in due to queue overflow",
rconn_get_name(ofconn->rconn));
}
}
struct ofconn *ofconn;
LIST_FOR_EACH (ofconn, node, &mgr->all_conns) {
- struct ofpbuf *msg;
+ struct rconn_packet_counter *counter = ofconn->monitor_counter;
+ struct ofpbuf *msg;
LIST_FOR_EACH_POP (msg, list_node, &ofconn->updates) {
- unsigned int n_bytes;
-
- ofconn_send(ofconn, msg, ofconn->monitor_counter);
- n_bytes = rconn_packet_counter_n_bytes(ofconn->monitor_counter);
- if (!ofconn->monitor_paused && n_bytes > 128 * 1024) {
- struct ofpbuf *pause;
-
- COVERAGE_INC(ofmonitor_pause);
- ofconn->monitor_paused = monitor_seqno++;
- pause = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_PAUSED,
- OFP10_VERSION, htonl(0), 0);
- ofconn_send(ofconn, pause, ofconn->monitor_counter);
- }
+ ofconn_send(ofconn, msg, counter);
+ }
+
+ if (!ofconn->monitor_paused
+ && rconn_packet_counter_n_bytes(counter) > 128 * 1024) {
+ struct ofpbuf *pause;
+
+ COVERAGE_INC(ofmonitor_pause);
+ ofconn->monitor_paused = monitor_seqno++;
+ pause = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_PAUSED,
+ OFP10_VERSION, htonl(0), 0);
+ ofconn_send(ofconn, pause, counter);
}
}
}
void
ofproto_async_msg_free(struct ofproto_async_msg *am)
{
- free(am->pin.up.public.packet);
- free(am->pin.up.public.userdata);
+ free(am->pin.up.base.packet);
+ free(am->pin.up.base.userdata);
free(am->pin.up.stack);
free(am->pin.up.actions);
free(am->pin.up.action_set);