mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-20 22:15:59 +00:00
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
This commit is contained in:
commit
92d499d991
2 changed files with 9 additions and 2 deletions
|
@ -76,6 +76,10 @@ int ehca_calc_ipd(struct ehca_shca *shca, int port,
|
||||||
|
|
||||||
link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
|
link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
|
||||||
|
|
||||||
|
if (path >= link)
|
||||||
|
/* no need to throttle if path faster than link */
|
||||||
|
*ipd = 0;
|
||||||
|
else
|
||||||
/* IPD = round((link / path) - 1) */
|
/* IPD = round((link / path) - 1) */
|
||||||
*ipd = ((link + (path >> 1)) / path) - 1;
|
*ipd = ((link + (path >> 1)) / path) - 1;
|
||||||
|
|
||||||
|
|
|
@ -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_dev_priv *priv = netdev_priv(dev);
|
||||||
struct ipoib_path *path;
|
struct ipoib_path *path;
|
||||||
|
|
||||||
|
if (!priv->broadcast)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
path = kzalloc(sizeof *path, GFP_ATOMIC);
|
path = kzalloc(sizeof *path, GFP_ATOMIC);
|
||||||
if (!path)
|
if (!path)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue