be2net: add code to display default value of tx rate for VFs
authorAjit Khaparde <ajit.khaparde@emulex.com>
Tue, 19 Apr 2011 12:11:55 +0000 (12:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Apr 2011 03:13:11 +0000 (20:13 -0700)
This change will allow the default value of tx rate to be displayed
when ip link show is called on a PF interface.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_main.c

index 77a6e7e4593c911c760981ff3e1275296731df9f..35294005361b9771746bd3b2786e675512009aea 100644 (file)
@@ -3082,9 +3082,22 @@ static int __devinit be_probe(struct pci_dev *pdev,
        netif_carrier_off(netdev);
 
        if (be_physfn(adapter) && adapter->sriov_enabled) {
+               u8 mac_speed;
+               bool link_up;
+               u16 vf, lnk_speed;
+
                status = be_vf_eth_addr_config(adapter);
                if (status)
                        goto unreg_netdev;
+
+               for (vf = 0; vf < num_vfs; vf++) {
+                       status = be_cmd_link_status_query(adapter, &link_up,
+                                       &mac_speed, &lnk_speed, vf + 1);
+                       if (!status)
+                               adapter->vf_cfg[vf].vf_tx_rate = lnk_speed * 10;
+                       else
+                               goto unreg_netdev;
+               }
        }
 
        dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num);