> Quoting Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: [PATCH 1/4] ib/ipoib: specify TClass and FlowLabel with PR 
> queries for QoS support
> 
>  > OFED includes a patch where MTU is taken from the device MTU.
>  > Want to see it?
> 
> I guess so although it seems that would cause problems if the device
> MTU changes.

Oh, I just do a flush in this case.
This makes it possible to control the path MTU with ifconfig
which seems kind of nifty.

>  > An alternative would be to use bcast group MTU.
> 
> That would seem to make more sense to me.


You decide. Anyway, here's the patch.

-->

IB/ipoib: user appropriate mtu selector for path queries

IPoIB must set mtu selector in path record query according to dev->mtu:
if we wildcard it, SM can select a path with lower MTU.
This breaks IPoIB on networks with SM Tavor quirk activates.

We can always require this, since IPoIB spec includes the following statement:
    The value (for IB MTU) assigned to the broadcast-GID must not
    be greater than any physical link MTU spanned by the IPoIB
    subnet.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

---

Index: ofed_1_1/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- ofed_1_1.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ ofed_1_1/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -182,6 +182,8 @@ static int ipoib_change_mtu(struct net_d
 
        dev->mtu = min(priv->mcast_mtu, priv->admin_mtu);
 
+       queue_work(ipoib_workqueue, &priv->flush_task);
+
        return 0;
 }
 
@@ -452,15 +454,39 @@ static int path_rec_start(struct net_dev
                          struct ipoib_path *path)
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
+       ib_sa_comp_mask comp_mask = IB_SA_PATH_REC_MTU_SELECTOR | 
IB_SA_PATH_REC_MTU;
+
+       path->pathrec.mtu_selector = IB_SA_GT;
 
-       ipoib_dbg(priv, "Start path record lookup for " IPOIB_GID_FMT "\n",
-                 IPOIB_GID_ARG(path->pathrec.dgid));
+       switch (roundup_pow_of_two(dev->mtu + IPOIB_ENCAP_LEN)) {
+       case 512:
+               path->pathrec.mtu = IB_MTU_256;
+               break;
+       case 1024:
+               path->pathrec.mtu = IB_MTU_512;
+               break;
+       case 2048:
+               path->pathrec.mtu = IB_MTU_1024;
+               break;
+       case 4096:
+               path->pathrec.mtu = IB_MTU_2048;
+               break;
+       default:
+               /* Wildcard everything */
+               comp_mask = 0;
+               path->pathrec.mtu = 0;
+               path->pathrec.mtu_selector = 0;
+       }
+
+       ipoib_dbg(priv, "Start path record lookup for " IPOIB_GID_FMT " MTU > 
%d\n",
+                 IPOIB_GID_ARG(path->pathrec.dgid),
+                 comp_mask ? ib_mtu_enum_to_int(path->pathrec.mtu) : 0);
 
        init_completion(&path->done);
 
        path->query_id =
                ib_sa_path_rec_get(&ipoib_sa_client, priv->ca, priv->port,
-                                  &path->pathrec,
+                                  &path->pathrec, comp_mask    |
                                   IB_SA_PATH_REC_DGID          |
                                   IB_SA_PATH_REC_SGID          |
                                   IB_SA_PATH_REC_NUMB_PATH     |


-- 
MST
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to