Intel Wired LAN Driver Updates 2024-01-02 (ixgbe, i40e)
Subsystems (3)
Tony Nguyen
maintainerThis series contains updates to ixgbe and i40e drivers.
Ovidiu Panait adds reporting of VF link state to ixgbe.
Jedrzej removes uses of IXGBE_ERR* codes to instead use standard error codes.
Andrii modifies behavior of VF disable to properly shut down queues on i40e.
Simon Horman removes, undesired, use of comma operator for i40e.
The following are changes since commit 954fb2d2d49f46e1d9861c45731e26bdeb081695:
Merge branch 'remove-retired-tc-uapi'
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 10GbE
Andrii Staikov (1):
i40e: Fix VF disable behavior to block all traffic
Jedrzej Jagielski (2):
ixgbe: Refactor overtemp event handling
ixgbe: Refactor returning internal error codes
Ovidiu Panait (1):
ixgbe: report link state for VF devices
Simon Horman (1):
i40e: Avoid unnecessary use of comma operator
.../net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 32 ++++ .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 1 + .../net/ethernet/intel/ixgbe/ixgbe_82598.c | 36 ++--- .../net/ethernet/intel/ixgbe/ixgbe_82599.c | 61 ++++---- .../net/ethernet/intel/ixgbe/ixgbe_common.c | 145 ++++++++--------- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 42 +++-- drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c | 34 ++-- drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 1 - drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 105 +++++++------ drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | 2 +- .../net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 +- drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 43 +---- drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 44 +++--- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 148 +++++++++--------- 16 files changed, 342 insertions(+), 359 deletions(-)
Signature · 1 line
2.41.0
Tony Nguyen
maintainerPATCH 1/5 ixgbe: report link state for VF devices
From: Ovidiu Panait <[email protected]>
The link state of VF devices can be controlled via "ip link set", but the current state (auto/disabled) is not reported by "ip link show".
Update ixgbe_ndo_get_vf_config() to make this info available to userspace.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +1 -0
@@ -1847,5 +1847,6 @@ int ixgbe_ndo_get_vf_config(struct net_device *netdev, ivi->spoofchk = adapter->vfinfo[vf].spoofchk_enabled; ivi->rss_query_en = adapter->vfinfo[vf].rss_query_enabled; ivi->trusted = adapter->vfinfo[vf].trusted; + ivi->linkstate = adapter->vfinfo[vf].link_state;return 0 ; }
Signature · 1 line
2.41.0
Tony Nguyen
maintainerPATCH 2/5 ixgbe: Refactor overtemp event handling
In reply to Tony NguyenFrom: Jedrzej Jagielski <[email protected]>
Currently ixgbe driver is notified of overheating events via internal IXGBE_ERR_OVERTEMP error code.
Change the approach for handle_lasi() to use freshly introduced is_overtemp function parameter which set when such event occurs. Change check_overtemp() to bool and return true if overtemp event occurs.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 16 +++----- drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 21 +++++----- drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 4 +- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 41 +++++++++++-------- 5 files changed, 43 insertions(+), 41 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +6 -10
@@ -2756,7 +2756,6 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter) {struct ixgbe_hw *hw = &adapter->hw;u32 eicr = adapter->interrupt_event; -s32 rc;if (test_bit (__IXGBE_DOWN, &adapter->state))return ;
@@ -2790,14 +2789,13 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter) }/* Check if this is not due to overtemp */ -if (hw->phy.ops.check_overtemp (hw) !=IXGBE_ERR_OVERTEMP ) +if (!hw->phy.ops.check_overtemp (hw))return ;break ;case IXGBE_DEV_ID_X550EM_A_1G_T :case IXGBE_DEV_ID_X550EM_A_1G_T_L : - rc = hw->phy.ops.check_overtemp (hw); -if (rc !=IXGBE_ERR_OVERTEMP ) +if (!hw->phy.ops.check_overtemp (hw))return ;break ;default :
@@ -7938,7 +7936,7 @@ static void ixgbe_service_timer(struct timer_list *t)static void ixgbe_phy_interrupt_subtask (struct ixgbe_adapter *adapter) {struct ixgbe_hw *hw = &adapter->hw; -u32 status; +bool overtemp;if (!(adapter->flags2 &IXGBE_FLAG2_PHY_INTERRUPT ))return ;
@@ -7948,11 +7946,9 @@ static void ixgbe_phy_interrupt_subtask(struct ixgbe_adapter *adapter)if (!hw->phy.ops.handle_lasi)return ; - status = hw->phy.ops.handle_lasi (&adapter->hw); -if (status !=IXGBE_ERR_OVERTEMP ) -return ; - -e_crit (drv,"%s\n" , ixgbe_overheat_msg); + hw->phy.ops.handle_lasi (&adapter->hw, &overtemp); +if (overtemp) +e_crit (drv,"%s\n" , ixgbe_overheat_msg); }static void ixgbe_reset_subtask (struct ixgbe_adapter *adapter)
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +11 -10
@@ -407,8 +407,7 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)return status;/* Don't reset PHY if it's shut down due to overtemp. */ -if (!hw->phy.reset_if_overtemp && - (IXGBE_ERR_OVERTEMP == hw->phy.ops.check_overtemp (hw))) +if (!hw->phy.reset_if_overtemp && hw->phy.ops.check_overtemp (hw))return 0 ;/* Blocked by MNG FW so bail */
@@ -2746,22 +2745,24 @@ static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw)* @hw: pointer to hardware structure * * Checks if the LASI temp alarm status was triggered due to overtemp +* +* Return true when an overtemp event detected, otherwise false. **/ -s32 ixgbe_tn_check_overtemp (struct ixgbe_hw *hw) +bool ixgbe_tn_check_overtemp (struct ixgbe_hw *hw) {u16 phy_data =0 ; +u32 status;if (hw->device_id !=IXGBE_DEV_ID_82599_T3_LOM ) -return 0 ; +return false;/* Check that the LASI temp alarm status was triggered */ - hw->phy.ops.read_reg (hw,IXGBE_TN_LASI_STATUS_REG , -MDIO_MMD_PMAPMD , &phy_data); - -if (!(phy_data &IXGBE_TN_LASI_STATUS_TEMP_ALARM )) -return 0 ; + status = hw->phy.ops.read_reg (hw,IXGBE_TN_LASI_STATUS_REG , +MDIO_MMD_PMAPMD , &phy_data); +if (status) +return false; -return IXGBE_ERR_OVERTEMP ; +return !!(phy_data &IXGBE_TN_LASI_STATUS_TEMP_ALARM ); }/** ixgbe_set_copper_phy_power - Control power for copper phy
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +1 -1
@@ -155,7 +155,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw);s32 ixgbe_get_sfp_init_sequence_offsets (struct ixgbe_hw *hw,u16 *list_offset,u16 *data_offset); -s32 ixgbe_tn_check_overtemp (struct ixgbe_hw *hw); +bool ixgbe_tn_check_overtemp (struct ixgbe_hw *hw);s32 ixgbe_read_i2c_byte_generic (struct ixgbe_hw *hw,u8 byte_offset,u8 dev_addr,u8 *data); s32 ixgbe_read_i2c_byte_generic_unlocked(struct ixgbe_hw *hw, u8 byte_offset,
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +2 -2
@@ -3509,10 +3509,10 @@ struct ixgbe_phy_operations {s32 (*read_i2c_sff8472)(struct ixgbe_hw *,u8 ,u8 *);s32 (*read_i2c_eeprom)(struct ixgbe_hw *,u8 ,u8 *);s32 (*write_i2c_eeprom)(struct ixgbe_hw *,u8 ,u8 ); -s32 (*check_overtemp)(struct ixgbe_hw *); +bool (*check_overtemp)(struct ixgbe_hw *);s32 (*set_phy_power)(struct ixgbe_hw *,bool on);s32 (*enter_lplu)(struct ixgbe_hw *); -s32 (*handle_lasi)(struct ixgbe_hw *hw); +s32 (*handle_lasi)(struct ixgbe_hw *hw,bool *);s32 (*read_i2c_byte_unlocked)(struct ixgbe_hw *,u8 offset,u8 addr,u8 *value); s32 (*write_i2c_byte_unlocked)(struct ixgbe_hw *, u8 offset, u8 addr,
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +23 -18
117 lines not on this page · raw message
Signature · 1 line
2.41.0
Tony Nguyen
maintainerPATCH 3/5 ixgbe: Refactor returning internal error codes
In reply to Tony NguyenFrom: Jedrzej Jagielski <[email protected]>
Change returning codes to the kernel ones instead of the internal ones for the entire ixgbe driver.
--- .../net/ethernet/intel/ixgbe/ixgbe_82598.c | 36 ++--- .../net/ethernet/intel/ixgbe/ixgbe_82599.c | 61 ++++---- .../net/ethernet/intel/ixgbe/ixgbe_common.c | 145 ++++++++---------- .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 26 ++-- drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c | 34 ++-- drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 1 - drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 84 +++++----- .../net/ethernet/intel/ixgbe/ixgbe_sriov.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 39 ----- drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 44 +++--- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 107 +++++++------ 12 files changed, 264 insertions(+), 317 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c +18 -18
@@ -123,14 +123,14 @@ static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)if (ret_val)return ret_val;if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) -return IXGBE_ERR_SFP_NOT_SUPPORTED ; +return -EOPNOTSUPP ;/* Check to see if SFP+ module is supported */ ret_val =ixgbe_get_sfp_init_sequence_offsets (hw, &list_offset, &data_offset);if (ret_val) -return IXGBE_ERR_SFP_NOT_SUPPORTED ; +return -EOPNOTSUPP ;break ;default :break ;
@@ -213,7 +213,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw,break ;default : -return IXGBE_ERR_LINK_SETUP ; +return -EIO ; }return 0 ;
@@ -283,7 +283,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)/* Validate the water mark configuration */ if (!hw->fc.pause_time) -return IXGBE_ERR_INVALID_LINK_SETTINGS ; +return -EINVAL ;/* Low water mark of zero causes XOFF floods */ for (i =0 ; i <MAX_TRAFFIC_CLASS ; i++) {
@@ -292,7 +292,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)if (!hw->fc.low_water[i] || hw->fc.low_water[i] >= hw->fc.high_water[i]) {hw_dbg (hw,"Invalid water mark configuration\n" ); -return IXGBE_ERR_INVALID_LINK_SETTINGS ; +return -EINVAL ; } } }
@@ -369,7 +369,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)break ;default :hw_dbg (hw,"Flow control param set incorrectly\n" ); -return IXGBE_ERR_CONFIG ; +return -EIO ; }/* Set 802.3x based flow control settings. */
@@ -438,7 +438,7 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw,msleep (100 ); }if (!(links_reg &IXGBE_LINKS_KX_AN_COMP )) { - status =IXGBE_ERR_AUTONEG_NOT_COMPLETE ; + status = -EIO ;hw_dbg (hw,"Autonegotiation did not complete.\n" ); } }
@@ -478,7 +478,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw)if (timeout ==IXGBE_VALIDATE_LINK_READY_TIMEOUT ) {hw_dbg (hw,"Link was indicated but link is down\n" ); -return IXGBE_ERR_LINK_SETUP ; +return -EIO ; }return 0 ;
@@ -594,7 +594,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, speed &= link_capabilities;if (speed ==IXGBE_LINK_SPEED_UNKNOWN ) -return IXGBE_ERR_LINK_SETUP ; +return -EINVAL ;/* Set KX4/KX support according to speed requested */ else if (link_mode == IXGBE_AUTOC_LMS_KX4_AN ||
@@ -701,9 +701,9 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)/* Init PHY and function pointers, perform SFP setup */ phy_status = hw->phy.ops.init (hw); -if (phy_status ==IXGBE_ERR_SFP_NOT_SUPPORTED ) +if (phy_status == -EOPNOTSUPP )return phy_status; -if (phy_status ==IXGBE_ERR_SFP_NOT_PRESENT ) +if (phy_status == -ENOENT ) goto mac_reset_top; hw->phy.ops.reset (hw);
@@ -727,7 +727,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)udelay (1 ); }if (ctrl &IXGBE_CTRL_RST ) { - status =IXGBE_ERR_RESET_FAILED ; + status = -EIO ;hw_dbg (hw,"Reset polling failed to complete.\n" ); }
@@ -789,7 +789,7 @@ static s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)/* Make sure we are using a valid rar index range */ if (rar >= rar_entries) {hw_dbg (hw,"RAR index %d is out of range.\n" , rar); -return IXGBE_ERR_INVALID_ARGUMENT ; +return -EINVAL ; } rar_high =IXGBE_READ_REG (hw,IXGBE_RAH (rar));
@@ -814,7 +814,7 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)/* Make sure we are using a valid rar index range */ if (rar >= rar_entries) {hw_dbg (hw,"RAR index %d is out of range.\n" , rar); -return IXGBE_ERR_INVALID_ARGUMENT ; +return -EINVAL ; } rar_high =IXGBE_READ_REG (hw,IXGBE_RAH (rar));
@@ -845,7 +845,7 @@ static s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind,u32 vftabyte;if (vlan >4095 ) -return IXGBE_ERR_PARAM ; +return -EINVAL ;/* Determine 32-bit word position in array */ regindex = (vlan >>5 ) &0x7F ;/* upper seven bits */
@@ -964,7 +964,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, gssr =IXGBE_GSSR_PHY0_SM ;if (hw->mac.ops.acquire_swfw_sync (hw, gssr) !=0 ) -return IXGBE_ERR_SWFW_SYNC ; +return -EBUSY ;if (hw->phy.type == ixgbe_phy_nl) {/*
@@ -993,7 +993,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,if (sfp_stat !=IXGBE_I2C_EEPROM_STATUS_PASS ) {hw_dbg (hw,"EEPROM read did not pass.\n" ); - status =IXGBE_ERR_SFP_NOT_PRESENT ; + status = -ENOENT ; goto out; }
@@ -1003,7 +1003,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, *eeprom_data = (u8)(sfp_data >>8 ); }else { - status =IXGBE_ERR_PHY ; + status = -EIO ; } out:
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +30 -31
233 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +67 -78
508 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +1 -1
@@ -3372,7 +3372,7 @@ static int ixgbe_get_module_eeprom(struct net_device *dev, {struct ixgbe_adapter *adapter =netdev_priv (dev);struct ixgbe_hw *hw = &adapter->hw; -s32 status =IXGBE_ERR_PHY_ADDR_INVALID ; +s32 status = -EFAULT ;u8 databyte =0xFF ;int i =0 ;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +13 -13
@@ -5510,7 +5510,7 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) {u32 speed;bool autoneg, link_up = false; -int ret =IXGBE_ERR_LINK_SETUP ; +int ret = -EIO ;if (hw->mac.ops.check_link) ret = hw->mac.ops.check_link (hw, &speed, &link_up, false);
@@ -5981,13 +5981,13 @@ void ixgbe_reset(struct ixgbe_adapter *adapter) err = hw->mac.ops.init_hw (hw);switch (err) {case 0 : -case IXGBE_ERR_SFP_NOT_PRESENT : -case IXGBE_ERR_SFP_NOT_SUPPORTED : +case -ENOENT : +case -EOPNOTSUPP :break ; -case IXGBE_ERR_PRIMARY_REQUESTS_PENDING : +case -EALREADY :e_dev_err ("primary disable timed out\n" );break ; -case IXGBE_ERR_EEPROM_VERSION : +case -EACCES :/* We are running on a pre-production device, log a warning */ e_dev_warn ("This device is a pre-production adapter/LOM. " "Please be aware there may be issues associated with "
@@ -7827,10 +7827,10 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter) adapter->sfp_poll_time = jiffies +IXGBE_SFP_POLL_JIFFIES -1 ; err = hw->phy.ops.identify_sfp (hw); -if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) +if (err == -EOPNOTSUPP ) goto sfp_out; -if (err ==IXGBE_ERR_SFP_NOT_PRESENT ) { +if (err == -ENOENT ) {/* If no cable is present, then we need to reset * the next time we find a good cable. */ adapter->flags2 |=IXGBE_FLAG2_SFP_NEEDS_RESET ;
@@ -7856,7 +7856,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)else err = hw->mac.ops.setup_sfp (hw); -if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) +if (err == -EOPNOTSUPP ) goto sfp_out; adapter->flags |=IXGBE_FLAG_NEED_LINK_CONFIG ;
@@ -7865,8 +7865,8 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter) sfp_out:clear_bit (__IXGBE_IN_SFP_INIT, &adapter->state); -if ((err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) && - (adapter->netdev->reg_state ==NETREG_REGISTERED )) { +if (err == -EOPNOTSUPP && + adapter->netdev->reg_state ==NETREG_REGISTERED ) {e_dev_err ("failed to initialize because an unsupported " "SFP+ module type was detected.\n" ); e_dev_err("Reload the driver after installing a "
@@ -10918,9 +10918,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = hw->mac.ops.reset_hw (hw); hw->phy.reset_if_overtemp = false;ixgbe_set_eee_capable (adapter); -if (err ==IXGBE_ERR_SFP_NOT_PRESENT ) { +if (err == -ENOENT ) { err =0 ; - }else if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { + }else if (err == -EOPNOTSUPP ) {e_dev_err ("failed to load because an unsupported SFP+ or QSFP module type was detected.\n" );e_dev_err ("Reload the driver after installing a supported module.\n" ); goto err_sw_init;
@@ -11139,7 +11139,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* reset the hardware with the new settings */ err = hw->mac.ops.start_hw (hw); -if (err ==IXGBE_ERR_EEPROM_VERSION ) { +if (err == -EACCES ) {/* We are running on a pre-production device, log a warning */ e_dev_warn ("This device is a pre-production adapter/LOM. " "Please be aware there may be issues associated "
drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c +17 -17
@@ -24,7 +24,7 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) size = mbx->size;if (!mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;return mbx->ops->read (hw, msg, size, mbx_id); }
@@ -43,10 +43,10 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)struct ixgbe_mbx_info *mbx = &hw->mbx;if (size > mbx->size) -return IXGBE_ERR_MBX ; +return -EINVAL ;if (!mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;return mbx->ops->write (hw, msg, size, mbx_id); }
@@ -63,7 +63,7 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)struct ixgbe_mbx_info *mbx = &hw->mbx;if (!mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;return mbx->ops->check_for_msg (hw, mbx_id); }
@@ -80,7 +80,7 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)struct ixgbe_mbx_info *mbx = &hw->mbx;if (!mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;return mbx->ops->check_for_ack (hw, mbx_id); }
@@ -97,7 +97,7 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)struct ixgbe_mbx_info *mbx = &hw->mbx;if (!mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;return mbx->ops->check_for_rst (hw, mbx_id); }
@@ -115,12 +115,12 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)int countdown = mbx->timeout;if (!countdown || !mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;while (mbx->ops->check_for_msg (hw, mbx_id)) { countdown--;if (!countdown) -return IXGBE_ERR_MBX ; +return -EIO ;udelay (mbx->usec_delay); }
@@ -140,12 +140,12 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)int countdown = mbx->timeout;if (!countdown || !mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ;while (mbx->ops->check_for_ack (hw, mbx_id)) { countdown--;if (!countdown) -return IXGBE_ERR_MBX ; +return -EIO ;udelay (mbx->usec_delay); }
@@ -169,7 +169,7 @@ static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,s32 ret_val;if (!mbx->ops) -return IXGBE_ERR_MBX ; +return -EIO ; ret_val =ixgbe_poll_for_msg (hw, mbx_id);if (ret_val)
@@ -197,7 +197,7 @@ static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,/* exit if either we can't write or there isn't a defined timeout */ if (!mbx->ops || !mbx->timeout) -return IXGBE_ERR_MBX ; +return -EIO ;/* send msg */ ret_val = mbx->ops->write (hw, msg, size, mbx_id);
@@ -217,7 +217,7 @@ static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)return 0 ; } -return IXGBE_ERR_MBX ; +return -EIO ; }/**
@@ -238,7 +238,7 @@ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number)return 0 ; } -return IXGBE_ERR_MBX ; +return -EIO ; }/**
@@ -259,7 +259,7 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number)return 0 ; } -return IXGBE_ERR_MBX ; +return -EIO ; }/**
@@ -295,7 +295,7 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)return 0 ; } -return IXGBE_ERR_MBX ; +return -EIO ; }/**
@@ -317,7 +317,7 @@ static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)if (p2v_mailbox &IXGBE_PFMAILBOX_PFU )return 0 ; -return IXGBE_ERR_MBX ; +return -EIO ; }/**
drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h +0 -1
@@ -7,7 +7,6 @@#include "ixgbe_type.h" #define IXGBE_VFMAILBOX_SIZE 16/* 16 32 bit words - 64 bytes */ -#define IXGBE_ERR_MBX -100#define IXGBE_VFMAILBOX 0x002FC#define IXGBE_VFMBMEM 0x00200
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +42 -42
321 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +1 -1
@@ -1325,7 +1325,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)break ;default :e_err (drv,"Unhandled Msg %8.8x\n" , msgbuf[0 ]); - retval =IXGBE_ERR_MBX ; + retval = -EIO ;break ; }
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +0 -39
@@ -3665,45 +3665,6 @@ struct ixgbe_info {const u32 *mvals; }; - -/* Error Codes */ -#define IXGBE_ERR_EEPROM -1 -#define IXGBE_ERR_EEPROM_CHECKSUM -2 -#define IXGBE_ERR_PHY -3 -#define IXGBE_ERR_CONFIG -4 -#define IXGBE_ERR_PARAM -5 -#define IXGBE_ERR_MAC_TYPE -6 -#define IXGBE_ERR_UNKNOWN_PHY -7 -#define IXGBE_ERR_LINK_SETUP -8 -#define IXGBE_ERR_ADAPTER_STOPPED -9 -#define IXGBE_ERR_INVALID_MAC_ADDR -10 -#define IXGBE_ERR_DEVICE_NOT_SUPPORTED -11 -#define IXGBE_ERR_PRIMARY_REQUESTS_PENDING -12 -#define IXGBE_ERR_INVALID_LINK_SETTINGS -13 -#define IXGBE_ERR_AUTONEG_NOT_COMPLETE -14 -#define IXGBE_ERR_RESET_FAILED -15 -#define IXGBE_ERR_SWFW_SYNC -16 -#define IXGBE_ERR_PHY_ADDR_INVALID -17 -#define IXGBE_ERR_I2C -18 -#define IXGBE_ERR_SFP_NOT_SUPPORTED -19 -#define IXGBE_ERR_SFP_NOT_PRESENT -20 -#define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21 -#define IXGBE_ERR_NO_SAN_ADDR_PTR -22 -#define IXGBE_ERR_FDIR_REINIT_FAILED -23 -#define IXGBE_ERR_EEPROM_VERSION -24 -#define IXGBE_ERR_NO_SPACE -25 -#define IXGBE_ERR_OVERTEMP -26 -#define IXGBE_ERR_FC_NOT_NEGOTIATED -27 -#define IXGBE_ERR_FC_NOT_SUPPORTED -28 -#define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE -30 -#define IXGBE_ERR_PBA_SECTION -31 -#define IXGBE_ERR_INVALID_ARGUMENT -32 -#define IXGBE_ERR_HOST_INTERFACE_COMMAND -33 -#define IXGBE_ERR_FDIR_CMD_INCOMPLETE -38 -#define IXGBE_ERR_FW_RESP_INVALID -39 -#define IXGBE_ERR_TOKEN_RETRY -40 -#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF -#define IXGBE_FUSES0_GROUP (_i) (0x11158 + ((_i) * 4))#define IXGBE_FUSES0_300MHZ BIT(5)#define IXGBE_FUSES0_REV_MASK (3u << 6)
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +22 -22
173 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +53 -54
409 lines not on this page · raw message
Signature · 1 line
2.41.0
Tony Nguyen
maintainerPATCH 4/5 i40e: Fix VF disable behavior to block all traffic
In reply to Tony NguyenFrom: Andrii Staikov <[email protected]>
Currently, if a VF is disabled using the
'ip link set dev $ETHX vf $VF_NUM state disable' command, the VF is still able to receive traffic.
Fix the behavior of the 'ip link set dev $ETHX vf $VF_NUM state disable' to completely shutdown the VF's queues making it entirely disabled and not able to receive or send any traffic.
Modify the behavior of the 'ip link set $ETHX vf $VF_NUM state enable' command to make a VF do reinitialization bringing the queues back up.
--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 32 +++++++++++++++++++ .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 1 + 2 files changed, 33 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +32 -0
@@ -2579,6 +2579,14 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg)int aq_ret =0 ;int i; +if (vf->is_disabled_from_host) { + aq_ret = -EPERM ; +dev_info (&pf->pdev->dev, +"Admin has disabled VF %d, will not enable queues\n" , + vf->vf_id); + goto error_param; + } +if (!test_bit (I40E_VF_STATE_ACTIVE , &vf->vf_states)) { aq_ret = -EINVAL ; goto error_param;
@@ -4705,9 +4713,12 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)struct i40e_link_status *ls = &pf->hw.phy.link_info;struct virtchnl_pf_event pfe;struct i40e_hw *hw = &pf->hw; +struct i40e_vsi *vsi; +unsigned long q_map;struct i40e_vf *vf;int abs_vf_id;int ret =0 ; +int tmp;if (test_and_set_bit (__I40E_VIRTCHNL_OP_PENDING, pf->state)) {dev_warn (&pf->pdev->dev,"Unable to configure VFs, other operation is pending.\n" );
@@ -4730,17 +4741,38 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)switch (link) {case IFLA_VF_LINK_STATE_AUTO : vf->link_forced = false; + vf->is_disabled_from_host = false; +/* reset needed to reinit VF resources */ +i40e_vc_reset_vf (vf, true);i40e_set_vf_link_state (vf, &pfe, ls);break ;case IFLA_VF_LINK_STATE_ENABLE : vf->link_forced = true; vf->link_up = true; + vf->is_disabled_from_host = false; +/* reset needed to reinit VF resources */ +i40e_vc_reset_vf (vf, true);i40e_set_vf_link_state (vf, &pfe, ls);break ;case IFLA_VF_LINK_STATE_DISABLE : vf->link_forced = true; vf->link_up = false;i40e_set_vf_link_state (vf, &pfe, ls); + + vsi = pf->vsi[vf->lan_vsi_idx]; + q_map =BIT (vsi->num_queue_pairs) -1 ; + + vf->is_disabled_from_host = true; + +/* Try to stop both Tx&Rx rings even if one of the calls fails +* to ensure we stop the rings even in case of errors. +* If any of them returns with an error then the first +* error that occurred will be returned. +*/ + tmp =i40e_ctrl_vf_tx_rings (vsi, q_map, false); + ret =i40e_ctrl_vf_rx_rings (vsi, q_map, false); + + ret = tmp ? tmp : ret;break ;default : ret = -EINVAL ;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +1 -0
@@ -100,6 +100,7 @@ struct i40e_vf {bool link_forced;bool link_up;/* only valid if VF link is forced */ bool spoofchk; +bool is_disabled_from_host;/* PF ctrl of VF enable/disable */ u16 num_vlan;/* ADq related variables */
Signature · 1 line
2.41.0
Tony Nguyen
maintainerPATCH 5/5 i40e: Avoid unnecessary use of comma operator
In reply to Tony NguyenFrom: Simon Horman <[email protected]>
Although it does not seem to have any untoward side-effects, the use of ';' to separate to assignments seems more appropriate than ','.
Flagged by clang-17 -Wcomma
No functional change intended.
Compile tested only.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -1911,7 +1911,7 @@ static int i40e_get_eeprom(struct net_device *netdev, len = eeprom->len - (I40E_NVM_SECTOR_SIZE * i); last = true; } - offset = eeprom->offset + (I40E_NVM_SECTOR_SIZE * i), + offset = eeprom->offset + (I40E_NVM_SECTOR_SIZE * i); ret_val =i40e_aq_read_nvm (hw,0x0 , offset, len, (u8 *)eeprom_buff + (I40E_NVM_SECTOR_SIZE * i), last,NULL );
Signature · 1 line
2.41.0
This series was applied to netdev/net-next.git (main) by Tony Nguyen <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Tony Nguyen <[email protected]>:
Quoted 8 lines · On Tue, 2 Jan 2024 14:24:18 -0800 you wrote:
This series contains updates to ixgbe and i40e drivers.
Ovidiu Panait adds reporting of VF link state to ixgbe.
Jedrzej removes uses of IXGBE_ERR* codes to instead use standard error codes.
[...]
Here is the summary with links:
- [net-next,1/5] ixgbe: report link state for VF devices
https://git.kernel.org/netdev/net-next/c/738808ae82d9 - [net-next,2/5] ixgbe: Refactor overtemp event handling https://git.kernel.org/netdev/net-next/c/6c1b4af8c1b2 - [net-next,3/5] ixgbe: Refactor returning internal error codes https://git.kernel.org/netdev/net-next/c/5795f533f30a - [net-next,4/5] i40e: Fix VF disable behavior to block all traffic https://git.kernel.org/netdev/net-next/c/31deb12e85c3 - [net-next,5/5] i40e: Avoid unnecessary use of comma operator https://git.kernel.org/netdev/net-next/c/55f96e8bbea0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html