sonic-net / SONiC

Landing page for Software for Open Networking in the Cloud (SONiC) - https://sonic-net.github.io/SONiC/
2.26k stars 1.13k forks source link

[SONiCv2] teamd cannot re-create lag after netdev devices re-creation #40

Open stcheng opened 8 years ago

stcheng commented 8 years ago

The teamd builds a LAG. After the netdev is removed, and then re-created, the previous teamd process is no longer valid and the previous LAG cannot be re-built.

log:

Ethernet4: Changed port state: "current" -> "expired"
Ethernet0: Changed port state: "current" -> "expired"
carrier changed to DOWN
Ethernet4: Changed port state: "expired" -> "defaulted"
Ethernet0: Changed port state: "expired" -> "defaulted"
Ethernet0: Changed port state: "defaulted" -> "disabled"
Ethernet0: ethtool-link went down.
Loop callback failed with: No such file or directory
ioctl SIOCDELMULTI failed.
Ethernet4: Changed port state: "defaulted" -> "disabled"
Ethernet4: ethtool-link went down.
Loop callback failed with: No such file or directory
ioctl SIOCDELMULTI failed.
lguohan commented 8 years ago

have you tried this teamd --no-ports option?

 -n, --no-ports
              Start   without   ports,   even   if  they  are  listed  in  the
              configuration.
stcheng commented 8 years ago

the --no-ports option is used to create the LAG without ports and then later use command teamdctl to add ports.

lguohan commented 7 years ago

Here is configuration for teamd. It has the port channel and member ports information. I am thinking it make sense for the teamd daemon to listen such new netdev message and added them into the port channel.

Anyway, there needs a daemon to do that and that daemon needs the bond information. Why not include this function into teamd daemon?

{
   "device": "PortChannel0",
   "runner": {
       "name": "lacp",
       "active": true,
       "min_ports": 2,
       "tx_hash": ["eth", "ipv4", "ipv6"]
   },
   "link_watch": {
       "name": "ethtool"
   },
   "ports": {
       "Ethernet0": {},
       "Ethernet4": {}
   }
 }

From Jiri,

What you describe is currently not implemented in teamd. Thinking about it now, it might make sense to have this functionality, as an optional behavior (not default). Question is, according to what you can tell that the netdev is the same netdev that was already bonded. I think that you would have to match on both netdev name and mac address.

Feel free to cook up a patch, including man pages documentation and submit it for the review.

liatgrozovik commented 7 years ago

I cannot find marian-pritsak in the list of assignee. Can any one assign this issue to him?

stcheng commented 7 years ago

the above issue is closed with two commits addressing all interfaces automatically coming up and enslaved in the master interface. however, the teamsyncd crashes when swss/teamd docker restarts. @marian-pritsak could you continue investigating this teamd issue?