]> err.no Git - linux-2.6/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 1 Dec 2007 04:07:54 +0000 (20:07 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 1 Dec 2007 04:07:54 +0000 (20:07 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/ehca: Fix static rate if path faster than link
  IPoIB: Fix oops if xmit is called when priv->broadcast is NULL

drivers/infiniband/hw/ehca/ehca_av.c
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 453eb995c1d47b59255e46d4fcad70147d83c9e5..f7782c882ab4c9cfb9c6c49ee116efb1107f639d 100644 (file)
@@ -76,8 +76,12 @@ int ehca_calc_ipd(struct ehca_shca *shca, int port,
 
        link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
 
-       /* IPD = round((link / path) - 1) */
-       *ipd = ((link + (path >> 1)) / path) - 1;
+       if (path >= link)
+               /* no need to throttle if path faster than link */
+               *ipd = 0;
+       else
+               /* IPD = round((link / path) - 1) */
+               *ipd = ((link + (path >> 1)) / path) - 1;
 
        return 0;
 }
index a03a65ebcf0c0a95d31903b17d448be3dd26ed85..c9f6077b615eb62db39dae44f385976c50018865 100644 (file)
@@ -460,6 +460,9 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, void *gid)
        struct ipoib_dev_priv *priv = netdev_priv(dev);
        struct ipoib_path *path;
 
+       if (!priv->broadcast)
+               return NULL;
+
        path = kzalloc(sizeof *path, GFP_ATOMIC);
        if (!path)
                return NULL;