[ovs-dev] [PATCH 4/4] doc: Updates bonding.rst because of api changed.

2017-02-13 Thread nickcooper-zhangtonghao
Signed-off-by: nickcooper-zhangtonghao 
---
 Documentation/topics/bonding.rst | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/topics/bonding.rst b/Documentation/topics/bonding.rst
index 2f67cbb..461935a 100644
--- a/Documentation/topics/bonding.rst
+++ b/Documentation/topics/bonding.rst
@@ -74,7 +74,7 @@ port for traffic that was destined for that slave (see
 ``bond_enable_slave()``).  It also sends a "gratuitous learning packet",
 specifically a RARP, on the bond port (on the newly chosen slave) for each MAC
 address that the vswitch has learned on a port other than the bond (see
-``bond_send_learning_packets()``), to teach the physical switch that the new
+``bundle_send_learning_packets()``), to teach the physical switch that the new
 slave should be used in place of the one that is now disabled.  (This behavior
 probably makes sense only for a vswitch that has only one port (the bond)
 connected to a physical switch; vswitchd should probably provide a way to
@@ -106,7 +106,7 @@ exception does not match normal ARP replies.  It will match 
the learning
 packets sent on bond fail-over.)
 
 The active slave is simply the first slave to be enabled after the bond is
-created (see ``bond_choose_active_iface()``).  If the active slave is disabled,
+created (see ``bond_choose_active_slave()``).  If the active slave is disabled,
 then a new active slave is chosen among the slaves that remain active.
 Currently due to the way that configuration works, this tends to be the
 remaining slave whose interface name is first alphabetically, but this is by no
@@ -116,7 +116,7 @@ Bond Packet Output
 --
 
 When a packet is sent out a bond port, the bond slave actually used is selected
-based on the packet's source MAC and VLAN tag (see ``choose_output_iface()``).
+based on the packet's source MAC and VLAN tag (see 
``bond_choose_output_slave()``).
 In particular, the source MAC and VLAN tag are hashed into one of 256 values,
 and that value is looked up in a hash table (the "bond hash") kept in the
 ``bond_hash`` member of struct port.  The hash table entry identifies a bond
@@ -124,7 +124,7 @@ slave.  If no bond slave has yet been chosen for that hash 
table entry,
 vswitchd chooses one arbitrarily.
 
 Every 10 seconds, vswitchd rebalances the bond slaves (see
-``bond_rebalance_port()``).  To rebalance, vswitchd examines the statistics for
+``bond_rebalance()``).  To rebalance, vswitchd examines the statistics for
 the number of bytes transmitted by each slave over approximately the past
 minute, with data sent more recently weighted more heavily than data sent less
 recently.  It considers each of the slaves in order from most-loaded to
-- 
1.8.3.1



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


[ovs-dev] [PATCH 3/4] ofproto/bond: balance-slb mode fallbacks to active-backup mode.

2017-02-13 Thread nickcooper-zhangtonghao
lacp-fallback-ab determines the behavior of OvS bond in LACP mode.
If the partner switch does not support LACP, setting this option
to true allows OvS to fallback to active-backup. The balance-tcp
mode requires lacp. If LACP negotiation fails and
other-config:lacp-fallback-ab is true, then active-backup mode is
used. But if users configure the bond port to balance-slb and lacp
(unsuccessfully), active-backup mode is also used.

Signed-off-by: nickcooper-zhangtonghao 
---
 ofproto/bond.c | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 2703bc9..56996bf 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -798,6 +798,19 @@ bond_check_admissibility(struct bond *bond, const void 
*slave_,
 }
 
 switch (bond->balance) {
+case BM_SLB:
+/* Drop all packets for which we have learned a different input port,
+ * because we probably sent the packet on one slave and got it back on
+ * the other.  Gratuitous ARP packets are an exception to this rule:
+ * the host has moved to another switch.  The exception to the
+ * exception is if we locked the learning table to avoid reflections on
+ * bond slaves. */
+if (bond->lacp_status == LACP_DISABLED) {
+verdict = BV_DROP_IF_MOVED;
+goto out;
+}
+/* Allows OvS to fallback to BM_AB. */
+
 case BM_TCP:
 /* TCP balanced bonds require successful LACP negotiations. Based on
  * the above check, LACP is off or lacp_fallback_ab is true on this
@@ -821,16 +834,6 @@ bond_check_admissibility(struct bond *bond, const void 
*slave_,
 }
 verdict = BV_ACCEPT;
 goto out;
-
-case BM_SLB:
-/* Drop all packets for which we have learned a different input port,
- * because we probably sent the packet on one slave and got it back on
- * the other.  Gratuitous ARP packets are an exception to this rule:
- * the host has moved to another switch.  The exception to the
- * exception is if we locked the learning table to avoid reflections on
- * bond slaves. */
-verdict = BV_DROP_IF_MOVED;
-goto out;
 }
 
 OVS_NOT_REACHED();
-- 
1.8.3.1



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


[ovs-dev] [PATCH 2/4] ofproto/bond: Drop traffic in balance-tcp mode without lacp.

2017-02-13 Thread nickcooper-zhangtonghao
The balance-tcp mode requires the upstream switch to support 802.3ad
with successful LACP negotiation. When bond ports are configured to
balance-tcp mode without lacp or lacp is disabled, drop the traffic.

Signed-off-by: nickcooper-zhangtonghao 
---
 ofproto/bond.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 2e018aa..2703bc9 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -799,11 +799,12 @@ bond_check_admissibility(struct bond *bond, const void 
*slave_,
 
 switch (bond->balance) {
 case BM_TCP:
-/* TCP balanced bonds require successful LACP negotiations. Based on 
the
- * above check, LACP is off or lacp_fallback_ab is true on this bond.
- * If lacp_fallback_ab is true fall through to BM_AB case else, we
- * drop all incoming traffic. */
-if (!bond->lacp_fallback_ab) {
+/* TCP balanced bonds require successful LACP negotiations. Based on
+ * the above check, LACP is off or lacp_fallback_ab is true on this
+ * bond. If LACP is in LACP_DISABLED state, drop all incoming traffic.
+ * If LACP is in LACP_CONFIGURED state and lacp_fallback_ab is true
+ * fall through to BM_AB case else, we drop all incoming traffic. */
+if (bond->lacp_status == LACP_DISABLED || !bond->lacp_fallback_ab) {
 goto out;
 }
 
-- 
1.8.3.1



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


[ovs-dev] [PATCH 1/4] ofproto/bond: Validate active-slave mac.

2017-02-13 Thread nickcooper-zhangtonghao
That the mac of active-slave is invalid(e.g. 00:00:00:00:00:00)
is incidental. The reason is described as below.

In the bridge_reconfig():
1. bond devices created in port_configure().
2. the bonded interfaces may be disabled even calling bridge_run__(),
   because the interface link is not ready.

The OvS will run bridge_run__() in next loop. In next loop, the
active-slave may be selected. But OvS the bridge_reconfig() again,
the bond_reconfigure() set active-slave mac zero and flag false.
If using the 'ovs-appctl bond/show bond-name' to check active-slave
mac, you will find the mac is zero and mac in the ovsdb is also zero.

The active_slave_mac and active_slave_changed should be initialized
when created.

Signed-off-by: nickcooper-zhangtonghao 
---
 ofproto/bond.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 5063b3f..2e018aa 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -242,6 +242,9 @@ bond_create(const struct bond_settings *s, struct 
ofproto_dpif *ofproto)
 ovs_refcount_init(>ref_cnt);
 hmap_init(>pr_rule_ops);
 
+bond->active_slave_mac = eth_addr_zero;
+bond->active_slave_changed = false;
+
 bond_reconfigure(bond, s);
 return bond;
 }
@@ -457,9 +460,6 @@ bond_reconfigure(struct bond *bond, const struct 
bond_settings *s)
 bond_entry_reset(bond);
 }
 
-bond->active_slave_mac = s->active_slave_mac;
-bond->active_slave_changed = false;
-
 ovs_rwlock_unlock();
 return revalidate;
 }
-- 
1.8.3.1



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


Re: [ovs-dev] [PATCH] Remove build-time generated files when "make clean" is run.

2017-02-13 Thread Justin Pettit

> On Feb 13, 2017, at 7:49 PM, Ben Pfaff  wrote:
> 
> On Mon, Feb 13, 2017 at 05:31:49PM -0800, Justin Pettit wrote:
>> "make clean" should remove all files generated by building a program, while
>> "make distclean" should also remove files generated by configuring the
>> program.  Previously some generated files during the build process, such
>> as man pages, were left behind when "make clean" was run.  This commit
>> only leaves configuration files after "make clean" is run, and removes
>> all other generated files.
>> 
>> Signed-off-by: Justin Pettit 
> 
> For this kind of change, it's helpful to try "make distcheck".

Just checked, and it passed.

> If that passes:
> Acked-by: Ben Pfaff 

Thanks.  I just pushed it.

--Justin


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


Re: [ovs-dev] [PATCH] Remove build-time generated files when "make clean" is run.

2017-02-13 Thread Ben Pfaff
On Mon, Feb 13, 2017 at 05:31:49PM -0800, Justin Pettit wrote:
> "make clean" should remove all files generated by building a program, while
> "make distclean" should also remove files generated by configuring the
> program.  Previously some generated files during the build process, such
> as man pages, were left behind when "make clean" was run.  This commit
> only leaves configuration files after "make clean" is run, and removes
> all other generated files.
> 
> Signed-off-by: Justin Pettit 

For this kind of change, it's helpful to try "make distcheck".

If that passes:
Acked-by: Ben Pfaff 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] Remove build-time generated files when "make clean" is run.

2017-02-13 Thread Justin Pettit
"make clean" should remove all files generated by building a program, while
"make distclean" should also remove files generated by configuring the
program.  Previously some generated files during the build process, such
as man pages, were left behind when "make clean" was run.  This commit
only leaves configuration files after "make clean" is run, and removes
all other generated files.

Signed-off-by: Justin Pettit 
---
 debian/automake.mk  |  2 +-
 ovn/automake.mk | 10 +-
 ovn/controller-vtep/automake.mk |  2 +-
 ovn/controller/automake.mk  |  2 +-
 ovn/northd/automake.mk  |  2 +-
 ovn/utilities/automake.mk   |  2 +-
 ovsdb/automake.mk   | 10 +-
 utilities/automake.mk   |  2 +-
 utilities/bugtool/automake.mk   |  2 +-
 vswitchd/automake.mk|  6 +++---
 vtep/automake.mk|  6 +++---
 11 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/debian/automake.mk b/debian/automake.mk
index e5e72de..07ea912 100644
--- a/debian/automake.mk
+++ b/debian/automake.mk
@@ -97,4 +97,4 @@ $(srcdir)/debian/copyright: AUTHORS.rst debian/copyright.in
  sed -e '34,/%AUTHORS%/d' $(srcdir)/debian/copyright.in;  \
} > $@
 
-DISTCLEANFILES += debian/copyright
+CLEANFILES += debian/copyright
diff --git a/ovn/automake.mk b/ovn/automake.mk
index 1257ef4..c5925e9 100644
--- a/ovn/automake.mk
+++ b/ovn/automake.mk
@@ -15,13 +15,13 @@ ovn/ovn-sb.pic: ovn/ovn-sb.gv ovsdb/dot2pic
mv $@.tmp $@
 OVN_SB_PIC = ovn/ovn-sb.pic
 OVN_SB_DOT_DIAGRAM_ARG = --er-diagram=$(OVN_SB_PIC)
-DISTCLEANFILES += ovn/ovn-sb.gv ovn/ovn-sb.pic
+CLEANFILES += ovn/ovn-sb.gv ovn/ovn-sb.pic
 endif
 endif
 
 # OVN southbound schema documentation
 EXTRA_DIST += ovn/ovn-sb.xml
-DISTCLEANFILES += ovn/ovn-sb.5
+CLEANFILES += ovn/ovn-sb.5
 man_MANS += ovn/ovn-sb.5
 ovn/ovn-sb.5: \
ovsdb/ovsdb-doc ovn/ovn-sb.xml ovn/ovn-sb.ovsschema $(OVN_SB_PIC)
@@ -49,13 +49,13 @@ ovn/ovn-nb.pic: ovn/ovn-nb.gv ovsdb/dot2pic
mv $@.tmp $@
 OVN_NB_PIC = ovn/ovn-nb.pic
 OVN_NB_DOT_DIAGRAM_ARG = --er-diagram=$(OVN_NB_PIC)
-DISTCLEANFILES += ovn/ovn-nb.gv ovn/ovn-nb.pic
+CLEANFILES += ovn/ovn-nb.gv ovn/ovn-nb.pic
 endif
 endif
 
 # OVN northbound schema documentation
 EXTRA_DIST += ovn/ovn-nb.xml
-DISTCLEANFILES += ovn/ovn-nb.5
+CLEANFILES += ovn/ovn-nb.5
 man_MANS += ovn/ovn-nb.5
 ovn/ovn-nb.5: \
ovsdb/ovsdb-doc ovn/ovn-nb.xml ovn/ovn-nb.ovsschema $(OVN_NB_PIC)
@@ -68,7 +68,7 @@ ovn/ovn-nb.5: \
 
 man_MANS += ovn/ovn-architecture.7
 EXTRA_DIST += ovn/ovn-architecture.7.xml
-DISTCLEANFILES += ovn/ovn-architecture.7
+CLEANFILES += ovn/ovn-architecture.7
 
 EXTRA_DIST += \
ovn/TODO.rst
diff --git a/ovn/controller-vtep/automake.mk b/ovn/controller-vtep/automake.mk
index cacfae6..0c83dc7 100644
--- a/ovn/controller-vtep/automake.mk
+++ b/ovn/controller-vtep/automake.mk
@@ -11,4 +11,4 @@ ovn_controller_vtep_ovn_controller_vtep_SOURCES = \
 ovn_controller_vtep_ovn_controller_vtep_LDADD = ovn/lib/libovn.la 
lib/libopenvswitch.la vtep/libvtep.la
 man_MANS += ovn/controller-vtep/ovn-controller-vtep.8
 EXTRA_DIST += ovn/controller-vtep/ovn-controller-vtep.8.xml
-DISTCLEANFILES += ovn/controller-vtep/ovn-controller-vtep.8
+CLEANFILES += ovn/controller-vtep/ovn-controller-vtep.8
diff --git a/ovn/controller/automake.mk b/ovn/controller/automake.mk
index cf57bbd..8c6a787 100644
--- a/ovn/controller/automake.mk
+++ b/ovn/controller/automake.mk
@@ -23,4 +23,4 @@ ovn_controller_ovn_controller_SOURCES = \
 ovn_controller_ovn_controller_LDADD = ovn/lib/libovn.la lib/libopenvswitch.la
 man_MANS += ovn/controller/ovn-controller.8
 EXTRA_DIST += ovn/controller/ovn-controller.8.xml
-DISTCLEANFILES += ovn/controller/ovn-controller.8
+CLEANFILES += ovn/controller/ovn-controller.8
diff --git a/ovn/northd/automake.mk b/ovn/northd/automake.mk
index 6e713fc..93aebe8 100644
--- a/ovn/northd/automake.mk
+++ b/ovn/northd/automake.mk
@@ -7,4 +7,4 @@ ovn_northd_ovn_northd_LDADD = \
lib/libopenvswitch.la
 man_MANS += ovn/northd/ovn-northd.8
 EXTRA_DIST += ovn/northd/ovn-northd.8.xml
-DISTCLEANFILES += ovn/northd/ovn-northd.8
+CLEANFILES += ovn/northd/ovn-northd.8
diff --git a/ovn/utilities/automake.mk b/ovn/utilities/automake.mk
index 164cdda..08e48ea 100644
--- a/ovn/utilities/automake.mk
+++ b/ovn/utilities/automake.mk
@@ -24,7 +24,7 @@ EXTRA_DIST += \
 ovn/utilities/ovn-trace.8.xml \
 ovn/utilities/ovndb-servers.ocf
 
-DISTCLEANFILES += \
+CLEANFILES += \
 ovn/utilities/ovn-ctl.8 \
 ovn/utilities/ovn-nbctl.8 \
 ovn/utilities/ovn-sbctl.8 \
diff --git a/ovsdb/automake.mk b/ovsdb/automake.mk
index 84aed2a..33d04f8 100644
--- a/ovsdb/automake.mk
+++ b/ovsdb/automake.mk
@@ -54,7 +54,7 @@ ovsdb_ovsdb_tool_SOURCES = ovsdb/ovsdb-tool.c
 ovsdb_ovsdb_tool_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
 # ovsdb-tool.1
 man_MANS += ovsdb/ovsdb-tool.1
-DISTCLEANFILES += ovsdb/ovsdb-tool.1
+CLEANFILES += 

Re: [ovs-dev] [PATCH ovs V3 17/25] dpif-netlink: Use netdev flow get api to query a flow

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:30 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 17/25] dpif-netlink: Use netdev flow get api to query
> a flow
> 
> From: Paul Blakey 
> 
> Search all datapath added netdevs for a given flow using netdev flow api and
> parse it back to dpif flow.
> 
> Signed-off-by: Paul Blakey 
> Reviewed-by: Roi Dayan 
> ---
>  lib/dpif-netlink.c | 11 ++-
>  lib/netdev.c   | 16 
>  2 files changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index b5f5694..a9eb25f
> 100644
> --- a/lib/dpif-netlink.c
> +++ b/lib/dpif-netlink.c
> @@ -2097,7 +2097,16 @@ try_send_to_netdev(struct dpif_netlink *dpif,
> struct dpif_op *op)
>  return netdev_ports_flow_del(DPIF_HMAP_KEY(>dpif), del-
> >ufid,
>   del->stats);
>  }
> -case DPIF_OP_FLOW_GET:
> +case DPIF_OP_FLOW_GET: {
> +struct dpif_flow_get *get = >u.flow_get;
> +
> +if (!op->u.flow_get.ufid) {
> +break;
> +}
> +dbg_print_flow(get->key, get->key_len, NULL, 0, NULL, 0,
> +   get->ufid, "GET");
> +return parse_flow_get(dpif, get);
> +}
>  case DPIF_OP_EXECUTE:
>  default:
>  break;
> diff --git a/lib/netdev.c b/lib/netdev.c index c6a4582..fd77d55 100644
> --- a/lib/netdev.c
> +++ b/lib/netdev.c
> @@ -2284,6 +2284,22 @@ netdev_ports_flow_del(const void *obj, const
> ovs_u128 *ufid,
>  return ENOENT;
>  }
> 
> +int
> +netdev_ports_flow_get(const void *obj, struct match *match,
> +  struct nlattr **actions, struct dpif_flow_stats *stats,
> +  const ovs_u128 *ufid, struct ofpbuf *buf) {
> +struct port_to_netdev_data *data;
> +
[Sugesh] Same comment here, I feel its good to keep track of installed flow as 
well with the netdev. 
> +HMAP_FOR_EACH(data, node, _to_netdev) {
> +if (data->obj == obj && !netdev_flow_get(data->netdev, match,
> actions,
> + stats, ufid, buf)) {
> +return 0;
> +}
> +}
> +return ENOENT;
> +}
> +
>  bool netdev_flow_api_enabled = false;
> 
>  void
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 15/25] dpif-netlink: Delete a flow from netdev

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 15/25] dpif-netlink: Delete a flow from netdev
> 
> From: Paul Blakey 
> +}
> +dbg_print_flow(del->key, del->key_len, NULL, 0, NULL, 0,
> +   del->ufid, "DEL");
> +return netdev_ports_flow_del(DPIF_HMAP_KEY(>dpif), del-
> >ufid,
> + del->stats);
> +}
>  case DPIF_OP_FLOW_GET:
>  case DPIF_OP_EXECUTE:
>  default:
> diff --git a/lib/netdev.c b/lib/netdev.c index a0206b0..c6a4582 100644
> --- a/lib/netdev.c
> +++ b/lib/netdev.c
> @@ -2269,6 +2269,21 @@ netdev_ports_flow_dumps_create(const void
> *obj, int *ports)
>  return dumps;
>  }
> 
> +int
> +netdev_ports_flow_del(const void *obj, const ovs_u128 *ufid,
> +  struct dpif_flow_stats *stats) {
> +struct port_to_netdev_data *data;
> +
[Sugesh]every flow delete may need to loop through all the netdev ovs ports 
even though there is no hardware offload flows are exists.
I would suggest to keep a hash map of installed hardware flows and do the 
lookup on it using the ufid at the time of delete. 
> +HMAP_FOR_EACH(data, node, _to_netdev) {
> +if (data->obj == obj && !netdev_flow_del(data->netdev, stats, ufid)) 
> {
> +return 0;
> +}
> +}
> +
> +return ENOENT;
> +}
> +
>  bool netdev_flow_api_enabled = false;
> 
>  void
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 14/25] netdev-tc-offloads: Implement netdev flow put using tc interface

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 14/25] netdev-tc-offloads: Implement netdev flow
> put using tc interface
> 
> From: Paul Blakey 
> 
> Signed-off-by: Paul Blakey 
> Reviewed-by: Roi Dayan 

..
[Sugesh] Good to mention its supports only tunnel offload for now.
>  return false;
>  }
> 
> +static int
> +parse_put_flow_set_action(struct tc_flower *flower, const struct nlattr
> *set,
> +  size_t set_len) {
> +static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
> +const struct nlattr *set_attr;
> +size_t set_left;
> +
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 13/25] netdev-tc-offloads: Add flower mask to priority map

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 13/25] netdev-tc-offloads: Add flower mask to
> priority map
> 
> From: Paul Blakey 
> 
> Flower classifer requires a different priority per mask, so we hash the mask
> and generate a new priority for each new mask used.
> 
> Signed-off-by: Paul Blakey 
> Reviewed-by: Roi Dayan 
> ---
> +};
> +
[Sugesh] May be I am missing something here, cant we generate this priority 
value from the ufid or ufid hash?
> +static uint16_t
> +get_prio_for_tc_flower(struct tc_flower *flower) {
> +static struct hmap prios = HMAP_INITIALIZER();
> +static struct ovs_mutex prios_lock = OVS_MUTEX_INITIALIZER;
> +static int last_prio = 0;
> +size_t key_len = sizeof(struct tc_flower_key);
> +size_t hash = hash_bytes(>mask, key_len,
> + (OVS_FORCE uint32_t) flower->key.eth_type);
> +struct prio_map_data *data;
> +struct prio_map_data *new_data;
> +
> +ovs_mutex_lock(_lock);
> +HMAP_FOR_EACH_WITH_HASH(data, node, hash, ) {
> +if (!memcmp(>mask, >mask, key_len)
> +&& data->protocol == flower->key.eth_type) {
> +ovs_mutex_unlock(_lock);
> +return data->prio;
> +}
> +}
> +
.
>  int
>  netdev_tc_flow_flush(struct netdev *netdev)  {
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 12/25] dpif-netlink: Use netdev flow put api to insert a flow

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 12/25] dpif-netlink: Use netdev flow put api to insert
> a flow
> 
> From: Paul Blakey 
> 
> +
> +// XXX: missing ofpbuf_uninit?
> +return 0;
> +}
> +
> +static int
> +parse_flow_put(struct dpif_netlink *dpif, struct dpif_flow_put *put) {
> +static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
> +struct match match;
> +odp_port_t in_port;
> +const struct nlattr *nla;
> +size_t left;
> +int outputs = 0;
> +struct netdev *dev;
> +struct offload_info info;
> +ovs_be16 dst_port = 0;
> +int err = 0;
> +
> +if (put->flags & DPIF_FP_PROBE) {
> +return EOPNOTSUPP;
> +}
> +
> +err = parse_key_and_mask_to_match(put->key, put->key_len, put-
> >mask,
> +  put->mask_len, );
> +if (err) {
> +return err;
> +}
> +
> +/* Get tunnel dst port and count outputs */
> +NL_ATTR_FOR_EACH(nla, left, put->actions, put->actions_len) {
> +if (nl_attr_type(nla) == OVS_ACTION_ATTR_OUTPUT) {
> +const struct netdev_tunnel_config *tnl_cfg;
> +struct netdev *outdev;
> +odp_port_t out_port;
> +
[Sugesh]  Just wondering , is it the right place to do these checks. In fact 
these are limited by the hardware(Correct me if I am wrong here). So this has 
to under the specific netdev_flow_put than here? 
> +outputs++;
> +if (outputs > 1) {
> +VLOG_WARN_RL(, "offloading multiple ports isn't 
> supported");
> +err = EOPNOTSUPP;
> +goto err_out;
> +}
> +
> +out_port = nl_attr_get_odp_port(nla);
> +outdev = netdev_hmap_port_get(out_port, DPIF_HMAP_KEY(
> >dpif));
> +tnl_cfg = netdev_get_tunnel_config(outdev);
> +if (tnl_cfg && tnl_cfg->dst_port != 0) {
> +dst_port = tnl_cfg->dst_port;
> +}
> +netdev_close(outdev);
> +}
> +}
> +
> +
> +info.port_hmap_obj = DPIF_HMAP_KEY(>dpif);
> +info.tp_dst_port = dst_port;
> +in_port = match.flow.in_port.odp_port;
> +dev = netdev_hmap_port_get(in_port, DPIF_HMAP_KEY(>dpif));
> +err = netdev_flow_put(dev, ,
> +  CONST_CAST(struct nlattr *, put->actions),
> +  put->actions_len, put->stats,
> +  CONST_CAST(ovs_u128 *, put->ufid), );
> +netdev_close(dev);
> +
> +if (!err) {
> +if (put->flags & DPIF_FP_MODIFY) {
> +struct dpif_op *opp;
> +struct dpif_op op;
> +
> +op.type = DPIF_OP_FLOW_DEL;
> +op.u.flow_del.key = put->key;
> +op.u.flow_del.key_len = put->key_len;
> +op.u.flow_del.ufid = put->ufid;
> +op.u.flow_del.pmd_id = put->pmd_id;
> +op.u.flow_del.stats = NULL;
> +op.u.flow_del.terse = false;
> +
> +opp = 
> +dpif_netlink_operate__(dpif, , 1);
> +}
> +VLOG_DBG("added flow");
> +} else if (err != EEXIST) {
> +VLOG_ERR_RL(, "failed adding flow: %s", ovs_strerror(err));
> +}
> +
> +err_out:
> +
> +return err;
> +}
> +
>  static void
> -dpif_netlink_operate(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
> +dbg_print_flow(const struct nlattr *key, size_t key_len,
> +   const struct nlattr *mask, size_t mask_len,
> +   const struct nlattr *actions, size_t actions_len,
> +   const ovs_u128 *ufid,
> +   const char *op)
> +{
> +struct ds s;
> +
> +ds_init();
> +ds_put_cstr(, op);
> +ds_put_cstr(, " (");
> +odp_format_ufid(ufid, );
> +ds_put_cstr(, ")");
> +if (key_len) {
> +ds_put_cstr(, "\nflow (verbose): ");
> +odp_flow_format(key, key_len, mask, mask_len, NULL, , true);
> +ds_put_cstr(, "\nflow: ");
> +odp_flow_format(key, key_len, mask, mask_len, NULL, , false);
> +}
> +ds_put_cstr(, "\nactions: ");
> +format_odp_actions(, actions, actions_len);
> +VLOG_DBG("\n%s", ds_cstr());
> +ds_destroy();
> +}
> +
> +static int
> 

Re: [ovs-dev] [PATCH ovs V3 10/25] netdev-tc-offloads: Add ufid to tc/netdev map

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 10/25] netdev-tc-offloads: Add ufid to tc/netdev
> map

.
> +
[Sugesh] Good to have comment on each functions explaining about the return 
values and parameters?
> +static bool
> +del_ufid_tc_mapping(const ovs_u128 *ufid) {
> +size_t hash = hash_bytes(ufid, sizeof *ufid, 0);
> +struct ufid_to_tc_data *data;
> +
> +ovs_mutex_lock(_lock);
> +HMAP_FOR_EACH_WITH_HASH(data, node, hash, _to_tc) {
> +if (ovs_u128_equals(*ufid, data->ufid)) {
> +break;
> +}
> +}
> +if (data) {
> +hmap_remove(_to_tc, >node);
> +ovs_mutex_unlock(_lock);
> +netdev_close(data->netdev);
> +free(data);
> +return true;
> +}
> +ovs_mutex_unlock(_lock);
> +return false;
> +}
> +
> +static ovs_u128 *
> +find_ufid(int prio, int handle, struct netdev *netdev) {
> +int ifindex = netdev_get_ifindex(netdev);
> +struct ufid_to_tc_data *data;
> +
> +ovs_mutex_lock(_lock);
> +HMAP_FOR_EACH(data, node, _to_tc) {
> +if (data->prio == prio && data->handle == handle
> +&& netdev_get_ifindex(data->netdev) == ifindex) {
> +break;
> +}
> +}
> +ovs_mutex_unlock(_lock);
> +if (data) {
> +return >ufid;
> +}
> +return NULL;
> +}
> +
> +static int
> +get_ufid_tc_mapping(const ovs_u128 *ufid, int *prio, struct netdev
> +**netdev) {
> +size_t hash = hash_bytes(ufid, sizeof *ufid, 0);
> +struct ufid_to_tc_data *data;
> +
> +ovs_mutex_lock(_lock);
> +HMAP_FOR_EACH_WITH_HASH(data, node, hash, _to_tc) {
> +if (ovs_u128_equals(*ufid, data->ufid)) {
> +break;
> +}
> +}
> +ovs_mutex_unlock(_lock);
> +if (data) {
> +if (prio) {
> +*prio = data->prio;
> +}
> +if (netdev) {
> +*netdev = netdev_ref(data->netdev);
> +}
> +return data->handle;
> +}
> +return 0;
> +}
> +
[Sugesh] I assume its add +replace than just add? May be its good to add 
comment or changing the function name accordingly.
> +static bool
> +add_ufid_tc_mapping(const ovs_u128 *ufid, int prio, int handle,
> +struct netdev *netdev) {
> +size_t hash = hash_bytes(ufid, sizeof *ufid, 0);
> +bool replace = del_ufid_tc_mapping(ufid);
> +struct ufid_to_tc_data *new_data = xzalloc(sizeof *new_data);
> +
> +new_data->ufid = *ufid;
> +new_data->prio = prio;
> +new_data->handle = handle;
> +new_data->netdev = netdev_ref(netdev);
> +
> +ovs_mutex_lock(_lock);
> +hmap_insert(_to_tc, _data->node, hash);
> +ovs_mutex_unlock(_lock);
> +
> +return replace;
> +}
> +
>  int
>  netdev_tc_flow_flush(struct netdev *netdev)  {
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 05/25] other-config: Add tc-policy switch to control tc flower flag

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 05/25] other-config: Add tc-policy switch to control tc
> flower flag
> 

> *ovs_other_config)
> 
>  VLOG_INFO("netdev: Flow API Enabled");
> 
> +tc_set_policy(smap_get_def(ovs_other_config, "tc-policy",
> +   TC_POLICY_DEFAULT));
> +
[Sugesh] I feel we better call this policy as hw-ofld-policy than tc-policy. As 
far as I know tc is one of the way to program the hardware. In the dpdk dpif 
there must be be another flow programming interface that can be used to program 
the offload. It would be nice if we can use the same configuration option  for 
all the deployments.
>  ovsthread_once_done();
>  }
>  }
> diff --git a/lib/tc.c b/lib/tc.c
> index 431242b..b2e3d21 100644
> --- a/lib/tc.c
> +++ b/lib/tc.c
> @@ -38,6 +38,14 @@ VLOG_DEFINE_THIS_MODULE(tc);
> 
>  static struct vlog_rate_limit parse_err = VLOG_RATE_LIMIT_INIT(5, 5);
> 
> +enum tc_offload_policy {
> +TC_POLICY_NONE,
> +TC_POLICY_SKIP_SW,
> +TC_POLICY_SKIP_HW
> +};
> +
> +static enum tc_offload_policy tc_policy = TC_POLICY_NONE;
> +
>  /* Returns tc handle 'major':'minor'. */  unsigned int
> tc_make_handle(unsigned int major, unsigned int minor) @@ -719,6 +727,18
> @@ tc_get_flower(int ifindex, int prio, int handle, struct tc_flower *flower)
>  return error;
>  }
> 
> +static int
> +tc_get_tc_cls_policy(enum tc_offload_policy policy) {
[Sugesh] tc_get_hw_ofld_policy ??
> +if (policy == TC_POLICY_SKIP_HW) {
> +return TCA_CLS_FLAGS_SKIP_HW;
> +} else if (policy == TC_POLICY_SKIP_SW) {
> +return TCA_CLS_FLAGS_SKIP_SW;
> +}
> +
> +return 0;
> +}
> +
>  static void
>  nl_msg_put_act_push_vlan(struct ofpbuf *request, uint16_t vid, uint8_t
> prio)  { @@ -989,7 +1009,7 @@ nl_msg_put_flower_options(struct ofpbuf
> *request, struct tc_flower *flower)
>  }
>  }
> 
> -nl_msg_put_u32(request, TCA_FLOWER_FLAGS, 0);
> +nl_msg_put_u32(request, TCA_FLOWER_FLAGS,
> + tc_get_tc_cls_policy(tc_policy));
> 
>  if (flower->tunnel.tunnel) {
>  nl_msg_put_flower_tunnel(request, flower); @@ -1033,3 +1053,24 @@
> tc_replace_flower(int ifindex, uint16_t prio, uint32_t handle,
> 
>  return error;
>  }
> +
> +void
> +tc_set_policy(const char *policy)
> +{
> +if (!policy) {
> +return;
> +}
> +
> +if (!strcmp(policy, "skip_sw")) {
> +tc_policy = TC_POLICY_SKIP_SW;
> +} else if (!strcmp(policy, "skip_hw")) {
> +tc_policy = TC_POLICY_SKIP_HW;
> +} else if (!strcmp(policy, "none")) {
> +tc_policy = TC_POLICY_NONE;
> +} else {
> +VLOG_WARN("tc: Invalid policy '%s'", policy);
> +return;
> +}
> +
> +VLOG_INFO("tc: Using policy '%s'", policy); }
> diff --git a/lib/tc.h b/lib/tc.h
> index 5ca6c55..6f6cc09 100644
> --- a/lib/tc.h
> +++ b/lib/tc.h
> @@ -115,5 +115,6 @@ int tc_flush(int ifindex);  int tc_dump_flower_start(int
> ifindex, struct nl_dump *dump);  int parse_netlink_to_tc_flower(struct
> ofpbuf *reply,
> struct tc_flower *flower);
> +void tc_set_policy(const char *policy);
> 
>  #endif /* tc.h */
> diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index
> 942e68f..8b9bdcb 100644
> --- a/vswitchd/vswitch.xml
> +++ b/vswitchd/vswitch.xml
> @@ -183,6 +183,23 @@
>  
>
> 
> +   +  type='{"type": "string"}'>
> +
> +Specified the policy used with HW offloading.
> +Options:
> +none- Add software rule and offload rule to 
> HW.
> +skip_sw - Offload rule to HW only.
> +skip_hw - Add software rule without offloading 
> rule
> to HW.
> +
> +
> +This is only relevant if HW offloading is enabled (hw-offload).
> +
> +
> +  The default value is false.
> +
> +  
> +
>type='{"type": "boolean"}'>
>  
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 04/25] other-config: Add hw-offload switch to control netdev flow offloading

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 04/25] other-config: Add hw-offload switch to control
> netdev flow offloading
> 
> From: Paul Blakey 
> 
>  }
> 
> diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index
> 146a816..942e68f 100644
> --- a/vswitchd/vswitch.xml
> +++ b/vswitchd/vswitch.xml
> @@ -170,6 +170,17 @@
>  
>The default is 1.
>  
> +
> +
> +   +  type='{"type": "boolean"}'>
> +
> +  Set this value to true to enable netdev flow offload.
> +
> +
> +  The default value is false. Changing this value 
> requires
> +  restarting the daemon
[Sugesh] Hope its only the case of current implementation. Its possible to 
change the hardware offload status at run-time in the future. The system will 
re-populate the hardware ports accordingly when the status get changed.
> +
>
> 
> --
> 2.7.4

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


Re: [ovs-dev] [PATCH ovs V3 00/25] Introducing HW offload support for openvswitch

2017-02-13 Thread Chandran, Sugesh
Hi Paul & Roi,
Thank you for the patch series, 
Please find my comments inline in the following mails.
I am trying to build it in OVS-DPDK and its failing on my board? JFYI I Rebased 
over commit e6932e5dd59fe2bd7d90ef365bdd95707cd369d0.


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh ; Roi
> Dayan 
> Subject: [PATCH ovs V3 00/25] Introducing HW offload support for
> openvswitch
> 
> This patch series introduces rule offload functionality to dpif-netlink via
> netdev ports new flow offloading API. The user can specify whether to
> enable rule offloading or not via OVS configuration. Netdev providers are
> able to implement netdev flow offload API in order to offload rules.
> 
> This patch series also implements one offload scheme for netdev-linux, using
> TC flower classifier, which was chosen because its sort of natural to state 
> OVS
> DP rules for this classifier. However, the code can be extended to support
> other classifiers such as U32, eBPF, etc which support offload as well.
> 
> The use-case we are currently addressing is the newly sriov switchdev mode
> in the Linux kernel which was introduced in version 4.8 [1][2].
> This series was tested against sriov vfs vports representors of the Mellanox
> 100G ConnectX-4 series exposed by the mlx5 kernel driver.
> 
> 
> V2->V3:
> - Code styling fixes
> - Bug fixes
> - Using already available macros/functions to match current OVS code
> - Refactored code according to V2 review
> - Replaced bool option skip-hw for string option tc-policy
> - Added hw offload tests using policy skip_hw
> - Fixed most compatability compiling issues
> - Travis
> https://travis-ci.org/roidayan/ovs/builds/199610124
> - AppVeyor
> https://ci.appveyor.com/project/roidayan/ovs/build/1.0.14
> - Fixed compiling with DPDK enabled
> 
> TODO:
> - need to fix datapath compiling issues found in travis after adding tc
>   compatability headers
> - need to fix failing test cases because of get_ifindex
> 
> 
> V1->V2:
> - Added generic netdev flow offloads API.
> - Implemented relevant flow API in netdev-linux (and netdev-vport).
> - Added a other_config hw-offload option to enable offloading (defaults to
> false).
> - Fixed coding style to conform with OVS.
> - Policy removed for now. (Will be discussed how best implemented later).
> 
> 
> Thanks,
> Paul & Roi
> 
> 
> Paul Blakey (25):
>   tc: Add tc flower interface
>   netdev-linux: Move some tc related functions to tc.c
>   netdev: Adding a new netdev api to be used for offloading flows
>   other-config: Add hw-offload switch to control netdev flow offloading
>   other-config: Add tc-policy switch to control tc flower flag
>   dpif: Save added ports in a port map for netdev flow api use
>   dpif-netlink: Flush added ports using netdev flow api
>   netdev-tc-offloads: Implement netdev flow flush using tc interface
>   dpif-netlink: Dump netdevs flows on flow dump
>   netdev-tc-offloads: Add ufid to tc/netdev map
>   netdev-tc-offloads: Implement netdev flow dump api using tc interface
>   dpif-netlink: Use netdev flow put api to insert a flow
>   netdev-tc-offloads: Add flower mask to priority map
>   netdev-tc-offloads: Implement netdev flow put using tc interface
>   dpif-netlink: Delete a flow from netdev
>   netdev-tc-offloads: Implement netdev flow del using tc interface
>   dpif-netlink: Use netdev flow get api to query a flow
>   netdev-tc-offloads: Implement flow get using tc interface
>   netdev-linux: Disallow setting policing when configured with hw
> offload
>   netdev-vport: Implement netdev vport get_ifindex on Linux
>   netdev-vport: Use common offloads interface
>   netdev-tc-offloads: Add ingress on netdev flow api init
>   dpctl: Add an option to dump only certain kinds of flows
>   tests: Add system-offloads-testsuite
>   compat: Add tc compatibility headers for old kernels
> 
>  acinclude.m4 |   26 +
>  configure.ac |1 +
>  include/automake.mk  |1 +
>  include/linux/automake.mk|4 +
>  include/linux/pkt_cls.h  |  579 ++
>  include/linux/tc_act/tc_tunnel_key.h |   48 ++
>  include/linux/tc_act/tc_vlan.h   |   44 

Re: [ovs-dev] [PATCH ovs V3 03/25] netdev: Adding a new netdev api to be used for offloading flows

2017-02-13 Thread Chandran, Sugesh


Regards
_Sugesh


> -Original Message-
> From: Roi Dayan [mailto:r...@mellanox.com]
> Sent: Wednesday, February 8, 2017 3:29 PM
> To: d...@openvswitch.org
> Cc: Paul Blakey ; Or Gerlitz
> ; Hadar Hen Zion ; Shahar
> Klein ; Mark Bloch ; Rony
> Efraim ; Fastabend, John R
> ; Joe Stringer ; Andy
> Gospodarek ; Lance Richardson
> ; Marcelo Ricardo Leitner ;
> Simon Horman ; Jiri Pirko
> ; Chandran, Sugesh 
> Subject: [PATCH ovs V3 03/25] netdev: Adding a new netdev api to be used
> for offloading flows
> 
> From: Paul Blakey 
> 
.

> +
>  /* Network device class structure, to be defined by each implementation of
> a
>   * network device.
>   *
> @@ -769,6 +777,49 @@ struct netdev_class {
> 
>  /* Discards all packets waiting to be received from 'rx'. */
>  int (*rxq_drain)(struct netdev_rxq *rx);
> +
> +/* ##  ## */
> +/* ## netdev flow offloading functions ## */
> +/* ##  ## */
[Sugesh] The netdev offload api are good to call out offload APIs. Something 
like hw_offload_flow_flush or offload_flow_flush. Thoughts??
> +
> +/* If a particular netdev class does not support offloading flows, all
> +these
> + * function pointers must be NULL. */
> +
> +/* Deleting all offloaded flows from netdev */
> +int (*flow_flush)(struct netdev *);
> +/* Dumping interface:
> + * Usage is as with dpif_port_dump api (create, next, destory).
> + * Create sets dump on success or returns error status on failure. */
> +int (*flow_dump_create)(struct netdev *, struct netdev_flow_dump
> **dump);
> +int (*flow_dump_destroy)(struct netdev_flow_dump *);
> + /* rbuffer is for use of the implementation (e.g using nl_dump),
> + * and is usually shared for the given thread that runs flow_dump_next.
> + * wbuffer is the buffer that dumped actions will be stored in, and given
> + * pointers to. */
> +bool (*flow_dump_next)(struct netdev_flow_dump *, struct match *,
> +   struct nlattr **actions,
> +   struct dpif_flow_stats *stats, ovs_u128 *ufid,
> +   struct ofpbuf *rbuffer, struct ofpbuf
> + *wbuffer);
> +
> +/* Offload the given flow (match, actions, stats, ufid) on netdev.
> + * If stats isn't null, sets the given stats for that flow.
> + * To modify the flow, use the same ufid.
> + * actions are in netlink format, as with struct dpif_flow_put.
> + * info is anything else that is need to offload the flow. */
> +int (*flow_put)(struct netdev *, struct match *, struct nlattr *actions,
> +size_t actions_len, struct dpif_flow_stats *,
> +const ovs_u128 *ufid, struct offload_info *info);
> +/* Queries the flow with specified ufid on netdev.
> + * Fills match, actions, stats as with flow_dump_next */
> +int (*flow_get)(struct netdev *, struct match *, struct nlattr **actions,
> +struct dpif_flow_stats *, const ovs_u128 *ufid,
> +struct ofpbuf *);
> +/* Deletes the given flow specified by ufid from netdev.
> + * If stats is not null, fills it with flow stats. */
> +int (*flow_del)(struct netdev *, struct dpif_flow_stats *,
> +const ovs_u128 *ufid);
> +/* Initializies the netdev flow api. */
> +int (*init_flow_api)(struct netdev *);
>  };
> 
.
> 2.7.4

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


Re: [ovs-dev] [PATCH 3/3] ovsdb: Prevent OVSDB server from replicating itself.

2017-02-13 Thread Andy Zhou
On Wed, Feb 8, 2017 at 11:40 AM, Ben Pfaff  wrote:
> On Tue, Feb 07, 2017 at 08:40:22PM -0800, Andy Zhou wrote:
>> Replication OVSDB server from itself is usually caused by configuration
>> errors. Such configuration errors can lead to OVSDB server data loss.
>> See "reported-at" for more details.
>>
>> This patch adds logics that prevent OVSDB server from replicating
>> itself.
>>
>> Reported-by: Guishuai Li 
>> Reported-at: 
>> https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326963.html
>> Suggested-by: Ben Pfaff 
>> Signed-off-by: Andy Zhou 
>
> In the manpage, "vSwitch" is not capitalized correctly, and I'd add a
> little more detail, something like this:
>
> diff --git a/ovsdb/ovsdb-server.1.in b/ovsdb/ovsdb-server.1.in
> index b0f488e..49ff5a6 100644
> --- a/ovsdb/ovsdb-server.1.in
> +++ b/ovsdb/ovsdb-server.1.in
> @@ -578,7 +578,7 @@ but in the response object to the monitor_cond request. 
> The formatting
>  of the  object, however, is the same in either case.
>  .
>  .IP "4.1.15. Get Server ID"
> -A new RPC method added in Open vSWitch version 2.7. The request contains
> +A new RPC method added in Open vSwitch version 2.7. The request contains
>  the following members:
>  .
>  .PP
> @@ -604,7 +604,8 @@ The response object contains the following members:
>  .
>  .IP
>   is JSON string that contains a UUID that uniquely identifies
> -the OVSDB server instance.
> +the running OVSDB server process.  A fresh UUID is generated when the
> +process restarts.
>  .
>  .IP "5.1. Notation"
>  For , RFC 7047 only allows the use of \fB!=\fR, \fB==\fR,
>
> In replication_init(), I'd use "=" to copy the uuid, instead of
> memcpy().
>
> It would be nice to get feedback from the original reporter.  Presumably
> it solves his problem but perhaps he'll have additional insight.
>
> Acked-by: Ben Pfaff 

Pushed all three patches in this series to master and branch-2.7, with
all comments
and suggestions applied.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Adminitración y Finanzas para compradores

2017-02-13 Thread Evaluación Costo-beneficio de las propuestas
Identificar ingresos sustituibles que puedan ayudar para comprar más con menos 
dinero.

Adminitración y Finanzas para compradores + 11 temas

Un objetivo estratégico del equipo del área de compras es trabajar dentro de un
presupuesto. Además de mantener los costos en el rango específico, e incluso
bajarlos; así como identificar en tiempo y forma los riesgos que se pueden 
presentar
debido a la volatilidad e inestabilidad del mercado.

Qué son las finanzas de la empresa, y cómo las afecta la función de compras.

2. Diferencia entre Utilidad y Rentabilidad.
3. El concepto del Costo Total de Adquisición y cómo mejorarlo.
4. Qué es el capital de trabajo y cómo se afecta por las compras.
5. La percepción de los descuentos por volumen.
6. Análisis y evaluación Costo-beneficio de las propuestas.
7. Financiamiento por parte del proveedor.

Si desea que le adjuntemos el temario Sin compromiso, responda este correo con 
la palabra: Compras, juntos con los datos solicitados.

Nombre:
Teléfono:
Correo:

y le enviaremos la información completa de este tema que esta incluido en 
nuestro Plan Integral de Capacitación de COMPRAS.
centro telefónico: 018002129393


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


Re: [ovs-dev] [PATCH v3 0/5] Backport 802.1ad patches

2017-02-13 Thread Eric Garver
On Mon, Feb 13, 2017 at 10:39:11AM +0800, Yi Yang wrote:
> This patch set is to backport 802.1ad patches Eric Garver did to ovs, per 
> discussion in ovs-dev mailing list, this fix patch
> "openvswitch: upcall: Fix vlan handling" depends on them, l3 patch set 
> depends on this patch set and "openvswitch: upcall: Fix vlan handling".
> 
> Yi Yang (5):
>   datapath: backport: vlan: Introduce helper functions to check if skb
> is tagged
>   datapath: backport: openvswitch: 802.1ad uapi changes.
>   datapath: backport: vlan: Check for vlan ethernet types for 8021.q or
> 802.1ad
>   datapath: backport: openvswitch: 802.1AD Flow handling, actions, vlan
> parsing, netlink attributes
>   datapath: Fix cvlan test failure on the old kernel versions
> 
>  acinclude.m4  |   2 +
>  datapath/actions.c|  16 +-
>  datapath/flow.c   |  65 +++--
>  datapath/flow.h   |   8 +-
>  datapath/flow_netlink.c   | 311 
> +++---
>  datapath/linux/compat/include/linux/if_vlan.h |  78 +-
>  datapath/linux/compat/include/linux/openvswitch.h |  17 +-
>  datapath/vport.c  |   7 +-
>  8 files changed, 365 insertions(+), 139 deletions(-)
> 

Thanks Yi.
For check-kmod on a 3.16 kernel, all cvlan/802.1ad tests pass with this
series applied.

I have ACKd the remaining patches I did not previously ACK.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 5/5] datapath: Fix cvlan test failure on the old kernel versions

2017-02-13 Thread Eric Garver
On Mon, Feb 13, 2017 at 10:39:16AM +0800, Yi Yang wrote:
> The root cause is the upcall re-inserts the VLAN back into the raw
> packet data, but the TPID is hard coded to 0x8100. This affects
> kernels for which HAVE_VLAN_INSERT_TAG_SET_PROTO is not set.
> 
> The below patch allows the cvlan and 802.ad tests to pass on debian
> with 3.16 kernel.
> 
> Signed-off-by: Eric Garver 
> Signed-off-by: Yi Yang 
> ---

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


Re: [ovs-dev] [PATCH v3 3/5] datapath: backport: vlan: Check for vlan ethernet types for 8021.q or 802.1ad

2017-02-13 Thread Eric Garver
On Mon, Feb 13, 2017 at 10:39:14AM +0800, Yi Yang wrote:
> commit fe19c4f971a55cea3be442d8032a5f6021702791
> Author: Eric Garver 
> Date:   Wed Sep 7 12:56:58 2016 -0400
> 
> This is to simplify using double tagged vlans. This function allows all
> valid vlan ethertypes to be checked in a single function call.
> Also replace some instances that check for both ETH_P_8021Q and
> ETH_P_8021AD.
> 
> Patch based on one originally by Thomas F Herbert.
> 
> Signed-off-by: Thomas F Herbert 
> Signed-off-by: Eric Garver 
> Acked-by: Pravin B Shelar 
> Signed-off-by: David S. Miller 
> 
> Signed-off-by: Yi Yang 
> ---

Thanks for adding the other hunks.

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


Re: [ovs-dev] [PATCH] rhel: make openvswitch service start return when ready

2017-02-13 Thread Russell Bryant
On Fri, Feb 10, 2017 at 7:03 PM, Alan Pevec  wrote:

> In OVS 2.6 openvswitch systemd service was changed to use BindsTo
> instead of Requires for sub-services but also removed them from After
>
> This made main openvswitch service return before sub-services were ready
> breaking scripts which assumed everything is ready after systemctl start
> e.g. in OpenStack CI infra [1] is calling ovs-vsctl immediately after
> service start exposing a race in virtualized CI environment:
> 2017-02-09T23:11:12.498Z|7|bridge|INFO|ovs-vswitchd (Open vSwitch)
> 2.6.1
> but ovs-ctl tried to access it few msec too early:
> 2017-02-09 23:11:12.352493 | ovs-vsctl: unix:/var/run/openvswitch/db.sock:
> database connection failed (No such file or directory)
>
> Solution is to add ordering dependencies, BindsTo/Requires do not ensure
> it [2]
>
> Fixes: 84ad120 ("rhel: Improved Systemd Integration")
>
> [1] https://github.com/openstack-infra/devstack-gate/blob/
> c435a724bd257b22a2e39e8e9125c11302a8c81d/functions.sh#L1057-L1078
>
> [2] https://www.freedesktop.org/software/systemd/man/systemd.
> unit.html#Requires=
>
> Signed-off-by: Alan Pevec 
> Reviewed-by: Aaron Conole 
> ---
>  rhel/usr_lib_systemd_system_openvswitch.service | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks for the patch!  I added your name to the AUTHORS file and applied
this patch to master, branch-2.7, and branch-2.6.


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


Re: [ovs-dev] [PATCH] packaging: Add hostname as dependency

2017-02-13 Thread Russell Bryant
On Thu, Feb 9, 2017 at 6:11 AM, Jakub Libosvar  wrote:

> ovs-ctl script uses hostname. This patch adds dependency for debian and
> rhel systems.
>
> Signed-off-by: Jakub Libosvar 
> ---
>  debian/control  | 2 +-
>  rhel/openvswitch-fedora.spec.in | 2 +-
>  rhel/openvswitch.spec.in| 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>

ACK for the rhel side, but I'd prefer someone else to ack the debian side.

Acked-by: Russell Bryant 


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


[ovs-dev] [PATCH] packaging: Add hostname as dependency

2017-02-13 Thread Jakub Libosvar
ovs-ctl script uses hostname. This patch adds dependency for debian and
rhel systems.

Signed-off-by: Jakub Libosvar 
---
 debian/control  | 2 +-
 rhel/openvswitch-fedora.spec.in | 2 +-
 rhel/openvswitch.spec.in| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 0b75f2b..25dc9b6 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,7 @@ Homepage: http://openvswitch.org/
 
 Package: openvswitch-datapath-source
 Architecture: all
-Depends: bzip2, debhelper (>= 5.0.37), module-assistant, ${misc:Depends}
+Depends: bzip2, debhelper (>= 5.0.37), hostname, module-assistant, 
${misc:Depends}
 Suggests: openvswitch-switch
 Description: Open vSwitch datapath module source - module-assistant version
  Open vSwitch is a production quality, multilayer, software-based,
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index b395613..79212ad 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -68,7 +68,7 @@ BuildRequires: dpdk-devel >= 16.11
 Provides: %{name}-dpdk = %{version}-%{release}
 %endif
 
-Requires: openssl iproute module-init-tools
+Requires: openssl hostname iproute module-init-tools
 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
 #Requires: kernel >= 3.15.0-0
 
diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index 6aa23de..31a535c 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -32,7 +32,7 @@ License: ASL 2.0
 Release: 1
 Source: openvswitch-%{version}.tar.gz
 Buildroot: /tmp/openvswitch-rpm
-Requires: logrotate, python >= 2.7, python-six
+Requires: logrotate, hostname, python >= 2.7, python-six
 BuildRequires: python-six
 BuildRequires: openssl-devel
 BuildRequires: checkpolicy, selinux-policy-devel
-- 
1.8.3.1

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


Re: [ovs-dev] [PATCH v3 00/16] port Jiri Benc's L3 patchset to ovs

2017-02-13 Thread Valentine Sinitsyn

Hi Jan,

On 10.02.2017 04:14, Jan Scheurich wrote:

Hi Valentine,

On 2017-02-09 08:58, Valentine Sinitsyn wrote:

This L3 patchset looks similar to what we did internally with OVS 2.6
to add support for IPv6 tunnels.

Could you please confirm that ovs-dpctl reports correct statistics
with this patchset when one uses in-kernel Linux datapath? We had some
issues with this (the counters were always zero). Largely, this was
because userspace code (I refer to the tools and the daemon, not DPDK
datapath here) assumes a plugged network interface is always L2, and I
don't see this patch touching these files.


The most recent user-space code in vswitchd that deals with the L3
tunnels in netdev and kernel datapath is contained in another patch
series:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-February/328391.html

You could help in reviewing that. It may not be complete with respect to
handling kernel datapath tunnels as we were not able to test yet due to
a lack of patches to configure L3 tunnel ports in the kernel. But
similar problems with counters might also exist with netdev datapath.
I had a quick look at patch series, thanks for the links. Will try to 
have a more in-depth look this week.


As for the "counters issue" I mentioned, it seems tiny given the scope 
of the patchset. Moreover, a get_etheraddr() change in [1] should fix 
it, although I haven't checked yet.


[1] https://mail.openvswitch.org/pipermail/ovs-dev/2017-February/328392.html

Best,
Valentine



Thanks, Jan


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