diff mbox

[ovs-dev] ofp-actions: Document that learn(limit=0) is no limit.

Message ID 20170428214521.28320-1-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer April 28, 2017, 9:45 p.m. UTC
Signed-off-by: Joe Stringer <joe@ovn.org>
---
 include/openvswitch/ofp-actions.h | 2 +-
 lib/ofp-actions.c                 | 3 ++-
 utilities/ovs-ofctl.8.in          | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Jarno Rajahalme April 29, 2017, 12:02 a.m. UTC | #1
A commit message would be nice.

Acked-by: Jarno Rajahalme <jarno@ovn.org>

> On Apr 28, 2017, at 2:45 PM, Joe Stringer <joe@ovn.org> wrote:
> 
> Signed-off-by: Joe Stringer <joe@ovn.org>
> ---
> include/openvswitch/ofp-actions.h | 2 +-
> lib/ofp-actions.c                 | 3 ++-
> utilities/ovs-ofctl.8.in          | 2 +-
> 3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h
> index e7529bfd61d2..324aac89289d 100644
> --- a/include/openvswitch/ofp-actions.h
> +++ b/include/openvswitch/ofp-actions.h
> @@ -762,7 +762,7 @@ struct ofpact_learn {
>         uint16_t fin_idle_timeout; /* Idle timeout after FIN, if nonzero. */
>         uint16_t fin_hard_timeout; /* Hard timeout after FIN, if nonzero. */
>         /* If the number of flows on 'table_id' with 'cookie' exceeds this,
> -         * the action will not add a new flow. */
> +         * the action will not add a new flow. 0 indicates unlimited. */
>         uint32_t limit;
>         /* Used only if 'flags' has NX_LEARN_F_WRITE_RESULT.  If the execution
>          * failed to install a new flow because 'limit' is exceeded,
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index be8cc20fdfd5..61e98601f117 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -4328,7 +4328,8 @@ OFP_ASSERT(sizeof(struct nx_action_learn) == 32);
> 
> struct nx_action_learn2 {
>     struct nx_action_learn up;  /* The wire format includes nx_action_learn. */
> -    ovs_be32 limit;             /* Maximum number of learned flows. */
> +    ovs_be32 limit;             /* Maximum number of learned flows.
> +                                 * 0 indicates unlimited. */
> 
>     /* Where to store the result. */
>     ovs_be16 result_dst_ofs;    /* Starting bit offset in destination. */
> diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in
> index 2e6679ebe98c..5525bc0bcbff 100644
> --- a/utilities/ovs-ofctl.8.in
> +++ b/utilities/ovs-ofctl.8.in
> @@ -1466,7 +1466,7 @@ This flag was added in Open vSwitch 2.4.
> .IP \fBlimit=\fInumber\fR
> If the number of flows in table \fBtable\fR with cookie id \fBcookie\fR exceeds
> \fInumber\fR, a new flow will not be learned by this action.  By default
> -there's no limit.
> +there's no limit. limit=0 is a long-hand for no limit.
> .
> .IP
> This flag was added in Open vSwitch 2.8.
> -- 
> 2.11.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Joe Stringer May 1, 2017, 5:05 p.m. UTC | #2
On 28 April 2017 at 17:02, Jarno Rajahalme <jarno@ovn.org> wrote:
> A commit message would be nice.
>
> Acked-by: Jarno Rajahalme <jarno@ovn.org>

Thanks, I wrote a commit message and applied to master.
diff mbox

Patch

diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h
index e7529bfd61d2..324aac89289d 100644
--- a/include/openvswitch/ofp-actions.h
+++ b/include/openvswitch/ofp-actions.h
@@ -762,7 +762,7 @@  struct ofpact_learn {
         uint16_t fin_idle_timeout; /* Idle timeout after FIN, if nonzero. */
         uint16_t fin_hard_timeout; /* Hard timeout after FIN, if nonzero. */
         /* If the number of flows on 'table_id' with 'cookie' exceeds this,
-         * the action will not add a new flow. */
+         * the action will not add a new flow. 0 indicates unlimited. */
         uint32_t limit;
         /* Used only if 'flags' has NX_LEARN_F_WRITE_RESULT.  If the execution
          * failed to install a new flow because 'limit' is exceeded,
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index be8cc20fdfd5..61e98601f117 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -4328,7 +4328,8 @@  OFP_ASSERT(sizeof(struct nx_action_learn) == 32);
 
 struct nx_action_learn2 {
     struct nx_action_learn up;  /* The wire format includes nx_action_learn. */
-    ovs_be32 limit;             /* Maximum number of learned flows. */
+    ovs_be32 limit;             /* Maximum number of learned flows.
+                                 * 0 indicates unlimited. */
 
     /* Where to store the result. */
     ovs_be16 result_dst_ofs;    /* Starting bit offset in destination. */
diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in
index 2e6679ebe98c..5525bc0bcbff 100644
--- a/utilities/ovs-ofctl.8.in
+++ b/utilities/ovs-ofctl.8.in
@@ -1466,7 +1466,7 @@  This flag was added in Open vSwitch 2.4.
 .IP \fBlimit=\fInumber\fR
 If the number of flows in table \fBtable\fR with cookie id \fBcookie\fR exceeds
 \fInumber\fR, a new flow will not be learned by this action.  By default
-there's no limit.
+there's no limit. limit=0 is a long-hand for no limit.
 .
 .IP
 This flag was added in Open vSwitch 2.8.