jpirko / libteam

team netdevice library
GNU Lesser General Public License v2.1
230 stars 57 forks source link

LACP: INFO_STATE_AGGREGATION not set on first port when subsequent ports join team #15

Closed ghost closed 8 years ago

ghost commented 9 years ago

With LACP, the INFO_STATE_AGGREGATION bit that indicates to a partner whether an actor is aggregatable is clear, correctly, in PDUs sent when there is only a single port in a team. Subsequent ports that are added to the team do get this bit set, but it remains clear in PDUs sent for the first port, even thought that port has now become aggregatable. The one switch out of one that I tested (Juniper EX2500) would not forward traffic sent on that port.

I was testing with libteam 1.15 on RHEL 7.1, but from looking at the source it appears the behaviour is the same on master.

Steps to reproduce:

$ cat > bond0.cfg
{
  "linkwatch": {
    "name": "ethtool",
    "delay_down": 0,
    "delay_up": 0
  },
  "debug_level": 0,
  "runner": {
    "tx_hash": ["l3"],
    "min_ports": 1,
    "agg_select_policy": "lacp_prio",
    "name": "lacp",
    "fast_rate": false,
    "sys_prio": 255,
    "active": true
  },
  "device": "bond0",
  "ports": {
  }
}
^D
$ teamd -r -f bond0.cfg -d
$ teamdctl bond0 port add ethX
$ teamdctl bond0 port add ethY
# LACP PDUs from ethY have INFO_STATE_AGGREGATION set, but not those from ethX.
jbainbri commented 8 years ago
static void lacp_port_actor_update(struct lacp_port *lacp_port)
{
...
        if (teamd_port_count(lacp_port->ctx) > 1)
                state |= INFO_STATE_AGGREGATION;

This check should probably be > 0. I'll test and report back.