Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Dec 1, 2007
2 parents 1811534 + b181258 commit 92d499d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/infiniband/hw/ehca/ehca_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 92d499d

Please sign in to comment.