i40e/i40evf updates
Subsystems (2)
cover i40e/i40evf updates
Catherine adds code that recognizes 1000Base_T_Optical phy type when link is up.
Greg B. adds support for non-willing Apps.
Greg R. removed unused defines.
Jesse adds code to moderate interrupts differently.
Jingjing fixes compile issue related to const string, and resets the invalid msg counter in vf when a valid msg is received.
Kiran enhances the fix to protect 'mac_filter_list' accesses.
Mitch correctly populates vlan_features, relaxs and staggers init timing a bit, and increases AQ work limit.
Shannon generates fewer startup messages, removes read/write failed messages from nvmupdate, adds priv flag for controlling VEB stats, and grabs the AQ spinlocks before clearing registers.
drivers/net/ethernet/intel/i40e/i40e.h | 8 ++-- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 45 ++++++++++---------- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 7 ++++ drivers/net/ethernet/intel/i40e/i40e_common.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 49 ++++++++++++++++++---- drivers/net/ethernet/intel/i40e/i40e_main.c | 34 +++++++++------ drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 +- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 10 +++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 2 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 5 +-- drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 45 ++++++++++---------- drivers/net/ethernet/intel/i40evf/i40e_common.c | 4 +- drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 4 +- drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 10 +++++ drivers/net/ethernet/intel/i40evf/i40evf.h | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 11 +++-- 19 files changed, 166 insertions(+), 86 deletions(-)
Signature · 1 line
1.9.3
PATCH 1/15 i40e: generate fewer startup messages
From: Shannon Nelson <[email protected]>
Cut down on the number of startup log entries by putting a couple behind debug flags and combining a couple others into a single line.
--- drivers/net/ethernet/intel/i40e/i40e.h | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++-------- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -2
@@ -584,10 +584,10 @@ struct i40e_device { };/** -* i40e_fw_version_str - format the FW and NVM version strings +* i40e_nvm_version_str - format the NVM version strings * @hw: ptr to the hardware info **/ -static inline char *i40e_fw_version_str (struct i40e_hw *hw) +static inline char *i40e_nvm_version_str (struct i40e_hw *hw) {static char buf[32 ];
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -1122,7 +1122,7 @@ static void i40e_get_drvinfo(struct net_device *netdev,strlcpy (drvinfo->driver, i40e_driver_name,sizeof (drvinfo->driver));strlcpy (drvinfo->version, i40e_driver_version_str,sizeof (drvinfo->version)); -strlcpy (drvinfo->fw_version,i40e_fw_version_str (&pf->hw), +strlcpy (drvinfo->fw_version,i40e_nvm_version_str (&pf->hw),sizeof (drvinfo->fw_version));strlcpy (drvinfo->bus_info,pci_name (pf->pdev),sizeof (drvinfo->bus_info));
drivers/net/ethernet/intel/i40e/i40e_main.c +12 -8
@@ -6402,8 +6402,9 @@ static void i40e_config_bridge_mode(struct i40e_veb *veb) {struct i40e_pf *pf = veb->pf; -dev_info (&pf->pdev->dev,"enabling bridge mode: %s\n" , - veb->bridge_mode ==BRIDGE_MODE_VEPA ?"VEPA" :"VEB" ); +if (pf->hw.debug_mask &I40E_DEBUG_LAN ) +dev_info (&pf->pdev->dev,"enabling bridge mode: %s\n" , + veb->bridge_mode ==BRIDGE_MODE_VEPA ?"VEPA" :"VEB" );if (veb->bridge_mode &BRIDGE_MODE_VEPA )i40e_disable_pf_switch_lb (pf);else
@@ -10133,6 +10134,10 @@ static void i40e_print_features(struct i40e_pf *pf)if (pf->flags &I40E_FLAG_FCOE_ENABLED ) buf +=sprintf (buf,"FCOE " );#endif +if (pf->flags &I40E_FLAG_VEB_MODE_ENABLED ) + buf +=sprintf (buf,"VEB " ); +else + buf +=sprintf (buf,"VEPA " );BUG_ON (buf > (string +INFO_STRING_LEN ));dev_info (&pf->pdev->dev,"%s\n" , string);
@@ -10272,13 +10277,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pf->hw.fc.requested_mode =I40E_FC_NONE ; err =i40e_init_adminq (hw); -dev_info (&pdev->dev,"%s\n" ,i40e_fw_version_str (hw)); -/* provide additional fw info, like api and ver */ -dev_info (&pdev->dev,"fw_version:%d.%d.%05d\n" , - hw->aq.fw_maj_ver, hw->aq.fw_min_ver, hw->aq.fw_build); -dev_info (&pdev->dev,"fw api version:%d.%d\n" , - hw->aq.api_maj_ver, hw->aq.api_min_ver); +/* provide nvm, fw, api versions */ +dev_info (&pdev->dev,"fw %d.%d.%05d api %d.%d nvm %s\n" , + hw->aq.fw_maj_ver, hw->aq.fw_min_ver, hw->aq.fw_build, + hw->aq.api_maj_ver, hw->aq.api_min_ver, +i40e_nvm_version_str (hw));if (err) { dev_info(&pdev->dev,
drivers/net/ethernet/intel/i40e/i40e_ptp.c +2 -2
@@ -674,8 +674,8 @@ void i40e_ptp_init(struct i40e_pf *pf)struct timespec64 ts;u32 regval; -dev_info (&pf->pdev->dev,"%s: added PHC on %s\n" , __func__, - netdev->name); +if (pf->hw.debug_mask &I40E_DEBUG_LAN ) +dev_info (&pf->pdev->dev,"PHC enabled\n" ); pf->flags |=I40E_FLAG_PTP ;/* Ensure the clocks are running. */
Signature · 1 line
1.9.3
Bowers
PATCH 1/15 i40e: generate fewer startup messages
Quoted 13 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 01/15] i40e: generate fewer startup messagesFrom: Shannon Nelson <[email protected]>
Cut down on the number of startup log entries by putting a couple behind debug flags and combining a couple others into a single line.
Quoted 8 lines
Signed-off-by Shannon Nelson <[email protected]>Change-ID I708089f086308f84d43f8b6f0e8a634a02d058fb--- drivers/net/ethernet/intel/i40e/i40e.h | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++-------- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-)
Code changes present in tree, fewer startup messages printed to log on startup, fw info follows new combined format.
PATCH 2/15 i40e/i40evf: Fix compile issue related to const string
In reply to Catherine SullivanFrom: Jingjing Wu <[email protected]>
Add const to functions that return strings that aren't going to be modified. This addresses some reported compile complaints.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 ++-- drivers/net/ethernet/intel/i40evf/i40e_common.c | 4 ++-- drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +2 -2
@@ -87,7 +87,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)* @hw: pointer to the HW structure * @aq_err: the AQ error code to convert **/ -char *i40e_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err) +const char *i40e_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err) {switch (aq_err) {case I40E_AQ_RC_OK :
@@ -147,7 +147,7 @@ char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err)* @hw: pointer to the HW structure * @stat_err: the status error code to convert **/ -char *i40e_stat_str (struct i40e_hw *hw,i40e_status stat_err) +const char *i40e_stat_str (struct i40e_hw *hw,i40e_status stat_err) {switch (stat_err) {case 0 :
drivers/net/ethernet/intel/i40e/i40e_nvm.c +1 -1
@@ -651,7 +651,7 @@ static inline u8 i40e_nvmupd_get_transaction(u32 val)return (u8)((val &I40E_NVM_TRANS_MASK ) >>I40E_NVM_TRANS_SHIFT ); } -static char *i40e_nvm_update_state_str[] = { +static const char *const i40e_nvm_update_state_str[] = {"I40E_NVMUPD_INVALID" ,"I40E_NVMUPD_READ_CON" ,"I40E_NVMUPD_READ_SNT" ,
drivers/net/ethernet/intel/i40e/i40e_prototype.h +2 -2
@@ -58,8 +58,8 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,void i40e_idle_aq (struct i40e_hw *hw);bool i40e_check_asq_alive (struct i40e_hw *hw);i40e_status i40e_aq_queue_shutdown (struct i40e_hw *hw,bool unloading); -char *i40e_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err); -char *i40e_stat_str (struct i40e_hw *hw,i40e_status stat_err); +const char *i40e_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err); +const char *i40e_stat_str (struct i40e_hw *hw,i40e_status stat_err);i40e_status i40e_aq_get_rss_lut (struct i40e_hw *hw,u16 seid,bool pf_lut,u8 *lut,u16 lut_size);
drivers/net/ethernet/intel/i40evf/i40e_common.c +2 -2
@@ -87,7 +87,7 @@ i40e_status i40e_set_mac_type(struct i40e_hw *hw)* @hw: pointer to the HW structure * @aq_err: the AQ error code to convert **/ -char *i40evf_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err) +const char *i40evf_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err) {switch (aq_err) {case I40E_AQ_RC_OK :
@@ -147,7 +147,7 @@ char *i40evf_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err)* @hw: pointer to the HW structure * @stat_err: the status error code to convert **/ -char *i40evf_stat_str (struct i40e_hw *hw,i40e_status stat_err) +const char *i40evf_stat_str (struct i40e_hw *hw,i40e_status stat_err) {switch (stat_err) {case 0 :
drivers/net/ethernet/intel/i40evf/i40e_prototype.h +2 -2
@@ -60,8 +60,8 @@ void i40e_idle_aq(struct i40e_hw *hw);void i40evf_resume_aq (struct i40e_hw *hw);bool i40evf_check_asq_alive (struct i40e_hw *hw);i40e_status i40evf_aq_queue_shutdown (struct i40e_hw *hw,bool unloading); -char *i40evf_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err); -char *i40evf_stat_str (struct i40e_hw *hw,i40e_status stat_err); +const char *i40evf_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err); +const char *i40evf_stat_str (struct i40e_hw *hw,i40e_status stat_err);i40e_status i40evf_aq_get_rss_lut (struct i40e_hw *hw,u16 seid,bool pf_lut,u8 *lut,u16 lut_size);
Signature · 1 line
1.9.3
Bowers
PATCH 2/15 i40e/i40evf: Fix compile issue related to const string
Quoted 16 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Wu, Jingjing
Subject: [Intel-wired-lan] [next PATCH S16 02/15] i40e/i40evf: Fix compile issue related to const stringFrom: Jingjing Wu <[email protected]>
Add const to functions that return strings that aren't going to be modified. This addresses some reported compile complaints.
Signed-off-by Jingjing Wu <[email protected]>Change-ID Ic56b1e814ab4d23a50480e7fdec652445f776ee8
Quoted 7 lines
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++-- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 ++-- drivers/net/ethernet/intel/i40evf/i40e_common.c | 4 ++-- drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-)
Code changes present in tree, no compile errors related to changed functions.
PATCH 3/15 i40e: remove read/write failed messages from nvmupdate
In reply to Catherine SullivanFrom: Shannon Nelson <[email protected]>
Allow the nvmupdate application to decide when a read or write error should be exposed to the user. Since the application needs to use write probes to find the ReadOnly sections on a potentially unknown NVM version in the HW and read probes to check the status of the last write, some error messages are expected, but need not be shown to the users. The driver doesn't know which are ignorable from real errors, so needs to let the application make the decision.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +2 -7
@@ -993,9 +993,7 @@ static int i40e_get_eeprom(struct net_device *netdev, cmd = (struct i40e_nvm_access *)eeprom; ret_val =i40e_nvmupd_command (hw, cmd, bytes, &errno); -if (ret_val && - ((hw->aq.asq_last_status !=I40E_AQ_RC_EACCES ) || - (hw->debug_mask &I40E_DEBUG_NVM ))) +if (ret_val && (hw->debug_mask &I40E_DEBUG_NVM )) dev_info(&pf->pdev->dev, "NVMUpdate read failed err=%d status=0x%x errno=%d module=%d offset=0x%x size=%d\n", ret_val, hw->aq.asq_last_status, errno,
@@ -1099,10 +1097,7 @@ static int i40e_set_eeprom(struct net_device *netdev, cmd = (struct i40e_nvm_access *)eeprom; ret_val =i40e_nvmupd_command (hw, cmd, bytes, &errno); -if (ret_val && - ((hw->aq.asq_last_status !=I40E_AQ_RC_EPERM && - hw->aq.asq_last_status !=I40E_AQ_RC_EBUSY ) || - (hw->debug_mask &I40E_DEBUG_NVM ))) +if (ret_val && (hw->debug_mask &I40E_DEBUG_NVM )) dev_info(&pf->pdev->dev, "NVMUpdate write failed err=%d status=0x%x errno=%d module=%d offset=0x%x size=%d\n", ret_val, hw->aq.asq_last_status, errno,
Signature · 1 line
1.9.3
Bowers
PATCH 3/15 i40e: remove read/write failed messages from nvmupdate
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 03/15] i40e: remove read/write failed messages from nvmupdateFrom: Shannon Nelson <[email protected]>
Allow the nvmupdate application to decide when a read or write error should be exposed to the user. Since the application needs to use write probes to find the ReadOnly sections on a potentially unknown NVM version in the HW and read probes to check the status of the last write, some error messages are expected, but need not be shown to the users.
The driver doesn't know which are ignorable from real errors, so needs to let the application make the decision.
Quoted 5 lines
Signed-off-by Shannon Nelson <[email protected]>Change-ID I78fca8ab672bede11c10c820b83c26adfd536d03--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
Code changes present in tree
PATCH 4/15 i40e: Removed unused defines
In reply to Catherine SullivanFrom: Greg Rose <[email protected]>
Two defines that are not used are causing customer confusion - remove them.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +0 -2
@@ -29,8 +29,6 @@#include "i40e.h" -#define I40E_MAX_MACVLAN_FILTERS 256 -#define I40E_MAX_VLAN_FILTERS 256#define I40E_MAX_VLANID 4095#define I40E_VIRTCHNL_SUPPORTED_QTYPES 2
Signature · 1 line
1.9.3
Bowers
PATCH 4/15 i40e: Removed unused defines
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 04/15] i40e: Removed unused definesFrom: Greg Rose <[email protected]>
Quoted 8 lines
Two defines that are not used are causing customer confusion - remove them.
Signed-off-by Greg Rose <[email protected]>Change-ID Icef0325aca8e0f4fcdfc519e026bdd375e791200--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 -- 1 file changed, 2 deletions(-)
Code changes present in tree
PATCH 5/15 i40e: priv flag for controlling VEB stats
In reply to Catherine SullivanFrom: Shannon Nelson <[email protected]>
Add an ethtool priv flag to enable and disable printing the VEB statistics.
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 ++++++++ 2 files changed, 9 insertions(+)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -103,6 +103,7 @@#define I40E_PRIV_FLAGS_NPAR_FLAG BIT(0)#define I40E_PRIV_FLAGS_LINKPOLL_FLAG BIT(1)#define I40E_PRIV_FLAGS_FD_ATR BIT(2) +#define I40E_PRIV_FLAGS_VEB_STATS BIT(3)#define I40E_NVM_VERSION_LO_SHIFT 0#define I40E_NVM_VERSION_LO_MASK (0xff << I40E_NVM_VERSION_LO_SHIFT)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +8 -0
@@ -229,6 +229,7 @@ static const char i40e_priv_flags_strings[][ETH_GSTRING_LEN] = {"NPAR" ,"LinkPolling" ,"flow-director-atr" , + "veb-stats", };#define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_priv_flags_strings)
@@ -2671,6 +2672,8 @@ static u32 i40e_get_priv_flags(struct net_device *dev) I40E_PRIV_FLAGS_LINKPOLL_FLAG :0 ; ret_flags |= pf->flags &I40E_FLAG_FD_ATR_ENABLED ?I40E_PRIV_FLAGS_FD_ATR :0 ; + ret_flags |= pf->flags &I40E_FLAG_VEB_STATS_ENABLED ? +I40E_PRIV_FLAGS_VEB_STATS :0 ;return ret_flags; }
@@ -2702,6 +2705,11 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) pf->auto_disable_flags |=I40E_FLAG_FD_ATR_ENABLED ; } +if (flags &I40E_PRIV_FLAGS_VEB_STATS ) + pf->flags |=I40E_FLAG_VEB_STATS_ENABLED ; +else + pf->flags &= ~I40E_FLAG_VEB_STATS_ENABLED ; +return 0 ; }
Signature · 1 line
1.9.3
Bowers
PATCH 5/15 i40e: priv flag for controlling VEB stats
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 05/15] i40e: priv flag for controlling VEB statsFrom: Shannon Nelson <[email protected]>
Quoted 8 lines
Add an ethtool priv flag to enable and disable printing the VEB statistics.
Signed-off-by Shannon Nelson <[email protected]>Change-ID I7654054a3a73b08aa8310d94ee8fce6219107dd8--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 ++++++++ 2 files changed, 9 insertions(+)
Code changes present in tree, "ethtool --show-priv-flags [device]" shows value for "veb-stats", flag can be toggled correctly.
PATCH 6/15 i40e: Add support for non-willing Apps
In reply to Catherine SullivanFrom: Greg Bowers <[email protected]>
Adds support for setting a new bit in the Set Local LLDP MIB AQ command Type field. When set to 1, the bit indicates to FW that Apps should be treated as non-willing. When 0, FW behaves as before.
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 7 +++++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 2 ++ 2 files changed, 9 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +7 -0
@@ -2132,6 +2132,13 @@ I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp);struct i40e_aqc_lldp_set_local_mib {#define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT 0#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT) +#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << \ + SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT) +#define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB 0x0 +#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT (1) +#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK (1 << \ + SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT) +#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS 0x1u8 type;u8 reserved0;__le16 length;
drivers/net/ethernet/intel/i40e/i40e_type.h +2 -0
@@ -475,6 +475,8 @@ struct i40e_dcbx_config {u8 dcbx_mode;#define I40E_DCBX_MODE_CEE 0x1#define I40E_DCBX_MODE_IEEE 0x2 +u8 app_mode; +#define I40E_DCBX_APPS_NON_WILLING 0x1u32 numapps;u32 tlv_status;/* CEE mode TLV status */ struct i40e_dcb_ets_config etscfg;
Signature · 1 line
1.9.3
Bowers
PATCH 6/15 i40e: Add support for non-willing Apps
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Bowers, Gregory J
Subject: [Intel-wired-lan] [next PATCH S16 06/15] i40e: Add support for non- willing AppsFrom: Greg Bowers <[email protected]>
Adds support for setting a new bit in the Set Local LLDP MIB AQ command Type field. When set to 1, the bit indicates to FW that Apps should be treated as non-willing. When 0, FW behaves as before.
Quoted 6 lines
Signed-off-by Greg Bowers <[email protected]>Change-ID I0d2101c1606c59c7188d3e6a0c7810e0f205233a--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 7 +++++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 2 ++ 2 files changed, 9 insertions(+)
Code changes present in tree
PATCH 7/15 i40e: Enhanced fix to protect 'mac_filter_list' accesses
In reply to Catherine SullivanFrom: Kiran Patil <[email protected]>
This patch protects invocation of i40e_set_mac ---> i40e_del_filter using 'mac_filter_list_lock' to synchronize 'mac_filter_list' accesses with service_task : i40e_sync_vsi_filters.
It also replaces spin_lock with spin_lock_bh where needed.
--- drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 62 +++++++++++----------- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 22 ++++---- 3 files changed, 45 insertions(+), 43 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_fcoe.c +2 -2
@@ -1516,12 +1516,12 @@ void i40e_fcoe_config_netdev(struct net_device *netdev, struct i40e_vsi *vsi)* same PCI function. */ netdev->dev_port =1 ; -spin_lock (&vsi->mac_filter_list_lock); +spin_lock_bh (&vsi->mac_filter_list_lock);i40e_add_filter (vsi, hw->mac.san_addr,0 , false, false);i40e_add_filter (vsi, (u8 [6 ])FC_FCOE_FLOGI_MAC ,0 , false, false);i40e_add_filter (vsi,FIP_ALL_FCOE_MACS ,0 , false, false);i40e_add_filter (vsi,FIP_ALL_ENODE_MACS ,0 , false, false); -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock);/* use san mac */ ether_addr_copy (netdev->dev_addr, hw->mac.san_addr);
drivers/net/ethernet/intel/i40e/i40e_main.c +32 -30
218 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +11 -11
@@ -548,7 +548,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)if (vf->port_vlan_id)i40e_vsi_add_pvid (vsi, vf->port_vlan_id); -spin_lock (&vsi->mac_filter_list_lock); +spin_lock_bh (&vsi->mac_filter_list_lock); f =i40e_add_filter (vsi, vf->default_lan_addr.addr, vf->port_vlan_id ? vf->port_vlan_id :-1 , true, false);
@@ -561,7 +561,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)if (!f)dev_info (&pf->pdev->dev,"Could not allocate VF broadcast filter\n" ); -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock); }/* program mac filter */
@@ -1602,7 +1602,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)/* Lock once, because all function inside for loop accesses VSI's * MAC filter list which needs to be protected using same lock. */ -spin_lock (&vsi->mac_filter_list_lock); +spin_lock_bh (&vsi->mac_filter_list_lock);/* add new addresses to the list */ for (i =0 ; i < al->num_elements; i++) {
@@ -1622,11 +1622,11 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)dev_err (&pf->pdev->dev,"Unable to add VF MAC filter\n" ); ret =I40E_ERR_PARAM ; -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock); goto error_param; } } -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock);/* program the updated filter list */ if (i40e_sync_vsi_filters (vsi))
@@ -1674,12 +1674,12 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) } vsi = pf->vsi[vf->lan_vsi_idx]; -spin_lock (&vsi->mac_filter_list_lock); +spin_lock_bh (&vsi->mac_filter_list_lock);/* delete addresses from the list */ for (i =0 ; i < al->num_elements; i++)i40e_del_filter (vsi, al->list[i].addr,I40E_VLAN_ANY , true, false); -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock);/* program the updated filter list */ if (i40e_sync_vsi_filters (vsi))
@@ -2079,7 +2079,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)/* Lock once because below invoked function add/del_filter requires * mac_filter_list_lock to be held */ -spin_lock (&vsi->mac_filter_list_lock); +spin_lock_bh (&vsi->mac_filter_list_lock);/* delete the temporary mac address */ i40e_del_filter(vsi, vf->default_lan_addr.addr,
@@ -2092,7 +2092,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)list_for_each_entry (f, &vsi->mac_filter_list, list)i40e_del_filter (vsi, f->macaddr, f->vlan, true, false); -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock);dev_info (&pf->pdev->dev,"Setting MAC %pM on VF %d\n" , mac, vf_id);/* program mac filter */
@@ -2156,9 +2156,9 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,/* duplicate request, so just return success */ goto error_pvid; -spin_lock (&vsi->mac_filter_list_lock); +spin_lock_bh (&vsi->mac_filter_list_lock); is_vsi_in_vlan =i40e_is_vsi_in_vlan (vsi); -spin_unlock (&vsi->mac_filter_list_lock); +spin_unlock_bh (&vsi->mac_filter_list_lock);if (le16_to_cpu (vsi->info.pvid) ==0 && is_vsi_in_vlan) { dev_err(&pf->pdev->dev,
Signature · 1 line
1.9.3
Sullivan
PATCH 7/15 i40e: Enhanced fix to protect 'mac_filter_list' accesses
v2 of this patch sent.
PATCH 8/15 i40e/i40evf: moderate interrupts differently
In reply to Catherine SullivanFrom: Jesse Brandeburg <[email protected]>
The XL710 hardware has a different interrupt moderation design that can support a limit of total interrupts per second per vector, in addition to the "number of interrupts per second" controls already established in the driver. This combination of hardware features allows us to set very low default latency settings but minimize the total CPU utilization by not making too many interrupts, should the user desire.
The current driver implementation is still enabling the dynamic moderation in the driver, and only using the rx/tx-usecs limit in ethtool to limit the interrupt rate per second, by default.
The new code implemented in this patch
2) adds init/use of the new "Interrupt Limit" register
3) adds ethtool knob to control/report the limits above
Usage is ethtool -C ethx rx-usecs-high <value> Where <value> is number of microseconds to create a rate of 1/N interrupts per second, regardless of rx-usecs or tx-usecs values. Since there is a credit based scheme in the hardware, the rx-usecs and tx-usecs can be configured for very low latency for short bursts, but once the credit runs out the refill rate on the credits is limited by rx-usecs-high.
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 24 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++++++--- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 10 ++++++++++ drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 10 ++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -500,6 +500,7 @@ struct i40e_vsi {*/ u16 rx_itr_setting;u16 tx_itr_setting; +u16 int_rate_limit;/* value in usecs */ u16 rss_table_size;u16 rss_size;
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +24 -0
@@ -1846,6 +1846,14 @@ static int i40e_get_coalesce(struct net_device *netdev, ec->rx_coalesce_usecs = vsi->rx_itr_setting & ~I40E_ITR_DYNAMIC ; ec->tx_coalesce_usecs = vsi->tx_itr_setting & ~I40E_ITR_DYNAMIC ; +/* we use the _usecs_high to store/set the interrupt rate limit +* that the hardware supports, that almost but not quite +* fits the original intent of the ethtool variable, +* the rx_coalesce_usecs_high limits total interrupts +* per second from both tx/rx sources. +*/ + ec->rx_coalesce_usecs_high = vsi->int_rate_limit; + ec->tx_coalesce_usecs_high = vsi->int_rate_limit;return 0 ; }
@@ -1864,6 +1872,17 @@ static int i40e_set_coalesce(struct net_device *netdev,if (ec->tx_max_coalesced_frames_irq || ec->rx_max_coalesced_frames_irq) vsi->work_limit = ec->tx_max_coalesced_frames_irq; +/* tx_coalesce_usecs_high is ignored, use rx-usecs-high instead */ +if (ec->tx_coalesce_usecs_high != vsi->int_rate_limit) { +netif_info (pf, drv, netdev,"tx-usecs-high is not used, please program rx-usecs-high\n" ); +return -EINVAL ; + } + +if (ec->rx_coalesce_usecs_high >=INTRL_REG_TO_USEC (I40E_MAX_INTRL )) { +netif_info (pf, drv, netdev,"Invalid value, rx-usecs-high range is 0-235\n" ); +return -EINVAL ; + } + vector = vsi->base_vector;if ((ec->rx_coalesce_usecs >= (I40E_MIN_ITR <<1 )) && (ec->rx_coalesce_usecs <= (I40E_MAX_ITR <<1 ))) {
@@ -1877,6 +1896,8 @@ static int i40e_set_coalesce(struct net_device *netdev,return -EINVAL ; } + vsi->int_rate_limit = ec->rx_coalesce_usecs_high; +if ((ec->tx_coalesce_usecs >= (I40E_MIN_ITR <<1 )) && (ec->tx_coalesce_usecs <= (I40E_MAX_ITR <<1 ))) { vsi->tx_itr_setting = ec->tx_coalesce_usecs;
@@ -1901,11 +1922,14 @@ static int i40e_set_coalesce(struct net_device *netdev, vsi->tx_itr_setting &= ~I40E_ITR_DYNAMIC ;for (i =0 ; i < vsi->num_q_vectors; i++, vector++) { +u16 intrl =INTRL_USEC_TO_REG (vsi->int_rate_limit); + q_vector = vsi->q_vectors[i]; q_vector->rx.itr =ITR_TO_REG (vsi->rx_itr_setting);wr32 (hw,I40E_PFINT_ITRN (0 , vector -1 ), q_vector->rx.itr); q_vector->tx.itr =ITR_TO_REG (vsi->tx_itr_setting);wr32 (hw,I40E_PFINT_ITRN (1 , vector -1 ), q_vector->tx.itr); +wr32 (hw,I40E_PFINT_RATEN (vector -1 ), intrl);i40e_flush (hw); }
drivers/net/ethernet/intel/i40e/i40e_main.c +7 -3
@@ -3087,11 +3087,9 @@ static int i40e_vsi_configure(struct i40e_vsi *vsi)static void i40e_vsi_configure_msix (struct i40e_vsi *vsi) {struct i40e_pf *pf = vsi->back; -struct i40e_q_vector *q_vector;struct i40e_hw *hw = &pf->hw;u16 vector;int i, q; -u32 val;u32 qp;/* The interrupt indexing is offset by 1 in the PFINT_ITRn
@@ -3101,7 +3099,8 @@ static void i40e_vsi_configure_msix(struct i40e_vsi *vsi) qp = vsi->base_queue; vector = vsi->base_vector;for (i =0 ; i < vsi->num_q_vectors; i++, vector++) { - q_vector = vsi->q_vectors[i]; +struct i40e_q_vector *q_vector = vsi->q_vectors[i]; + q_vector->rx.itr =ITR_TO_REG (vsi->rx_itr_setting); q_vector->rx.latency_range =I40E_LOW_LATENCY ; wr32(hw, I40E_PFINT_ITRN(I40E_RX_ITR, vector - 1),
@@ -3110,10 +3109,14 @@ static void i40e_vsi_configure_msix(struct i40e_vsi *vsi) q_vector->tx.latency_range =I40E_LOW_LATENCY ;wr32 (hw,I40E_PFINT_ITRN (I40E_TX_ITR , vector -1 ), q_vector->tx.itr); +wr32 (hw,I40E_PFINT_RATEN (vector -1 ), +INTRL_USEC_TO_REG (vsi->int_rate_limit));/* Linked list for the queuepairs assigned to this vector */ wr32 (hw,I40E_PFINT_LNKLSTN (vector -1 ), qp);for (q =0 ; q < q_vector->num_ringpairs; q++) { +u32 val; + val =I40E_QINT_RQCTL_CAUSE_ENA_MASK | (I40E_RX_ITR <<I40E_QINT_RQCTL_ITR_INDX_SHIFT ) | (vector << I40E_QINT_RQCTL_MSIX_INDX_SHIFT) |
@@ -7226,6 +7229,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type) vsi->idx = vsi_idx; vsi->rx_itr_setting = pf->rx_itr_default; vsi->tx_itr_setting = pf->tx_itr_default; + vsi->int_rate_limit =0 ; vsi->rss_table_size = (vsi->type ==I40E_VSI_MAIN ) ? pf->rss_table_size :64 ; vsi->netdev_registered = false;
drivers/net/ethernet/intel/i40e/i40e_txrx.h +10 -0
@@ -35,6 +35,7 @@#define I40E_ITR_20K 0x0019#define I40E_ITR_8K 0x003E#define I40E_ITR_4K 0x007A +#define I40E_MAX_INTRL 0x3B/* reg uses 4 usec resolution */ #define I40E_ITR_RX_DEF I40E_ITR_8K#define I40E_ITR_TX_DEF I40E_ITR_4K#define I40E_ITR_DYNAMIC 0x8000/* use top bit as a flag */
@@ -44,6 +45,15 @@#define ITR_TO_REG (setting) ((setting & ~I40E_ITR_DYNAMIC) >> 1)#define ITR_IS_DYNAMIC (setting) (!!(setting & I40E_ITR_DYNAMIC))#define ITR_REG_TO_USEC (itr_reg) (itr_reg << 1) +/* 0x40 is the enable bit for interrupt rate limiting, and must be set if +* the value of the rate limit is non-zero +*/ +#define INTRL_ENA BIT(6) +#define INTRL_REG_TO_USEC (intrl) ((intrl & ~INTRL_ENA) << 2) +#define INTRL_USEC_TO_REG (set) ((set) ? ((set) >> 2) | INTRL_ENA : 0) +#define I40E_INTRL_8K 125/* 8000 ints/sec */ +#define I40E_INTRL_62K 16/* 62500 ints/sec */ +#define I40E_INTRL_83K 12/* 83333 ints/sec */ #define I40E_QUEUE_END_OF_LIST 0x7FF
drivers/net/ethernet/intel/i40evf/i40e_txrx.h +10 -0
@@ -35,6 +35,7 @@#define I40E_ITR_20K 0x0019#define I40E_ITR_8K 0x003E#define I40E_ITR_4K 0x007A +#define I40E_MAX_INTRL 0x3B/* reg uses 4 usec resolution */ #define I40E_ITR_RX_DEF I40E_ITR_8K#define I40E_ITR_TX_DEF I40E_ITR_4K#define I40E_ITR_DYNAMIC 0x8000/* use top bit as a flag */
@@ -44,6 +45,15 @@#define ITR_TO_REG (setting) ((setting & ~I40E_ITR_DYNAMIC) >> 1)#define ITR_IS_DYNAMIC (setting) (!!(setting & I40E_ITR_DYNAMIC))#define ITR_REG_TO_USEC (itr_reg) (itr_reg << 1) +/* 0x40 is the enable bit for interrupt rate limiting, and must be set if +* the value of the rate limit is non-zero +*/ +#define INTRL_ENA BIT(6) +#define INTRL_REG_TO_USEC (intrl) ((intrl & ~INTRL_ENA) << 2) +#define INTRL_USEC_TO_REG (set) ((set) ? ((set) >> 2) | INTRL_ENA : 0) +#define I40E_INTRL_8K 125/* 8000 ints/sec */ +#define I40E_INTRL_62K 16/* 62500 ints/sec */ +#define I40E_INTRL_83K 12/* 83333 ints/sec */ #define I40E_QUEUE_END_OF_LIST 0x7FF
Signature · 1 line
1.9.3
Bowers
PATCH 8/15 i40e/i40evf: moderate interrupts differently
Quoted 35 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 08/15] i40e/i40evf: moderate interrupts differentlyFrom: Jesse Brandeburg <[email protected]>
The XL710 hardware has a different interrupt moderation design that can support a limit of total interrupts per second per vector, in addition to the "number of interrupts per second"
controls already established in the driver. This combination of hardware features allows us to set very low default latency settings but minimize the total CPU utilization by not making too many interrupts, should the user desire.The current driver implementation is still enabling the dynamic moderation in the driver, and only using the rx/tx-usecs limit in ethtool to limit the interrupt rate per second, by default.
The new code implemented in this patch
2) adds init/use of the new "Interrupt Limit" register
3) adds ethtool knob to control/report the limits aboveUsage is ethtool -C ethx rx-usecs-high <value> Where <value> is number of microseconds to create a rate of 1/N interrupts per second, regardless of rx- usecs or tx-usecs values. Since there is a credit based scheme in the hardware, the rx-usecs and tx-usecs can be configured for very low latency for short bursts, but once the credit runs out the refill rate on the credits is limited by rx-usecs-high.
Signed-off-by Jesse Brandeburg <[email protected]>Change-ID I3a1075d3296123b0f4f50623c779b027af5b188d
Quoted 8 lines
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 24 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++++++--- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 10 ++++++++++ drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 10 ++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-)
Code changes present in tree, ethtool command line switches correctly set and displayed values for tx-usecs-high
PATCH 9/15 i40e/i40evf: grab the AQ spinlocks before clearing registers
In reply to Catherine SullivanFrom: Shannon Nelson <[email protected]>
Make sure we have the spinlocks before we clear the ARQ and ASQ management registers. Also, widen the locked portion and make a sanity check earlier in the send function to be sure we're working with safe register values.
--- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 45 +++++++++++++------------ drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 45 +++++++++++++------------ 2 files changed, 46 insertions(+), 44 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq.c +23 -22
@@ -482,8 +482,12 @@ static i40e_status i40e_shutdown_asq(struct i40e_hw *hw) {i40e_status ret_code =0 ; -if (hw->aq.asq.count ==0 ) -return I40E_ERR_NOT_READY ; +mutex_lock (&hw->aq.asq_mutex); + +if (hw->aq.asq.count ==0 ) { + ret_code =I40E_ERR_NOT_READY ; + goto shutdown_asq_out; + }/* Stop firmware AdminQ processing */ wr32 (hw, hw->aq.asq.head,0 );
@@ -492,16 +496,13 @@ static i40e_status i40e_shutdown_asq(struct i40e_hw *hw)wr32 (hw, hw->aq.asq.bal,0 );wr32 (hw, hw->aq.asq.bah,0 ); -/* make sure lock is available */ -mutex_lock (&hw->aq.asq_mutex); - hw->aq.asq.count =0 ;/* to indicate uninitialized queue */ /* free ring buffers */ i40e_free_asq_bufs (hw); +shutdown_asq_out:mutex_unlock (&hw->aq.asq_mutex); -return ret_code; }
@@ -515,8 +516,12 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw) {i40e_status ret_code =0 ; -if (hw->aq.arq.count ==0 ) -return I40E_ERR_NOT_READY ; +mutex_lock (&hw->aq.arq_mutex); + +if (hw->aq.arq.count ==0 ) { + ret_code =I40E_ERR_NOT_READY ; + goto shutdown_arq_out; + }/* Stop firmware AdminQ processing */ wr32 (hw, hw->aq.arq.head,0 );
@@ -525,16 +530,13 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)wr32 (hw, hw->aq.arq.bal,0 );wr32 (hw, hw->aq.arq.bah,0 ); -/* make sure lock is available */ -mutex_lock (&hw->aq.arq_mutex); - hw->aq.arq.count =0 ;/* to indicate uninitialized queue */ /* free ring buffers */ i40e_free_arq_bufs (hw); +shutdown_arq_out:mutex_unlock (&hw->aq.arq_mutex); -return ret_code; }
@@ -751,21 +753,23 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,u16 retval =0 ;u32 val =0 ; +mutex_lock (&hw->aq.asq_mutex); + hw->aq.asq_last_status =I40E_AQ_RC_OK ; - val =rd32 (hw, hw->aq.asq.head); -if (val >= hw->aq.num_asq_entries) { +if (hw->aq.asq.count ==0 ) {i40e_debug (hw,I40E_DEBUG_AQ_MESSAGE , -"AQTX: head overrun at %d\n" , val); +"AQTX: Admin queue not initialized.\n" ); status =I40E_ERR_QUEUE_EMPTY ; - goto asq_send_command_exit; + goto asq_send_command_error; } -if (hw->aq.asq.count ==0 ) { + val =rd32 (hw, hw->aq.asq.head); +if (val >= hw->aq.num_asq_entries) {i40e_debug (hw,I40E_DEBUG_AQ_MESSAGE , -"AQTX: Admin queue not initialized.\n" ); +"AQTX: head overrun at %d\n" , val); status =I40E_ERR_QUEUE_EMPTY ; - goto asq_send_command_exit; + goto asq_send_command_error; } details =I40E_ADMINQ_DETAILS (hw->aq.asq, hw->aq.asq.next_to_use);
@@ -790,8 +794,6 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, desc->flags &= ~cpu_to_le16 (details->flags_dis); desc->flags |=cpu_to_le16 (details->flags_ena); -mutex_lock (&hw->aq.asq_mutex); -if (buff_size > hw->aq.asq_buf_size) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
@@ -915,7 +917,6 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, asq_send_command_error:mutex_unlock (&hw->aq.asq_mutex); -asq_send_command_exit:return status; }
drivers/net/ethernet/intel/i40evf/i40e_adminq.c +23 -22
107 lines not on this page · raw message
Signature · 1 line
1.9.3
Bowers
PATCH 9/15 i40e/i40evf: grab the AQ spinlocks before clearing registers
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 09/15] i40e/i40evf: grab the AQ spinlocks before clearing registersFrom: Shannon Nelson <[email protected]>
Make sure we have the spinlocks before we clear the ARQ and ASQ management registers. Also, widen the locked portion and make a sanity check earlier in the send function to be sure we're working with safe register values.
Quoted 8 lines
Signed-off-by Shannon Nelson <[email protected]>Change-ID I34b56044b33461ed780f3d2de8d62826cdf933f9--- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 45 +++++++++++++------- ----- drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 45 +++++++++++++------ ------ 2 files changed, 46 insertions(+), 44 deletions(-)
Code changes present in tree
PATCH 10/15 i40e: reset the invalid msg counter in vf when a valid msg is received
In reply to Catherine SullivanFrom: Jingjing Wu <[email protected]>
When the number of invalid messages from a VF is exceeded, the VF will be disabled, due to the invalid messages. This happens if other VF drivers (like DPDK) send a message through the driver's mailbox (aka virtchannel) interface, but the message is not supported by the i40e pf driver, such as CONFIG_PROMISCUOUS_MODE.
This patch changes the num_invalid_msgs in struct i40e_vf to record the continuous invalid msgs, and it will be reset when a valid msg is received.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 -0
@@ -1105,6 +1105,8 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, } }else { vf->num_valid_msgs++; +/* reset the invalid counter, if a valid message is received. */ + vf->num_invalid_msgs =0 ; } aq_ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval,
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +2 -1
@@ -96,7 +96,8 @@ struct i40e_vf {u8 num_queue_pairs;/* num of qps assigned to VF vsis */ u64 num_mdd_events;/* num of mdd events detected */ -u64 num_invalid_msgs;/* num of malformed or invalid msgs detected */ +/* num of continuous malformed or invalid msgs detected */ +u64 num_invalid_msgs;u64 num_valid_msgs;/* num of valid msgs detected */ unsigned long vf_caps;/* vf's adv. capabilities */
Signature · 1 line
1.9.3
Bowers
PATCH 10/15 i40e: reset the invalid msg counter in vf when a valid msg is received
Quoted 20 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Wu, Jingjing
Subject: [Intel-wired-lan] [next PATCH S16 10/15] i40e: reset the invalid msg counter in vf when a valid msg is receivedFrom: Jingjing Wu <[email protected]>
When the number of invalid messages from a VF is exceeded, the VF will be disabled, due to the invalid messages. This happens if other VF drivers (like DPDK) send a message through the driver's mailbox (aka virtchannel) interface, but the message is not supported by the i40e pf driver, such as
CONFIG_PROMISCUOUS_MODE.This patch changes the
num_invalid_msgsin structi40e_vfto record the continuous invalid msgs, and it will be reset when a valid msg is received.
Quoted 7 lines
Signed-off-by Jingjing Wu <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>Change-ID Iaec42fd3dcdd281476b3518be23261dd46fc3718--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
Code changes present in tree
PATCH 11/15 i40evf: correctly populate vlan_features
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
The vlan_features field was correctly being set to the same value as the netdev features field. However, this was being done before the features were actually being set up, leaving the vlan_features empty.
Also, after a reset, vlan_features will be incorrectly assigned the previous netdev feature flags, which can contain VLAN feature bits. This makes the VLAN code angry and will cause a stack dump.
To fix these issues, set up the netdev features first, then mask out the VLAN feature bits when assigning vlan_features.
--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +4 -1
@@ -2123,7 +2123,10 @@ int i40evf_process_config(struct i40evf_adapter *adapter)if (adapter->vf_res->vf_offload_flags &I40E_VIRTCHNL_VF_OFFLOAD_VLAN ) { - netdev->vlan_features = netdev->features; + netdev->vlan_features = netdev->features & + ~(NETIF_F_HW_VLAN_CTAG_TX | +NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_CTAG_FILTER ); netdev->features |=NETIF_F_HW_VLAN_CTAG_TX |NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_CTAG_FILTER ;
Signature · 1 line
1.9.3
Bowers
PATCH 11/15 i40evf: correctly populate vlan_features
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 11/15] i40evf: correctly populatevlan_featuresFrom: Mitch Williams <[email protected]>
The
vlan_featuresfield was correctly being set to the same value as the netdev features field. However, this was being done before the features were actually being set up, leaving thevlan_featuresempty.Also, after a reset,
vlan_featureswill be incorrectly assigned the previous netdev feature flags, which can contain VLAN feature bits. This makes the VLAN code angry and will cause a stack dump.
Quoted 8 lines
To fix these issues, set up the netdev features first, then mask out the VLAN feature bits when assigning
vlan_features.Signed-off-by Mitch Williams <[email protected]>Change-ID Ib0548869dc83cf6a841cb8697dd94c12359ba4d2--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Patch code changes correctly applied, features shown correctly at init
PATCH 12/15 i40e: Recognize 1000Base_T_Optical phy type when link is up
In reply to Catherine Sullivan1000Base_T_Optical got added to the function that figures out what is supported when link is down but not when link is up. Add it in there too so that we display the correct information.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +6 -0
@@ -307,6 +307,12 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,if (hw_link_info->requested_speeds &I40E_LINK_SPEED_1GB ) ecmd->advertising |= ADVERTISED_1000baseT_Full;break ; +case I40E_PHY_TYPE_1000BASE_T_OPTICAL : + ecmd->supported = SUPPORTED_Autoneg | + SUPPORTED_1000baseT_Full; + ecmd->advertising = ADVERTISED_Autoneg | + ADVERTISED_1000baseT_Full; +break ;case I40E_PHY_TYPE_100BASE_TX : ecmd->supported = SUPPORTED_Autoneg | SUPPORTED_100baseT_Full;
Signature · 1 line
1.9.3
Bowers
PATCH 12/15 i40e: Recognize 1000Base_T_Optical phy type when link is up
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 12/15] i40e: Recognize 1000Base_T_Optical phy type when link is up1000Base_T_Optical got added to the function that figures out what is supported when link is down but not when link is up. Add it in there too so that we display the correct information.
Quoted 5 lines
Signed-off-by Catherine Sullivan <[email protected]>Change-ID I85ebcdfa7c02d898c44c673b1500552a53c8042e--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 ++++++ 1 file changed, 6 insertions(+)
Code changes present in tree, correct link information shown in ethtool with 1000BaseT optical PHY
PATCH 13/15 i40evf: relax and stagger init timing a bit
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
On some devices, in some systems, in some configurations, the VFs would fail to initialize the first time you loaded the driver.
To correct this, increase the delay time for the init task slightly, and wait longer before giving up.
If we enable VFs and load the VF driver in the same kernel as the PF driver, we can totally overwhelm the PF driver with AQ requests because all of the instances try to initialize at the same time.
To help alleviate this, stagger the initial scheduling of the init task using the PCIe function as a multiplier. We mask off the function to only three bits so no instance has to wait too long.
With these two changes, initializing 128 VFs on a single device goes from four minutes to just a few seconds.
--- drivers/net/ethernet/intel/i40evf/i40evf.h | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +1 -1
@@ -87,7 +87,7 @@ struct i40e_vsi {#define I40EVF_MAX_RXBUFFER 16384/* largest size for single descriptor */ #define I40EVF_MAX_AQ_BUF_SIZE 4096#define I40EVF_AQ_LEN 32 -#define I40EVF_AQ_MAX_ERR 10/* times to try before resetting AQ */ +#define I40EVF_AQ_MAX_ERR 20/* times to try before resetting AQ */ #define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +2 -2
@@ -2344,7 +2344,7 @@ static void i40evf_init_task(struct work_struct *work) }return ; restart: -schedule_delayed_work (&adapter->init_task,msecs_to_jiffies (20 )); +schedule_delayed_work (&adapter->init_task,msecs_to_jiffies (30 ));return ; err_register:
@@ -2361,7 +2361,7 @@ err: adapter->flags |=I40EVF_FLAG_PF_COMMS_FAILED ;return ;/* do not reschedule */ } -schedule_delayed_work (&adapter->init_task,HZ /2 ); +schedule_delayed_work (&adapter->init_task,HZ ); }/**
Signature · 1 line
1.9.3
Bowers
PATCH 13/15 i40evf: relax and stagger init timing a bit
Quoted 27 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 13/15] i40evf: relax and stagger init timing a bitFrom: Mitch Williams <[email protected]>
On some devices, in some systems, in some configurations, the VFs would fail to initialize the first time you loaded the driver.
To correct this, increase the delay time for the init task slightly, and wait longer before giving up.
If we enable VFs and load the VF driver in the same kernel as the PF driver, we can totally overwhelm the PF driver with AQ requests because all of the instances try to initialize at the same time.
To help alleviate this, stagger the initial scheduling of the init task using the PCIe function as a multiplier. We mask off the function to only three bits so no instance has to wait too long.
With these two changes, initializing 128 VFs on a single device goes from four minutes to just a few seconds.
Quoted 6 lines
Signed-off-by Mitch Williams <[email protected]>Change-ID If3d8720c1c4e838ab36d8781d9ec295a62380936--- drivers/net/ethernet/intel/i40evf/i40evf.h | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Code changes present in tree, able to initialize and remove 64 VFs in a few seconds.
PATCH 14/15 i40e: increase AQ work limit
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
With 64 VFs, we can easily overwhelm the AQ on the PF if we have too low a limit on the number of AQ requests. This leads to ARQ overflow errors, and occasionally VFs that fail to initialize.
Since we really only hit this condition on initial VF driver load, the requests that we process are lightweight, so this extra work doesn't cause problems for the PF driver.
--- drivers/net/ethernet/intel/i40e/i40e.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -1
@@ -93,7 +93,7 @@#endif /* I40E_FCOE */ #define I40E_MAX_AQ_BUF_SIZE 4096#define I40E_AQ_LEN 256 -#define I40E_AQ_WORK_LIMIT 32 +#define I40E_AQ_WORK_LIMIT 66/* max number of VFs + a little */ #define I40E_MAX_USER_PRIORITY 8#define I40E_DEFAULT_MSG_ENABLE 4#define I40E_QUEUE_WAIT_RETRY_LIMIT 10
Signature · 1 line
1.9.3
Bowers
PATCH 14/15 i40e: increase AQ work limit
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 14/15] i40e: increase AQ work limitFrom: Mitch Williams <[email protected]>
With 64 VFs, we can easily overwhelm the AQ on the PF if we have too low a limit on the number of AQ requests. This leads to ARQ overflow errors, and occasionally VFs that fail to initialize.
Since we really only hit this condition on initial VF driver load, the requests that we process are lightweight, so this extra work doesn't cause problems for the PF driver.
Quoted 5 lines
Signed-off-by Mitch Williams <[email protected]>Change-ID I620221520d8af987df6ace9ba938ffaf22107681--- drivers/net/ethernet/intel/i40e/i40e.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Code changes present in tree
PATCH 15/15 i40e/i40evf: Bump i40e to 1.3.34 and i40evf to 1.3.21
In reply to Catherine SullivanBump.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =#define DRV_VERSION_MAJOR 1#define DRV_VERSION_MINOR 3 -#define DRV_VERSION_BUILD 28 +#define DRV_VERSION_BUILD 34#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
@@ -34,7 +34,7 @@ char i40evf_driver_name[] = "i40evf";static const char i40evf_driver_string[] ="Intel(R) XL710/X710 Virtual Function Network Driver" ; -#define DRV_VERSION "1.3.19" +#define DRV_VERSION "1.3.21"const char i40evf_driver_version[] =DRV_VERSION ;static const char i40evf_copyright[] ="Copyright (c) 2013 - 2015 Intel Corporation." ;
Signature · 1 line
1.9.3
Bowers
PATCH 15/15 i40e/i40evf: Bump i40e to 1.3.34 and i40evf to 1.3.21
Quoted 8 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, September 28, 2015 11:13 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S16 15/15] i40e/i40evf: Bump i40e to 1.3.34 and i40evf to 1.3.21
Quoted 8 lines
Bump.
Signed-off-by Catherine Sullivan <[email protected]>Change-ID I7ec818a507554648675b9b245ced9e6b6bd9ed4e--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Code changes present in tree, superseded by subsequent version bump to 1.3.38 and 1.3.25
Sullivan
cover i40e/i40evf updates
In reply to Catherine Sullivanv2 of the cover letter sent with the changes for patch 7.