diff mbox series

[ovs-dev,v4,2/4] dpctl: Update docs about dump-flows and HWoffloading.

Message ID 20190515153601.31636-3-i.maximets@samsung.com
State Accepted
Headers show
Series netdev: Dynamic per-port Flow API +Offload Split Up. | expand

Commit Message

Ilya Maximets May 15, 2019, 3:35 p.m. UTC
Since introduction of dynamic flow API for netdevs, tricky
accesses to uninitialized flow API are no longer possible.
So, ovs-dpctl doesn't support dumping HW offloaded flows now.
Claim this in docs and man pages. Additionally forbidden
'type' argument for 'ovs-dpctl dump-flows'.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 Documentation/faq/design.rst | 5 ++++-
 lib/dpctl.c                  | 7 +++++++
 lib/dpctl.man                | 2 ++
 vswitchd/vswitch.xml         | 5 +++++
 4 files changed, 18 insertions(+), 1 deletion(-)

Comments

Roi Dayan May 21, 2019, 4:48 p.m. UTC | #1
On 15/05/2019 18:35, Ilya Maximets wrote:
> Since introduction of dynamic flow API for netdevs, tricky
> accesses to uninitialized flow API are no longer possible.
> So, ovs-dpctl doesn't support dumping HW offloaded flows now.
> Claim this in docs and man pages. Additionally forbidden
> 'type' argument for 'ovs-dpctl dump-flows'.
> 
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---
>  Documentation/faq/design.rst | 5 ++++-
>  lib/dpctl.c                  | 7 +++++++
>  lib/dpctl.man                | 2 ++
>  vswitchd/vswitch.xml         | 5 +++++
>  4 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/faq/design.rst b/Documentation/faq/design.rst
> index 4732cb1dd..efb62a2f7 100644
> --- a/Documentation/faq/design.rst
> +++ b/Documentation/faq/design.rst
> @@ -73,10 +73,13 @@ Q: Why are there so many different ways to dump flows?
>        Linux kernel-based datapath.  In Open vSwitch 1.10 and later,
>        ovs-vswitchd merges multiple switches into a single datapath, so it will
>        show all the flows on all your kernel-based switches.  This command can
> -      occasionally be useful for debugging.
> +      occasionally be useful for debugging.  It doesn't dump flows that was
> +      offloaded to hardware.
>  
>      - ``ovs-appctl dpif/dump-flows <br>``, new in Open vSwitch 1.10, dumps
>        datapath flows for only the specified bridge, regardless of the type.
> +      Supports dumping of HW offloaded flows.  See ovs-vswitchd(8) for
> +      details.
>  
>  Q: How does multicast snooping works with VLANs?
>  
> diff --git a/lib/dpctl.c b/lib/dpctl.c
> index 9c4eb65d9..f9eb1cad3 100644
> --- a/lib/dpctl.c
> +++ b/lib/dpctl.c
> @@ -963,6 +963,13 @@ dpctl_dump_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p)
>          if (!strncmp(argv[argc - 1], "filter=", 7) && !filter) {
>              filter = xstrdup(argv[--argc] + 7);
>          } else if (!strncmp(argv[argc - 1], "type=", 5) && !types_list) {
> +            if (!dpctl_p->is_appctl) {
> +                dpctl_error(dpctl_p, 0,
> +                            "Invalid argument 'type'. "
> +                            "Use 'ovs-appctl dpctl/dump-flows' instead.");
> +                error = EINVAL;
> +                goto out_free;
> +            }
>              types_list = xstrdup(argv[--argc] + 5);
>          }
>      }
> diff --git a/lib/dpctl.man b/lib/dpctl.man
> index 1ff351170..1eeef38a7 100644
> --- a/lib/dpctl.man
> +++ b/lib/dpctl.man
> @@ -119,6 +119,7 @@ flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the
>  datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'.
>  .IP
>  If \fBtype=\fItype\fR is specified, only displays flows of the specified types.
> +This option supported only for \fBovs\-appctl dpctl/dump\-flows\fR.
>  \fItype\fR is a comma separated list, which can contain any of the following:
>  .
>     \fBovs\fR - displays flows handled in the ovs dp
> @@ -128,6 +129,7 @@ If \fBtype=\fItype\fR is specified, only displays flows of the specified types.
>     \fBall\fR - displays all the types of flows
>  .IP
>  By default all the types of flows are displayed.
> +\fBovs\-dpctl\fR always acts as if the \fBtype\fR was \fIovs\fR.
>  .
>  .IP "\*(DX\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR"
>  .TP
> diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
> index 08001dbce..672b3c3ad 100644
> --- a/vswitchd/vswitch.xml
> +++ b/vswitchd/vswitch.xml
> @@ -208,6 +208,11 @@
>            available, Open vSwitch may not be able to offload
>            functionality to hardware.
>          </p>
> +        <p>
> +          In order to dump HW offloaded flows use
> +          <code>ovs-appctl dpctl/dump-flows</code>, <code>ovs-dpctl</code>
> +          doesn't support this functionality. See ovs-vswitchd(8) for details.
> +        </p>
>        </column>
>  
>        <column name="other_config" key="tc-policy"
> 

Acked-by: Roi Dayan <roid@mellanox.com>
diff mbox series

Patch

diff --git a/Documentation/faq/design.rst b/Documentation/faq/design.rst
index 4732cb1dd..efb62a2f7 100644
--- a/Documentation/faq/design.rst
+++ b/Documentation/faq/design.rst
@@ -73,10 +73,13 @@  Q: Why are there so many different ways to dump flows?
       Linux kernel-based datapath.  In Open vSwitch 1.10 and later,
       ovs-vswitchd merges multiple switches into a single datapath, so it will
       show all the flows on all your kernel-based switches.  This command can
-      occasionally be useful for debugging.
+      occasionally be useful for debugging.  It doesn't dump flows that was
+      offloaded to hardware.
 
     - ``ovs-appctl dpif/dump-flows <br>``, new in Open vSwitch 1.10, dumps
       datapath flows for only the specified bridge, regardless of the type.
+      Supports dumping of HW offloaded flows.  See ovs-vswitchd(8) for
+      details.
 
 Q: How does multicast snooping works with VLANs?
 
diff --git a/lib/dpctl.c b/lib/dpctl.c
index 9c4eb65d9..f9eb1cad3 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -963,6 +963,13 @@  dpctl_dump_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p)
         if (!strncmp(argv[argc - 1], "filter=", 7) && !filter) {
             filter = xstrdup(argv[--argc] + 7);
         } else if (!strncmp(argv[argc - 1], "type=", 5) && !types_list) {
+            if (!dpctl_p->is_appctl) {
+                dpctl_error(dpctl_p, 0,
+                            "Invalid argument 'type'. "
+                            "Use 'ovs-appctl dpctl/dump-flows' instead.");
+                error = EINVAL;
+                goto out_free;
+            }
             types_list = xstrdup(argv[--argc] + 5);
         }
     }
diff --git a/lib/dpctl.man b/lib/dpctl.man
index 1ff351170..1eeef38a7 100644
--- a/lib/dpctl.man
+++ b/lib/dpctl.man
@@ -119,6 +119,7 @@  flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the
 datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'.
 .IP
 If \fBtype=\fItype\fR is specified, only displays flows of the specified types.
+This option supported only for \fBovs\-appctl dpctl/dump\-flows\fR.
 \fItype\fR is a comma separated list, which can contain any of the following:
 .
    \fBovs\fR - displays flows handled in the ovs dp
@@ -128,6 +129,7 @@  If \fBtype=\fItype\fR is specified, only displays flows of the specified types.
    \fBall\fR - displays all the types of flows
 .IP
 By default all the types of flows are displayed.
+\fBovs\-dpctl\fR always acts as if the \fBtype\fR was \fIovs\fR.
 .
 .IP "\*(DX\fBadd\-flow\fR [\fIdp\fR] \fIflow actions\fR"
 .TP
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 08001dbce..672b3c3ad 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -208,6 +208,11 @@ 
           available, Open vSwitch may not be able to offload
           functionality to hardware.
         </p>
+        <p>
+          In order to dump HW offloaded flows use
+          <code>ovs-appctl dpctl/dump-flows</code>, <code>ovs-dpctl</code>
+          doesn't support this functionality. See ovs-vswitchd(8) for details.
+        </p>
       </column>
 
       <column name="other_config" key="tc-policy"