Change Log
Subsystems (2)
cover Change Log
V4: Submission to Jeff's tree
V5: Re-ordered patches
V6: Sync with Jeff's latest tree
V7: Changes to patches 1 and 2 as per community feedback
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 12 ++ drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 55 ++++- drivers/net/ethernet/intel/i40e/i40e_common.c | 231 +++++++++++++++++---- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 154 ++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 7 + drivers/net/ethernet/intel/i40e/i40e_prototype.h | 9 + drivers/net/ethernet/intel/i40e/i40e_type.h | 19 ++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 97 +++++++-- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 5 +- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 55 ++++- drivers/net/ethernet/intel/i40evf/i40e_common.c | 69 ++++++ drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 9 + drivers/net/ethernet/intel/i40evf/i40e_type.h | 20 ++ drivers/net/ethernet/intel/i40evf/i40evf.h | 4 + drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 38 +++- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 97 ++++++++- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 44 +++- 17 files changed, 846 insertions(+), 79 deletions(-)
Signature · 1 line
2.9.4
PATCH 1/12 i40e: Fix reporting of supported link modes
From: Filip Sadowski <[email protected]>
This patch fixes incorrect reporting of supported link modes on some NICs.
Signed-off-by Filip Sadowski <[email protected]>
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 20 ++++++++++++++++++-- drivers/net/ethernet/intel/i40e/i40e_common.c | 11 ++++++++++- drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 20 ++++++++++++++++++-- 3 files changed, 46 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +18 -2
@@ -1734,6 +1734,8 @@ enum i40e_aq_phy_type {I40E_PHY_TYPE_10GBASE_CR1_CU =0xB ,I40E_PHY_TYPE_10GBASE_AOC =0xC ,I40E_PHY_TYPE_40GBASE_AOC =0xD , +I40E_PHY_TYPE_UNRECOGNIZED =0xE , +I40E_PHY_TYPE_UNSUPPORTED =0xF ,I40E_PHY_TYPE_100BASE_TX =0x11 ,I40E_PHY_TYPE_1000BASE_T =0x12 , I40E_PHY_TYPE_10GBASE_T = 0x13,
@@ -1754,6 +1756,8 @@ enum i40e_aq_phy_type {I40E_PHY_TYPE_25GBASE_LR =0x22 ,I40E_PHY_TYPE_25GBASE_AOC =0x23 ,I40E_PHY_TYPE_25GBASE_ACC =0x24 , +I40E_PHY_TYPE_EMPTY =0xFE , +I40E_PHY_TYPE_DEFAULT =0xFF , I40E_PHY_TYPE_MAX };
@@ -1947,19 +1951,31 @@ struct i40e_aqc_get_link_status {#define I40E_AQ_25G_SERDES_UCODE_ERR 0X04#define I40E_AQ_25G_NIMB_UCODE_ERR 0X05u8 loopback;/* use defines from i40e_aqc_set_lb_mode */ +/* Since firmware API 1.7 loopback field keeps power class info as well */ +#define I40E_AQ_LOOPBACK_MASK 0x07 +#define I40E_AQ_PWR_CLASS_SHIFT_LB 6 +#define I40E_AQ_PWR_CLASS_MASK_LB (0x03 << I40E_AQ_PWR_CLASS_SHIFT_LB)__le16 max_frame_size;u8 config;#define I40E_AQ_CONFIG_FEC_KR_ENA 0x01#define I40E_AQ_CONFIG_FEC_RS_ENA 0x02#define I40E_AQ_CONFIG_CRC_ENA 0x04#define I40E_AQ_CONFIG_PACING_MASK 0x78 -u8 power_desc; +union { +struct { +u8 power_desc;#define I40E_AQ_LINK_POWER_CLASS_1 0x00#define I40E_AQ_LINK_POWER_CLASS_2 0x01#define I40E_AQ_LINK_POWER_CLASS_3 0x02#define I40E_AQ_LINK_POWER_CLASS_4 0x03#define I40E_AQ_PWR_CLASS_MASK 0x03 -u8 reserved[4 ]; +u8 reserved[4 ]; + }; +struct { +u8 link_type[4 ]; +u8 link_type_ext; + }; + }; };I40E_CHECK_CMD_LENGTH (i40e_aqc_get_link_status);
drivers/net/ethernet/intel/i40e/i40e_common.c +10 -1
@@ -1828,7 +1828,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, hw_link_info->fec_info = resp->config & (I40E_AQ_CONFIG_FEC_KR_ENA |I40E_AQ_CONFIG_FEC_RS_ENA ); hw_link_info->ext_info = resp->ext_info; - hw_link_info->loopback = resp->loopback; + hw_link_info->loopback = resp->loopback &I40E_AQ_LOOPBACK_MASK ; hw_link_info->max_frame_size =le16_to_cpu (resp->max_frame_size); hw_link_info->pacing = resp->config &I40E_AQ_CONFIG_PACING_MASK ;
@@ -1859,6 +1859,15 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; +if (hw->aq.api_maj_ver ==I40E_FW_API_VERSION_MAJOR && + hw->aq.api_min_ver >=7 ) { +__le32 tmp; + +memcpy (&tmp, resp->link_type,sizeof (tmp)); + hw->phy.phy_types =le32_to_cpu (tmp); + hw->phy.phy_types |= ((u64 )resp->link_type_ext <<32 ); + } +/* save link status information */ if (link) *link = *hw_link_info;
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +18 -2
@@ -1730,6 +1730,8 @@ enum i40e_aq_phy_type {I40E_PHY_TYPE_10GBASE_CR1_CU =0xB ,I40E_PHY_TYPE_10GBASE_AOC =0xC ,I40E_PHY_TYPE_40GBASE_AOC =0xD , +I40E_PHY_TYPE_UNRECOGNIZED =0xE , +I40E_PHY_TYPE_UNSUPPORTED =0xF ,I40E_PHY_TYPE_100BASE_TX =0x11 ,I40E_PHY_TYPE_1000BASE_T =0x12 , I40E_PHY_TYPE_10GBASE_T = 0x13,
@@ -1750,6 +1752,8 @@ enum i40e_aq_phy_type {I40E_PHY_TYPE_25GBASE_LR =0x22 ,I40E_PHY_TYPE_25GBASE_AOC =0x23 ,I40E_PHY_TYPE_25GBASE_ACC =0x24 , +I40E_PHY_TYPE_EMPTY =0xFE , +I40E_PHY_TYPE_DEFAULT =0xFF , I40E_PHY_TYPE_MAX };
@@ -1943,19 +1947,31 @@ struct i40e_aqc_get_link_status {#define I40E_AQ_25G_SERDES_UCODE_ERR 0X04#define I40E_AQ_25G_NIMB_UCODE_ERR 0X05u8 loopback;/* use defines from i40e_aqc_set_lb_mode */ +/* Since firmware API 1.7 loopback field keeps power class info as well */ +#define I40E_AQ_LOOPBACK_MASK 0x07 +#define I40E_AQ_PWR_CLASS_SHIFT_LB 6 +#define I40E_AQ_PWR_CLASS_MASK_LB (0x03 << I40E_AQ_PWR_CLASS_SHIFT_LB)__le16 max_frame_size;u8 config;#define I40E_AQ_CONFIG_FEC_KR_ENA 0x01#define I40E_AQ_CONFIG_FEC_RS_ENA 0x02#define I40E_AQ_CONFIG_CRC_ENA 0x04#define I40E_AQ_CONFIG_PACING_MASK 0x78 -u8 power_desc; +union { +struct { +u8 power_desc;#define I40E_AQ_LINK_POWER_CLASS_1 0x00#define I40E_AQ_LINK_POWER_CLASS_2 0x01#define I40E_AQ_LINK_POWER_CLASS_3 0x02#define I40E_AQ_LINK_POWER_CLASS_4 0x03#define I40E_AQ_PWR_CLASS_MASK 0x03 -u8 reserved[4 ]; +u8 reserved[4 ]; + }; +struct { +u8 link_type[4 ]; +u8 link_type_ext; + }; + }; };I40E_CHECK_CMD_LENGTH (i40e_aqc_get_link_status);
Signature · 1 line
2.9.4
PATCH 2/12 i40e: Add support for 'ethtool -m'
In reply to Alice MichaelFrom: Filip Sadowski <[email protected]>
This patch adds support for 'ethtool -m' command which displays information about (Q)SFP+ module plugged into NIC's cage.
Signed-off-by Filip Sadowski <[email protected]>
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 18 +++ drivers/net/ethernet/intel/i40e/i40e_common.c | 69 +++++++++ drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 154 +++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_prototype.h | 9 ++ drivers/net/ethernet/intel/i40e/i40e_type.h | 12 ++ .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 18 +++ drivers/net/ethernet/intel/i40evf/i40e_common.c | 69 +++++++++ drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 9 ++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 12 ++ 9 files changed, 370 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +18 -0
@@ -244,6 +244,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_set_phy_debug =0x0622 , i40e_aqc_opc_upload_ext_phy_fm =0x0625 , i40e_aqc_opc_run_phy_activity =0x0626 , + i40e_aqc_opc_set_phy_register =0x0628 , + i40e_aqc_opc_get_phy_register =0x0629 ,/* NVM commands */ i40e_aqc_opc_nvm_read = 0x0701,
@@ -2058,6 +2060,22 @@ struct i40e_aqc_run_phy_activity {I40E_CHECK_CMD_LENGTH (i40e_aqc_run_phy_activity); +/* Set PHY Register command (0x0628) */ +/* Get PHY Register command (0x0629) */ +struct i40e_aqc_phy_register_access { +u8 phy_interface; +#define I40E_AQ_PHY_REG_ACCESS_INTERNAL 0 +#define I40E_AQ_PHY_REG_ACCESS_EXTERNAL 1 +#define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2 +u8 dev_address; +u8 reserved1[2 ]; +__le32 reg_address; +__le32 reg_value; +u8 reserved2[4 ]; +}; + +I40E_CHECK_CMD_LENGTH (i40e_aqc_phy_register_access); +/* NVM Read command (indirect 0x0701) * NVM Erase commands (direct 0x0702) * NVM Update commands (indirect 0x0703)
drivers/net/ethernet/intel/i40e/i40e_common.c +69 -0
75 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +154 -0
166 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_prototype.h +9 -0
@@ -362,6 +362,15 @@ i40e_status i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, u32 reg_addr, u32 reg_val, struct i40e_asq_cmd_details *cmd_details);void i40e_write_rx_ctl (struct i40e_hw *hw,u32 reg_addr,u32 reg_val); +i40e_status i40e_aq_set_phy_register (struct i40e_hw *hw, +u8 phy_select,u8 dev_addr, +u32 reg_addr,u32 reg_val, +struct i40e_asq_cmd_details *cmd_details); +i40e_status i40e_aq_get_phy_register (struct i40e_hw *hw, +u8 phy_select,u8 dev_addr, +u32 reg_addr,u32 *reg_val, +struct i40e_asq_cmd_details *cmd_details); +i40e_status i40e_read_phy_register_clause22 (struct i40e_hw *hw,u16 reg,u8 phy_addr,u16 *value); i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw,
drivers/net/ethernet/intel/i40e/i40e_type.h +12 -0
@@ -428,6 +428,18 @@ struct i40e_nvm_access {u8 data[1 ]; }; +/* (Q)SFP module access definitions */ +#define I40E_I2C_EEPROM_DEV_ADDR 0xA0 +#define I40E_I2C_EEPROM_DEV_ADDR2 0xA2 +#define I40E_MODULE_TYPE_ADDR 0x00 +#define I40E_MODULE_REVISION_ADDR 0x01 +#define I40E_MODULE_SFF_8472_COMP 0x5E +#define I40E_MODULE_SFF_8472_SWAP 0x5C +#define I40E_MODULE_SFF_ADDR_MODE 0x04 +#define I40E_MODULE_TYPE_QSFP_PLUS 0x0D +#define I40E_MODULE_TYPE_QSFP28 0x11 +#define I40E_MODULE_QSFP_MAX_LEN 640 +/* PCI bus types */ enum i40e_bus_type { i40e_bus_type_unknown =0 ,
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +18 -0
@@ -244,6 +244,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_set_phy_debug =0x0622 , i40e_aqc_opc_upload_ext_phy_fm =0x0625 , i40e_aqc_opc_run_phy_activity =0x0626 , + i40e_aqc_opc_set_phy_register =0x0628 , + i40e_aqc_opc_get_phy_register =0x0629 ,/* NVM commands */ i40e_aqc_opc_nvm_read = 0x0701,
@@ -2051,6 +2053,22 @@ struct i40e_aqc_run_phy_activity {I40E_CHECK_CMD_LENGTH (i40e_aqc_run_phy_activity); +/* Set PHY Register command (0x0628) */ +/* Get PHY Register command (0x0629) */ +struct i40e_aqc_phy_register_access { +u8 phy_interface; +#define I40E_AQ_PHY_REG_ACCESS_INTERNAL 0 +#define I40E_AQ_PHY_REG_ACCESS_EXTERNAL 1 +#define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2 +u8 dev_address; +u8 reserved1[2 ]; +__le32 reg_address; +__le32 reg_value; +u8 reserved2[4 ]; +}; + +I40E_CHECK_CMD_LENGTH (i40e_aqc_phy_register_access); +/* NVM Read command (indirect 0x0701) * NVM Erase commands (direct 0x0702) * NVM Update commands (indirect 0x0703)
drivers/net/ethernet/intel/i40evf/i40e_common.c +69 -0
75 lines not on this page · raw message
drivers/net/ethernet/intel/i40evf/i40e_prototype.h +9 -0
@@ -111,6 +111,15 @@ i40e_status i40evf_aq_rx_ctl_write_register(struct i40e_hw *hw, u32 reg_addr, u32 reg_val, struct i40e_asq_cmd_details *cmd_details);void i40evf_write_rx_ctl (struct i40e_hw *hw,u32 reg_addr,u32 reg_val); +i40e_status i40e_aq_set_phy_register (struct i40e_hw *hw, +u8 phy_select,u8 dev_addr, +u32 reg_addr,u32 reg_val, +struct i40e_asq_cmd_details *cmd_details); +i40e_status i40e_aq_get_phy_register (struct i40e_hw *hw, +u8 phy_select,u8 dev_addr, +u32 reg_addr,u32 *reg_val, +struct i40e_asq_cmd_details *cmd_details); +i40e_status i40e_read_phy_register (struct i40e_hw *hw,u8 page,u16 reg,u8 phy_addr,u16 *value); i40e_status i40e_write_phy_register(struct i40e_hw *hw, u8 page,
drivers/net/ethernet/intel/i40evf/i40e_type.h +12 -0
@@ -401,6 +401,18 @@ struct i40e_nvm_access {u8 data[1 ]; }; +/* (Q)SFP module access definitions */ +#define I40E_I2C_EEPROM_DEV_ADDR 0xA0 +#define I40E_I2C_EEPROM_DEV_ADDR2 0xA2 +#define I40E_MODULE_TYPE_ADDR 0x00 +#define I40E_MODULE_REVISION_ADDR 0x01 +#define I40E_MODULE_SFF_8472_COMP 0x5E +#define I40E_MODULE_SFF_8472_SWAP 0x5C +#define I40E_MODULE_SFF_ADDR_MODE 0x04 +#define I40E_MODULE_TYPE_QSFP_PLUS 0x0D +#define I40E_MODULE_TYPE_QSFP28 0x11 +#define I40E_MODULE_QSFP_MAX_LEN 640 +/* PCI bus types */ enum i40e_bus_type { i40e_bus_type_unknown =0 ,
Signature · 1 line
2.9.4