i40e/i40evf updates
Subsystems (2)
cover i40e/i40evf updates
Carolyn marks a parameter __always_unused, adds info to nvm info struct for OEM version data, and updates fw version text string per previous product formats.
Catherine adds module_types and update_link_info and refactors PHY structure and add phy_capabilities enum.
Greg B. converts CEE App TLV selector to IEEE selector.
Greg R. adds promiscuous on VLAN support.
Mitch properly handles ndo_set_mac_address call, removes a redundant call, tells the pf not to panic on VSI allocation failure, and the vf not to blow away MAC addresses.
Neerav uses the BIT() macro for priority map parsing.
Shannon adds new link status defines and splits device ids into a separate file.
drivers/net/ethernet/intel/i40e/i40e.h | 10 +- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 9 +- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 4 +- drivers/net/ethernet/intel/i40e/i40e_common.c | 98 +++++++++- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 18 +- drivers/net/ethernet/intel/i40e/i40e_devids.h | 55 ++++++ drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 205 ++++++++++++--------- drivers/net/ethernet/intel/i40e/i40e_main.c | 22 ++- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 7 + drivers/net/ethernet/intel/i40e/i40e_type.h | 86 ++++++--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 +- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 4 +- drivers/net/ethernet/intel/i40evf/i40e_devids.h | 55 ++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 83 ++++++--- drivers/net/ethernet/intel/i40evf/i40evf.h | 1 + drivers/net/ethernet/intel/i40evf/i40evf_main.c | 20 +- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 2 + 17 files changed, 518 insertions(+), 174 deletions(-) create mode 100644 drivers/net/ethernet/intel/i40e/i40e_devids.h create mode 100644 drivers/net/ethernet/intel/i40evf/i40e_devids.h
Signature · 1 line
1.9.3
PATCH 1/15 i40e/i40evf: Add new link status defines
From: Shannon Nelson <[email protected]>
Add the new Port link status bit and rename the link status to function link status.
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 4 +++- drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +3 -1
@@ -1722,11 +1722,13 @@ struct i40e_aqc_get_link_status {u8 phy_type;/* i40e_aq_phy_type */ u8 link_speed;/* i40e_aq_link_speed */ u8 link_info; -#define I40E_AQ_LINK_UP 0x01 +#define I40E_AQ_LINK_UP 0x01/* obsolete */ +#define I40E_AQ_LINK_UP_FUNCTION 0x01#define I40E_AQ_LINK_FAULT 0x02#define I40E_AQ_LINK_FAULT_TX 0x04#define I40E_AQ_LINK_FAULT_RX 0x08#define I40E_AQ_LINK_FAULT_REMOTE 0x10 +#define I40E_AQ_LINK_UP_PORT 0x20#define I40E_AQ_MEDIA_AVAILABLE 0x40#define I40E_AQ_SIGNAL_DETECT 0x80u8 an_info;
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +3 -1
@@ -1719,11 +1719,13 @@ struct i40e_aqc_get_link_status {u8 phy_type;/* i40e_aq_phy_type */ u8 link_speed;/* i40e_aq_link_speed */ u8 link_info; -#define I40E_AQ_LINK_UP 0x01 +#define I40E_AQ_LINK_UP 0x01/* obsolete */ +#define I40E_AQ_LINK_UP_FUNCTION 0x01#define I40E_AQ_LINK_FAULT 0x02#define I40E_AQ_LINK_FAULT_TX 0x04#define I40E_AQ_LINK_FAULT_RX 0x08#define I40E_AQ_LINK_FAULT_REMOTE 0x10 +#define I40E_AQ_LINK_UP_PORT 0x20#define I40E_AQ_MEDIA_AVAILABLE 0x40#define I40E_AQ_SIGNAL_DETECT 0x80u8 an_info;
Signature · 1 line
1.9.3
Bowers
PATCH 1/15 i40e/i40evf: Add new link status defines
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 01/15] i40e/i40evf: Add new link status definesFrom: Shannon Nelson <[email protected]>
Add the new Port link status bit and rename the link status to function link status.
Quoted 6 lines
Signed-off-by Shannon Nelson <[email protected]>Change-ID I71289327ae62638ce967b6ad40114caf998b6dab--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 4 +++- drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
Code changes present in tree
PATCH 2/15 i40e: Make it clear a parameter is never used
In reply to Catherine SullivanFrom: Carolyn Wyborny <[email protected]>
Flag the filter_mask parameter as __always_unused in the ndo_bridge_getlink function.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -1
@@ -8336,7 +8336,8 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,**/ static int i40e_ndo_bridge_getlink (struct sk_buff *skb,u32 pid,u32 seq,struct net_device *dev, -u32 filter_mask,int nlflags) +u32 __always_unused filter_mask, +int nlflags) {struct i40e_netdev_priv *np =netdev_priv (dev);struct i40e_vsi *vsi = np->vsi;
Signature · 1 line
1.9.3
Bowers
PATCH 2/15 i40e: Make it clear a parameter is never used
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 02/15] i40e: Make it clear a parameter is never usedFrom: Carolyn Wyborny <[email protected]>
Quoted 8 lines
Flag the
filter_maskparameter as__always_unusedin thendo_bridge_getlinkfunction.Signed-off-by Carolyn Wyborny <[email protected]>Change-ID Ifc1e99c7fb84bcbf81cf7b0ac891ad8ca956ffb2--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Code changes present in tree
PATCH 3/15 i40e: Use BIT() macro for priority map parsing
In reply to Catherine SullivanFrom: Neerav Parikh <[email protected]>
Replace one left over (1 << up) in the i40e_dcb.c file with the BIT() macro.
--- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_dcb.c +1 -1
@@ -393,7 +393,7 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,for (i =0 ; i < dcbcfg->numapps; i++) { app = (struct i40e_cee_app_prio *)(tlv->tlvinfo + offset);for (up =0 ; up <I40E_MAX_USER_PRIORITY ; up++) { -if (app->prio_map & (1 << up)) +if (app->prio_map &BIT (up))break ; } dcbcfg->app[i].priority = up;
Signature · 1 line
1.9.3
Bowers
PATCH 3/15 i40e: Use BIT() macro for priority map parsing
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 03/15] i40e: UseBIT()macro for priority map parsingFrom: Neerav Parikh <[email protected]>
Quoted 7 lines
Replace one left over (1 << up) in the
i40e_dcb.cfile with theBIT()macro.Signed-off-by Neerav Parikh <[email protected]>Change-ID I39492a400a2cee5ac566143a5b436cc478bea0db--- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Code changes present in tree
PATCH 4/15 i40evf: properly handle ndo_set_mac_address calls
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
The driver was not correctly handling calls to its ndo_set_mac_address method. It did not properly check to see if the override would be allowed by the PF driver, and never removed the old address from its filter list.
Add a new flag to the adapter struct which is set if the MAC address is assigned by the PF. Check this flag and don't allow the MAC address to be changed if it is set. Search for and properly remove the filter for the old MAC address when the new one is set.
--- drivers/net/ethernet/intel/i40evf/i40evf.h | 1 + drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +1 -0
@@ -220,6 +220,7 @@ struct i40evf_adapter {#define I40EVF_FLAG_RESET_NEEDED BIT(10)#define I40EVF_FLAG_WB_ON_ITR_CAPABLE BIT(11)#define I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE BIT(12) +#define I40EVF_FLAG_ADDR_SET_BY_PF BIT(13)/* duplicates for common code */ #define I40E_FLAG_FDIR_ATR_ENABLED 0#define I40E_FLAG_DCB_ENABLED 0
drivers/net/ethernet/intel/i40evf/i40evf_main.c +15 -3
@@ -841,6 +841,15 @@ static int i40evf_set_mac(struct net_device *netdev, void *p)if (ether_addr_equal (netdev->dev_addr, addr->sa_data))return 0 ; +if (adapter->flags &I40EVF_FLAG_ADDR_SET_BY_PF ) +return -EPERM ; + + f =i40evf_find_filter (adapter, hw->mac.addr); +if (f) { + f->remove = true; + adapter->aq_required |=I40EVF_FLAG_AQ_DEL_MAC_FILTER ; + } + f =i40evf_add_filter (adapter, addr->sa_data);if (f) {ether_addr_copy (hw->mac.addr, addr->sa_data);
@@ -2244,10 +2253,13 @@ static void i40evf_init_task(struct work_struct *work)if (!is_valid_ether_addr (adapter->hw.mac.addr)) {dev_info (&pdev->dev,"Invalid MAC address %pM, using random\n" , adapter->hw.mac.addr); -random_ether_addr (adapter->hw.mac.addr); +eth_hw_addr_random (netdev); +ether_addr_copy (adapter->hw.mac.addr, netdev->dev_addr); + }else { + adapter->flags |=I40EVF_FLAG_ADDR_SET_BY_PF ; +ether_addr_copy (netdev->dev_addr, adapter->hw.mac.addr); +ether_addr_copy (netdev->perm_addr, adapter->hw.mac.addr); } -ether_addr_copy (netdev->dev_addr, adapter->hw.mac.addr); -ether_addr_copy (netdev->perm_addr, adapter->hw.mac.addr);init_timer (&adapter->watchdog_timer); adapter->watchdog_timer.function = &i40evf_watchdog_timer;
Signature · 1 line
1.9.3
Bowers
PATCH 4/15 i40evf: properly handle ndo_set_mac_address calls
Quoted 19 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 04/15] i40evf: properly handlendo_set_mac_addresscallsFrom: Mitch Williams <[email protected]>
The driver was not correctly handling calls to its
ndo_set_mac_addressmethod. It did not properly check to see if the override would be allowed by the PF driver, and never removed the old address from its filter list.Add a new flag to the adapter struct which is set if the MAC address is assigned by the PF. Check this flag and don't allow the MAC address to be changed if it is set. Search for and properly remove the filter for the old MAC address when the new one is set.
Quoted 6 lines
Signed-off-by Mitch Williams <[email protected]>Change-ID I817bf620c869c5a80e6a7eab65c9cbad1dc89799--- drivers/net/ethernet/intel/i40evf/i40evf.h | 1 + drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
Code changes present in tree, can change VF MAC with ethtool and ip.
PATCH 5/15 i40e/i40evf: Add info to nvm info struct for OEM version data
In reply to Catherine SullivanFrom: Carolyn Wyborny <[email protected]>
This patch adds a member to the nvm_info struct for oem_ver info to be output either by OID or ethtool.
--- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 9 ++++++++- drivers/net/ethernet/intel/i40e/i40e_type.h | 3 +++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_adminq.c +8 -1
@@ -551,8 +551,9 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)**/ i40e_status i40e_init_adminq (struct i40e_hw *hw) { -i40e_status ret_code; +u16 cfg_ptr, oem_hi, oem_lo;u16 eetrack_lo, eetrack_hi; +i40e_status ret_code;int retry =0 ;/* verify input for valid configuration */
@@ -611,6 +612,12 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)i40e_read_nvm_word (hw,I40E_SR_NVM_EETRACK_LO , &eetrack_lo);i40e_read_nvm_word (hw,I40E_SR_NVM_EETRACK_HI , &eetrack_hi); hw->nvm.eetrack = (eetrack_hi <<16 ) | eetrack_lo; +i40e_read_nvm_word (hw,I40E_SR_BOOT_CONFIG_PTR , &cfg_ptr); +i40e_read_nvm_word (hw, (cfg_ptr +I40E_NVM_OEM_VER_OFF ), + &oem_hi); +i40e_read_nvm_word (hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF +1 )), + &oem_lo); + hw->nvm.oem_ver = ((u32 )oem_hi <<16 ) | oem_lo;if (hw->aq.api_maj_ver >I40E_FW_API_VERSION_MAJOR ) { ret_code =I40E_ERR_FIRMWARE_API_VERSION ;
drivers/net/ethernet/intel/i40e/i40e_type.h +3 -0
@@ -289,6 +289,7 @@ struct i40e_nvm_info {bool blank_nvm_mode;/* is NVM empty (no FW present)*/ u16 version;/* NVM package version */ u32 eetrack;/* NVM data version */ +u32 oem_ver;/* OEM version info */ };/* definitions used in NVM update support */
@@ -1204,6 +1205,8 @@ struct i40e_hw_port_stats {#define I40E_SR_EMP_MODULE_PTR 0x0F#define I40E_SR_PBA_FLAGS 0x15#define I40E_SR_PBA_BLOCK_PTR 0x16 +#define I40E_SR_BOOT_CONFIG_PTR 0x17 +#define I40E_NVM_OEM_VER_OFF 0x83#define I40E_SR_NVM_DEV_STARTER_VERSION 0x18#define I40E_SR_NVM_WAKE_ON_LAN 0x19#define I40E_SR_ALTERNATE_SAN_MAC_ADDRESS_PTR 0x27
drivers/net/ethernet/intel/i40evf/i40e_type.h +2 -0
@@ -288,6 +288,7 @@ struct i40e_nvm_info {bool blank_nvm_mode;/* is NVM empty (no FW present)*/ u16 version;/* NVM package version */ u32 eetrack;/* NVM data version */ +u32 oem_ver;/* OEM version info */ };/* definitions used in NVM update support */
@@ -1173,6 +1174,7 @@ struct i40e_hw_port_stats {/* Checksum and Shadow RAM pointers */ #define I40E_SR_NVM_CONTROL_WORD 0x00#define I40E_SR_EMP_MODULE_PTR 0x0F +#define I40E_NVM_OEM_VER_OFF 0x83#define I40E_SR_NVM_DEV_STARTER_VERSION 0x18#define I40E_SR_NVM_WAKE_ON_LAN 0x19#define I40E_SR_ALTERNATE_SAN_MAC_ADDRESS_PTR 0x27
Signature · 1 line
1.9.3
Bowers
PATCH 5/15 i40e/i40evf: Add info to nvm info struct for OEM version data
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 05/15] i40e/i40evf: Add info to nvm info struct for OEM version dataFrom: Carolyn Wyborny <[email protected]>
This patch adds a member to the
nvm_infostruct foroem_verinfo to be output either by OID or ethtool.
Quoted 7 lines
Signed-off-by Carolyn Wyborny <[email protected]>Change-ID I1e5d513ae67622e2af17042924fdb4b5d6d85366--- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 9 ++++++++- drivers/net/ethernet/intel/i40e/i40e_type.h | 3 +++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-)
Code changes present in tree, ethtool shows OEM version info
PATCH 6/15 i40e: Convert CEE App TLV selector to IEEE selector
In reply to Catherine SullivanFrom: Greg Bowers <[email protected]>
Changes the parsing of CEE App TLVs to fill in the App selector in struct i40e_dcbx_config with the IEEE App selector so the caller doesn't have to consider whether the App came from a CEE or IEEE DCBX negotiation.
--- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 16 ++++++++++++---- drivers/net/ethernet/intel/i40e/i40e_type.h | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_dcb.c +12 -4
@@ -380,7 +380,7 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv, {u16 length, typelength, offset =0 ;struct i40e_cee_app_prio *app; -u8 i, up; +u8 i, up, selector; typelength =ntohs (tlv->hdr.typelen); length = (u16)((typelength & I40E_LLDP_TLV_LEN_MASK) >>
@@ -397,9 +397,17 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,break ; } dcbcfg->app[i].priority = up; -/* Get Selector from lower 2 bits */ - dcbcfg->app[i].selector = (app->upper_oui_sel & -I40E_CEE_APP_SELECTOR_MASK ); + +/* Get Selector from lower 2 bits, and convert to IEEE */ + selector = (app->upper_oui_sel &I40E_CEE_APP_SELECTOR_MASK ); +if (selector ==I40E_CEE_APP_SEL_ETHTYPE ) + dcbcfg->app[i].selector =I40E_APP_SEL_ETHTYPE ; +else if (selector ==I40E_CEE_APP_SEL_TCPIP ) + dcbcfg->app[i].selector =I40E_APP_SEL_TCPIP ; +else +/* Keep selector as it is for unknown types */ + dcbcfg->app[i].selector = selector; + dcbcfg->app[i].protocolid =ntohs (app->protocol);/* Move to next app */ offset +=sizeof (*app);
drivers/net/ethernet/intel/i40e/i40e_type.h +2 -0
@@ -418,6 +418,8 @@ struct i40e_fc_info {#define I40E_APP_PROTOID_FIP 0x8914#define I40E_APP_SEL_ETHTYPE 0x1#define I40E_APP_SEL_TCPIP 0x2 +#define I40E_CEE_APP_SEL_ETHTYPE 0x0 +#define I40E_CEE_APP_SEL_TCPIP 0x1/* CEE or IEEE 802.1Qaz ETS Configuration data */ struct i40e_dcb_ets_config {
Signature · 1 line
1.9.3
Bowers
PATCH 6/15 i40e: Convert CEE App TLV selector to IEEE selector
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Bowers, Gregory J
Subject: [Intel-wired-lan] [next PATCH S14 06/15] i40e: Convert CEE App TLV selector to IEEE selectorFrom: Greg Bowers <[email protected]>
Changes the parsing of CEE App TLVs to fill in the App selector in struct
i40e_dcbx_configwith the IEEE App selector so the caller doesn't have to consider whether the App came from a CEE or IEEE DCBX negotiation.
Quoted 6 lines
Signed-off-by Greg Bowers <[email protected]>Change-ID Ia7d9d664cde04d2ebcc9822fd22e4929c6edab3a--- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 16 ++++++++++++---- drivers/net/ethernet/intel/i40e/i40e_type.h | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-)
Code changes present in tree
PATCH 7/15 i40e: remove redundant call
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
This function call isn't needed here; the same function is already called by i40e_reset_vf.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +0 -2
@@ -964,8 +964,6 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)/* VF resources get allocated during reset */ i40e_reset_vf (&vfs[i], false); -/* enable VF vplan_qtable mappings */ -i40e_enable_vf_mappings (&vfs[i]); } pf->num_alloc_vfs = num_alloc_vfs;
Signature · 1 line
1.9.3
Bowers
PATCH 7/15 i40e: remove redundant call
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 07/15] i40e: remove redundant callFrom: Mitch Williams <[email protected]>
Quoted 8 lines
This function call isn't needed here; the same function is already called by
i40e_reset_vf.Signed-off-by Mitch Williams <[email protected]>Change-ID I96ccbf91b752965c9e28fe895d4c7d4c46e3ba44--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 -- 1 file changed, 2 deletions(-)
Code changes present in tree
PATCH 8/15 i40e: don't panic on VSI allocation failure
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
In some circumstances, the firmware may fail to allocate a VSI for a VF. When this happens, the driver does not react well to the bad news and has a panic attack.
To fix this problem, check the return value from i40e_alloc_vf_res and don't try to configure the device further if it failed. Additionally, explicitly clear the INIT bit when we free VF resources, so that this bit will be in the proper state in the failure case, and won't blow up elsewhere.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -5
@@ -703,6 +703,7 @@ static void i40e_free_vf_res(struct i40e_vf *vf)*/ vf->num_queue_pairs =0 ; vf->vf_states =0 ; +clear_bit (I40E_VF_STAT_INIT , &vf->vf_states); }/**
@@ -841,11 +842,11 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) complete_reset:/* reallocate VF resources to reset the VSI state */ i40e_free_vf_res (vf); -i40e_alloc_vf_res (vf); -i40e_enable_vf_mappings (vf); -set_bit (I40E_VF_STAT_ACTIVE , &vf->vf_states); -clear_bit (I40E_VF_STAT_DISABLED , &vf->vf_states); - +if (!i40e_alloc_vf_res (vf)) { +i40e_enable_vf_mappings (vf); +set_bit (I40E_VF_STAT_ACTIVE , &vf->vf_states); +clear_bit (I40E_VF_STAT_DISABLED , &vf->vf_states); + }/* tell the VF the reset is done */ wr32 (hw,I40E_VFGEN_RSTAT1 (vf->vf_id),I40E_VFR_VFACTIVE );i40e_flush (hw);
Signature · 1 line
1.9.3
Bowers
PATCH 8/15 i40e: don't panic on VSI allocation failure
Quoted 19 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 08/15] i40e: don't panic on VSI allocation failureFrom: Mitch Williams <[email protected]>
In some circumstances, the firmware may fail to allocate a VSI for a VF. When this happens, the driver does not react well to the bad news and has a panic attack.
To fix this problem, check the return value from
i40e_alloc_vf_resand don't try to configure the device further if it failed. Additionally, explicitly clear the INIT bit when we free VF resources, so that this bit will be in the proper state in the failure case, and won't blow up elsewhere.
Quoted 5 lines
Signed-off-by Mitch Williams <[email protected]>Change-ID I6a20ce2b59c3458fd832032e88fa28cd42500189--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
Code changes present in tree, builds, compiles, passes traffic.
PATCH 9/15 i40e: update fw version text string per previous product formats
In reply to Catherine SullivanFrom: Carolyn Wyborny <[email protected]>
This patch moves the internal fw version and fw api version info to be output in probe. The nvm version, etrack and oem version info are now configured for output via ethtool -i.
--- drivers/net/ethernet/intel/i40e/i40e.h | 10 ++++++---- drivers/net/ethernet/intel/i40e/i40e_main.c | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +6 -4
@@ -107,6 +107,8 @@#define I40E_NVM_VERSION_LO_MASK (0xff << I40E_NVM_VERSION_LO_SHIFT)#define I40E_NVM_VERSION_HI_SHIFT 12#define I40E_NVM_VERSION_HI_MASK (0xf << I40E_NVM_VERSION_HI_SHIFT) +#define I40E_OEM_VER_BUILD_MASK 0xff00 +#define I40E_OEM_VER_PATCH_MASK 0xff/* The values in here are decimal coded as hex as is the case in the NVM map*/ #define I40E_CURRENT_NVM_VERSION_HI 0x2
@@ -589,14 +591,14 @@ static inline char *i40e_fw_version_str(struct i40e_hw *hw)static char buf[32 ];snprintf (buf,sizeof (buf), -"f%d.%d.%05d a%d.%d n%x.%02x e%x" , - hw->aq.fw_maj_ver, hw->aq.fw_min_ver, hw->aq.fw_build, - hw->aq.api_maj_ver, hw->aq.api_min_ver, +"%x.%02x 0x%x %d.%d.%d" , (hw->nvm.version &I40E_NVM_VERSION_HI_MASK ) >>I40E_NVM_VERSION_HI_SHIFT , (hw->nvm.version &I40E_NVM_VERSION_LO_MASK ) >>I40E_NVM_VERSION_LO_SHIFT , - (hw->nvm.eetrack &0xffffff )); + hw->nvm.eetrack, (hw->nvm.oem_ver >>24 ), + (hw->nvm.oem_ver &I40E_OEM_VER_BUILD_MASK ) >>8 , + hw->nvm.oem_ver &I40E_OEM_VER_PATCH_MASK );return buf; }
drivers/net/ethernet/intel/i40e/i40e_main.c +7 -0
@@ -10100,6 +10100,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 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); +if (err) {dev_info (&pdev->dev,"The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n" );
Signature · 1 line
1.9.3
Bowers
PATCH 9/15 i40e: update fw version text string per previous product formats
Quoted 14 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 09/15] i40e: update fw version text string per previous product formatsFrom: Carolyn Wyborny <[email protected]>
This patch moves the internal fw version and fw api version info to be output in probe. The nvm version, etrack and oem version info are now configured for output via ethtool -i.
Quoted 6 lines
Signed-off-by Carolyn Wyborny <[email protected]>Change-ID I05d490093a7137dbefcdef263d014d1e5c9e83d0--- drivers/net/ethernet/intel/i40e/i40e.h | 10 ++++++---- drivers/net/ethernet/intel/i40e/i40e_main.c | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-)
Code changes present in tree, 'ethtool -i [device] shows proper info
PATCH 10/15 i40e/i40evf: split device ids into a separate file
In reply to Catherine SullivanFrom: Shannon Nelson <[email protected]>
Due to desires to write userland drivers, and other requests, without needing the rest of the include files, the device ids are pulled out into a standalone file.
--- drivers/net/ethernet/intel/i40e/i40e_devids.h | 55 +++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 26 +----------- drivers/net/ethernet/intel/i40evf/i40e_devids.h | 55 +++++++++++++++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 26 +----------- 4 files changed, 112 insertions(+), 50 deletions(-) create mode 100644 drivers/net/ethernet/intel/i40e/i40e_devids.h create mode 100644 drivers/net/ethernet/intel/i40evf/i40e_devids.h
drivers/net/ethernet/intel/i40e/i40e_devids.h new file +55 -0
@@ -0,0 +1,55 @@ +/******************************************************************************* +* +* Intel Ethernet Controller XL710 Family Linux Driver +* Copyright(c) 2013 - 2015 Intel Corporation. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms and conditions of the GNU General Public License, +* version 2, as published by the Free Software Foundation. +* +* This program is distributed in the hope it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see <http://www.gnu.org/licenses/>. +* +* The full GNU General Public License is included in this distribution in +* the file called "COPYING". +* +* Contact Information: +* e1000-devel Mailing List <[email protected]> +* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 +* +******************************************************************************/ + +#ifndef _I40E_DEVIDS_H_ +#define _I40E_DEVIDS_H_ + +/* Device IDs */ +#define I40E_DEV_ID_SFP_XL710 0x1572 +#define I40E_DEV_ID_QEMU 0x1574 +#define I40E_DEV_ID_KX_A 0x157F +#define I40E_DEV_ID_KX_B 0x1580 +#define I40E_DEV_ID_KX_C 0x1581 +#define I40E_DEV_ID_QSFP_A 0x1583 +#define I40E_DEV_ID_QSFP_B 0x1584 +#define I40E_DEV_ID_QSFP_C 0x1585 +#define I40E_DEV_ID_10G_BASE_T 0x1586 +#define I40E_DEV_ID_20G_KR2 0x1587 +#define I40E_DEV_ID_20G_KR2_A 0x1588 +#define I40E_DEV_ID_10G_BASE_T4 0x1589 +#define I40E_DEV_ID_VF 0x154C +#define I40E_DEV_ID_VF_HV 0x1571 +#define I40E_DEV_ID_SFP_X722 0x37D0 +#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1 +#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 +#define I40E_DEV_ID_X722_VF 0x37CD +#define I40E_DEV_ID_X722_VF_HV 0x37D9 + +#define i40e_is_40G_device (d) ((d) == I40E_DEV_ID_QSFP_A || \ + (d) == I40E_DEV_ID_QSFP_B || \ + (d) == I40E_DEV_ID_QSFP_C) + +#endif /* _I40E_DEVIDS_H_ */
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -25
@@ -33,31 +33,7 @@#include "i40e_adminq.h" #include "i40e_hmc.h" #include "i40e_lan_hmc.h" - -/* Device IDs */ -#define I40E_DEV_ID_SFP_XL710 0x1572 -#define I40E_DEV_ID_QEMU 0x1574 -#define I40E_DEV_ID_KX_A 0x157F -#define I40E_DEV_ID_KX_B 0x1580 -#define I40E_DEV_ID_KX_C 0x1581 -#define I40E_DEV_ID_QSFP_A 0x1583 -#define I40E_DEV_ID_QSFP_B 0x1584 -#define I40E_DEV_ID_QSFP_C 0x1585 -#define I40E_DEV_ID_10G_BASE_T 0x1586 -#define I40E_DEV_ID_20G_KR2 0x1587 -#define I40E_DEV_ID_20G_KR2_A 0x1588 -#define I40E_DEV_ID_10G_BASE_T4 0x1589 -#define I40E_DEV_ID_VF 0x154C -#define I40E_DEV_ID_VF_HV 0x1571 -#define I40E_DEV_ID_SFP_X722 0x37D0 -#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1 -#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 -#define I40E_DEV_ID_X722_VF 0x37CD -#define I40E_DEV_ID_X722_VF_HV 0x37D9 - -#define i40e_is_40G_device (d) ((d) == I40E_DEV_ID_QSFP_A || \ - (d) == I40E_DEV_ID_QSFP_B || \ - (d) == I40E_DEV_ID_QSFP_C) +#include "i40e_devids.h" /* I40E_MASK is a macro used on 32 bit registers */ #define I40E_MASK (mask, shift) (mask << shift)
drivers/net/ethernet/intel/i40evf/i40e_devids.h new file +55 -0
55 lines not on this page · raw message
drivers/net/ethernet/intel/i40evf/i40e_type.h +1 -25
@@ -33,31 +33,7 @@#include "i40e_adminq.h" #include "i40e_hmc.h" #include "i40e_lan_hmc.h" - -/* Device IDs */ -#define I40E_DEV_ID_SFP_XL710 0x1572 -#define I40E_DEV_ID_QEMU 0x1574 -#define I40E_DEV_ID_KX_A 0x157F -#define I40E_DEV_ID_KX_B 0x1580 -#define I40E_DEV_ID_KX_C 0x1581 -#define I40E_DEV_ID_QSFP_A 0x1583 -#define I40E_DEV_ID_QSFP_B 0x1584 -#define I40E_DEV_ID_QSFP_C 0x1585 -#define I40E_DEV_ID_10G_BASE_T 0x1586 -#define I40E_DEV_ID_20G_KR2 0x1587 -#define I40E_DEV_ID_20G_KR2_A 0x1588 -#define I40E_DEV_ID_10G_BASE_T4 0x1589 -#define I40E_DEV_ID_VF 0x154C -#define I40E_DEV_ID_VF_HV 0x1571 -#define I40E_DEV_ID_SFP_X722 0x37D0 -#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1 -#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 -#define I40E_DEV_ID_X722_VF 0x37CD -#define I40E_DEV_ID_X722_VF_HV 0x37D9 - -#define i40e_is_40G_device (d) ((d) == I40E_DEV_ID_QSFP_A || \ - (d) == I40E_DEV_ID_QSFP_B || \ - (d) == I40E_DEV_ID_QSFP_C) +#include "i40e_devids.h" /* I40E_MASK is a macro used on 32 bit registers */ #define I40E_MASK (mask, shift) (mask << shift)
Signature · 1 line
1.9.3
Bowers
PATCH 10/15 i40e/i40evf: split device ids into a separate file
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 10/15] i40e/i40evf: split device ids into a separate fileFrom: Shannon Nelson <[email protected]>
Due to desires to write userland drivers, and other requests, without needing the rest of the include files, the device ids are pulled out into a standalone file.
Signed-off-by Shannon Nelson <[email protected]>Change-ID Ic0b047dbf9d4b0891892309c1f2079f56d9b60e8
Quoted 10 lines
--- drivers/net/ethernet/intel/i40e/i40e_devids.h | 55 +++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 26 +----------- drivers/net/ethernet/intel/i40evf/i40e_devids.h | 55 +++++++++++++++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 26 +----------- 4 files changed, 112 insertions(+), 50 deletions(-) create mode 100644 drivers/net/ethernet/intel/i40e/i40e_devids.h create mode 100644 drivers/net/ethernet/intel/i40evf/i40e_devids.h
Code changes present in tree, new file i40e_devids.h present in tree.
PATCH 11/15 i40evf: don't blow away MAC address
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
Under certain circumstances, we can get an extra VF_RESOURCES message from the PF driver at runtime. When this happens, we need to parse it because our VSI may have changed out from underneath us, and that will affect our relationship with the PF driver.
However, parsing the resources message also blows away our current MAC address in the hardware struct, usually with all zeros. When this happens, the next time the interface is opened, it will have no MAC address and will a) not work and b) complain.
Fix this issue by restoring the current MAC address from the netdev struct after we parse the resource message.
--- drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +2 -0
@@ -751,6 +751,8 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,sizeof (struct i40e_virtchnl_vsi_resource );memcpy (adapter->vf_res, msg,min (msglen, len));i40e_vf_parse_hw_config (&adapter->hw, adapter->vf_res); +/* restore current mac address */ +ether_addr_copy (adapter->hw.mac.addr, netdev->dev_addr);i40evf_process_config (adapter); }break ;
Signature · 1 line
1.9.3
Bowers
PATCH 11/15 i40evf: don't blow away MAC address
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 11/15] i40evf: don't blow away MAC addressFrom: Mitch Williams <[email protected]>
Under certain circumstances, we can get an extra
VF_RESOURCESmessage from the PF driver at runtime. When this happens, we need to parse it because our VSI may have changed out from underneath us, and that will affect our relationship with the PF driver.However, parsing the resources message also blows away our current MAC address in the hardware struct, usually with all zeros. When this happens, the next time the interface is opened, it will have no MAC address and will a) not work and b) complain.
Quoted 8 lines
Fix this issue by restoring the current MAC address from the netdev struct after we parse the resource message.
Signed-off-by Mitch Williams <[email protected]>Change-ID I6cd1b624fc20432f81dc901166c8de195b8e0e65--- drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 2 ++ 1 file changed, 2 insertions(+)
Code changes present in tree
PATCH 12/15 i40e: Add promiscuous on VLAN support
In reply to Catherine SullivanFrom: Greg Rose <[email protected]>
NFV use cases require the ability to steer packets to VSIs by VLAN tag alone while being in promiscuous mode for multicast and unicast MAC addresses. These two new functions support that ability.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 68 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_prototype.h | 6 +++ 2 files changed, 74 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +68 -0
@@ -2013,6 +2013,74 @@ i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw, }/** +* i40e_aq_set_vsi_mc_promisc_on_vlan +* @hw: pointer to the hw struct +* @seid: vsi number +* @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN +* @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag +* @cmd_details: pointer to command details structure or NULL +**/ +i40e_status i40e_aq_set_vsi_mc_promisc_on_vlan (struct i40e_hw *hw, +u16 seid,bool enable,u16 vid, +struct i40e_asq_cmd_details *cmd_details) +{ +struct i40e_aq_desc desc; +struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; +i40e_status status; +u16 flags =0 ; + +i40e_fill_default_direct_cmd_desc (&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + +if (enable) + flags |=I40E_AQC_SET_VSI_PROMISC_MULTICAST ; + + cmd->promiscuous_flags =cpu_to_le16 (flags); + cmd->valid_flags =cpu_to_le16 (I40E_AQC_SET_VSI_PROMISC_MULTICAST ); + cmd->seid =cpu_to_le16 (seid); + cmd->vlan_tag =cpu_to_le16 (vid |I40E_AQC_SET_VSI_VLAN_VALID ); + + status =i40e_asq_send_command (hw, &desc,NULL ,0 , cmd_details); + +return status; +} + +/** +* i40e_aq_set_vsi_uc_promisc_on_vlan +* @hw: pointer to the hw struct +* @seid: vsi number +* @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN +* @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag +* @cmd_details: pointer to command details structure or NULL +**/ +i40e_status i40e_aq_set_vsi_uc_promisc_on_vlan (struct i40e_hw *hw, +u16 seid,bool enable,u16 vid, +struct i40e_asq_cmd_details *cmd_details) +{ +struct i40e_aq_desc desc; +struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; +i40e_status status; +u16 flags =0 ; + +i40e_fill_default_direct_cmd_desc (&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + +if (enable) + flags |=I40E_AQC_SET_VSI_PROMISC_UNICAST ; + + cmd->promiscuous_flags =cpu_to_le16 (flags); + cmd->valid_flags =cpu_to_le16 (I40E_AQC_SET_VSI_PROMISC_UNICAST ); + cmd->seid =cpu_to_le16 (seid); + cmd->vlan_tag =cpu_to_le16 (vid |I40E_AQC_SET_VSI_VLAN_VALID ); + + status =i40e_asq_send_command (hw, &desc,NULL ,0 , cmd_details); + +return status; +} + +/** * i40e_aq_set_vsi_broadcast * @hw: pointer to the hw struct * @seid: vsi number
drivers/net/ethernet/intel/i40e/i40e_prototype.h +6 -0
@@ -127,6 +127,12 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);i40e_status i40e_aq_set_vsi_multicast_promiscuous (struct i40e_hw *hw,u16 vsi_id,bool set,struct i40e_asq_cmd_details *cmd_details); +i40e_status i40e_aq_set_vsi_mc_promisc_on_vlan (struct i40e_hw *hw, +u16 seid,bool enable,u16 vid, +struct i40e_asq_cmd_details *cmd_details); +i40e_status i40e_aq_set_vsi_uc_promisc_on_vlan (struct i40e_hw *hw, +u16 seid,bool enable,u16 vid, +struct i40e_asq_cmd_details *cmd_details);i40e_status i40e_aq_get_vsi_params (struct i40e_hw *hw,struct i40e_vsi_context *vsi_ctx,struct i40e_asq_cmd_details *cmd_details);
Signature · 1 line
1.9.3
Bowers
PATCH 12/15 i40e: Add promiscuous on VLAN support
Quoted 14 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 12/15] i40e: Add promiscuous on VLAN supportFrom: Greg Rose <[email protected]>
NFV use cases require the ability to steer packets to VSIs by VLAN tag alone while being in promiscuous mode for multicast and unicast MAC addresses. These two new functions support that ability.
Quoted 7 lines
Signed-off-by Greg Rose <[email protected]>Change-ID Ifef704b07e0ee8a39d3c351dbd5dc83bb2f63c45--- drivers/net/ethernet/intel/i40e/i40e_common.c | 68 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_prototype.h | 6 +++ 2 files changed, 74 insertions(+)
Code changes present in tree, monitoring VLAN interface with Wireshark set to promiscuous mode shows "entering promiscuous mode" for the vlan, but vlan will not pass traffic. PF will pass traffic.
PATCH 13/15 i40e/i40evf: Add module_types and update_link_info
In reply to Catherine SullivanAdd a module_types variable to the link_info struct to save the module information from get_phy_capabilities. This information can be used to determine which speeds the module supports.
Also add a new function update_link_info which updates the module_types parameter and then calls get_link_info. This function should be called in place of get_link_info so that the module_types variable stays up-to-date with the rest of the link information.
The EAS table does not reflect the values that are actually returned, so instead, basing these values on the Ethernet compliance codes specified in table 33 of SFF-8436 as these have been accurate.
Use the new variable in ethtool to differentiate between a 10G/1G dual speed fiber module and a 10G only module.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 30 +++++++++++++++++++++--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++++++++---- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 1 + drivers/net/ethernet/intel/i40e/i40e_type.h | 18 ++++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 18 ++++++++++++++ 6 files changed, 76 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +27 -3
@@ -1717,14 +1717,14 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures, *aq_failures |=I40E_SET_FC_AQ_FAIL_SET ; }/* Update the link info */ - status =i40e_aq_get_link_info (hw, true,NULL ,NULL ); + status =i40e_update_link_info (hw);if (status) {/* Wait a little bit (on 40G cards it sometimes takes a really * long time for link to come back from the atomic reset) * and try once more */ msleep (1000 ); - status =i40e_aq_get_link_info (hw, true,NULL ,NULL ); + status =i40e_update_link_info (hw); }if (status) *aq_failures |=I40E_SET_FC_AQ_FAIL_UPDATE ;
@@ -2315,7 +2315,7 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)i40e_status status =0 ;if (hw->phy.get_link_info) { - status =i40e_aq_get_link_info (hw, true,NULL ,NULL ); + status =i40e_update_link_info (hw);if (status) i40e_debug(hw, I40E_DEBUG_LINK, "get link failed: status %d\n",
@@ -2328,6 +2328,30 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up) }/** +* i40e_updatelink_status - update status of the HW network link +* @hw: pointer to the hw struct +**/ +i40e_status i40e_update_link_info (struct i40e_hw *hw) +{ +struct i40e_aq_get_phy_abilities_resp abilities; +i40e_status status =0 ; + + status =i40e_aq_get_link_info (hw, true,NULL ,NULL ); +if (status) +return status; + + status =i40e_aq_get_phy_capabilities (hw, false, false, &abilities, +NULL ); +if (status) +return status; + +memcpy (hw->phy.link_info.module_type, &abilities.module_type, +sizeof (hw->phy.link_info.module_type)); + +return status; +} + +/** * i40e_aq_add_veb - Insert a VEB between the VSI and the MAC * @hw: pointer to the hw struct * @uplink_seid: the MAC or other gizmo SEID
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +11 -5
@@ -307,12 +307,18 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,case I40E_PHY_TYPE_10GBASE_LR :case I40E_PHY_TYPE_1000BASE_SX :case I40E_PHY_TYPE_1000BASE_LX : - ecmd->supported = SUPPORTED_10000baseT_Full | - SUPPORTED_1000baseT_Full; + ecmd->supported = SUPPORTED_10000baseT_Full; +if (hw_link_info->module_type[2 ] & +I40E_MODULE_TYPE_1000BASE_SX || + hw_link_info->module_type[2 ] & +I40E_MODULE_TYPE_1000BASE_LX ) { + ecmd->supported |= SUPPORTED_1000baseT_Full; +if (hw_link_info->requested_speeds & +I40E_LINK_SPEED_1GB ) + ecmd->advertising |= ADVERTISED_1000baseT_Full; + }if (hw_link_info->requested_speeds &I40E_LINK_SPEED_10GB ) ecmd->advertising |= ADVERTISED_10000baseT_Full; -if (hw_link_info->requested_speeds &I40E_LINK_SPEED_1GB ) - ecmd->advertising |= ADVERTISED_1000baseT_Full;break ;case I40E_PHY_TYPE_1000BASE_KX : ecmd->supported = SUPPORTED_Autoneg |
@@ -704,7 +710,7 @@ static int i40e_set_settings(struct net_device *netdev,return -EAGAIN ; } - status =i40e_aq_get_link_info (hw, true,NULL ,NULL ); + status =i40e_update_link_info (hw);if (status) netdev_info(netdev, "Updating link info failed with err %s aq_err %s\n", i40e_stat_str(hw, status),
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -9764,7 +9764,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)i40e_config_rss (pf);/* fill in link information and enable LSE reporting */ -i40e_aq_get_link_info (&pf->hw, true,NULL ,NULL ); +i40e_update_link_info (&pf->hw);i40e_link_event (pf);/* Initialize user-specific link properties */
drivers/net/ethernet/intel/i40e/i40e_prototype.h +1 -0
@@ -265,6 +265,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw);void i40e_clear_hw (struct i40e_hw *hw);void i40e_clear_pxe_mode (struct i40e_hw *hw);i40e_status i40e_get_link_status (struct i40e_hw *hw,bool *link_up); +i40e_status i40e_update_link_info (struct i40e_hw *hw);i40e_status i40e_get_mac_addr (struct i40e_hw *hw,u8 *mac_addr); i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw, u32 *max_bw, u32 *min_bw, bool *min_valid,
drivers/net/ethernet/intel/i40e/i40e_type.h +18 -0
@@ -167,6 +167,24 @@ struct i40e_link_status {bool crc_enable;u8 pacing;u8 requested_speeds; +u8 module_type[3 ]; +/* 1st byte: module identifier */ +#define I40E_MODULE_TYPE_SFP 0x03 +#define I40E_MODULE_TYPE_QSFP 0x0D +/* 2nd byte: ethernet compliance codes for 10/40G */ +#define I40E_MODULE_TYPE_40G_ACTIVE 0x01 +#define I40E_MODULE_TYPE_40G_LR4 0x02 +#define I40E_MODULE_TYPE_40G_SR4 0x04 +#define I40E_MODULE_TYPE_40G_CR4 0x08 +#define I40E_MODULE_TYPE_10G_BASE_SR 0x10 +#define I40E_MODULE_TYPE_10G_BASE_LR 0x20 +#define I40E_MODULE_TYPE_10G_BASE_LRM 0x40 +#define I40E_MODULE_TYPE_10G_BASE_ER 0x80 +/* 3rd byte: ethernet compliance codes for 1G */ +#define I40E_MODULE_TYPE_1000BASE_SX 0x01 +#define I40E_MODULE_TYPE_1000BASE_LX 0x02 +#define I40E_MODULE_TYPE_1000BASE_CX 0x04 +#define I40E_MODULE_TYPE_1000BASE_T 0x08 };struct i40e_phy_info {
drivers/net/ethernet/intel/i40evf/i40e_type.h +18 -0
@@ -167,6 +167,24 @@ struct i40e_link_status {bool crc_enable;u8 pacing;u8 requested_speeds; +u8 module_type[3 ]; +/* 1st byte: module identifier */ +#define I40E_MODULE_TYPE_SFP 0x03 +#define I40E_MODULE_TYPE_QSFP 0x0D +/* 2nd byte: ethernet compliance codes for 10/40G */ +#define I40E_MODULE_TYPE_40G_ACTIVE 0x01 +#define I40E_MODULE_TYPE_40G_LR4 0x02 +#define I40E_MODULE_TYPE_40G_SR4 0x04 +#define I40E_MODULE_TYPE_40G_CR4 0x08 +#define I40E_MODULE_TYPE_10G_BASE_SR 0x10 +#define I40E_MODULE_TYPE_10G_BASE_LR 0x20 +#define I40E_MODULE_TYPE_10G_BASE_LRM 0x40 +#define I40E_MODULE_TYPE_10G_BASE_ER 0x80 +/* 3rd byte: ethernet compliance codes for 1G */ +#define I40E_MODULE_TYPE_1000BASE_SX 0x01 +#define I40E_MODULE_TYPE_1000BASE_LX 0x02 +#define I40E_MODULE_TYPE_1000BASE_CX 0x04 +#define I40E_MODULE_TYPE_1000BASE_T 0x08 };struct i40e_phy_info {
Signature · 1 line
1.9.3
Bowers
PATCH 13/15 i40e/i40evf: Add module_types and update_link_info
Quoted 26 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Monday, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 13/15] i40e/i40evf: Addmodule_typesandupdate_link_infoAdd a
module_typesvariable to thelink_infostruct to save the module information fromget_phy_capabilities. This information can be used to determine which speeds the module supports.Also add a new function
update_link_infowhich updates themodule_typesparameter and then callsget_link_info. This function should be called in place ofget_link_infoso that themodule_typesvariable stays up-to-date with the rest of the link information.The EAS table does not reflect the values that are actually returned, so instead, basing these values on the Ethernet compliance codes specified in table 33 of SFF-8436 as these have been accurate.
Use the new variable in ethtool to differentiate between a 10G/1G dual speed fiber module and a 10G only module.
Signed-off-by Catherine Sullivan <[email protected]>Change-ID Ib7585cce321319c10ce15180054c41a6cbd41389
Quoted 9 lines
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 30 +++++++++++++++++++++--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++++++++---- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 1 + drivers/net/ethernet/intel/i40e/i40e_type.h | 18 ++++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 18 ++++++++++++++ 6 files changed, 76 insertions(+), 9 deletions(-)
Code changes present in tree
PATCH 14/15 i40e/i40evf: Refactor PHY structure and add phy_capabilities enum
In reply to Catherine SullivanRemove unused members in the PHY structure and add a new member to store all the capabilities the PHY has as reported by the FW. This information will help us determine what speeds the device is capable of when link is down.
Also add an enum to decode the PHY types the NVM is capable of. Use the phy_types variable to determine what phy types are possible when link is down instead of device id as it will be more accurate.
When on a backplane device, we do not support changing any settings, however we should display all the phy_types we are capable of so if we see a backplane dev ID set supported and advertised purely based on the phy_types variable.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 189 ++++++++++++++----------- drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++ drivers/net/ethernet/intel/i40e/i40e_type.h | 37 ++++- drivers/net/ethernet/intel/i40evf/i40e_type.h | 37 ++++- 4 files changed, 181 insertions(+), 90 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +105 -84
@@ -273,36 +273,12 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,case I40E_PHY_TYPE_40GBASE_AOC : ecmd->supported = SUPPORTED_40000baseCR4_Full;break ; -case I40E_PHY_TYPE_40GBASE_KR4 : - ecmd->supported = SUPPORTED_Autoneg | - SUPPORTED_40000baseKR4_Full; - ecmd->advertising = ADVERTISED_Autoneg | - ADVERTISED_40000baseKR4_Full; -break ;case I40E_PHY_TYPE_40GBASE_SR4 : ecmd->supported = SUPPORTED_40000baseSR4_Full;break ;case I40E_PHY_TYPE_40GBASE_LR4 : ecmd->supported = SUPPORTED_40000baseLR4_Full;break ; -case I40E_PHY_TYPE_20GBASE_KR2 : - ecmd->supported = SUPPORTED_Autoneg | - SUPPORTED_20000baseKR2_Full; - ecmd->advertising = ADVERTISED_Autoneg | - ADVERTISED_20000baseKR2_Full; -break ; -case I40E_PHY_TYPE_10GBASE_KX4 : - ecmd->supported = SUPPORTED_Autoneg | - SUPPORTED_10000baseKX4_Full; - ecmd->advertising = ADVERTISED_Autoneg | - ADVERTISED_10000baseKX4_Full; -break ; -case I40E_PHY_TYPE_10GBASE_KR : - ecmd->supported = SUPPORTED_Autoneg | - SUPPORTED_10000baseKR_Full; - ecmd->advertising = ADVERTISED_Autoneg | - ADVERTISED_10000baseKR_Full; -break ;case I40E_PHY_TYPE_10GBASE_SR :case I40E_PHY_TYPE_10GBASE_LR :case I40E_PHY_TYPE_1000BASE_SX :
@@ -320,12 +296,6 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,if (hw_link_info->requested_speeds &I40E_LINK_SPEED_10GB ) ecmd->advertising |= ADVERTISED_10000baseT_Full;break ; -case I40E_PHY_TYPE_1000BASE_KX : - ecmd->supported = SUPPORTED_Autoneg | - SUPPORTED_1000baseKX_Full; - ecmd->advertising = ADVERTISED_Autoneg | - ADVERTISED_1000baseKX_Full; -break ;case I40E_PHY_TYPE_10GBASE_T :case I40E_PHY_TYPE_1000BASE_T :case I40E_PHY_TYPE_100BASE_TX :
@@ -364,6 +334,15 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,if (hw_link_info->requested_speeds &I40E_LINK_SPEED_100MB ) ecmd->advertising |= ADVERTISED_100baseT_Full;break ; +/* Backplane is set based on supported phy types in get_settings +* so don't set anything here but don't warn either +*/ +case I40E_PHY_TYPE_40GBASE_KR4 : +case I40E_PHY_TYPE_20GBASE_KR2 : +case I40E_PHY_TYPE_10GBASE_KR : +case I40E_PHY_TYPE_10GBASE_KX4 : +case I40E_PHY_TYPE_1000BASE_KX : +break ;default :/* if we got here and link is up something bad is afoot */ netdev_info(netdev, "WARNING: Link is up but PHY type 0x%x is not recognized.\n",
@@ -403,64 +382,67 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,static void i40e_get_settings_link_down (struct i40e_hw *hw,struct ethtool_cmd *ecmd) { -struct i40e_link_status *hw_link_info = &hw->phy.link_info; +enum i40e_aq_capabilities_phy_type phy_types = hw->phy.phy_types;/* link is down and the driver needs to fall back on -* device ID to determine what kinds of info to display, -* it's mostly a guess that may change when link is up +* supported phy types to figure out what info to display */ -switch (hw->device_id) { -case I40E_DEV_ID_QSFP_A : -case I40E_DEV_ID_QSFP_B : -case I40E_DEV_ID_QSFP_C : -/* pluggable QSFP */ - ecmd->supported = SUPPORTED_40000baseSR4_Full | - SUPPORTED_40000baseCR4_Full | - SUPPORTED_40000baseLR4_Full; - ecmd->advertising = ADVERTISED_40000baseSR4_Full | - ADVERTISED_40000baseCR4_Full | - ADVERTISED_40000baseLR4_Full; -break ; -case I40E_DEV_ID_KX_B : -/* backplane 40G */ - ecmd->supported = SUPPORTED_40000baseKR4_Full; - ecmd->advertising = ADVERTISED_40000baseKR4_Full; -break ; -case I40E_DEV_ID_KX_C : -/* backplane 10G */ - ecmd->supported = SUPPORTED_10000baseKR_Full; - ecmd->advertising = ADVERTISED_10000baseKR_Full; -break ; -case I40E_DEV_ID_10G_BASE_T : -case I40E_DEV_ID_10G_BASE_T4 : - ecmd->supported = SUPPORTED_10000baseT_Full | - SUPPORTED_1000baseT_Full | - SUPPORTED_100baseT_Full; -/* Figure out what has been requested */ -if (hw_link_info->requested_speeds &I40E_LINK_SPEED_10GB ) - ecmd->advertising |= ADVERTISED_10000baseT_Full; -if (hw_link_info->requested_speeds &I40E_LINK_SPEED_1GB ) - ecmd->advertising |= ADVERTISED_1000baseT_Full; -if (hw_link_info->requested_speeds &I40E_LINK_SPEED_100MB ) - ecmd->advertising |= ADVERTISED_100baseT_Full; -break ; -case I40E_DEV_ID_20G_KR2 : -case I40E_DEV_ID_20G_KR2_A : -/* backplane 20G */ - ecmd->supported = SUPPORTED_20000baseKR2_Full; - ecmd->advertising = ADVERTISED_20000baseKR2_Full; -break ; -default : -/* all the rest are 10G/1G */ - ecmd->supported = SUPPORTED_10000baseT_Full | - SUPPORTED_1000baseT_Full; -/* Figure out what has been requested */ -if (hw_link_info->requested_speeds &I40E_LINK_SPEED_10GB ) - ecmd->advertising |= ADVERTISED_10000baseT_Full; -if (hw_link_info->requested_speeds &I40E_LINK_SPEED_1GB ) - ecmd->advertising |= ADVERTISED_1000baseT_Full; -break ; + ecmd->supported =0x0 ; + ecmd->advertising =0x0 ; +if (phy_types &I40E_CAP_PHY_TYPE_SGMII ) { + ecmd->supported |= SUPPORTED_Autoneg | + SUPPORTED_1000baseT_Full | + SUPPORTED_100baseT_Full; + ecmd->advertising |= ADVERTISED_Autoneg | + ADVERTISED_1000baseT_Full | + ADVERTISED_100baseT_Full; + } +if (phy_types &I40E_CAP_PHY_TYPE_XAUI || + phy_types &I40E_CAP_PHY_TYPE_XFI || + phy_types &I40E_CAP_PHY_TYPE_SFI || + phy_types &I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU || + phy_types &I40E_CAP_PHY_TYPE_10GBASE_AOC ) + ecmd->supported |= SUPPORTED_10000baseT_Full; +if (phy_types &I40E_CAP_PHY_TYPE_10GBASE_CR1_CU || + phy_types &I40E_CAP_PHY_TYPE_10GBASE_CR1 || + phy_types &I40E_CAP_PHY_TYPE_10GBASE_T || + phy_types &I40E_CAP_PHY_TYPE_10GBASE_SR || + phy_types &I40E_CAP_PHY_TYPE_10GBASE_LR ) { + ecmd->supported |= SUPPORTED_Autoneg | + SUPPORTED_10000baseT_Full; + ecmd->advertising |= ADVERTISED_Autoneg | + ADVERTISED_10000baseT_Full; + } +if (phy_types &I40E_CAP_PHY_TYPE_XLAUI || + phy_types &I40E_CAP_PHY_TYPE_XLPPI || + phy_types &I40E_CAP_PHY_TYPE_40GBASE_AOC ) + ecmd->supported |= SUPPORTED_40000baseCR4_Full; +if (phy_types &I40E_CAP_PHY_TYPE_40GBASE_CR4_CU || + phy_types &I40E_CAP_PHY_TYPE_40GBASE_CR4 ) { + ecmd->supported |= SUPPORTED_Autoneg | + SUPPORTED_40000baseCR4_Full; + ecmd->advertising |= ADVERTISED_Autoneg | + ADVERTISED_40000baseCR4_Full; } +if (phy_types &I40E_CAP_PHY_TYPE_100BASE_TX ) { + ecmd->supported |= SUPPORTED_Autoneg | + SUPPORTED_100baseT_Full; + ecmd->advertising |= ADVERTISED_Autoneg | + ADVERTISED_100baseT_Full; + } +if (phy_types &I40E_CAP_PHY_TYPE_1000BASE_T || + phy_types &I40E_CAP_PHY_TYPE_1000BASE_SX || + phy_types &I40E_CAP_PHY_TYPE_1000BASE_LX || + phy_types &I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL ) { + ecmd->supported |= SUPPORTED_Autoneg | + SUPPORTED_1000baseT_Full; + ecmd->advertising |= ADVERTISED_Autoneg | + ADVERTISED_1000baseT_Full; + } +if (phy_types &I40E_CAP_PHY_TYPE_40GBASE_SR4 ) + ecmd->supported |= SUPPORTED_40000baseSR4_Full; +if (phy_types &I40E_CAP_PHY_TYPE_40GBASE_LR4 ) + ecmd->supported |= SUPPORTED_40000baseLR4_Full;/* With no link speed and duplex are unknown */ ethtool_cmd_speed_set (ecmd,SPEED_UNKNOWN );
@@ -490,6 +472,37 @@ static int i40e_get_settings(struct net_device *netdev,/* Now set the settings that don't rely on link being up/down */ +/* For backplane, supported and advertised are only reliant on the +* phy types the NVM specifies are supported. +*/ +if (hw->device_id ==I40E_DEV_ID_KX_B || + hw->device_id ==I40E_DEV_ID_KX_C || + hw->device_id ==I40E_DEV_ID_20G_KR2 || + hw->device_id ==I40E_DEV_ID_20G_KR2_A ) { + ecmd->supported = SUPPORTED_Autoneg; + ecmd->advertising = ADVERTISED_Autoneg; +if (hw->phy.phy_types &I40E_CAP_PHY_TYPE_40GBASE_KR4 ) { + ecmd->supported |= SUPPORTED_40000baseKR4_Full; + ecmd->advertising |= ADVERTISED_40000baseKR4_Full; + } +if (hw->phy.phy_types &I40E_CAP_PHY_TYPE_20GBASE_KR2 ) { + ecmd->supported |= SUPPORTED_20000baseKR2_Full; + ecmd->advertising |= ADVERTISED_20000baseKR2_Full; + } +if (hw->phy.phy_types &I40E_CAP_PHY_TYPE_10GBASE_KR ) { + ecmd->supported |= SUPPORTED_10000baseKR_Full; + ecmd->advertising |= ADVERTISED_10000baseKR_Full; + } +if (hw->phy.phy_types &I40E_CAP_PHY_TYPE_10GBASE_KX4 ) { + ecmd->supported |= SUPPORTED_10000baseKX4_Full; + ecmd->advertising |= ADVERTISED_10000baseKX4_Full; + } +if (hw->phy.phy_types &I40E_CAP_PHY_TYPE_1000BASE_KX ) { + ecmd->supported |= SUPPORTED_1000baseKX_Full; + ecmd->advertising |= ADVERTISED_1000baseKX_Full; + } + } +/* Set autoneg settings */ ecmd->autoneg = ((hw_link_info->an_info &I40E_AQ_AN_COMPLETED ) ?AUTONEG_ENABLE :AUTONEG_DISABLE );
@@ -589,6 +602,14 @@ static int i40e_set_settings(struct net_device *netdev, hw->phy.link_info.link_info & I40E_AQ_LINK_UP)return -EOPNOTSUPP ; +if (hw->device_id ==I40E_DEV_ID_KX_B || + hw->device_id ==I40E_DEV_ID_KX_C || + hw->device_id ==I40E_DEV_ID_20G_KR2 || + hw->device_id ==I40E_DEV_ID_20G_KR2_A ) { +netdev_info (netdev,"Changing settings is not supported on backplane.\n" ); +return -EOPNOTSUPP ; + } +/* get our own copy of the bits to check against */ memset (&safe_ecmd,0 ,sizeof (struct ethtool_cmd ));i40e_get_settings (netdev, &safe_ecmd);
drivers/net/ethernet/intel/i40e/i40e_main.c +8 -0
@@ -10375,6 +10375,14 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); pf->hw.phy.link_info.requested_speeds = abilities.link_speed; +/* get the supported phy types from the fw */ + err =i40e_aq_get_phy_capabilities (hw, false, true, &abilities,NULL ); +if (err) +dev_dbg (&pf->pdev->dev,"get supported phy types ret = %s last_status = %s\n" , +i40e_stat_str (&pf->hw, err), +i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); + pf->hw.phy.phy_types = abilities.phy_type; +/* print a string summarizing features */ i40e_print_features (pf);
drivers/net/ethernet/intel/i40e/i40e_type.h +34 -3
@@ -187,14 +187,45 @@ struct i40e_link_status {#define I40E_MODULE_TYPE_1000BASE_T 0x08 }; +enum i40e_aq_capabilities_phy_type { +I40E_CAP_PHY_TYPE_SGMII =BIT (I40E_PHY_TYPE_SGMII ), +I40E_CAP_PHY_TYPE_1000BASE_KX =BIT (I40E_PHY_TYPE_1000BASE_KX ), +I40E_CAP_PHY_TYPE_10GBASE_KX4 =BIT (I40E_PHY_TYPE_10GBASE_KX4 ), +I40E_CAP_PHY_TYPE_10GBASE_KR =BIT (I40E_PHY_TYPE_10GBASE_KR ), +I40E_CAP_PHY_TYPE_40GBASE_KR4 =BIT (I40E_PHY_TYPE_40GBASE_KR4 ), +I40E_CAP_PHY_TYPE_XAUI =BIT (I40E_PHY_TYPE_XAUI ), +I40E_CAP_PHY_TYPE_XFI =BIT (I40E_PHY_TYPE_XFI ), +I40E_CAP_PHY_TYPE_SFI =BIT (I40E_PHY_TYPE_SFI ), +I40E_CAP_PHY_TYPE_XLAUI =BIT (I40E_PHY_TYPE_XLAUI ), +I40E_CAP_PHY_TYPE_XLPPI =BIT (I40E_PHY_TYPE_XLPPI ), +I40E_CAP_PHY_TYPE_40GBASE_CR4_CU =BIT (I40E_PHY_TYPE_40GBASE_CR4_CU ), +I40E_CAP_PHY_TYPE_10GBASE_CR1_CU =BIT (I40E_PHY_TYPE_10GBASE_CR1_CU ), +I40E_CAP_PHY_TYPE_10GBASE_AOC =BIT (I40E_PHY_TYPE_10GBASE_AOC ), +I40E_CAP_PHY_TYPE_40GBASE_AOC =BIT (I40E_PHY_TYPE_40GBASE_AOC ), +I40E_CAP_PHY_TYPE_100BASE_TX =BIT (I40E_PHY_TYPE_100BASE_TX ), +I40E_CAP_PHY_TYPE_1000BASE_T =BIT (I40E_PHY_TYPE_1000BASE_T ), +I40E_CAP_PHY_TYPE_10GBASE_T =BIT (I40E_PHY_TYPE_10GBASE_T ), +I40E_CAP_PHY_TYPE_10GBASE_SR =BIT (I40E_PHY_TYPE_10GBASE_SR ), +I40E_CAP_PHY_TYPE_10GBASE_LR =BIT (I40E_PHY_TYPE_10GBASE_LR ), +I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU =BIT (I40E_PHY_TYPE_10GBASE_SFPP_CU ), +I40E_CAP_PHY_TYPE_10GBASE_CR1 =BIT (I40E_PHY_TYPE_10GBASE_CR1 ), +I40E_CAP_PHY_TYPE_40GBASE_CR4 =BIT (I40E_PHY_TYPE_40GBASE_CR4 ), +I40E_CAP_PHY_TYPE_40GBASE_SR4 =BIT (I40E_PHY_TYPE_40GBASE_SR4 ), +I40E_CAP_PHY_TYPE_40GBASE_LR4 =BIT (I40E_PHY_TYPE_40GBASE_LR4 ), +I40E_CAP_PHY_TYPE_1000BASE_SX =BIT (I40E_PHY_TYPE_1000BASE_SX ), +I40E_CAP_PHY_TYPE_1000BASE_LX =BIT (I40E_PHY_TYPE_1000BASE_LX ), +I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL = +BIT (I40E_PHY_TYPE_1000BASE_T_OPTICAL ), +I40E_CAP_PHY_TYPE_20GBASE_KR2 =BIT (I40E_PHY_TYPE_20GBASE_KR2 ) +}; +struct i40e_phy_info {struct i40e_link_status link_info;struct i40e_link_status link_info_old; -u32 autoneg_advertised; -u32 phy_id; -u32 module_type;bool get_link_info;enum i40e_media_type media_type; +/* all the phy types the NVM is capable of */ +enum i40e_aq_capabilities_phy_type phy_types; };#define I40E_HW_CAP_MAX_GPIO 30
drivers/net/ethernet/intel/i40evf/i40e_type.h +34 -3
@@ -187,14 +187,45 @@ struct i40e_link_status {#define I40E_MODULE_TYPE_1000BASE_T 0x08 }; +enum i40e_aq_capabilities_phy_type { +I40E_CAP_PHY_TYPE_SGMII =BIT (I40E_PHY_TYPE_SGMII ), +I40E_CAP_PHY_TYPE_1000BASE_KX =BIT (I40E_PHY_TYPE_1000BASE_KX ), +I40E_CAP_PHY_TYPE_10GBASE_KX4 =BIT (I40E_PHY_TYPE_10GBASE_KX4 ), +I40E_CAP_PHY_TYPE_10GBASE_KR =BIT (I40E_PHY_TYPE_10GBASE_KR ), +I40E_CAP_PHY_TYPE_40GBASE_KR4 =BIT (I40E_PHY_TYPE_40GBASE_KR4 ), +I40E_CAP_PHY_TYPE_XAUI =BIT (I40E_PHY_TYPE_XAUI ), +I40E_CAP_PHY_TYPE_XFI =BIT (I40E_PHY_TYPE_XFI ), +I40E_CAP_PHY_TYPE_SFI =BIT (I40E_PHY_TYPE_SFI ), +I40E_CAP_PHY_TYPE_XLAUI =BIT (I40E_PHY_TYPE_XLAUI ), +I40E_CAP_PHY_TYPE_XLPPI =BIT (I40E_PHY_TYPE_XLPPI ), +I40E_CAP_PHY_TYPE_40GBASE_CR4_CU =BIT (I40E_PHY_TYPE_40GBASE_CR4_CU ), +I40E_CAP_PHY_TYPE_10GBASE_CR1_CU =BIT (I40E_PHY_TYPE_10GBASE_CR1_CU ), +I40E_CAP_PHY_TYPE_10GBASE_AOC =BIT (I40E_PHY_TYPE_10GBASE_AOC ), +I40E_CAP_PHY_TYPE_40GBASE_AOC =BIT (I40E_PHY_TYPE_40GBASE_AOC ), +I40E_CAP_PHY_TYPE_100BASE_TX =BIT (I40E_PHY_TYPE_100BASE_TX ), +I40E_CAP_PHY_TYPE_1000BASE_T =BIT (I40E_PHY_TYPE_1000BASE_T ), +I40E_CAP_PHY_TYPE_10GBASE_T =BIT (I40E_PHY_TYPE_10GBASE_T ), +I40E_CAP_PHY_TYPE_10GBASE_SR =BIT (I40E_PHY_TYPE_10GBASE_SR ), +I40E_CAP_PHY_TYPE_10GBASE_LR =BIT (I40E_PHY_TYPE_10GBASE_LR ), +I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU =BIT (I40E_PHY_TYPE_10GBASE_SFPP_CU ), +I40E_CAP_PHY_TYPE_10GBASE_CR1 =BIT (I40E_PHY_TYPE_10GBASE_CR1 ), +I40E_CAP_PHY_TYPE_40GBASE_CR4 =BIT (I40E_PHY_TYPE_40GBASE_CR4 ), +I40E_CAP_PHY_TYPE_40GBASE_SR4 =BIT (I40E_PHY_TYPE_40GBASE_SR4 ), +I40E_CAP_PHY_TYPE_40GBASE_LR4 =BIT (I40E_PHY_TYPE_40GBASE_LR4 ), +I40E_CAP_PHY_TYPE_1000BASE_SX =BIT (I40E_PHY_TYPE_1000BASE_SX ), +I40E_CAP_PHY_TYPE_1000BASE_LX =BIT (I40E_PHY_TYPE_1000BASE_LX ), +I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL = +BIT (I40E_PHY_TYPE_1000BASE_T_OPTICAL ), +I40E_CAP_PHY_TYPE_20GBASE_KR2 =BIT (I40E_PHY_TYPE_20GBASE_KR2 ) +}; +struct i40e_phy_info {struct i40e_link_status link_info;struct i40e_link_status link_info_old; -u32 autoneg_advertised; -u32 phy_id; -u32 module_type;bool get_link_info;enum i40e_media_type media_type; +/* all the phy types the NVM is capable of */ +enum i40e_aq_capabilities_phy_type phy_types; };#define I40E_HW_CAP_MAX_GPIO 30
Signature · 1 line
1.9.3
Sullivan
PATCH 14/15 i40e/i40evf: Refactor PHY structure and add phy_capabilities enum
V2 has been sent, please disregard this version.
PATCH 15/15 i40e/i40evf: Bump i40e version to 1.3.25 and i40evf to 1.3.17
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 21 +#define DRV_VERSION_BUILD 25#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.13" +#define DRV_VERSION "1.3.17"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 version to 1.3.25 and i40evf to 1.3.17
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, August 31, 2015 4:55 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S14 15/15] i40e/i40evf: Bump i40e version to 1.3.25 and i40evf to 1.3.17
Quoted 8 lines
Bump.
Signed-off-by Catherine Sullivan <[email protected]>Change-ID If3cd42f6c1b9546beed60faf9c79faab35216f58--- 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, "modinfo" shows correct version for i40e and i40evf.