+ p->tx_count++;
+}
+\f
+/* Unixctl. */
+
+static struct stp *
+stp_find(const char *name) OVS_REQUIRES(mutex)
+{
+ struct stp *stp;
+
+ LIST_FOR_EACH (stp, node, all_stps) {
+ if (!strcmp(stp->name, name)) {
+ return stp;
+ }
+ }
+ return NULL;
+}
+
+static void
+stp_unixctl_tcn(struct unixctl_conn *conn, int argc,
+ const char *argv[], void *aux OVS_UNUSED)
+{
+ ovs_mutex_lock(&mutex);
+ if (argc > 1) {
+ struct stp *stp = stp_find(argv[1]);
+
+ if (!stp) {
+ unixctl_command_reply_error(conn, "no such stp object");
+ goto out;
+ }
+ stp_topology_change_detection(stp);
+ } else {
+ struct stp *stp;
+
+ LIST_FOR_EACH (stp, node, all_stps) {
+ stp_topology_change_detection(stp);
+ }
+ }
+
+ unixctl_command_reply(conn, "OK");
+
+out:
+ ovs_mutex_unlock(&mutex);