Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143429
b: refs/heads/master
c: 9ca046d
h: refs/heads/master
i:
  143427: 40231c3
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Apr 11, 2009
1 parent 1c281dc commit fad2cb5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 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: 2d165771062cae75de26fe7bc7cb2d937ff6f1b4
refs/heads/master: 9ca046d57412361ac4d220b96fed7fb932616d85
37 changes: 22 additions & 15 deletions trunk/drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,25 +1261,32 @@ static int __devinit igb_probe(struct pci_dev *pdev,
int i;
unsigned char mac_addr[ETH_ALEN];

if (num_vfs)
if (num_vfs) {
adapter->vf_data = kcalloc(num_vfs,
sizeof(struct vf_data_storage),
GFP_KERNEL);
if (!adapter->vf_data) {
dev_err(&pdev->dev, "Could not allocate VF private "
"data - IOV enable failed\n");
} else {
err = pci_enable_sriov(pdev, num_vfs);
if (!err) {
adapter->vfs_allocated_count = num_vfs;
dev_info(&pdev->dev, "%d vfs allocated\n", num_vfs);
for (i = 0; i < adapter->vfs_allocated_count; i++) {
random_ether_addr(mac_addr);
igb_set_vf_mac(adapter, i, mac_addr);
}
if (!adapter->vf_data) {
dev_err(&pdev->dev,
"Could not allocate VF private data - "
"IOV enable failed\n");
} else {
kfree(adapter->vf_data);
adapter->vf_data = NULL;
err = pci_enable_sriov(pdev, num_vfs);
if (!err) {
adapter->vfs_allocated_count = num_vfs;
dev_info(&pdev->dev,
"%d vfs allocated\n",
num_vfs);
for (i = 0;
i < adapter->vfs_allocated_count;
i++) {
random_ether_addr(mac_addr);
igb_set_vf_mac(adapter, i,
mac_addr);
}
} else {
kfree(adapter->vf_data);
adapter->vf_data = NULL;
}
}
}
}
Expand Down

0 comments on commit fad2cb5

Please sign in to comment.