ipoib: Don't do a light flush when MTU is unchanged.

When changing the MTU of ibX network interfaces, check that the MTU was really
changed before requesting an update of the multicast rules. Else we might go
into an infinite loop joining and leaving ibX multicast groups towards the
opensm master interface.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
This commit is contained in:
Slava Shwartsman 2018-12-05 13:26:17 +00:00
parent 099ad46e81
commit d705eff259
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341536

View File

@ -305,9 +305,11 @@ ipoib_change_mtu(struct ipoib_dev_priv *priv, int new_mtu, bool propagate)
priv->admin_mtu = new_mtu;
error = ipoib_propagate_ifnet_mtu(priv, min(priv->mcast_mtu,
priv->admin_mtu), propagate);
if (error == 0)
queue_work(ipoib_workqueue, &priv->flush_light);
else
if (error == 0) {
/* check for MTU change to avoid infinite loop */
if (prev_admin_mtu != new_mtu)
queue_work(ipoib_workqueue, &priv->flush_light);
} else
priv->admin_mtu = prev_admin_mtu;
return (error);
}