hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
....@@ -135,12 +135,11 @@
135135 kfree(mcast);
136136 }
137137
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)
140139 {
141140 struct ipoib_mcast *mcast;
142141
143
- mcast = kzalloc(sizeof(*mcast), can_sleep ? GFP_KERNEL : GFP_ATOMIC);
142
+ mcast = kzalloc(sizeof(*mcast), GFP_ATOMIC);
144143 if (!mcast)
145144 return NULL;
146145
....@@ -218,6 +217,7 @@
218217 struct rdma_ah_attr av;
219218 int ret;
220219 int set_qkey = 0;
220
+ int mtu;
221221
222222 mcast->mcmember = *mcmember;
223223
....@@ -240,13 +240,12 @@
240240 priv->broadcast->mcmember.flow_label = mcmember->flow_label;
241241 priv->broadcast->mcmember.hop_limit = mcmember->hop_limit;
242242 /* 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);
243245 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;
250249
251250 priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey);
252251 spin_unlock_irq(&priv->lock);
....@@ -599,7 +598,7 @@
599598 if (!priv->broadcast) {
600599 struct ipoib_mcast *broadcast;
601600
602
- broadcast = ipoib_mcast_alloc(dev, 0);
601
+ broadcast = ipoib_mcast_alloc(dev);
603602 if (!broadcast) {
604603 ipoib_warn(priv, "failed to allocate broadcast group\n");
605604 /*
....@@ -681,15 +680,13 @@
681680 spin_unlock_irqrestore(&priv->lock, flags);
682681 }
683682
684
-int ipoib_mcast_stop_thread(struct net_device *dev)
683
+void ipoib_mcast_stop_thread(struct net_device *dev)
685684 {
686685 struct ipoib_dev_priv *priv = ipoib_priv(dev);
687686
688687 ipoib_dbg_mcast(priv, "stopping multicast thread\n");
689688
690689 cancel_delayed_work_sync(&priv->mcast_task);
691
-
692
- return 0;
693690 }
694691
695692 static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
....@@ -782,7 +779,7 @@
782779 ipoib_dbg_mcast(priv, "setting up send only multicast group for %pI6\n",
783780 mgid);
784781
785
- mcast = ipoib_mcast_alloc(dev, 0);
782
+ mcast = ipoib_mcast_alloc(dev);
786783 if (!mcast) {
787784 ipoib_warn(priv, "unable to allocate memory "
788785 "for multicast structure\n");
....@@ -936,7 +933,7 @@
936933 ipoib_dbg_mcast(priv, "adding multicast entry for mgid %pI6\n",
937934 mgid.raw);
938935
939
- nmcast = ipoib_mcast_alloc(dev, 0);
936
+ nmcast = ipoib_mcast_alloc(dev);
940937 if (!nmcast) {
941938 ipoib_warn(priv, "unable to allocate memory for multicast structure\n");
942939 continue;