Re: [ovs-dev] [PATCH v2 ovn 1/3] Forwarding group to load balance l2 traffic with liveness detection

2020-01-23 Thread Ben Pfaff
On Wed, Jan 22, 2020 at 08:13:20PM +, Manoj Sharma wrote:
> Some of the issues reported by checkpatch can not be avoided. I fixed 
> whatever could be broken into two lines.

For what it's worth, checkpatch is sometimes wrong.  It's a hint, not a
command.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 ovn 1/3] Forwarding group to load balance l2 traffic with liveness detection

2020-01-22 Thread Manoj Sharma
Hi Numan,

I sent v3 just now. Please take a look.

Some of the issues reported by checkpatch can not be avoided. I fixed whatever 
could be broken into two lines.
The warnings below are for ‘-‘ in fwd-group-add/del.

Thanks,
Manoj

From: Numan Siddique 
Date: Thursday, January 16, 2020 at 7:36 AM
To: Manoj Sharma 
Cc: "ovs-dev@openvswitch.org" 
Subject: Re: [ovs-dev] [PATCH v2 ovn 1/3] Forwarding group to load balance l2 
traffic with liveness detection



On Sat, Jan 11, 2020 at 6:11 AM Manoj Sharma 
mailto:manoj.sha...@nutanix.com>> wrote:
Add a forwarding group table and a reference to the logical switch it is
configured on. The forwarding group is configured with a virtual IP, virtual
MAC and a number of logical switch ports from a logical switch.

Signed-off-by: Manoj Sharma 
mailto:manoj.sha...@nutanix.com>>

This patch has below checkpatch issues. Can you please fix them.


== Checking 198cdb9bab38 ("Forwarding group to load balance l2 traffic with 
liveness detection") ==
WARNING: Line is 149 characters long (recommended limit is 79)
#125 FILE: utilities/ovn-nbctl.8.xml:489:
  [--liveness]fwd-group-add group 
switch vip vmac ports

WARNING: Line is 85 characters long (recommended limit is 79)
#146 FILE: utilities/ovn-nbctl.8.xml:510:
  [--if-exists] fwd-group-del 
group

WARNING: Line lacks whitespace around operator
#172 FILE: utilities/ovn-nbctl.c:653:
  fwd-group-add GROUP SWITCH VIP VMAC PORTS...\n\

WARNING: Line lacks whitespace around operator
#174 FILE: utilities/ovn-nbctl.c:655:
  fwd-group-del GROUP   delete a forwarding group\n\

WARNING: Line lacks whitespace around operator
#175 FILE: utilities/ovn-nbctl.c:656:
  fwd-group-list [SWITCH]   print forwarding groups\n\

ERROR: Improper whitespace around control block
#196 FILE: utilities/ovn-nbctl.c:4742:
NBREC_FORWARDING_GROUP_FOR_EACH(fwd_group, ctx->idl) {

ERROR: Improper whitespace around control block
#392 FILE: utilities/ovn-nbctl.c:4938:
NBREC_FORWARDING_GROUP_FOR_EACH(fwd_group, ctx->idl) {
**

I think you can ignore the warnings in ovn-nbctl.c.

You can run these checks your self -  "utilities/checkpatch.py -1"

You need to bump  up the version in ovn-nb.ovsschema to 5.19.0

Also please move the relevant test cases from patch 3 to this one.

Thanks
Numan



---
 ovn-nb.ovsschema  |  18 +++-
 ovn-nb.xml|  35 +++
 utilities/ovn-nbctl.8.xml |  37 +++
 utilities/ovn-nbctl.c | 253 ++
 4 files changed, 341 insertions(+), 2 deletions(-)

diff --git a/ovn-nb.ovsschema b/ovn-nb.ovsschema
index 12999a4..99b6285 100644
--- a/ovn-nb.ovsschema
+++ b/ovn-nb.ovsschema
@@ -1,7 +1,7 @@
 {
 "name": "OVN_Northbound",
 "version": "5.18.0",
-"cksum": "2806349485 24196",
+"cksum": "63300136 24879",
 "tables": {
 "NB_Global": {
 "columns": {
@@ -59,7 +59,12 @@
  "min": 0, "max": "unlimited"}},
 "external_ids": {
 "type": {"key": "string", "value": "string",
- "min": 0, "max": "unlimited"}}},
+ "min": 0, "max": "unlimited"}},
+   "forwarding_groups": {
+"type": {"key": {"type": "uuid",
+ "refTable": "Forwarding_Group",
+ "refType": "strong"},
+ "min": 0, "max": "unlimited"}}},
 "isRoot": true},
 "Logical_Switch_Port": {
 "columns": {
@@ -113,6 +118,15 @@
  "min": 0, "max": "unlimited"}}},
 "indexes": [["name"]],
 "isRoot": false},
+"Forwarding_Group": {
+"columns": {
+"name": {"type": "string"},
+"vip": {"type": "string"},
+"vmac": {"type": "string"},
+"liveness": {"type": "boolean"},
+"child_port": {"type": {"key": "string",
+"min": 1, "max": "unlimited"}}},
+"isRoot": false},
 "Address_Set": {
 "columns": {
 "name": {"t

Re: [ovs-dev] [PATCH v2 ovn 1/3] Forwarding group to load balance l2 traffic with liveness detection

2020-01-16 Thread Numan Siddique
On Sat, Jan 11, 2020 at 6:11 AM Manoj Sharma 
wrote:

> Add a forwarding group table and a reference to the logical switch it is
> configured on. The forwarding group is configured with a virtual IP,
> virtual
> MAC and a number of logical switch ports from a logical switch.
>
> Signed-off-by: Manoj Sharma 
>

This patch has below checkpatch issues. Can you please fix them.


== Checking 198cdb9bab38 ("Forwarding group to load balance l2 traffic with
liveness detection") ==
WARNING: Line is 149 characters long (recommended limit is 79)
#125 FILE: utilities/ovn-nbctl.8.xml:489:
  [--liveness]fwd-group-add
group switch vip vmac
ports

WARNING: Line is 85 characters long (recommended limit is 79)
#146 FILE: utilities/ovn-nbctl.8.xml:510:
  [--if-exists] fwd-group-del
group

WARNING: Line lacks whitespace around operator
#172 FILE: utilities/ovn-nbctl.c:653:
  fwd-group-add GROUP SWITCH VIP VMAC PORTS...\n\

WARNING: Line lacks whitespace around operator
#174 FILE: utilities/ovn-nbctl.c:655:
  fwd-group-del GROUP   delete a forwarding group\n\

WARNING: Line lacks whitespace around operator
#175 FILE: utilities/ovn-nbctl.c:656:
  fwd-group-list [SWITCH]   print forwarding groups\n\

ERROR: Improper whitespace around control block
#196 FILE: utilities/ovn-nbctl.c:4742:
NBREC_FORWARDING_GROUP_FOR_EACH(fwd_group, ctx->idl) {

ERROR: Improper whitespace around control block
#392 FILE: utilities/ovn-nbctl.c:4938:
NBREC_FORWARDING_GROUP_FOR_EACH(fwd_group, ctx->idl) {
**

I think you can ignore the warnings in ovn-nbctl.c.

You can run these checks your self -  "utilities/checkpatch.py -1"

You need to bump  up the version in ovn-nb.ovsschema to 5.19.0

Also please move the relevant test cases from patch 3 to this one.

Thanks
Numan




> ---
>  ovn-nb.ovsschema  |  18 +++-
>  ovn-nb.xml|  35 +++
>  utilities/ovn-nbctl.8.xml |  37 +++
>  utilities/ovn-nbctl.c | 253
> ++
>  4 files changed, 341 insertions(+), 2 deletions(-)
>
> diff --git a/ovn-nb.ovsschema b/ovn-nb.ovsschema
> index 12999a4..99b6285 100644
> --- a/ovn-nb.ovsschema
> +++ b/ovn-nb.ovsschema
> @@ -1,7 +1,7 @@
>  {
>  "name": "OVN_Northbound",
>  "version": "5.18.0",
> -"cksum": "2806349485 24196",
> +"cksum": "63300136 24879",
>  "tables": {
>  "NB_Global": {
>  "columns": {
> @@ -59,7 +59,12 @@
>   "min": 0, "max": "unlimited"}},
>  "external_ids": {
>  "type": {"key": "string", "value": "string",
> - "min": 0, "max": "unlimited"}}},
> + "min": 0, "max": "unlimited"}},
> +   "forwarding_groups": {
> +"type": {"key": {"type": "uuid",
> + "refTable": "Forwarding_Group",
> + "refType": "strong"},
> + "min": 0, "max": "unlimited"}}},
>  "isRoot": true},
>  "Logical_Switch_Port": {
>  "columns": {
> @@ -113,6 +118,15 @@
>   "min": 0, "max": "unlimited"}}},
>  "indexes": [["name"]],
>  "isRoot": false},
> +"Forwarding_Group": {
> +"columns": {
> +"name": {"type": "string"},
> +"vip": {"type": "string"},
> +"vmac": {"type": "string"},
> +"liveness": {"type": "boolean"},
> +"child_port": {"type": {"key": "string",
> +"min": 1, "max": "unlimited"}}},
> +"isRoot": false},
>  "Address_Set": {
>  "columns": {
>  "name": {"type": "string"},
> diff --git a/ovn-nb.xml b/ovn-nb.xml
> index 5ae52bb..decb4ae 100644
> --- a/ovn-nb.xml
> +++ b/ovn-nb.xml
> @@ -197,6 +197,11 @@
>Please see the  table.
>  
>
> +
> +  Groups a set of logical port endpoints for traffic going out of the
> +  logical switch.
> +
> +
>  
>
>  These columns provide names for the logical switch.  From OVN's
> @@ -1152,6 +1157,36 @@
>  
>
>
> +  
> +
> +  Each row represents one forwarding group.
> +
> +
> +
> +  A name for the forwarding group.  This name has no special meaning
> or
> +  purpose other than to provide convenience for human interaction with
> +  the ovn-nb database.
> +
> +
> +
> +  The virtual IP address assigned to the forwarding group. It will
> respond
> +  with vmac when an ARP request is sent for vip.
> +
> +
> +
> +  The virtual MAC address assigned to the forwarding group.
> +
> +
> +
> +  If set to true, liveness is enabled for child ports
> +  otherwise it is disabled.
> +
> +
> +
> +  List of child ports in the forwarding group.
> +
> +  
> +
>
>  
> 

Re: [ovs-dev] [PATCH v2 ovn 1/3] Forwarding group to load balance l2 traffic with liveness detection

2020-01-10 Thread 0-day Robot
Bleep bloop.  Greetings Manoj Sharma, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line is 149 characters long (recommended limit is 79)
#125 FILE: utilities/ovn-nbctl.8.xml:489:
  [--liveness]fwd-group-add group 
switch vip vmac ports

WARNING: Line is 85 characters long (recommended limit is 79)
#146 FILE: utilities/ovn-nbctl.8.xml:510:
  [--if-exists] fwd-group-del 
group

WARNING: Line lacks whitespace around operator
#172 FILE: utilities/ovn-nbctl.c:653:
  fwd-group-add GROUP SWITCH VIP VMAC PORTS...\n\

WARNING: Line lacks whitespace around operator
#174 FILE: utilities/ovn-nbctl.c:655:
  fwd-group-del GROUP   delete a forwarding group\n\

WARNING: Line lacks whitespace around operator
#175 FILE: utilities/ovn-nbctl.c:656:
  fwd-group-list [SWITCH]   print forwarding groups\n\

ERROR: Improper whitespace around control block
#196 FILE: utilities/ovn-nbctl.c:4742:
NBREC_FORWARDING_GROUP_FOR_EACH(fwd_group, ctx->idl) {

ERROR: Improper whitespace around control block
#392 FILE: utilities/ovn-nbctl.c:4938:
NBREC_FORWARDING_GROUP_FOR_EACH(fwd_group, ctx->idl) {

Lines checked: 443, Warnings: 5, Errors: 2


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 ovn 1/3] Forwarding group to load balance l2 traffic with liveness detection

2020-01-10 Thread Manoj Sharma
Add a forwarding group table and a reference to the logical switch it is
configured on. The forwarding group is configured with a virtual IP, virtual
MAC and a number of logical switch ports from a logical switch.

Signed-off-by: Manoj Sharma 
---
 ovn-nb.ovsschema  |  18 +++-
 ovn-nb.xml|  35 +++
 utilities/ovn-nbctl.8.xml |  37 +++
 utilities/ovn-nbctl.c | 253 ++
 4 files changed, 341 insertions(+), 2 deletions(-)

diff --git a/ovn-nb.ovsschema b/ovn-nb.ovsschema
index 12999a4..99b6285 100644
--- a/ovn-nb.ovsschema
+++ b/ovn-nb.ovsschema
@@ -1,7 +1,7 @@
 {
 "name": "OVN_Northbound",
 "version": "5.18.0",
-"cksum": "2806349485 24196",
+"cksum": "63300136 24879",
 "tables": {
 "NB_Global": {
 "columns": {
@@ -59,7 +59,12 @@
  "min": 0, "max": "unlimited"}},
 "external_ids": {
 "type": {"key": "string", "value": "string",
- "min": 0, "max": "unlimited"}}},
+ "min": 0, "max": "unlimited"}},
+   "forwarding_groups": {
+"type": {"key": {"type": "uuid",
+ "refTable": "Forwarding_Group",
+ "refType": "strong"},
+ "min": 0, "max": "unlimited"}}},
 "isRoot": true},
 "Logical_Switch_Port": {
 "columns": {
@@ -113,6 +118,15 @@
  "min": 0, "max": "unlimited"}}},
 "indexes": [["name"]],
 "isRoot": false},
+"Forwarding_Group": {
+"columns": {
+"name": {"type": "string"},
+"vip": {"type": "string"},
+"vmac": {"type": "string"},
+"liveness": {"type": "boolean"},
+"child_port": {"type": {"key": "string",
+"min": 1, "max": "unlimited"}}},
+"isRoot": false},
 "Address_Set": {
 "columns": {
 "name": {"type": "string"},
diff --git a/ovn-nb.xml b/ovn-nb.xml
index 5ae52bb..decb4ae 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -197,6 +197,11 @@
   Please see the  table.
 
 
+
+  Groups a set of logical port endpoints for traffic going out of the
+  logical switch.
+
+
 
   
 These columns provide names for the logical switch.  From OVN's
@@ -1152,6 +1157,36 @@
 
   
 
+  
+
+  Each row represents one forwarding group.
+
+
+
+  A name for the forwarding group.  This name has no special meaning or
+  purpose other than to provide convenience for human interaction with
+  the ovn-nb database.
+
+
+
+  The virtual IP address assigned to the forwarding group. It will respond
+  with vmac when an ARP request is sent for vip.
+
+
+
+  The virtual MAC address assigned to the forwarding group.
+
+
+
+  If set to true, liveness is enabled for child ports
+  otherwise it is disabled.
+
+
+
+  List of child ports in the forwarding group.
+
+  
+
   
 
   Each row in this table represents a named set of addresses.
diff --git a/utilities/ovn-nbctl.8.xml b/utilities/ovn-nbctl.8.xml
index 88ebd13..2f3badd 100644
--- a/utilities/ovn-nbctl.8.xml
+++ b/utilities/ovn-nbctl.8.xml
@@ -483,6 +483,43 @@
 
 
 
+Forwarding Group Commands
+
+
+  [--liveness]fwd-group-add group 
switch vip vmac ports
+  
+
+  Creates a new forwarding group named group as the name
+  with the provided vip and vmac. vip
+  should be a virtual IP address and vmac should be a
+  virtual MAC address to access the forwarding group. ports
+  are the logical switch port names that are put in the forwarding
+  group. Example for ports is lsp1 lsp2 ...
+  Traffic destined to virtual IP of the forwarding group will be load
+  balanced to all the child ports.
+
+
+  When --liveness is specified then child ports are
+  expected to be bound to external devices like routers. BFD should
+  be configured between hypervisors and the external devices.
+  The child port selection will become dependent on BFD status with
+  its external device.
+
+  
+
+  [--if-exists] fwd-group-del 
group
+  
+Deletes group.  It is an error if group does
+not exist, unless --if-exists is specified.
+  
+
+  fwd-group-list [switch]
+  
+Lists all existing forwarding groups, If switch is specified
+then only the forwarding groups configured for switch will
+be listed.
+  
+
 Logical Router Commands
 
 
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 46ba3a9..39f53da 100644
--- a/utilities