* New action "check_pkt_len".
* Port configuration with "other-config:priority-tags" now has a mode
that retains the 802.1Q header even if VLAN and priority are both zero.
+ * 'ovs-appctl exit' now implies cleanup of non-internal ports in userspace
+ datapath regardless of '--cleanup' option. Use '--cleanup' to remove
+ internal ports too.
- OVSDB:
* OVSDB clients can now resynchronize with clustered servers much more
quickly after a brief disconnection, saving bandwidth and CPU time.
const struct dpif_class dpif_netdev_class = {
"netdev",
+ true, /* cleanup_required */
dpif_netdev_init,
dpif_netdev_enumerate,
dpif_netdev_port_open_type,
\f
const struct dpif_class dpif_netlink_class = {
"system",
+ false, /* cleanup_required */
NULL, /* init */
dpif_netlink_enumerate,
NULL,
* the type assumed if no type is specified when opening a dpif. */
const char *type;
+ /* If 'true', datapath ports should be destroyed on ofproto destruction.
+ *
+ * This is used by the vswitch at exit, so that it can clean any
+ * datapaths that can not exist without it (e.g. netdev datapath). */
+ bool cleanup_required;
+
/* Called when the dpif provider is registered, typically at program
* startup. Returning an error from this function will prevent any
* datapath with this class from being created.
return dpif->dpif_class->type;
}
+/* Checks if datapath 'dpif' requires cleanup. */
+bool
+dpif_cleanup_required(const struct dpif *dpif)
+{
+ return dpif->dpif_class->cleanup_required;
+}
+
/* Returns the fully spelled out name for the given datapath 'type'.
*
* Normalized type string can be compared with strcmp(). Unnormalized type
const char *dpif_base_name(const struct dpif *);
const char *dpif_type(const struct dpif *);
+bool dpif_cleanup_required(const struct dpif *);
+
int dpif_delete(struct dpif *);
/* Statistics for a dpif as a whole. */
struct ofport_dpif *port = ofport_dpif_cast(port_);
struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto);
const char *devname = netdev_get_name(port->up.netdev);
+ const char *netdev_type = netdev_get_type(port->up.netdev);
char namebuf[NETDEV_VPORT_NAME_BUFSIZE];
const char *dp_port_name;
xlate_ofport_remove(port);
xlate_txn_commit();
+ if (!del && strcmp(netdev_type,
+ ofproto_port_open_type(port->up.ofproto, "internal"))) {
+ /* Check if datapath requires removal of attached ports. Avoid
+ * removal of 'internal' ports to preserve user ip/route settings. */
+ del = dpif_cleanup_required(ofproto->backer->dpif);
+ }
+
dp_port_name = netdev_vport_get_dpif_port(port->up.netdev, namebuf,
sizeof namebuf);
if (del && dpif_port_exists(ofproto->backer->dpif, dp_port_name)) {
Causes \fBovs\-vswitchd\fR to gracefully terminate. If \fI--cleanup\fR
is specified, release datapath resources configured by \fBovs\-vswitchd\fR.
Otherwise, datapath flows and other resources remains undeleted.
+Resources of datapaths that are integrated into \fBovs\-vswitchd\fR (e.g.
+the \fBnetdev\fR datapath type) are always released regardless of
+\fI--cleanup\fR except for ports with \fBinternal\fR type. Use \fI--cleanup\fR
+to release \fBinternal\fR ports too.
.
.IP "\fBqos/show-types\fR \fIinterface\fR"
Queries the interface for a list of Quality of Service types that are