igb: Enable PF side of SR-IOV support for i350 devices
authorCarolyn Wyborny <carolyn.wyborny@intel.com>
Thu, 20 Jan 2011 06:40:45 +0000 (06:40 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 11 Feb 2011 16:42:47 +0000 (08:42 -0800)
This patch adds full support for SR-IOV by enabling the PF side.
VF side has already been committed.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/igb/e1000_82575.c
drivers/net/igb/e1000_mbx.c
drivers/net/igb/igb_main.c

index c1552b6f4a681b0359c3f7c9e99dc7a779d87f37..65c1833244f728f6ff5cadf87cad6f9030a73181 100644 (file)
@@ -238,9 +238,15 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
                size = 14;
        nvm->word_size = 1 << size;
 
-       /* if 82576 then initialize mailbox parameters */
-       if (mac->type == e1000_82576)
+       /* if part supports SR-IOV then initialize mailbox parameters */
+       switch (mac->type) {
+       case e1000_82576:
+       case e1000_i350:
                igb_init_mbx_params_pf(hw);
+               break;
+       default:
+               break;
+       }
 
        /* setup PHY parameters */
        if (phy->media_type != e1000_media_type_copper) {
index c474cdb70047c6f9cde8851a6b793c13143bdfdf..78d48c7fa8591e98024b3a4c583173ab6d5bbb54 100644 (file)
@@ -422,26 +422,24 @@ s32 igb_init_mbx_params_pf(struct e1000_hw *hw)
 {
        struct e1000_mbx_info *mbx = &hw->mbx;
 
-       if (hw->mac.type == e1000_82576) {
-               mbx->timeout = 0;
-               mbx->usec_delay = 0;
-
-               mbx->size = E1000_VFMAILBOX_SIZE;
-
-               mbx->ops.read = igb_read_mbx_pf;
-               mbx->ops.write = igb_write_mbx_pf;
-               mbx->ops.read_posted = igb_read_posted_mbx;
-               mbx->ops.write_posted = igb_write_posted_mbx;
-               mbx->ops.check_for_msg = igb_check_for_msg_pf;
-               mbx->ops.check_for_ack = igb_check_for_ack_pf;
-               mbx->ops.check_for_rst = igb_check_for_rst_pf;
-
-               mbx->stats.msgs_tx = 0;
-               mbx->stats.msgs_rx = 0;
-               mbx->stats.reqs = 0;
-               mbx->stats.acks = 0;
-               mbx->stats.rsts = 0;
-       }
+       mbx->timeout = 0;
+       mbx->usec_delay = 0;
+
+       mbx->size = E1000_VFMAILBOX_SIZE;
+
+       mbx->ops.read = igb_read_mbx_pf;
+       mbx->ops.write = igb_write_mbx_pf;
+       mbx->ops.read_posted = igb_read_posted_mbx;
+       mbx->ops.write_posted = igb_write_posted_mbx;
+       mbx->ops.check_for_msg = igb_check_for_msg_pf;
+       mbx->ops.check_for_ack = igb_check_for_ack_pf;
+       mbx->ops.check_for_rst = igb_check_for_rst_pf;
+
+       mbx->stats.msgs_tx = 0;
+       mbx->stats.msgs_rx = 0;
+       mbx->stats.reqs = 0;
+       mbx->stats.acks = 0;
+       mbx->stats.rsts = 0;
 
        return 0;
 }
index 200cc3209672083946497e122a852181c043ad61..cb6bf7b815aee3b4fdf8df8a62ef0a0bec288916 100644 (file)
@@ -2287,9 +2287,14 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
 
        spin_lock_init(&adapter->stats64_lock);
 #ifdef CONFIG_PCI_IOV
-       if (hw->mac.type == e1000_82576)
+       switch (hw->mac.type) {
+       case e1000_82576:
+       case e1000_i350:
                adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
-
+               break;
+       default:
+               break;
+       }
 #endif /* CONFIG_PCI_IOV */
        adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());