[ovs-dev] [PATCH] ovs-ofctl: Adding support for table ID.

Reid Price reid at nicira.com
Sat Jul 31 00:33:57 UTC 2010


On Fri, Jul 30, 2010 at 5:08 PM, Hao Zheng <hzheng at nicira.com> wrote:

> Now for add-flow, add-flows, mod-flows and del-flows commands of ovs-ofctl
> command, user can specify on which table these commands modify flows.  The
> is accomplished by adding "table=table_id" to your flow description.
> Note: currently Open vSwitch only supports up to 32 tables, so a valid
> table_id should be in the range of 0 to 31.  If "table=table_id" is not
> specified as part of the flow description, then these commands behave like
> before.
> ---
>  utilities/ovs-ofctl.8.in |   27 ++++++++++++--------
>  utilities/ovs-ofctl.c    |   59
> +++++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 72 insertions(+), 14 deletions(-)
>
> diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
> index ac8fdb7..29e3aa7 100644
> --- a/utilities/ovs-ofctl.c
> +++ b/utilities/ovs-ofctl.c
> @@ -830,6 +830,9 @@ str_to_flow(char *string, struct ofp_match *match,
> struct ofpbuf *actions,
>
>             if (table_idx && !strcmp(name, "table")) {
>                 *table_idx = atoi(value);
> +                if (*table_idx < 0 || *table_idx > 31) {
> +                    ovs_fatal(0, "table %s is invalid, must be between 0
> and 31", value);
> +                }
>             } else if (out_port && !strcmp(name, "out_port")) {
>                 *out_port = atoi(value);
>             } else if (priority && !strcmp(name, "priority")) {
> @@ -916,6 +919,21 @@ do_dump_aggregate(int argc, char *argv[])
>  }
>

Out of curiosity, is there a constant available that could be used instead
of hard-coding 31 here, or is 32 tables expected to be fairly permanent?

  -Reid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20100730/676cbab7/attachment-0003.html>


More information about the dev mailing list