| .. | .. |
|---|
| 135 | 135 | kfree(mcast); |
|---|
| 136 | 136 | } |
|---|
| 137 | 137 | |
|---|
| 138 | | -static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev, |
|---|
| 139 | | - int can_sleep) |
|---|
| 138 | +static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev) |
|---|
| 140 | 139 | { |
|---|
| 141 | 140 | struct ipoib_mcast *mcast; |
|---|
| 142 | 141 | |
|---|
| 143 | | - mcast = kzalloc(sizeof(*mcast), can_sleep ? GFP_KERNEL : GFP_ATOMIC); |
|---|
| 142 | + mcast = kzalloc(sizeof(*mcast), GFP_ATOMIC); |
|---|
| 144 | 143 | if (!mcast) |
|---|
| 145 | 144 | return NULL; |
|---|
| 146 | 145 | |
|---|
| .. | .. |
|---|
| 218 | 217 | struct rdma_ah_attr av; |
|---|
| 219 | 218 | int ret; |
|---|
| 220 | 219 | int set_qkey = 0; |
|---|
| 220 | + int mtu; |
|---|
| 221 | 221 | |
|---|
| 222 | 222 | mcast->mcmember = *mcmember; |
|---|
| 223 | 223 | |
|---|
| .. | .. |
|---|
| 240 | 240 | priv->broadcast->mcmember.flow_label = mcmember->flow_label; |
|---|
| 241 | 241 | priv->broadcast->mcmember.hop_limit = mcmember->hop_limit; |
|---|
| 242 | 242 | /* assume if the admin and the mcast are the same both can be changed */ |
|---|
| 243 | + mtu = rdma_mtu_enum_to_int(priv->ca, priv->port, |
|---|
| 244 | + priv->broadcast->mcmember.mtu); |
|---|
| 243 | 245 | if (priv->mcast_mtu == priv->admin_mtu) |
|---|
| 244 | | - priv->admin_mtu = |
|---|
| 245 | | - priv->mcast_mtu = |
|---|
| 246 | | - IPOIB_UD_MTU(ib_mtu_enum_to_int(priv->broadcast->mcmember.mtu)); |
|---|
| 247 | | - else |
|---|
| 248 | | - priv->mcast_mtu = |
|---|
| 249 | | - IPOIB_UD_MTU(ib_mtu_enum_to_int(priv->broadcast->mcmember.mtu)); |
|---|
| 246 | + priv->admin_mtu = IPOIB_UD_MTU(mtu); |
|---|
| 247 | + priv->mcast_mtu = IPOIB_UD_MTU(mtu); |
|---|
| 248 | + rn->mtu = priv->mcast_mtu; |
|---|
| 250 | 249 | |
|---|
| 251 | 250 | priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey); |
|---|
| 252 | 251 | spin_unlock_irq(&priv->lock); |
|---|
| .. | .. |
|---|
| 599 | 598 | if (!priv->broadcast) { |
|---|
| 600 | 599 | struct ipoib_mcast *broadcast; |
|---|
| 601 | 600 | |
|---|
| 602 | | - broadcast = ipoib_mcast_alloc(dev, 0); |
|---|
| 601 | + broadcast = ipoib_mcast_alloc(dev); |
|---|
| 603 | 602 | if (!broadcast) { |
|---|
| 604 | 603 | ipoib_warn(priv, "failed to allocate broadcast group\n"); |
|---|
| 605 | 604 | /* |
|---|
| .. | .. |
|---|
| 681 | 680 | spin_unlock_irqrestore(&priv->lock, flags); |
|---|
| 682 | 681 | } |
|---|
| 683 | 682 | |
|---|
| 684 | | -int ipoib_mcast_stop_thread(struct net_device *dev) |
|---|
| 683 | +void ipoib_mcast_stop_thread(struct net_device *dev) |
|---|
| 685 | 684 | { |
|---|
| 686 | 685 | struct ipoib_dev_priv *priv = ipoib_priv(dev); |
|---|
| 687 | 686 | |
|---|
| 688 | 687 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); |
|---|
| 689 | 688 | |
|---|
| 690 | 689 | cancel_delayed_work_sync(&priv->mcast_task); |
|---|
| 691 | | - |
|---|
| 692 | | - return 0; |
|---|
| 693 | 690 | } |
|---|
| 694 | 691 | |
|---|
| 695 | 692 | static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast) |
|---|
| .. | .. |
|---|
| 782 | 779 | ipoib_dbg_mcast(priv, "setting up send only multicast group for %pI6\n", |
|---|
| 783 | 780 | mgid); |
|---|
| 784 | 781 | |
|---|
| 785 | | - mcast = ipoib_mcast_alloc(dev, 0); |
|---|
| 782 | + mcast = ipoib_mcast_alloc(dev); |
|---|
| 786 | 783 | if (!mcast) { |
|---|
| 787 | 784 | ipoib_warn(priv, "unable to allocate memory " |
|---|
| 788 | 785 | "for multicast structure\n"); |
|---|
| .. | .. |
|---|
| 936 | 933 | ipoib_dbg_mcast(priv, "adding multicast entry for mgid %pI6\n", |
|---|
| 937 | 934 | mgid.raw); |
|---|
| 938 | 935 | |
|---|
| 939 | | - nmcast = ipoib_mcast_alloc(dev, 0); |
|---|
| 936 | + nmcast = ipoib_mcast_alloc(dev); |
|---|
| 940 | 937 | if (!nmcast) { |
|---|
| 941 | 938 | ipoib_warn(priv, "unable to allocate memory for multicast structure\n"); |
|---|
| 942 | 939 | continue; |
|---|