Re: [ovs-dev] [PATCH 03/12] ovs-vsctl: Add datapath and CT zone commands.

2019-07-29 Thread Darrell Ball
added one more comment.

On Fri, Jul 26, 2019 at 4:10 PM Darrell Ball  wrote:

> added one more comment for now
>
>
> On Fri, Jul 26, 2019 at 11:13 AM Darrell Ball  wrote:
>
>> Thanks for the patch
>>
>> Not a full review; just some initial testing
>>
>>
>> 1/ AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
>> icmp_reply_blah=3])])
>>
>> The above syntax is NOT flagged as an error
>>
>>
>> 2/ AT_CHECK([RUN_OVS_VSCTL([--may-exist add-zone-tp netdev zone=2
>> icmp_first=2 icmp_reply=3])])
>>
>> The above "--may-exist" option fails with
>> +ovs-vsctl: 'add-zone-tp' command has no '--may-exist' option
>>
>> AT_CHECK([RUN_OVS_VSCTL([--if-exists del-zone-tp netdev zone=1])])
>> is also failing
>> +ovs-vsctl: 'del-zone-tp' command has no '--if-exists' option
>>
>> Please support both "--may-exist" and "--if-exists"
>>
>>
>> 3/ The below should fail, but it is accepted.
>>
>> AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
>> icmp_reply=3])])
>> AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
>> icmp_reply=3])])
>>
>>
>> 4/ The below fails (which is good), but the error is in idl, rather than
>> the 'del-zone-tp' command
>>
>> AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
>> AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
>> fails with
>> +2019-07-26T17:56:10Z|2|ovsdb_idl|WARN|Trying to delete a key that
>> doesn't exist in the map.
>>
>>
>>
>> 5/ Please support --may-exist for add-dp
>>
>> 6/ Please support --if-exists for del-dp
>>
>>
>> 7/ Few comments below
>>
>>
>> Thanks Darrell
>>
>>
>> On Thu, Jul 25, 2019 at 4:26 PM Yi-Hung Wei  wrote:
>>
>>> From: William Tu 
>>>
>>> The patch adds the following commands
>>>   $ ovs-vsctl {add,del,list}-dp
>>> for creating/deleting/listing the datapath, and
>>>   $ ovs-vsctl {add,del,list}-zone-tp
>>> for conntrack zones and timeout policies.
>>>
>>> Signed-off-by: William Tu 
>>> ---
>>>  tests/ovs-vsctl.at   |  20 +++-
>>>  utilities/ovs-vsctl.8.in |  29 ++
>>>  utilities/ovs-vsctl.c| 245
>>> +++
>>>  3 files changed, 292 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
>>> index 77604c58a2bc..8854138ecb1e 100644
>>> --- a/tests/ovs-vsctl.at
>>> +++ b/tests/ovs-vsctl.at
>>> @@ -805,6 +805,22 @@ AT_CHECK(
>>>[RUN_OVS_VSCTL([--if-exists remove netflow x targets '"1.2.3.4:567
>>> "'])])
>>>  AT_CHECK(
>>>[RUN_OVS_VSCTL([--if-exists clear netflow x targets])])
>>> +
>>> +AT_CHECK([RUN_OVS_VSCTL([add-dp netdev])])
>>> +AT_CHECK([RUN_OVS_VSCTL([add-dp system])])
>>> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=1 icmp_first=1
>>> icmp_reply=2])])
>>> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout
>>> Policies: icmp_first=1 icmp_reply=2
>>> +])
>>> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
>>> icmp_reply=3])])
>>>
>>
>> Add all possible keys as part of positive tests so we know thye work
>>
>>
>>
>>
>>> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout
>>> Policies: icmp_first=1 icmp_reply=2
>>> +Zone:2, Timeout Policies: icmp_first=2 icmp_reply=3
>>> +])
>>> +AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
>>> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:2, Timeout
>>> Policies: icmp_first=2 icmp_reply=3
>>> +])
>>> +AT_CHECK([RUN_OVS_VSCTL([del-dp netdev])])
>>> +AT_CHECK([RUN_OVS_VSCTL([list-dp | sed 's/ uuid.*$//'])], [0], [system
>>> +])
>>>  OVS_VSCTL_CLEANUP
>>>  AT_CLEANUP
>>>
>>> @@ -890,10 +906,10 @@ AT_CHECK([RUN_OVS_VSCTL([set bridge br0
>>> flood_vlans=-1])],
>>>  AT_CHECK([RUN_OVS_VSCTL([set bridge br0 flood_vlans=4096])],
>>>[1], [], [ovs-vsctl: constraint violation: 4096 is not in the valid
>>> range 0 to 4095 (inclusive)
>>>  ])
>>> -AT_CHECK([RUN_OVS_VSCTL([set c br1 'connection-mode=xyz'])],
>>> +AT_CHECK([RUN_OVS_VSCTL([set controller br1 'connection-mode=xyz'])],
>>>
>>
>> unrelated change
>>
>>
>>
>>>[1], [], [[ovs-vsctl: constraint violation: xyz is not one of the
>>> allowed values ([in-band, out-of-band])
>>>  ]])
>>> -AT_CHECK([RUN_OVS_VSCTL([set c br1 connection-mode:x=y])],
>>> +AT_CHECK([RUN_OVS_VSCTL([set controller br1 connection-mode:x=y])],
>>>
>>
>> unrelated change
>>
>>
>>
>>>[1], [], [ovs-vsctl: cannot specify key to set for non-map column
>>> connection_mode
>>>  ])
>>>  AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y])],
>>> diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in
>>> index 7c09df79bd29..f8ec995247e7 100644
>>> --- a/utilities/ovs-vsctl.8.in
>>> +++ b/utilities/ovs-vsctl.8.in
>>> @@ -353,6 +353,35 @@ list.
>>>  Prints the name of the bridge that contains \fIiface\fR on standard
>>>  output.
>>>  .
>>> +.SS "Datapath Commands"
>>> +These commands examine and manipulate Open vSwitch datapath.
>>> +.
>>> +.IP "\fBadd\-dp \fIdatapath\fR"
>>> +Creates a new datapath named \fIdatapath\fR.  Use "netdev" for userspace
>>> +datapath 

Re: [ovs-dev] [PATCH 03/12] ovs-vsctl: Add datapath and CT zone commands.

2019-07-26 Thread Darrell Ball
added one more comment for now


On Fri, Jul 26, 2019 at 11:13 AM Darrell Ball  wrote:

> Thanks for the patch
>
> Not a full review; just some initial testing
>
>
> 1/ AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
> icmp_reply_blah=3])])
>
> The above syntax is NOT flagged as an error
>
>
> 2/ AT_CHECK([RUN_OVS_VSCTL([--may-exist add-zone-tp netdev zone=2
> icmp_first=2 icmp_reply=3])])
>
> The above "--may-exist" option fails with
> +ovs-vsctl: 'add-zone-tp' command has no '--may-exist' option
>
> AT_CHECK([RUN_OVS_VSCTL([--if-exists del-zone-tp netdev zone=1])])
> is also failing
> +ovs-vsctl: 'del-zone-tp' command has no '--if-exists' option
>
> Please support both "--may-exist" and "--if-exists"
>
>
> 3/ The below should fail, but it is accepted.
>
> AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
> icmp_reply=3])])
> AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
> icmp_reply=3])])
>
>
> 4/ The below fails (which is good), but the error is in idl, rather than
> the 'del-zone-tp' command
>
> AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
> AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
> fails with
> +2019-07-26T17:56:10Z|2|ovsdb_idl|WARN|Trying to delete a key that
> doesn't exist in the map.
>
>
>
> 5/ Please support --may-exist for add-dp
>
> 6/ Please support --if-exists for del-dp
>
>
> 7/ Few comments below
>
>
> Thanks Darrell
>
>
> On Thu, Jul 25, 2019 at 4:26 PM Yi-Hung Wei  wrote:
>
>> From: William Tu 
>>
>> The patch adds the following commands
>>   $ ovs-vsctl {add,del,list}-dp
>> for creating/deleting/listing the datapath, and
>>   $ ovs-vsctl {add,del,list}-zone-tp
>> for conntrack zones and timeout policies.
>>
>> Signed-off-by: William Tu 
>> ---
>>  tests/ovs-vsctl.at   |  20 +++-
>>  utilities/ovs-vsctl.8.in |  29 ++
>>  utilities/ovs-vsctl.c| 245
>> +++
>>  3 files changed, 292 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
>> index 77604c58a2bc..8854138ecb1e 100644
>> --- a/tests/ovs-vsctl.at
>> +++ b/tests/ovs-vsctl.at
>> @@ -805,6 +805,22 @@ AT_CHECK(
>>[RUN_OVS_VSCTL([--if-exists remove netflow x targets '"1.2.3.4:567
>> "'])])
>>  AT_CHECK(
>>[RUN_OVS_VSCTL([--if-exists clear netflow x targets])])
>> +
>> +AT_CHECK([RUN_OVS_VSCTL([add-dp netdev])])
>> +AT_CHECK([RUN_OVS_VSCTL([add-dp system])])
>> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=1 icmp_first=1
>> icmp_reply=2])])
>> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout
>> Policies: icmp_first=1 icmp_reply=2
>> +])
>> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
>> icmp_reply=3])])
>>
>
> Add all possible keys as part of positive tests so we know thye work
>
>
>
>
>> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout
>> Policies: icmp_first=1 icmp_reply=2
>> +Zone:2, Timeout Policies: icmp_first=2 icmp_reply=3
>> +])
>> +AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
>> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:2, Timeout
>> Policies: icmp_first=2 icmp_reply=3
>> +])
>> +AT_CHECK([RUN_OVS_VSCTL([del-dp netdev])])
>> +AT_CHECK([RUN_OVS_VSCTL([list-dp | sed 's/ uuid.*$//'])], [0], [system
>> +])
>>  OVS_VSCTL_CLEANUP
>>  AT_CLEANUP
>>
>> @@ -890,10 +906,10 @@ AT_CHECK([RUN_OVS_VSCTL([set bridge br0
>> flood_vlans=-1])],
>>  AT_CHECK([RUN_OVS_VSCTL([set bridge br0 flood_vlans=4096])],
>>[1], [], [ovs-vsctl: constraint violation: 4096 is not in the valid
>> range 0 to 4095 (inclusive)
>>  ])
>> -AT_CHECK([RUN_OVS_VSCTL([set c br1 'connection-mode=xyz'])],
>> +AT_CHECK([RUN_OVS_VSCTL([set controller br1 'connection-mode=xyz'])],
>>
>
> unrelated change
>
>
>
>>[1], [], [[ovs-vsctl: constraint violation: xyz is not one of the
>> allowed values ([in-band, out-of-band])
>>  ]])
>> -AT_CHECK([RUN_OVS_VSCTL([set c br1 connection-mode:x=y])],
>> +AT_CHECK([RUN_OVS_VSCTL([set controller br1 connection-mode:x=y])],
>>
>
> unrelated change
>
>
>
>>[1], [], [ovs-vsctl: cannot specify key to set for non-map column
>> connection_mode
>>  ])
>>  AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y])],
>> diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in
>> index 7c09df79bd29..f8ec995247e7 100644
>> --- a/utilities/ovs-vsctl.8.in
>> +++ b/utilities/ovs-vsctl.8.in
>> @@ -353,6 +353,35 @@ list.
>>  Prints the name of the bridge that contains \fIiface\fR on standard
>>  output.
>>  .
>> +.SS "Datapath Commands"
>> +These commands examine and manipulate Open vSwitch datapath.
>> +.
>> +.IP "\fBadd\-dp \fIdatapath\fR"
>> +Creates a new datapath named \fIdatapath\fR.  Use "netdev" for userspace
>> +datapath and "system" for kernel datapath.  Initially the datapath will
>> +have no CT zones or other data.
>> +.IP "\fBdel\-dp \fIdatapath\fR"
>> +Deletes \fIdatapath\fR.
>> +.IP "\fBlist\-dp \fIdatapath\fR"
>> +Prints the datapath name and its uuid.

Re: [ovs-dev] [PATCH 03/12] ovs-vsctl: Add datapath and CT zone commands.

2019-07-26 Thread Darrell Ball
Thanks for the patch

Not a full review; just some initial testing


1/ AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
icmp_reply_blah=3])])

The above syntax is NOT flagged as an error


2/ AT_CHECK([RUN_OVS_VSCTL([--may-exist add-zone-tp netdev zone=2
icmp_first=2 icmp_reply=3])])

The above "--may-exist" option fails with
+ovs-vsctl: 'add-zone-tp' command has no '--may-exist' option

AT_CHECK([RUN_OVS_VSCTL([--if-exists del-zone-tp netdev zone=1])])
is also failing
+ovs-vsctl: 'del-zone-tp' command has no '--if-exists' option

Please support both "--may-exist" and "--if-exists"


3/ The below should fail, but it is accepted.

AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
icmp_reply=3])])
AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
icmp_reply=3])])


4/ The below fails (which is good), but the error is in idl, rather than
the 'del-zone-tp' command

AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
fails with
+2019-07-26T17:56:10Z|2|ovsdb_idl|WARN|Trying to delete a key that
doesn't exist in the map.



5/ Please support --may-exist for add-dp

6/ Please support --if-exists for del-dp


7/ Few comments below


Thanks Darrell


On Thu, Jul 25, 2019 at 4:26 PM Yi-Hung Wei  wrote:

> From: William Tu 
>
> The patch adds the following commands
>   $ ovs-vsctl {add,del,list}-dp
> for creating/deleting/listing the datapath, and
>   $ ovs-vsctl {add,del,list}-zone-tp
> for conntrack zones and timeout policies.
>
> Signed-off-by: William Tu 
> ---
>  tests/ovs-vsctl.at   |  20 +++-
>  utilities/ovs-vsctl.8.in |  29 ++
>  utilities/ovs-vsctl.c| 245
> +++
>  3 files changed, 292 insertions(+), 2 deletions(-)
>
> diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
> index 77604c58a2bc..8854138ecb1e 100644
> --- a/tests/ovs-vsctl.at
> +++ b/tests/ovs-vsctl.at
> @@ -805,6 +805,22 @@ AT_CHECK(
>[RUN_OVS_VSCTL([--if-exists remove netflow x targets '"1.2.3.4:567
> "'])])
>  AT_CHECK(
>[RUN_OVS_VSCTL([--if-exists clear netflow x targets])])
> +
> +AT_CHECK([RUN_OVS_VSCTL([add-dp netdev])])
> +AT_CHECK([RUN_OVS_VSCTL([add-dp system])])
> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=1 icmp_first=1
> icmp_reply=2])])
> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout
> Policies: icmp_first=1 icmp_reply=2
> +])
> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2
> icmp_reply=3])])
>

Add all possible keys as part of positive tests so we know thye work




> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout
> Policies: icmp_first=1 icmp_reply=2
> +Zone:2, Timeout Policies: icmp_first=2 icmp_reply=3
> +])
> +AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:2, Timeout
> Policies: icmp_first=2 icmp_reply=3
> +])
> +AT_CHECK([RUN_OVS_VSCTL([del-dp netdev])])
> +AT_CHECK([RUN_OVS_VSCTL([list-dp | sed 's/ uuid.*$//'])], [0], [system
> +])
>  OVS_VSCTL_CLEANUP
>  AT_CLEANUP
>
> @@ -890,10 +906,10 @@ AT_CHECK([RUN_OVS_VSCTL([set bridge br0
> flood_vlans=-1])],
>  AT_CHECK([RUN_OVS_VSCTL([set bridge br0 flood_vlans=4096])],
>[1], [], [ovs-vsctl: constraint violation: 4096 is not in the valid
> range 0 to 4095 (inclusive)
>  ])
> -AT_CHECK([RUN_OVS_VSCTL([set c br1 'connection-mode=xyz'])],
> +AT_CHECK([RUN_OVS_VSCTL([set controller br1 'connection-mode=xyz'])],
>

unrelated change



>[1], [], [[ovs-vsctl: constraint violation: xyz is not one of the
> allowed values ([in-band, out-of-band])
>  ]])
> -AT_CHECK([RUN_OVS_VSCTL([set c br1 connection-mode:x=y])],
> +AT_CHECK([RUN_OVS_VSCTL([set controller br1 connection-mode:x=y])],
>

unrelated change



>[1], [], [ovs-vsctl: cannot specify key to set for non-map column
> connection_mode
>  ])
>  AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y])],
> diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in
> index 7c09df79bd29..f8ec995247e7 100644
> --- a/utilities/ovs-vsctl.8.in
> +++ b/utilities/ovs-vsctl.8.in
> @@ -353,6 +353,35 @@ list.
>  Prints the name of the bridge that contains \fIiface\fR on standard
>  output.
>  .
> +.SS "Datapath Commands"
> +These commands examine and manipulate Open vSwitch datapath.
> +.
> +.IP "\fBadd\-dp \fIdatapath\fR"
> +Creates a new datapath named \fIdatapath\fR.  Use "netdev" for userspace
> +datapath and "system" for kernel datapath.  Initially the datapath will
> +have no CT zones or other data.
> +.IP "\fBdel\-dp \fIdatapath\fR"
> +Deletes \fIdatapath\fR.
> +.IP "\fBlist\-dp \fIdatapath\fR"
> +Prints the datapath name and its uuid.
> +.
> +.SS "Conntrack Zone Commands"
> +These commands query and modify datapath CT zones and Timeout Policies.
> +.
> +.IP "\fBadd\-zone\-tp \fIdatapath \fBzone=\fIzone_id \fIpolicies\fR"
> +Creates a conntrack zone with \fIzone_id\fR under the datapath
> \fIdatapath\fR.
> 

Re: [ovs-dev] [PATCH 03/12] ovs-vsctl: Add datapath and CT zone commands.

2019-07-26 Thread William Tu
On Thu, Jul 25, 2019 at 04:24:05PM -0700, Yi-Hung Wei wrote:
> From: William Tu 
> 
> The patch adds the following commands
>   $ ovs-vsctl {add,del,list}-dp
> for creating/deleting/listing the datapath, and
>   $ ovs-vsctl {add,del,list}-zone-tp
> for conntrack zones and timeout policies.
> 
> Signed-off-by: William Tu 
> ---
>  tests/ovs-vsctl.at   |  20 +++-
>  utilities/ovs-vsctl.8.in |  29 ++
>  utilities/ovs-vsctl.c| 245 
> +++
>  3 files changed, 292 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
> index 77604c58a2bc..8854138ecb1e 100644
> --- a/tests/ovs-vsctl.at
> +++ b/tests/ovs-vsctl.at
> @@ -805,6 +805,22 @@ AT_CHECK(
>[RUN_OVS_VSCTL([--if-exists remove netflow x targets '"1.2.3.4:567"'])])
>  AT_CHECK(
>[RUN_OVS_VSCTL([--if-exists clear netflow x targets])])
> +
> +AT_CHECK([RUN_OVS_VSCTL([add-dp netdev])])
> +AT_CHECK([RUN_OVS_VSCTL([add-dp system])])
> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=1 icmp_first=1 
> icmp_reply=2])])
> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout 
> Policies: icmp_first=1 icmp_reply=2
> +])
> +AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2 
> icmp_reply=3])])
> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout 
> Policies: icmp_first=1 icmp_reply=2
> +Zone:2, Timeout Policies: icmp_first=2 icmp_reply=3
> +])
> +AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
> +AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:2, Timeout 
> Policies: icmp_first=2 icmp_reply=3
> +])
> +AT_CHECK([RUN_OVS_VSCTL([del-dp netdev])])
> +AT_CHECK([RUN_OVS_VSCTL([list-dp | sed 's/ uuid.*$//'])], [0], [system
> +])
>  OVS_VSCTL_CLEANUP
>  AT_CLEANUP
>  

I realize I should add more test cases here.
The above has only positive checks, I will add negative checks.



Thanks
William

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 03/12] ovs-vsctl: Add datapath and CT zone commands.

2019-07-25 Thread Yi-Hung Wei
From: William Tu 

The patch adds the following commands
  $ ovs-vsctl {add,del,list}-dp
for creating/deleting/listing the datapath, and
  $ ovs-vsctl {add,del,list}-zone-tp
for conntrack zones and timeout policies.

Signed-off-by: William Tu 
---
 tests/ovs-vsctl.at   |  20 +++-
 utilities/ovs-vsctl.8.in |  29 ++
 utilities/ovs-vsctl.c| 245 +++
 3 files changed, 292 insertions(+), 2 deletions(-)

diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
index 77604c58a2bc..8854138ecb1e 100644
--- a/tests/ovs-vsctl.at
+++ b/tests/ovs-vsctl.at
@@ -805,6 +805,22 @@ AT_CHECK(
   [RUN_OVS_VSCTL([--if-exists remove netflow x targets '"1.2.3.4:567"'])])
 AT_CHECK(
   [RUN_OVS_VSCTL([--if-exists clear netflow x targets])])
+
+AT_CHECK([RUN_OVS_VSCTL([add-dp netdev])])
+AT_CHECK([RUN_OVS_VSCTL([add-dp system])])
+AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=1 icmp_first=1 
icmp_reply=2])])
+AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout 
Policies: icmp_first=1 icmp_reply=2
+])
+AT_CHECK([RUN_OVS_VSCTL([add-zone-tp netdev zone=2 icmp_first=2 
icmp_reply=3])])
+AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:1, Timeout 
Policies: icmp_first=1 icmp_reply=2
+Zone:2, Timeout Policies: icmp_first=2 icmp_reply=3
+])
+AT_CHECK([RUN_OVS_VSCTL([del-zone-tp netdev zone=1])])
+AT_CHECK([RUN_OVS_VSCTL([list-zone-tp netdev])], [0], [Zone:2, Timeout 
Policies: icmp_first=2 icmp_reply=3
+])
+AT_CHECK([RUN_OVS_VSCTL([del-dp netdev])])
+AT_CHECK([RUN_OVS_VSCTL([list-dp | sed 's/ uuid.*$//'])], [0], [system
+])
 OVS_VSCTL_CLEANUP
 AT_CLEANUP
 
@@ -890,10 +906,10 @@ AT_CHECK([RUN_OVS_VSCTL([set bridge br0 flood_vlans=-1])],
 AT_CHECK([RUN_OVS_VSCTL([set bridge br0 flood_vlans=4096])],
   [1], [], [ovs-vsctl: constraint violation: 4096 is not in the valid range 0 
to 4095 (inclusive)
 ])
-AT_CHECK([RUN_OVS_VSCTL([set c br1 'connection-mode=xyz'])],
+AT_CHECK([RUN_OVS_VSCTL([set controller br1 'connection-mode=xyz'])],
   [1], [], [[ovs-vsctl: constraint violation: xyz is not one of the allowed 
values ([in-band, out-of-band])
 ]])
-AT_CHECK([RUN_OVS_VSCTL([set c br1 connection-mode:x=y])],
+AT_CHECK([RUN_OVS_VSCTL([set controller br1 connection-mode:x=y])],
   [1], [], [ovs-vsctl: cannot specify key to set for non-map column 
connection_mode
 ])
 AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y])],
diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in
index 7c09df79bd29..f8ec995247e7 100644
--- a/utilities/ovs-vsctl.8.in
+++ b/utilities/ovs-vsctl.8.in
@@ -353,6 +353,35 @@ list.
 Prints the name of the bridge that contains \fIiface\fR on standard
 output.
 .
+.SS "Datapath Commands"
+These commands examine and manipulate Open vSwitch datapath.
+.
+.IP "\fBadd\-dp \fIdatapath\fR"
+Creates a new datapath named \fIdatapath\fR.  Use "netdev" for userspace
+datapath and "system" for kernel datapath.  Initially the datapath will
+have no CT zones or other data.
+.IP "\fBdel\-dp \fIdatapath\fR"
+Deletes \fIdatapath\fR.
+.IP "\fBlist\-dp \fIdatapath\fR"
+Prints the datapath name and its uuid.
+.
+.SS "Conntrack Zone Commands"
+These commands query and modify datapath CT zones and Timeout Policies.
+.
+.IP "\fBadd\-zone\-tp \fIdatapath \fBzone=\fIzone_id \fIpolicies\fR"
+Creates a conntrack zone with \fIzone_id\fR under the datapath \fIdatapath\fR.
+Associate the conntrack timeout policies to it by a list of
+\fIkey\fB=\fIvalue\fR pairs, separated by space.  For example, specifying
+30-second timeout policy for first icmp packet, and 60-second for icmp reply 
packet
+by doing \fBicmp_first=30 icmp_reply=60\fR.  See CT_Timeout_Policy TABLE
+at \fBovs-vswitchd.conf.db\fR(5) for all available configurations.
+.
+.IP "\fBdel\-zone\-tp \fIdatapath \fBzone=\fIzone_id\fR"
+Delete a zone under \fIdatapath\fR by specifying its zone ID.
+.
+.IP "\fBlist\-zone\-tp \fIdatapath\fR"
+Prints the timeout policies of all zones under the \fIdatapath\fR.
+.
 .SS "OpenFlow Controller Connectivity"
 .
 \fBovs\-vswitchd\fR can perform all configured bridging and switching
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index 4948137efe8c..3ec9b2b05f35 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -40,6 +40,7 @@
 #include "ovsdb-idl.h"
 #include "openvswitch/poll-loop.h"
 #include "process.h"
+#include "simap.h"
 #include "stream.h"
 #include "stream-ssl.h"
 #include "smap.h"
@@ -49,6 +50,7 @@
 #include "table.h"
 #include "timeval.h"
 #include "util.h"
+#include "openvswitch/ofp-parse.h"
 #include "openvswitch/vconn.h"
 #include "openvswitch/vlog.h"
 
@@ -1154,6 +1156,239 @@ cmd_emer_reset(struct ctl_context *ctx)
 }
 
 static void
+cmd_add_dp(struct ctl_context *ctx)
+{
+struct vsctl_context *vsctl_ctx = vsctl_context_cast(ctx);
+const struct ovsrec_open_vswitch *ovs = vsctl_ctx->ovs;
+struct ovsrec_datapath *dp;
+const char *dp_name;
+int i;
+
+dp_name = ctx->argv[1];
+
+for (i = 0; i <