From 66e6961c8e53c0c0079d5b67faf9b7fe33525892 Mon Sep 17 00:00:00 2001 From: Emil Tantilov Date: Sat, 16 Apr 2011 06:12:51 +0000 Subject: ixgbe: convert to ethtool set_phys_id Based on the original patch submitted by Stephen Hemminger. This patch makes the following changes: - Change ETHTOOL_ID_INACTIVE return value to 2 (blinks/sec) - Fix restoring of IXGBE_LEDCTL CC: Stephen Hemminger Signed-off-by: Emil Tantilov Tested-by: Evan Swanson Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 8d46802..37ff531 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -461,6 +461,7 @@ struct ixgbe_adapter { u16 eeprom_version; int node; + u32 led_reg; struct work_struct check_overtemp_task; u32 interrupt_event; char lsc_int_name[IFNAMSIZ + 9]; -- cgit v1.1 From a1cbb15c13971bd5d41626e9e5ced9f9de132c47 Mon Sep 17 00:00:00 2001 From: Greg Rose Date: Fri, 13 May 2011 01:33:48 +0000 Subject: ixgbe: Add macvlan support for VF Add infrastructure in the PF driver to support macvlan in the VF driver. Signed-off-by: Greg Rose Tested-by: Sibai Li Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 37ff531..91c1540 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -106,6 +106,7 @@ #define IXGBE_MAX_VF_FUNCTIONS 64 #define IXGBE_MAX_VFTA_ENTRIES 128 #define MAX_EMULATION_MAC_ADDRS 16 +#define IXGBE_MAX_PF_MACVLANS 15 #define VMDQ_P(p) ((p) + adapter->num_vfs) struct vf_data_storage { @@ -121,6 +122,15 @@ struct vf_data_storage { u16 tx_rate; }; +struct vf_macvlans { + struct list_head l; + int vf; + int rar_entry; + bool free; + bool is_macvlan; + u8 vf_macvlan[ETH_ALEN]; +}; + /* wrapper around a pointer to a socket buffer, * so a DMA handle can be stored along with the buffer */ struct ixgbe_tx_buffer { @@ -471,6 +481,9 @@ struct ixgbe_adapter { unsigned int num_vfs; struct vf_data_storage *vfinfo; int vf_rate_link_speed; + struct vf_macvlans vf_mvs; + struct vf_macvlans *mv_list; + bool antispoofing_enabled; }; enum ixbge_state_t { -- cgit v1.1 From e606bfe74de63d6c3778c145ee0673d96ab257c9 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 22 Apr 2011 04:07:43 +0000 Subject: ixgbe: move flags and state into the same cacheline This change moves flags and state into the same cacheline. The reason for this change is because both are frequently read around the same time and infrequently written. By combining them into the same cacheline this should help to reduce memory utilization. Signed-off-by: Alexander Duyck Tested-by: Evan Swanson Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 88 ++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 43 deletions(-) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 91c1540..ec948ff 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -341,10 +341,48 @@ struct ixgbe_q_vector { /* board specific private data structure */ struct ixgbe_adapter { - struct timer_list watchdog_timer; + unsigned long state; + + /* Some features need tri-state capability, + * thus the additional *_CAPABLE flags. + */ + u32 flags; +#define IXGBE_FLAG_RX_CSUM_ENABLED (u32)(1) +#define IXGBE_FLAG_MSI_CAPABLE (u32)(1 << 1) +#define IXGBE_FLAG_MSI_ENABLED (u32)(1 << 2) +#define IXGBE_FLAG_MSIX_CAPABLE (u32)(1 << 3) +#define IXGBE_FLAG_MSIX_ENABLED (u32)(1 << 4) +#define IXGBE_FLAG_RX_1BUF_CAPABLE (u32)(1 << 6) +#define IXGBE_FLAG_RX_PS_CAPABLE (u32)(1 << 7) +#define IXGBE_FLAG_RX_PS_ENABLED (u32)(1 << 8) +#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 9) +#define IXGBE_FLAG_DCA_ENABLED (u32)(1 << 10) +#define IXGBE_FLAG_DCA_CAPABLE (u32)(1 << 11) +#define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12) +#define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13) +#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 14) +#define IXGBE_FLAG_RSS_ENABLED (u32)(1 << 16) +#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17) +#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18) +#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19) +#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20) +#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22) +#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 23) +#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 24) +#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 25) +#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 26) +#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 27) +#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 28) +#define IXGBE_FLAG_SRIOV_CAPABLE (u32)(1 << 29) +#define IXGBE_FLAG_SRIOV_ENABLED (u32)(1 << 30) + + u32 flags2; +#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1) +#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1) +#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2) + unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; u16 bd_number; - struct work_struct reset_task; struct ixgbe_q_vector *q_vector[MAX_MSIX_Q_VECTORS]; /* DCB parameters */ @@ -387,43 +425,6 @@ struct ixgbe_adapter { u32 alloc_rx_page_failed; u32 alloc_rx_buff_failed; - /* Some features need tri-state capability, - * thus the additional *_CAPABLE flags. - */ - u32 flags; -#define IXGBE_FLAG_RX_CSUM_ENABLED (u32)(1) -#define IXGBE_FLAG_MSI_CAPABLE (u32)(1 << 1) -#define IXGBE_FLAG_MSI_ENABLED (u32)(1 << 2) -#define IXGBE_FLAG_MSIX_CAPABLE (u32)(1 << 3) -#define IXGBE_FLAG_MSIX_ENABLED (u32)(1 << 4) -#define IXGBE_FLAG_RX_1BUF_CAPABLE (u32)(1 << 6) -#define IXGBE_FLAG_RX_PS_CAPABLE (u32)(1 << 7) -#define IXGBE_FLAG_RX_PS_ENABLED (u32)(1 << 8) -#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 9) -#define IXGBE_FLAG_DCA_ENABLED (u32)(1 << 10) -#define IXGBE_FLAG_DCA_CAPABLE (u32)(1 << 11) -#define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12) -#define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13) -#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 14) -#define IXGBE_FLAG_RSS_ENABLED (u32)(1 << 16) -#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17) -#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18) -#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19) -#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20) -#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22) -#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 23) -#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 24) -#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 25) -#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 26) -#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 27) -#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 28) -#define IXGBE_FLAG_SRIOV_CAPABLE (u32)(1 << 29) -#define IXGBE_FLAG_SRIOV_ENABLED (u32)(1 << 30) - - u32 flags2; -#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1) -#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1) -#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2) /* default to trying for four seconds */ #define IXGBE_TRY_LINK_TIMEOUT (4 * HZ) @@ -444,7 +445,6 @@ struct ixgbe_adapter { u32 rx_eitr_param; u32 tx_eitr_param; - unsigned long state; u64 tx_busy; unsigned int tx_ring_count; unsigned int rx_ring_count; @@ -453,15 +453,18 @@ struct ixgbe_adapter { bool link_up; unsigned long link_check_timeout; + struct work_struct reset_task; struct work_struct watchdog_task; struct work_struct sfp_task; - struct timer_list sfp_timer; struct work_struct multispeed_fiber_task; struct work_struct sfp_config_module_task; + struct work_struct fdir_reinit_task; + struct work_struct check_overtemp_task; + struct timer_list watchdog_timer; + struct timer_list sfp_timer; u32 fdir_pballoc; u32 atr_sample_rate; spinlock_t fdir_perfect_lock; - struct work_struct fdir_reinit_task; #ifdef IXGBE_FCOE struct ixgbe_fcoe fcoe; #endif /* IXGBE_FCOE */ @@ -472,7 +475,6 @@ struct ixgbe_adapter { int node; u32 led_reg; - struct work_struct check_overtemp_task; u32 interrupt_event; char lsc_int_name[IFNAMSIZ + 9]; -- cgit v1.1 From 7086400d87a06588c13270949db9134afc9553ba Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Wed, 27 Apr 2011 09:13:56 +0000 Subject: ixgbe: Combine SFP and multi-speed fiber task into single service task This change is meant to address several race conditions with multi-speed fiber SFP+ modules in 82599 adapters. Specifically issues have been seen in which both the SFP configuration and the multi-speed fiber configuration are running simultaneously which will result in the device getting into an erroneous link down state. Signed-off-by: Alexander Duyck Tested-by: Evan Swanson Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index ec948ff..cbb04ba 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -367,19 +367,20 @@ struct ixgbe_adapter { #define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19) #define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20) #define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22) -#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 23) -#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 24) -#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 25) -#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 26) -#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 27) -#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 28) -#define IXGBE_FLAG_SRIOV_CAPABLE (u32)(1 << 29) -#define IXGBE_FLAG_SRIOV_ENABLED (u32)(1 << 30) +#define IXGBE_FLAG_NEED_LINK_CONFIG (u32)(1 << 23) +#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 24) +#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 25) +#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 26) +#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 27) +#define IXGBE_FLAG_SRIOV_CAPABLE (u32)(1 << 28) +#define IXGBE_FLAG_SRIOV_ENABLED (u32)(1 << 29) u32 flags2; #define IXGBE_FLAG2_RSC_CAPABLE (u32)(1) #define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1) #define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2) +#define IXGBE_FLAG2_SEARCH_FOR_SFP (u32)(1 << 4) +#define IXGBE_FLAG2_SFP_NEEDS_RESET (u32)(1 << 5) unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; u16 bd_number; @@ -455,13 +456,11 @@ struct ixgbe_adapter { struct work_struct reset_task; struct work_struct watchdog_task; - struct work_struct sfp_task; - struct work_struct multispeed_fiber_task; - struct work_struct sfp_config_module_task; struct work_struct fdir_reinit_task; struct work_struct check_overtemp_task; + struct work_struct service_task; struct timer_list watchdog_timer; - struct timer_list sfp_timer; + struct timer_list service_timer; u32 fdir_pballoc; u32 atr_sample_rate; spinlock_t fdir_perfect_lock; @@ -492,7 +491,8 @@ enum ixbge_state_t { __IXGBE_TESTING, __IXGBE_RESETTING, __IXGBE_DOWN, - __IXGBE_SFP_MODULE_NOT_FOUND + __IXGBE_SERVICE_SCHED, + __IXGBE_IN_SFP_INIT, }; struct ixgbe_rsc_cb { -- cgit v1.1 From 93c52dd0033be3cb91376916b8461fcb94ef0c22 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 22 Apr 2011 04:07:54 +0000 Subject: ixgbe: Merge watchdog functionality into service task This patch is meant to merge the functionality of the ixgbe watchdog task into the service task. By doing this all link state functionality will be controlled by a single task. As a result the reliability of the interface will be improved as the likelihood of any race conditions is further reduced. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index cbb04ba..193c6c4 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -455,11 +455,9 @@ struct ixgbe_adapter { unsigned long link_check_timeout; struct work_struct reset_task; - struct work_struct watchdog_task; struct work_struct fdir_reinit_task; struct work_struct check_overtemp_task; struct work_struct service_task; - struct timer_list watchdog_timer; struct timer_list service_timer; u32 fdir_pballoc; u32 atr_sample_rate; -- cgit v1.1 From c83c6cbdbff360e5323748720dfb2b000c0ae491 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Wed, 27 Apr 2011 09:21:16 +0000 Subject: ixgbe: merge reset task into service task This change is meant to further help to reduce possible configuration collisions between the various tasklets. This change combines the device reset with the service task. As a result it is now not possible to be updating the link on the device while also resetting the part. Signed-off-by: Alexander Duyck Tested-by: Evan Swanson Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 193c6c4..760b850 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -381,6 +381,7 @@ struct ixgbe_adapter { #define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2) #define IXGBE_FLAG2_SEARCH_FOR_SFP (u32)(1 << 4) #define IXGBE_FLAG2_SFP_NEEDS_RESET (u32)(1 << 5) +#define IXGBE_FLAG2_RESET_REQUESTED (u32)(1 << 6) unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; u16 bd_number; @@ -454,7 +455,6 @@ struct ixgbe_adapter { bool link_up; unsigned long link_check_timeout; - struct work_struct reset_task; struct work_struct fdir_reinit_task; struct work_struct check_overtemp_task; struct work_struct service_task; -- cgit v1.1 From d034acf1851c15c3da56d31e7eb4151e40ed0119 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Wed, 27 Apr 2011 09:25:34 +0000 Subject: ixgbe: Merge ATR reinit into the service task This change merges the ATR table reinitialization into the service task. This is yet another opportunity to avoid any race conditions as we don't want to be attempting to reinitialize the table during a possible reset. In addition this change adds a counter for table reinitialization so that it can be tracked as part of the regular statistics. Signed-off-by: Alexander Duyck Tested-by: Evan Swanson Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 760b850..a180cde 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -382,6 +382,7 @@ struct ixgbe_adapter { #define IXGBE_FLAG2_SEARCH_FOR_SFP (u32)(1 << 4) #define IXGBE_FLAG2_SFP_NEEDS_RESET (u32)(1 << 5) #define IXGBE_FLAG2_RESET_REQUESTED (u32)(1 << 6) +#define IXGBE_FLAG2_FDIR_REQUIRES_REINIT (u32)(1 << 7) unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; u16 bd_number; @@ -455,12 +456,12 @@ struct ixgbe_adapter { bool link_up; unsigned long link_check_timeout; - struct work_struct fdir_reinit_task; struct work_struct check_overtemp_task; struct work_struct service_task; struct timer_list service_timer; u32 fdir_pballoc; u32 atr_sample_rate; + unsigned long fdir_overflow; /* number of times ATR was backed off */ spinlock_t fdir_perfect_lock; #ifdef IXGBE_FCOE struct ixgbe_fcoe fcoe; -- cgit v1.1 From f0f9778d043481f3cded693849e3b88b01fbc69b Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 22 Apr 2011 04:08:09 +0000 Subject: ixgbe: Merge over-temp task into service task This change merges the over-temp task into the service task. As a result all tasklets are finally combined into once single tasklet for easier management. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/ixgbe/ixgbe.h') diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index a180cde..e467b20 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -379,6 +379,7 @@ struct ixgbe_adapter { #define IXGBE_FLAG2_RSC_CAPABLE (u32)(1) #define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1) #define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2) +#define IXGBE_FLAG2_TEMP_SENSOR_EVENT (u32)(1 << 3) #define IXGBE_FLAG2_SEARCH_FOR_SFP (u32)(1 << 4) #define IXGBE_FLAG2_SFP_NEEDS_RESET (u32)(1 << 5) #define IXGBE_FLAG2_RESET_REQUESTED (u32)(1 << 6) @@ -456,7 +457,6 @@ struct ixgbe_adapter { bool link_up; unsigned long link_check_timeout; - struct work_struct check_overtemp_task; struct work_struct service_task; struct timer_list service_timer; u32 fdir_pballoc; -- cgit v1.1