diff mbox

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

Message ID 20170403094100.28739-6-matthias.may@neratec.com
State RFC
Headers show

Commit Message

Matthias May April 3, 2017, 9:40 a.m. UTC
Signed-off-by: Matthias May <matthias.may@neratec.com>
---
 ofproto/ofproto-dpif.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Ben Pfaff April 22, 2017, 1:56 a.m. UTC | #1
On Mon, Apr 03, 2017 at 11:40:59AM +0200, Matthias May wrote:
> Signed-off-by: Matthias May <matthias.may@neratec.com>

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.
diff mbox

Patch

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, &ofproto->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(&bundle->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) {