Re: [ovs-dev] [RFC] [PATCH 5/6] port_group: ofproto-dpif: add port_group definition and init

2017-04-21 Thread Ben Pfaff
On Mon, Apr 03, 2017 at 11:40:59AM +0200, Matthias May wrote:
> Signed-off-by: Matthias May 

I'm getting lots of errors with this, I guess that the next patch needs
to be folded in.

(I'm concluding that there should only a single patch for this feature.)

Thanks,

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


[ovs-dev] [RFC] [PATCH 5/6] port_group: ofproto-dpif: add port_group definition and init

2017-04-03 Thread Matthias May
Signed-off-by: Matthias May 
---
 ofproto/ofproto-dpif.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 523adad6f..32d7d69c5 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -93,6 +93,7 @@ struct ofbundle {
 
 /* Configuration. */
 struct ovs_list ports;  /* Contains "struct ofport"s. */
+ofp_port_t port_group;  /* Group of ports to forbid loopback */
 enum port_vlan_mode vlan_mode; /* VLAN mode */
 uint16_t qinq_ethtype;
 int vlan;   /* -1=trunk port, else a 12-bit VLAN ID. */
@@ -451,8 +452,9 @@ type_run(const char *type)
 
 HMAP_FOR_EACH (bundle, hmap_node, >bundles) {
 xlate_bundle_set(ofproto, bundle, bundle->name,
- bundle->vlan_mode, bundle->qinq_ethtype,
- bundle->vlan, bundle->trunks, bundle->cvlans,
+ bundle->port_group, bundle->vlan_mode,
+ bundle->qinq_ethtype, bundle->vlan,
+ bundle->trunks, bundle->cvlans,
  bundle->use_priority_tags,
  bundle->bond, bundle->lacp,
  bundle->floodable, bundle->protected);
@@ -2896,6 +2898,7 @@ bundle_set(struct ofproto *ofproto_, void *aux,
 bundle->name = NULL;
 
 ovs_list_init(>ports);
+bundle->port_group = 0;
 bundle->vlan_mode = PORT_VLAN_TRUNK;
 bundle->qinq_ethtype = ETH_TYPE_VLAN_8021AD;
 bundle->vlan = -1;
@@ -2957,6 +2960,12 @@ bundle_set(struct ofproto *ofproto_, void *aux,
 return EINVAL;
 }
 
+/* Set port_group */
+if (s->port_group != bundle->port_group) {
+bundle->port_group = s->port_group;
+need_flush = true;
+}
+
 /* Set VLAN tagging mode */
 if (s->vlan_mode != bundle->vlan_mode
 || s->use_priority_tags != bundle->use_priority_tags) {
-- 
2.11.0

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