aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-30 23:07:54 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-30 23:07:54 -0500
commit92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c (patch)
tree7b6da4d31ab802a4d8feddea39d5cac9edfe3c1c
parent1811534a80697b34add31cff53a321cfc291ddfe (diff)
parentb1812582ba94b5f377d5d3cec7646cc17d84e733 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* '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
-rw-r--r--drivers/infiniband/hw/ehca/ehca_av.c8
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c3
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_av.c b/drivers/infiniband/hw/ehca/ehca_av.c
index 453eb995c1d4..f7782c882ab4 100644
--- a/drivers/infiniband/hw/ehca/ehca_av.c
+++ b/drivers/infiniband/hw/ehca/ehca_av.c
@@ -76,8 +76,12 @@ int ehca_calc_ipd(struct ehca_shca *shca, int port,
76 76
77 link = ib_width_enum_to_int(pa.active_width) * pa.active_speed; 77 link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
78 78
79 /* IPD = round((link / path) - 1) */ 79 if (path >= link)
80 *ipd = ((link + (path >> 1)) / path) - 1; 80 /* no need to throttle if path faster than link */
81 *ipd = 0;
82 else
83 /* IPD = round((link / path) - 1) */
84 *ipd = ((link + (path >> 1)) / path) - 1;
81 85
82 return 0; 86 return 0;
83} 87}
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index a03a65ebcf0c..c9f6077b615e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -460,6 +460,9 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, void *gid)
460 struct ipoib_dev_priv *priv = netdev_priv(dev); 460 struct ipoib_dev_priv *priv = netdev_priv(dev);
461 struct ipoib_path *path; 461 struct ipoib_path *path;
462 462
463 if (!priv->broadcast)
464 return NULL;
465
463 path = kzalloc(sizeof *path, GFP_ATOMIC); 466 path = kzalloc(sizeof *path, GFP_ATOMIC);
464 if (!path) 467 if (!path)
465 return NULL; 468 return NULL;