igb: fix unused external references introduced with sr-iov changes
Subsystems (2)
PATCH 1/3 igb: fix unused external references introduced with sr-iov changes
From: Alexander Duyck <[email protected]>
There were several unused external references added with the sr-iov enablement changes. This patch changes all those references to static local references.
---
drivers/net/igb/e1000_mac.c | 2 +- drivers/net/igb/e1000_mac.h | 1 - drivers/net/igb/e1000_mbx.c | 17 ++--------------- drivers/net/igb/e1000_mbx.h | 2 -- 4 files changed, 3 insertions(+), 19 deletions(-)
drivers/net/igb/e1000_mac.c +1 -1
@@ -111,7 +111,7 @@ void igb_clear_vfta(struct e1000_hw *hw)* Writes value at the given offset in the register array which stores * the VLAN filter table. **/ -void igb_write_vfta (struct e1000_hw *hw,u32 offset,u32 value) +static void igb_write_vfta (struct e1000_hw *hw,u32 offset,u32 value) {array_wr32 (E1000_VFTA , offset, value);wrfl ();
drivers/net/igb/e1000_mac.h +0 -1
@@ -66,7 +66,6 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);s32 igb_check_alt_mac_addr (struct e1000_hw *hw);void igb_reset_adaptive (struct e1000_hw *hw);void igb_update_adaptive (struct e1000_hw *hw); -void igb_write_vfta (struct e1000_hw *hw,u32 offset,u32 value);bool igb_enable_mng_pass_thru (struct e1000_hw *hw);
drivers/net/igb/e1000_mbx.c +2 -15
@@ -188,7 +188,7 @@ out:* returns SUCCESS if it successfully received a message notification and * copied it into the receive buffer. **/ -s32 igb_read_posted_mbx (struct e1000_hw *hw,u32 *msg,u16 size,u16 mbx_id) +static s32 igb_read_posted_mbx (struct e1000_hw *hw,u32 *msg,u16 size,u16 mbx_id) {struct e1000_mbx_info *mbx = &hw->mbx;s32 ret_val = -E1000_ERR_MBX ;
@@ -214,7 +214,7 @@ out:* returns SUCCESS if it successfully copied message into the buffer and * received an ack to that message within delay * timeout period **/ -s32 igb_write_posted_mbx (struct e1000_hw *hw,u32 *msg,u16 size,u16 mbx_id) +static s32 igb_write_posted_mbx (struct e1000_hw *hw,u32 *msg,u16 size,u16 mbx_id) {struct e1000_mbx_info *mbx = &hw->mbx;s32 ret_val =0 ;
@@ -232,19 +232,6 @@ out:return ret_val; } -/** -* e1000_init_mbx_ops_generic - Initialize NVM function pointers -* @hw: pointer to the HW structure -* -* Setups up the function pointers to no-op functions -**/ -void e1000_init_mbx_ops_generic (struct e1000_hw *hw) -{ -struct e1000_mbx_info *mbx = &hw->mbx; - mbx->ops.read_posted = igb_read_posted_mbx; - mbx->ops.write_posted = igb_write_posted_mbx; -} -static s32 igb_check_for_bit_pf (struct e1000_hw *hw,u32 mask) {u32 mbvficr =rd32 (E1000_MBVFICR );
drivers/net/igb/e1000_mbx.h +0 -2
@@ -67,8 +67,6 @@s32 igb_read_mbx (struct e1000_hw *,u32 *,u16 ,u16 );s32 igb_write_mbx (struct e1000_hw *,u32 *,u16 ,u16 ); -s32 igb_read_posted_mbx (struct e1000_hw *,u32 *,u16 ,u16 ); -s32 igb_write_posted_mbx (struct e1000_hw *,u32 *,u16 ,u16 );s32 igb_check_for_msg (struct e1000_hw *,u16 );s32 igb_check_for_ack (struct e1000_hw *,u16 );s32 igb_check_for_rst (struct e1000_hw *,u16 );
PATCH 2/3 igbvf: fix unused external references
From: Alexander Duyck <[email protected]>
The igbvbf driver exposed several unused extrnal references due to the fact that code was copied from igb and then some functionality was removed. This changes that so that unused functions are either removed or made static.
---
drivers/net/igbvf/igbvf.h | 3 --- drivers/net/igbvf/netdev.c | 9 ++++++--- drivers/net/igbvf/vf.c | 2 +- drivers/net/igbvf/vf.h | 1 - 4 files changed, 7 insertions(+), 8 deletions(-)
drivers/net/igbvf/igbvf.h +0 -3
@@ -321,14 +321,11 @@ extern void igbvf_set_ethtool_ops(struct net_device *);extern int igbvf_up (struct igbvf_adapter *);extern void igbvf_down (struct igbvf_adapter *);extern void igbvf_reinit_locked (struct igbvf_adapter *); -extern void igbvf_reset (struct igbvf_adapter *);extern int igbvf_setup_rx_resources (struct igbvf_adapter *,struct igbvf_ring *);extern int igbvf_setup_tx_resources (struct igbvf_adapter *,struct igbvf_ring *);extern void igbvf_free_rx_resources (struct igbvf_ring *);extern void igbvf_free_tx_resources (struct igbvf_ring *);extern void igbvf_update_stats (struct igbvf_adapter *); -extern void igbvf_set_interrupt_capability (struct igbvf_adapter *); -extern void igbvf_reset_interrupt_capability (struct igbvf_adapter *);extern unsigned int copybreak;
drivers/net/igbvf/netdev.c +6 -3
@@ -52,6 +52,9 @@ static const char igbvf_driver_string[] =static const char igbvf_copyright[] ="Copyright (c) 2009 Intel Corporation." ;static int igbvf_poll (struct napi_struct *napi,int budget); +static void igbvf_reset (struct igbvf_adapter *); +static void igbvf_set_interrupt_capability (struct igbvf_adapter *); +static void igbvf_reset_interrupt_capability (struct igbvf_adapter *);static struct igbvf_info igbvf_vf_info = { .mac = e1000_vfadapt,
@@ -990,7 +993,7 @@ static void igbvf_configure_msix(struct igbvf_adapter *adapter)e1e_flush (); } -void igbvf_reset_interrupt_capability (struct igbvf_adapter *adapter) +static void igbvf_reset_interrupt_capability (struct igbvf_adapter *adapter) {if (adapter->msix_entries) {pci_disable_msix (adapter->pdev);
@@ -1005,7 +1008,7 @@ void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter)* Attempt to configure interrupts using the best available * capabilities of the hardware and kernel. **/ -void igbvf_set_interrupt_capability (struct igbvf_adapter *adapter) +static void igbvf_set_interrupt_capability (struct igbvf_adapter *adapter) {int err = -ENOMEM ;int i;
@@ -1447,7 +1450,7 @@ static void igbvf_configure(struct igbvf_adapter *adapter)* set/changed during runtime. After reset the device needs to be * properly configured for Rx, Tx etc. */ -void igbvf_reset (struct igbvf_adapter *adapter) +static void igbvf_reset (struct igbvf_adapter *adapter) {struct e1000_mac_info *mac = &adapter->hw.mac;struct net_device *netdev = adapter->netdev;
drivers/net/igbvf/vf.c +1 -1
@@ -44,7 +44,7 @@ static s32 e1000_set_vfta_vf(struct e1000_hw *, u16, bool);* e1000_init_mac_params_vf - Inits MAC params * @hw: pointer to the HW structure **/ -s32 e1000_init_mac_params_vf (struct e1000_hw *hw) +static s32 e1000_init_mac_params_vf (struct e1000_hw *hw) {struct e1000_mac_info *mac = &hw->mac;
drivers/net/igbvf/vf.h +0 -1
@@ -259,7 +259,6 @@ struct e1000_hw {/* These functions must be implemented by drivers */ void e1000_rlpml_set_vf (struct e1000_hw *,u16 );void e1000_init_function_pointers_vf (struct e1000_hw *hw); -s32 e1000_init_mac_params_vf (struct e1000_hw *hw);#endif /* _E1000_VF_H_ */
PATCH 3/3 igb: do not check for vf_data if we didn't enable vfs
In reply to Jeff KirsherFrom: Alexander Duyck <[email protected]>
The driver is currently dumping a message in the log about failing to allocate vf data when max_vfs is equal to 0. This change makes it so the error message is only displayed if we set max_vfs to a non zero value.
---
drivers/net/igb/igb_main.c | 37 ++++++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 15 deletions(-)
drivers/net/igb/igb_main.c +22 -15
@@ -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 ; + } } } }
David Miller
maintainerFrom: Jeff Kirsher <[email protected]>
Date: Fri, 10 Apr 2009 01:49:02 -0700
Quoted 6 lines
There were several unused external references added with the sr-iov enablement changes. This patch changes all those references to static local references.
Signed-off-by Alexander Duyck <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Because these three IGB/IGBVF patches are curing fallout from the igvf driver recently merged, I'm adding them all directly to net-2.6
Thanks.