Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279151
b: refs/heads/master
c: 94f434c
h: refs/heads/master
i:
  279149: aad9243
  279147: f0631f1
  279143: 2990528
  279135: ea4f70c
v: v3
  • Loading branch information
Ajit Khaparde authored and David S. Miller committed Dec 30, 2011
1 parent 773d9eb commit f2ced1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 80817cbf5ac13da76f3ee2b9259f26c09b385e84
refs/heads/master: 94f434c2055db5fe20f10d4e0ec50ab395e1f62b
14 changes: 9 additions & 5 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,18 +978,22 @@ static int be_set_vf_tx_rate(struct net_device *netdev,
if (!sriov_enabled(adapter))
return -EPERM;

if (vf >= adapter->num_vfs || rate < 0)
if (vf >= adapter->num_vfs)
return -EINVAL;

if (rate > 10000)
rate = 10000;
if (rate < 100 || rate > 10000) {
dev_err(&adapter->pdev->dev,
"tx rate must be between 100 and 10000 Mbps\n");
return -EINVAL;
}

adapter->vf_cfg[vf].tx_rate = rate;
status = be_cmd_set_qos(adapter, rate / 10, vf + 1);

if (status)
dev_info(&adapter->pdev->dev,
dev_err(&adapter->pdev->dev,
"tx rate %d on VF %d failed\n", rate, vf);
else
adapter->vf_cfg[vf].tx_rate = rate;
return status;
}

Expand Down

0 comments on commit f2ced1c

Please sign in to comment.