diff mbox series

[ovs-dev,v2,1/2] ofproto-dpif-upcall: Add debug commands to pause/resume revalidators.

Message ID 20220913190852.383513-2-i.maximets@ovn.org
State Accepted
Commit 647551935957ae8a44bc5b397c1ad5144d8e3233
Headers show
Series bond: Avoid deadlock while updating post recirculation rules. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Ilya Maximets Sept. 13, 2022, 7:08 p.m. UTC
New commands 'revalidator/pause' and 'revalidator/resume'.
Not documented, since these should not be used in production
environments.

Will be used for unit tests in the next commit.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 ofproto/ofproto-dpif-upcall.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Mike Pattrick Sept. 16, 2022, 4:21 a.m. UTC | #1
On Tue, Sep 13, 2022 at 3:09 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> New commands 'revalidator/pause' and 'revalidator/resume'.
> Not documented, since these should not be used in production
> environments.
>
> Will be used for unit tests in the next commit.
>
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Acked-by: Mike Pattrick <mkp@redhat.com>
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 57f94df54..fe4709058 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -362,6 +362,10 @@  static void upcall_unixctl_dump_wait(struct unixctl_conn *conn, int argc,
                                      const char *argv[], void *aux);
 static void upcall_unixctl_purge(struct unixctl_conn *conn, int argc,
                                  const char *argv[], void *aux);
+static void upcall_unixctl_pause(struct unixctl_conn *conn, int argc,
+                                 const char *argv[], void *aux);
+static void upcall_unixctl_resume(struct unixctl_conn *conn, int argc,
+                                  const char *argv[], void *aux);
 
 static struct udpif_key *ukey_create_from_upcall(struct upcall *,
                                                  struct flow_wildcards *);
@@ -434,6 +438,10 @@  udpif_init(void)
                                  upcall_unixctl_dump_wait, NULL);
         unixctl_command_register("revalidator/purge", "", 0, 0,
                                  upcall_unixctl_purge, NULL);
+        unixctl_command_register("revalidator/pause", NULL, 0, 0,
+                                 upcall_unixctl_pause, NULL);
+        unixctl_command_register("revalidator/resume", NULL, 0, 0,
+                                 upcall_unixctl_resume, NULL);
         ovsthread_once_done(&once);
     }
 }
@@ -3099,6 +3107,31 @@  upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED,
     unixctl_command_reply(conn, "");
 }
 
+static void
+upcall_unixctl_pause(struct unixctl_conn *conn, int argc OVS_UNUSED,
+                     const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+{
+    struct udpif *udpif;
+
+    LIST_FOR_EACH (udpif, list_node, &all_udpifs) {
+        udpif_pause_revalidators(udpif);
+    }
+    unixctl_command_reply(conn, "");
+}
+
+static void
+upcall_unixctl_resume(struct unixctl_conn *conn, int argc OVS_UNUSED,
+                      const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+{
+    struct udpif *udpif;
+
+    LIST_FOR_EACH (udpif, list_node, &all_udpifs) {
+        udpif_resume_revalidators(udpif);
+    }
+    unixctl_command_reply(conn, "");
+}
+
+
 /* Flows are sorted in the following order:
  * netdev, flow state (offloaded/kernel path), flow_pps_rate.
  */