2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

vswitchd: Add serial number configuration.

Signed-off-by: Kirill A. Kornilov <kornilov@zelax.ru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Kirill A. Kornilov 2020-01-13 12:29:10 +03:00 committed by Ben Pfaff
parent eb540c0f5f
commit 8e371aa497
5 changed files with 32 additions and 0 deletions

3
NEWS
View File

@ -1,6 +1,9 @@
Post-v2.13.0
---------------------
- ovs-vswitchd no longer deletes datapath flows on exit by default.
- OpenFlow:
* The OpenFlow ofp_desc/serial_num may now be configured by setting the
value of other-config:dp-sn in the Bridge table.
v2.13.0 - xx xxx xxxx

View File

@ -815,6 +815,13 @@ ofproto_set_dp_desc(struct ofproto *p, const char *dp_desc)
p->dp_desc = nullable_xstrdup(dp_desc);
}
void
ofproto_set_serial_desc(struct ofproto *p, const char *serial_desc)
{
free(p->serial_desc);
p->serial_desc = nullable_xstrdup(serial_desc);
}
int
ofproto_set_snoops(struct ofproto *ofproto, const struct sset *snoops)
{

View File

@ -351,6 +351,7 @@ void ofproto_set_threads(int n_handlers, int n_revalidators);
void ofproto_type_set_config(const char *type,
const struct smap *other_config);
void ofproto_set_dp_desc(struct ofproto *, const char *dp_desc);
void ofproto_set_serial_desc(struct ofproto *p, const char *serial_desc);
int ofproto_set_snoops(struct ofproto *, const struct sset *snoops);
int ofproto_set_netflow(struct ofproto *,
const struct netflow_options *nf_options);

View File

@ -288,6 +288,7 @@ static void bridge_configure_ipfix(struct bridge *);
static void bridge_configure_spanning_tree(struct bridge *);
static void bridge_configure_tables(struct bridge *);
static void bridge_configure_dp_desc(struct bridge *);
static void bridge_configure_serial_desc(struct bridge *);
static void bridge_configure_aa(struct bridge *);
static void bridge_aa_refresh_queued(struct bridge *);
static bool bridge_aa_need_refresh(struct bridge *);
@ -939,6 +940,7 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
bridge_configure_spanning_tree(br);
bridge_configure_tables(br);
bridge_configure_dp_desc(br);
bridge_configure_serial_desc(br);
bridge_configure_aa(br);
}
free(managers);
@ -4123,6 +4125,13 @@ bridge_configure_dp_desc(struct bridge *br)
smap_get(&br->cfg->other_config, "dp-desc"));
}
static void
bridge_configure_serial_desc(struct bridge *br)
{
ofproto_set_serial_desc(br->ofproto,
smap_get(&br->cfg->other_config, "dp-sn"));
}
static struct aa_mapping *
bridge_aa_mapping_find(struct bridge *br, const int64_t isid)
{

View File

@ -1261,6 +1261,18 @@
Human readable description of datapath. It is a maximum 256
byte-long free-form string to describe the datapath for
debugging purposes, e.g. <code>switch3 in room 3120</code>.
The value is returned by the switch as a part of reply to OFPMP_DESC
request (ofp_desc). The OpenFlow specification (e.g. 1.3.5) describes
the ofp_desc structure to contaion "NULL terminated ASCII strings".
For the compatibility reasons no more than 255 ASCII characters should be used.
</column>
<column name="other_config" key="dp-sn">
Serial number. It is a maximum 32 byte-long free-form string to
provide an additional switch identification. The value is returned
by the switch as a part of reply to OFPMP_DESC request (ofp_desc).
Same as mentioned in the description of <ref column="other-config" key="dp-desc"/>,
the string should be no more than 31 ASCII characters for the compatibility.
</column>
<column name="other_config" key="disable-in-band"