From 8b6ff72912871a8101a8427be1c38941326332ad Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 26 Dec 2012 15:00:06 -0800 Subject: ovs-vswitch: Make OpenFlow "dp_desc" configurable. Signed-off-by: Felician Nemeth [blp@nicira.com refactored the code that this was based on and revised the patch accordingly] Signed-off-by: Ben Pfaff --- NEWS | 2 ++ ofproto/ofproto.c | 7 +++++++ ofproto/ofproto.h | 1 + vswitchd/bridge.c | 9 +++++++++ vswitchd/vswitch.xml | 6 ++++++ 5 files changed, 25 insertions(+) diff --git a/NEWS b/NEWS index 6afc41755..2f8fbde7e 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ post-v1.9.0 http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-02). - New "vlog/disable-rate-limit" and "vlog/enable-rate-limit" commands available through ovs-appctl allow control over logging rate limits. + - The OpenFlow "dp_desc" may now be configured by setting the value of + other-config:dp-desc in the Bridge table. v1.9.0 - xx xxx xxxx diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 939ad2020..d8f696d9e 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -597,6 +597,13 @@ ofproto_set_mac_table_config(struct ofproto *ofproto, unsigned idle_time, } } +void +ofproto_set_dp_desc(struct ofproto *p, const char *dp_desc) +{ + free(p->dp_desc); + p->dp_desc = dp_desc ? xstrdup(dp_desc) : NULL; +} + int ofproto_set_snoops(struct ofproto *ofproto, const struct sset *snoops) { diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index cedb2cdf0..413472af6 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -225,6 +225,7 @@ void ofproto_set_flow_eviction_threshold(struct ofproto *, unsigned threshold); void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu); void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time, size_t max_entries); +void ofproto_set_dp_desc(struct ofproto *, const char *dp_desc); int ofproto_set_snoops(struct ofproto *, const struct sset *snoops); int ofproto_set_netflow(struct ofproto *, const struct netflow_options *nf_options); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index d23caf254..e58c3c4b8 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -186,6 +186,7 @@ static void bridge_configure_mac_table(struct bridge *); static void bridge_configure_sflow(struct bridge *, int *sflow_bridge_number); static void bridge_configure_stp(struct bridge *); static void bridge_configure_tables(struct bridge *); +static void bridge_configure_dp_desc(struct bridge *); static void bridge_configure_remotes(struct bridge *, const struct sockaddr_in *managers, size_t n_managers); @@ -597,6 +598,7 @@ bridge_reconfigure_continue(const struct ovsrec_open_vswitch *ovs_cfg) bridge_configure_sflow(br, &sflow_bridge_number); bridge_configure_stp(br); bridge_configure_tables(br); + bridge_configure_dp_desc(br); } free(managers); @@ -2901,6 +2903,13 @@ bridge_configure_tables(struct bridge *br) br->cfg->key_flow_tables[j]); } } + +static void +bridge_configure_dp_desc(struct bridge *br) +{ + ofproto_set_dp_desc(br->ofproto, + smap_get(&br->cfg->other_config, "dp-desc")); +} /* Port functions. */ diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index c78899f7e..64ad6c72e 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -439,6 +439,12 @@ value. May not be all-zero. + + Human readable description of datapath. It it a maximum 256 + byte-long free-form string to describe the datapath for + debugging purposes, e.g. switch3 in room 3120. + + If set to true, disable in-band control on the bridge -- cgit v1.2.1