Merge Intel IGC and E1000 drivers, and update E1000 base code
Subsystems (2)
PATCH 9/24 net/igc/base: fix semaphore timeout value
In reply to Anatoly BurakovFrom: Pawel Malinowski <[email protected]>
According to datasheet software ownership of SWSM.SWESMBI bit should not exceed 100ms. Current implementation caused incorrect timeout counter values, where each iteration equals 50us delay. Because of that driver was allowed to wait for semaphore even for 1,5s. This might trigger DPC timeout.
This implementation hardcodes value to 2000, which multiplied by 50us, gives 100ms of possible wait time.
--- drivers/net/intel/igc/base/igc_defines.h | 1 + drivers/net/intel/igc/base/igc_i225.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/igc/base/igc_defines.h +1 -0
@@ -525,6 +525,7 @@/* SW Semaphore Register */ #define IGC_SWSM_SMBI 0x00000001/* Driver Semaphore bit */ #define IGC_SWSM_SWESMBI 0x00000002/* FW Semaphore bit */ +#define IGC_SWSM_TIMEOUT 2000/* Driver Semaphore max timeout counter */ #define IGC_SWSM_DRV_LOAD 0x00000008/* Driver Loaded Bit */ #define IGC_SWSM2_LOCK 0x00000002/* Secondary driver semaphore bit */
drivers/net/intel/igc/base/igc_i225.c +1 -1
@@ -388,7 +388,7 @@ s32 igc_setup_copper_link_i225(struct igc_hw *hw)static s32 igc_get_hw_semaphore_i225 (struct igc_hw *hw) {u32 swsm; -s32 timeout = hw->nvm.word_size +1 ; +s32 timeout =IGC_SWSM_TIMEOUT ;s32 i =0 ;DEBUGFUNC ("igc_get_hw_semaphore_i225" );
Signature · 1 line
2.43.5
PATCH 10/24 net/igc/base: fix iterator type
In reply to Anatoly BurakovFrom: Amir Avivi <[email protected]>
Fix static analysis warning about comparison between types of incompatible width, which might lead to an infinite loop due to overflow.
--- .mailmap | 1 + drivers/net/intel/igc/base/igc_phy.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
.mailmap +1 -0
@@ -84,6 +84,7 @@ Amaranath Somalapuram <[email protected]> Amine Kherbouche <[email protected]> Amin Tootoonchian <[email protected]> Ami Sabo <[email protected]> +Amir Avivi <[email protected]> Amit Bernstein <[email protected]> Amit Gupta <[email protected]> Amit Prakash Shukla <[email protected]>
drivers/net/intel/igc/base/igc_phy.c +2 -1
@@ -2366,7 +2366,8 @@ s32 igc_phy_has_link_generic(struct igc_hw *hw, u32 iterations, u32 usec_interval, bool *success) { s32 ret_val = IGC_SUCCESS; -u16 i, phy_status; +u16 phy_status; +u32 i;DEBUGFUNC ("igc_phy_has_link_generic" );
Signature · 1 line
2.43.5
PATCH 11/24 net/igc/base: fix MAC addr hash bit shift
In reply to Anatoly BurakovFrom: Aleksandr Loktionov <[email protected]>
In e1000_hash_mc_addr_generic() the expression:
"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"
shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range.
--- drivers/net/intel/igc/base/igc_mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/intel/igc/base/igc_mac.c +2 -2
@@ -486,7 +486,7 @@ static int igc_rar_set_generic(struct igc_hw *hw, u8 *addr, u32 index)u32 igc_hash_mc_addr_generic (struct igc_hw *hw,u8 *mc_addr) {u32 hash_value, hash_mask; -u8 bit_shift =0 ; +u8 bit_shift =1 ;DEBUGFUNC ("igc_hash_mc_addr_generic" );
@@ -496,7 +496,7 @@ u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr)/* For a mc_filter_type of 0, bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ -while (hash_mask >> bit_shift !=0xFF ) +while (hash_mask >> bit_shift !=0xFF && bit_shift <4 ) bit_shift++;/* The portion of the address that is used for the hash table
Signature · 1 line
2.43.5
PATCH 12/24 net/igc/base: fix data type in MAC hash
In reply to Anatoly BurakovFrom: Barbara Skobiej <[email protected]>
One of the bit shifts in MAC hash calculation triggers a static analysis warning about a potential overflow. Fix the data type to avoid this.
--- drivers/net/intel/igc/base/igc_mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/intel/igc/base/igc_mac.c +4 -2
@@ -539,8 +539,10 @@ u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr)break ; } - hash_value = hash_mask & (((mc_addr[4 ] >> (8 - bit_shift)) | - (((u16 )mc_addr[5 ]) << bit_shift))); + hash_value = (u32 )mc_addr[4 ]; + hash_value = hash_value >> (8 - bit_shift); + hash_value |= (((u32 )mc_addr[5 ]) << bit_shift); + hash_value &= hash_mask;return hash_value; }
Signature · 1 line
2.43.5
PATCH 13/24 net/igc/base: fix static analysis warning
In reply to Anatoly BurakovFrom: Przemyslaw Ciesielski <[email protected]>
There is a static analysis warning due to wrong data types being used for NVM read data shifts. Fix it via explicit type cast.
--- drivers/net/intel/igc/base/igc_nvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/intel/igc/base/igc_nvm.c +2 -2
@@ -926,14 +926,14 @@ s32 igc_read_pba_num_generic(struct igc_hw *hw, u32 *pba_num)DEBUGOUT ("NVM Not Supported\n" );return -IGC_NOT_IMPLEMENTED ; } - *pba_num = (u32)(nvm_data <<16 ); + *pba_num = ((u32 )nvm_data <<16 ); ret_val = hw->nvm.ops.read (hw,NVM_PBA_OFFSET_1 ,1 , &nvm_data);if (ret_val) {DEBUGOUT ("NVM Read Error\n" );return ret_val; } - *pba_num |= nvm_data; + *pba_num |= (u32 )nvm_data;return IGC_SUCCESS ; }
Signature · 1 line
2.43.5
PATCH 14/24 net/e1000/base: fix semaphore timeout value
In reply to Anatoly BurakovFrom: Pawel Malinowski <[email protected]>
According to datasheet software ownership of SWSM.SWESMBI bit should not exceed 100ms. Current implementation caused incorrect timeout counter values, where each iteration equals 50us delay. Because of that driver was allowed to wait for semaphore even for 1,5s. This might trigger DPC timeout.
This implementation hardcodes value to 2000, which multiplied by 50us, gives 100ms of possible wait time.
--- drivers/net/intel/e1000/base/e1000_defines.h | 1 + drivers/net/intel/e1000/base/e1000_mac.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +1 -0
@@ -504,6 +504,7 @@/* SW Semaphore Register */ #define E1000_SWSM_SMBI 0x00000001/* Driver Semaphore bit */ #define E1000_SWSM_SWESMBI 0x00000002/* FW Semaphore bit */ +#define E1000_SWSM_TIMEOUT 2000/* Driver Semaphore max timeout counter */ #define E1000_SWSM_DRV_LOAD 0x00000008/* Driver Loaded Bit */ #define E1000_SWSM2_LOCK 0x00000002/* Secondary driver semaphore bit */
drivers/net/intel/e1000/base/e1000_mac.c +1 -1
@@ -1688,7 +1688,7 @@ s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw E1000_UNUSEDs32 e1000_get_hw_semaphore_generic (struct e1000_hw *hw) {u32 swsm; -s32 timeout = hw->nvm.word_size +1 ; +s32 timeout =E1000_SWSM_TIMEOUT ;s32 i =0 ;DEBUGFUNC ("e1000_get_hw_semaphore_generic" );
Signature · 1 line
2.43.5
PATCH 15/24 net/e1000/base: correct mPHY access logic
In reply to Anatoly BurakovThe original code had incorrect indentation, and the fix was applied to follow the indentation, i.e. adding brackets making the indentation valid. However, the actual issue was incorrect indentation and not missing braces, so the fix was incorrect.
This fix restores the original logic and corrects indentation.
--- drivers/net/intel/e1000/base/e1000_phy.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +10 -12
@@ -4134,13 +4134,12 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data) *data =E1000_READ_REG (hw,E1000_MPHY_DATA );/* Disable access to mPHY if it was originally disabled */ -if (locked) { +if (locked) ready =e1000_is_mphy_ready (hw); -if (!ready) -return -E1000_ERR_PHY ; -E1000_WRITE_REG (hw,E1000_MPHY_ADDR_CTRL , -E1000_MPHY_DIS_ACCESS ); - } +if (!ready) +return -E1000_ERR_PHY ; +E1000_WRITE_REG (hw,E1000_MPHY_ADDR_CTRL , +E1000_MPHY_DIS_ACCESS );return E1000_SUCCESS ; }
@@ -4200,13 +4199,12 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data,E1000_WRITE_REG (hw,E1000_MPHY_DATA , data);/* Disable access to mPHY if it was originally disabled */ -if (locked) { +if (locked) ready =e1000_is_mphy_ready (hw); -if (!ready) -return -E1000_ERR_PHY ; -E1000_WRITE_REG (hw,E1000_MPHY_ADDR_CTRL , -E1000_MPHY_DIS_ACCESS ); - } +if (!ready) +return -E1000_ERR_PHY ; +E1000_WRITE_REG (hw,E1000_MPHY_ADDR_CTRL , +E1000_MPHY_DIS_ACCESS );return E1000_SUCCESS ; }
Signature · 1 line
2.43.5
PATCH 16/24 net/e1000/base: fix iterator type
In reply to Anatoly BurakovFrom: Amir Avivi <[email protected]>
Fix static analysis warning about comparison between types of incompatible width, which might lead to an infinite loop due to overflow.
--- drivers/net/intel/e1000/base/e1000_phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_phy.c +2 -1
@@ -2333,7 +2333,8 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, u32 usec_interval, bool *success) { s32 ret_val = E1000_SUCCESS; -u16 i, phy_status; +u16 phy_status; +u32 i;DEBUGFUNC ("e1000_phy_has_link_generic" );
Signature · 1 line
2.43.5
PATCH 17/24 net/e1000/base: fix MAC addr hash bit shift
In reply to Anatoly BurakovFrom: Aleksandr Loktionov <[email protected]>
In e1000_hash_mc_addr_generic() the expression:
"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"
shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range.
--- drivers/net/intel/e1000/base/e1000_mac.c | 4 ++-- drivers/net/intel/e1000/base/e1000_vf.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_mac.c +2 -2
@@ -488,7 +488,7 @@ int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)u32 e1000_hash_mc_addr_generic (struct e1000_hw *hw,u8 *mc_addr) {u32 hash_value, hash_mask; -u8 bit_shift =0 ; +u8 bit_shift =1 ;DEBUGFUNC ("e1000_hash_mc_addr_generic" );
@@ -498,7 +498,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)/* For a mc_filter_type of 0, bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ -while (hash_mask >> bit_shift !=0xFF ) +while (hash_mask >> bit_shift !=0xFF && bit_shift <4 ) bit_shift++;/* The portion of the address that is used for the hash table
drivers/net/intel/e1000/base/e1000_vf.c +2 -2
@@ -331,7 +331,7 @@ STATIC int e1000_rar_set_vf(struct e1000_hw *hw, u8 *addr, STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) {u32 hash_value, hash_mask; -u8 bit_shift =0 ; +u8 bit_shift =1 ;DEBUGFUNC ("e1000_hash_mc_addr_generic" );
@@ -342,7 +342,7 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)* The bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ -while (hash_mask >> bit_shift !=0xFF ) +while (hash_mask >> bit_shift !=0xFF && bit_shift <4 ) bit_shift++; hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
Signature · 1 line
2.43.5
PATCH 18/24 net/e1000/base: fix data type in MAC hash
In reply to Anatoly BurakovFrom: Barbara Skobiej <[email protected]>
One of the bit shifts in MAC hash calculation triggers a static analysis warning about a potential overflow. Fix the data type to avoid this.
--- drivers/net/intel/e1000/base/e1000_mac.c | 6 ++++-- drivers/net/intel/e1000/base/e1000_vf.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_mac.c +4 -2
@@ -541,8 +541,10 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)break ; } - hash_value = hash_mask & (((mc_addr[4 ] >> (8 - bit_shift)) | - (((u16 ) mc_addr[5 ]) << bit_shift))); + hash_value = (u32 )mc_addr[4 ]; + hash_value = hash_value >> (8 - bit_shift); + hash_value |= (((u32 )mc_addr[5 ]) << bit_shift); + hash_value &= hash_mask;return hash_value; }
drivers/net/intel/e1000/base/e1000_vf.c +4 -2
@@ -345,8 +345,10 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)while (hash_mask >> bit_shift !=0xFF && bit_shift <4 ) bit_shift++; - hash_value = hash_mask & (((mc_addr[4 ] >> (8 - bit_shift)) | - (((u16 ) mc_addr[5 ]) << bit_shift))); + hash_value = (u32 )mc_addr[4 ]; + hash_value = hash_value >> (8 - bit_shift); + hash_value |= (((u32 )mc_addr[5 ]) << bit_shift); + hash_value &= hash_mask;return hash_value; }
Signature · 1 line
2.43.5
PATCH 19/24 net/e1000/base: fix uninitialized variable usage
In reply to Anatoly BurakovFrom: Jakub Buchocki <[email protected]>
Static analysis has detected potential usage of uninitialized values inside the array. Fix the warning by initializing array.
--- .mailmap | 1 + drivers/net/intel/e1000/base/e1000_vf.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
.mailmap +1 -0
@@ -619,6 +619,7 @@ Jacek Piasecki <[email protected]> Jacek Siuda <[email protected]> Jack Bond-Preston <[email protected]> <[email protected]> Jacob Keller <[email protected]> +Jakub Buchocki <[email protected]> Jakub Chylkowski <[email protected]> Jakub Grajciar <[email protected]> Jakub Neruda <[email protected]>
drivers/net/intel/e1000/base/e1000_vf.c +1 -1
@@ -376,7 +376,7 @@ STATIC void e1000_write_msg_read_ack(struct e1000_hw *hw,void e1000_update_mc_addr_list_vf (struct e1000_hw *hw,u8 *mc_addr_list,u32 mc_addr_count) { -u32 msgbuf[E1000_VFMAILBOX_SIZE ]; +u32 msgbuf[E1000_VFMAILBOX_SIZE ] = {0 };u16 *hash_list = (u16 *)&msgbuf[1 ];u32 hash_value;u32 i;
Signature · 1 line
2.43.5
PATCH 20/24 net/e1000/base: fix static analysis warning
In reply to Anatoly BurakovFrom: Przemyslaw Ciesielski <[email protected]>
There is a static analysis warning due to wrong data types being used for SW/FW semaphore masking. Fix it via explicit type cast.
--- drivers/net/intel/e1000/base/e1000_80003es2lan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_80003es2lan.c +1 -1
@@ -426,7 +426,7 @@ STATIC void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask) ;/* Empty */ swfw_sync =E1000_READ_REG (hw,E1000_SW_FW_SYNC ); - swfw_sync &= ~mask; + swfw_sync &= ~(u32 )mask;E1000_WRITE_REG (hw,E1000_SW_FW_SYNC , swfw_sync);e1000_put_hw_semaphore_generic (hw);
Signature · 1 line
2.43.5
PATCH 21/24 net/e1000/base: fix static analysis warning
In reply to Anatoly BurakovFrom: Przemyslaw Ciesielski <[email protected]>
There is a static analysis warning due to wrong data types being used for NVM read data shifts. Fix it via explicit type cast.
--- drivers/net/intel/e1000/base/e1000_nvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_nvm.c +2 -2
@@ -935,14 +935,14 @@ s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num)DEBUGOUT ("NVM Not Supported\n" );return -E1000_NOT_IMPLEMENTED ; } - *pba_num = (u32)(nvm_data <<16 ); + *pba_num = ((u32 )nvm_data <<16 ); ret_val = hw->nvm.ops.read (hw,NVM_PBA_OFFSET_1 ,1 , &nvm_data);if (ret_val) {DEBUGOUT ("NVM Read Error\n" );return ret_val; } - *pba_num |= nvm_data; + *pba_num |= (u32 )nvm_data;return E1000_SUCCESS ; }
Signature · 1 line
2.43.5
PATCH 22/24 net/e1000/base: fix reset for 82580
In reply to Anatoly BurakovFrom: Barbara Skobiej <[email protected]>
Fix setting device reset status bit in e1000_reset_hw_82580() function for 82580 by first reading the register value, and then setting the device reset bit.
--- drivers/net/intel/e1000/base/e1000_82575.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_82575.c +3 -2
@@ -2280,7 +2280,7 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)s32 ret_val =E1000_SUCCESS ;/* BH SW mailbox bit in SW_FW_SYNC */ u16 swmbsw_mask =E1000_SW_SYNCH_MB ; -u32 ctrl; +u32 ctrl, status;bool global_device_reset = hw->dev_spec._82575.global_device_reset;DEBUGFUNC ("e1000_reset_hw_82580" );
@@ -2345,7 +2345,8 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw) }/* clear global device reset status bit */ -E1000_WRITE_REG (hw,E1000_STATUS ,E1000_STAT_DEV_RST_SET ); + status =E1000_READ_REG (hw,E1000_STATUS ); +E1000_WRITE_REG (hw,E1000_STATUS , status |E1000_STAT_DEV_RST_SET );/* Clear any pending interrupt events. */ E1000_WRITE_REG (hw,E1000_IMC ,0xffffffff );
Signature · 1 line
2.43.5
PATCH 23/24 net/e1000/base: fix unchecked return
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
Static analysis has detected a write that is not checked for errors, leading to ignored error return value. Add a check.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +2 -0
@@ -962,6 +962,8 @@ s32 e1000_set_eee_pchlan(struct e1000_hw *hw) data &= ~I82579_LPI_100_PLL_SHUT ; ret_val =e1000_write_emi_reg_locked (hw,I82579_LPI_PLL_SHUT , data); +if (ret_val) + goto release; }/* R/Clr IEEE MMD 3.1 bits 11:10 - Tx/Rx LPI Received */
Signature · 1 line
2.43.5
PATCH 24/24 net/e1000/base: skip MANC check for 82575
In reply to Anatoly BurakovFrom: Carolyn Wyborny <[email protected]>
On 82575, driver is not supposed to check if managegement control is enabled, and flush the Rx FIFO unconditionally.
--- drivers/net/intel/e1000/base/e1000_base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_base.c +2 -1
@@ -132,7 +132,8 @@ void e1000_rx_fifo_flush_base(struct e1000_hw *hw) rfctl |=E1000_RFCTL_IPV6_EX_DIS ;E1000_WRITE_REG (hw,E1000_RFCTL , rfctl); -if (!(E1000_READ_REG (hw,E1000_MANC ) &E1000_MANC_RCV_TCO_EN )) +if (hw->mac.type != e1000_82575 || + !(E1000_READ_REG (hw,E1000_MANC ) &E1000_MANC_RCV_TCO_EN ))return ;/* Disable all Rx queues */
Signature · 1 line
2.43.5
Re: [PATCH v1 00/24] Fixes for igc and e1000
In reply to Anatoly BurakovQuoted 4 lines · Anatoly Burakov
This patchset is taken out of recent e1000/igc driver update [1].
Thanks Anatoly. All the patches for e1000 and igc will be easier to work on in two sets rather than one huge one, and it should make it easier to backport all these fixes too.
/Bruce
Re: [PATCH v1 00/24] Fixes for igc and e1000
In reply to Anatoly BurakovQuoted 48 lines · Anatoly Burakov
This patchset is taken out of recent e1000/igc driver update [1].
[1] https://inbox.dpdk.org/dev/[email protected]/
Aleksandr Loktionov (2):
net/igc/base: fix MAC addr hash bit shift
net/e1000/base: fix MAC addr hash bit shiftAmir Avivi (2):
net/igc/base: fix iterator type
net/e1000/base: fix iterator typeAnatoly Burakov (1):
net/e1000/base: correct mPHY access logicBarbara Skobiej (3):
net/igc/base: fix data type in MAC hash
net/e1000/base: fix data type in MAC hash
net/e1000/base: fix reset for 82580Carolyn Wyborny (1):
net/e1000/base: skip MANC check for 82575Dima Ruinskiy (5):
net/igc/base: fix deadlock in i225
net/igc/base: fix infinite loop
net/igc/base: fix typo in LTR calculation
net/igc/base: fix unused value
net/e1000/base: fix unchecked returnJakub Buchocki (1):
net/e1000/base: fix uninitialized variable usagePawel Malinowski (2):
net/igc/base: fix semaphore timeout value
net/e1000/base: fix semaphore timeout valuePrzemyslaw Ciesielski (4):
net/igc/base: fix bitwise op type mismatch
net/igc/base: fix static analysis warning
net/e1000/base: fix static analysis warning
net/e1000/base: fix static analysis warningSasha Neftin (3):
net/igc/base: increase PHY power up delay
net/igc/base: reset loop variable
net/igc/base: fix LTR for i225
Quoted 17 lines
.mailmap | 3 +++ .../net/intel/e1000/base/e1000_80003es2lan.c | 2 +- drivers/net/intel/e1000/base/e1000_82575.c | 5 ++-- drivers/net/intel/e1000/base/e1000_base.c | 3 ++- drivers/net/intel/e1000/base/e1000_defines.h | 1 + drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 ++ drivers/net/intel/e1000/base/e1000_mac.c | 12 +++++---- drivers/net/intel/e1000/base/e1000_nvm.c | 4 +-- drivers/net/intel/e1000/base/e1000_phy.c | 25 +++++++++---------- drivers/net/intel/e1000/base/e1000_vf.c | 12 +++++---- drivers/net/intel/igc/base/igc_defines.h | 1 + drivers/net/intel/igc/base/igc_i225.c | 24 ++++++++++++------ drivers/net/intel/igc/base/igc_mac.c | 10 +++++--- drivers/net/intel/igc/base/igc_nvm.c | 4 +-- drivers/net/intel/igc/base/igc_phy.c | 8 +++--- 15 files changed, 68 insertions(+), 48 deletions(-)
Patches all LGTM. I see a couple of fixes have to be applied to both e1000 and igc - which is another reason why we are deduplicating and merging those drivers - but agree with the decision to keep the fixes in separate patches here for easier reviewing/backporting/cherry-picking.
Series applied to dpdk-next-net-intel
Thanks,
/Bruce
v3 cover Merge Intel IGC and E1000 drivers, and update E1000 base code
In reply to Anatoly BurakovIntel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).
After the merge is done, base code is also updated to latest snapshot.
v2 -> v3:
- Fixes to drivers were separated out as a separate patchset [1]
- Fixed signoffs and authorship
- Fixed check-git-log and check-meson warnings
- Added libabigail ignore for the removed driver
- Added release notes
- Updated MAINTAINERS file
v1 -> v2:
- igc code is now a direct copy from IGC rather than a rebuild-from-source
- i225-related fixes are now separate, not squashed
- removed unused args warning workaround
Adam Ludkiewicz (1):
net/e1000/base: add WoL definitions
Anatoly Burakov (9):
net/e1000/base: copy i225 code into e1000 net/igc: merge with net/e1000
net/igc: remove the driver
net/e1000/base: remove unused parameter workaround net/e1000: add missing i225 devices net/e1000: add missing hardware support net/e1000/base: correct formatting differences net/e1000/base: add missing definitions net/e1000: update e1000 documentation
Dima Ruinskiy (4):
net/e1000/base: read PCIe bus info in i225 net/e1000/base: make PHY wakeup access non-static net/e1000/base: make debug prints more informative net/e1000/base: hardcode bus parameters for ICH8
Evgeny Efimov (2):
net/e1000/base: add PHY reset support for i225
net/e1000/base: add EEE common API function
Marcin Jurczak (1):
net/e1000/base: remove non-inclusive language
Menachem Fogel (1):
net/e1000/base: add LED blink support for i225
Nir Efrati (8):
net/e1000/base: remove unused function net/e1000/base: make i225 set LTR non-static net/e1000/base: workaround for packet loss net/e1000/base: add definition for EXFWSM register net/e1000/base: use longer ULP exit timeout on more HW net/e1000/base: remove redundant access to RO register net/e1000/base: introduce PHY ID retry mechanism net/e1000/base: add PHY read/write retry mechanism
Piotr Kubaj (1):
net/e1000/base: rename NVM version variable
Piotr Pietruszewski (1):
net/e1000/base: improve code flow in ICH8LAN
Sasha Neftin (6):
net/e1000/base: rename VLAN PQF macros net/e1000/base: add PHY power management control net/e1000/base: add queue select definitions net/e1000/base: add profile information field net/e1000/base: add LPI counters net/e1000/base: improve NVM checksum handling
Vitaly Lifshits (2):
net/e1000: add support for more I219 devices
net/e1000/base: correct disable k1 logic
.mailmap | 3 +-
MAINTAINERS | 8 +-
devtools/libabigail.abignore | 1 +
doc/guides/nics/igc.rst | 2 +-
doc/guides/rel_notes/release_25_03.rst | 14 +-
drivers/net/intel/e1000/base/README | 8 +-
.../net/intel/e1000/base/e1000_80003es2lan.c | 8 +-
drivers/net/intel/e1000/base/e1000_82571.c | 4 +-
drivers/net/intel/e1000/base/e1000_82575.c | 16 +-
drivers/net/intel/e1000/base/e1000_82575.h | 29 -
drivers/net/intel/e1000/base/e1000_api.c | 77 +-
drivers/net/intel/e1000/base/e1000_api.h | 4 +-
drivers/net/intel/e1000/base/e1000_base.c | 4 +-
drivers/net/intel/e1000/base/e1000_defines.h | 261 +-
drivers/net/intel/e1000/base/e1000_hw.h | 95 +-
drivers/net/intel/e1000/base/e1000_i210.c | 14 +-
drivers/net/intel/e1000/base/e1000_i210.h | 4 +
drivers/net/intel/e1000/base/e1000_i225.c | 1371 +++++
drivers/net/intel/e1000/base/e1000_i225.h | 117 +
drivers/net/intel/e1000/base/e1000_ich8lan.c | 222 +-
drivers/net/intel/e1000/base/e1000_ich8lan.h | 3 +-
drivers/net/intel/e1000/base/e1000_mac.c | 50 +-
drivers/net/intel/e1000/base/e1000_mac.h | 2 +-
drivers/net/intel/e1000/base/e1000_nvm.c | 8 +-
drivers/net/intel/e1000/base/e1000_osdep.c | 11 +-
drivers/net/intel/e1000/base/e1000_osdep.h | 41 +-
drivers/net/intel/e1000/base/e1000_phy.c | 431 +-
drivers/net/intel/e1000/base/e1000_phy.h | 21 +
drivers/net/intel/e1000/base/e1000_regs.h | 53 +-
drivers/net/intel/e1000/base/e1000_vf.c | 2 +-
drivers/net/intel/e1000/base/meson.build | 13 +-
drivers/net/intel/e1000/em_ethdev.c | 36 +-
drivers/net/intel/e1000/igb_ethdev.c | 1 +
drivers/net/intel/{igc => e1000}/igc_ethdev.c | 914 ++--
drivers/net/intel/{igc => e1000}/igc_ethdev.h | 32 +-
drivers/net/intel/{igc => e1000}/igc_filter.c | 84 +-
drivers/net/intel/{igc => e1000}/igc_filter.h | 0
drivers/net/intel/{igc => e1000}/igc_flow.c | 2 +-
drivers/net/intel/{igc => e1000}/igc_flow.h | 0
drivers/net/intel/{igc => e1000}/igc_logs.c | 2 +-
drivers/net/intel/{igc => e1000}/igc_txrx.c | 376 +-
drivers/net/intel/{igc => e1000}/igc_txrx.h | 6 +-
drivers/net/intel/e1000/meson.build | 11 +
drivers/net/intel/igc/base/README | 29 -
drivers/net/intel/igc/base/igc_82571.h | 36 -
drivers/net/intel/igc/base/igc_82575.h | 351 --
drivers/net/intel/igc/base/igc_api.c | 1853 -------
drivers/net/intel/igc/base/igc_api.h | 111 -
drivers/net/intel/igc/base/igc_base.c | 190 -
drivers/net/intel/igc/base/igc_base.h | 127 -
drivers/net/intel/igc/base/igc_defines.h | 1671 -------
drivers/net/intel/igc/base/igc_hw.h | 1059 ----
drivers/net/intel/igc/base/igc_i225.c | 1380 -----
drivers/net/intel/igc/base/igc_i225.h | 110 -
drivers/net/intel/igc/base/igc_ich8lan.h | 296 --
drivers/net/intel/igc/base/igc_mac.c | 2102 --------
drivers/net/intel/igc/base/igc_mac.h | 64 -
drivers/net/intel/igc/base/igc_manage.c | 547 --
drivers/net/intel/igc/base/igc_manage.h | 65 -
drivers/net/intel/igc/base/igc_nvm.c | 1324 -----
drivers/net/intel/igc/base/igc_nvm.h | 69 -
drivers/net/intel/igc/base/igc_osdep.c | 64 -
drivers/net/intel/igc/base/igc_osdep.h | 163 -
drivers/net/intel/igc/base/igc_phy.c | 4418 -----------------
drivers/net/intel/igc/base/igc_phy.h | 337 --
drivers/net/intel/igc/base/igc_regs.h | 732 ---
drivers/net/intel/igc/base/meson.build | 19 -
drivers/net/intel/igc/igc_logs.h | 43 -
drivers/net/intel/igc/meson.build | 21 -
drivers/net/meson.build | 1 -
70 files changed, 3296 insertions(+), 18247 deletions(-)
create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c
create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h
rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)
delete mode 100644 drivers/net/intel/igc/base/README
delete mode 100644 drivers/net/intel/igc/base/igc_82571.h
delete mode 100644 drivers/net/intel/igc/base/igc_82575.h
delete mode 100644 drivers/net/intel/igc/base/igc_api.c
delete mode 100644 drivers/net/intel/igc/base/igc_api.h
delete mode 100644 drivers/net/intel/igc/base/igc_base.c
delete mode 100644 drivers/net/intel/igc/base/igc_base.h
delete mode 100644 drivers/net/intel/igc/base/igc_defines.h
delete mode 100644 drivers/net/intel/igc/base/igc_hw.h
delete mode 100644 drivers/net/intel/igc/base/igc_i225.c
delete mode 100644 drivers/net/intel/igc/base/igc_i225.h
delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h
delete mode 100644 drivers/net/intel/igc/base/igc_mac.c
delete mode 100644 drivers/net/intel/igc/base/igc_mac.h
delete mode 100644 drivers/net/intel/igc/base/igc_manage.c
delete mode 100644 drivers/net/intel/igc/base/igc_manage.h
delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c
delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h
delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c
delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h
delete mode 100644 drivers/net/intel/igc/base/igc_phy.c
delete mode 100644 drivers/net/intel/igc/base/igc_phy.h
delete mode 100644 drivers/net/intel/igc/base/igc_regs.h
delete mode 100644 drivers/net/intel/igc/base/meson.build
delete mode 100644 drivers/net/intel/igc/igc_logs.h
delete mode 100644 drivers/net/intel/igc/meson.buildSignature · 1 line
2.43.5
PATCH v3 1/36 net/e1000/base: copy i225 code into e1000
Do a direct copy of i225 code into e1000 directory, replacing all symbol and definition names with e1000_/E1000_ prefix instead of igc_/IGC_ prefix. This is done in preparation for merging the two drivers together.
---
drivers/net/intel/e1000/base/e1000_api.c | 19 +
drivers/net/intel/e1000/base/e1000_api.h | 1 +
drivers/net/intel/e1000/base/e1000_defines.h | 175 +++-
drivers/net/intel/e1000/base/e1000_hw.h | 46 +
.../igc_i225.c => e1000/base/e1000_i225.c} | 823 +++++++++---------
drivers/net/intel/e1000/base/e1000_i225.h | 110 +++
drivers/net/intel/e1000/base/e1000_mac.c | 24 +-
drivers/net/intel/e1000/base/e1000_nvm.c | 1 +
drivers/net/intel/e1000/base/e1000_osdep.h | 6 +
drivers/net/intel/e1000/base/e1000_phy.c | 137 ++-
drivers/net/intel/e1000/base/e1000_phy.h | 17 +
drivers/net/intel/e1000/base/e1000_regs.h | 59 ++
drivers/net/intel/e1000/base/meson.build | 1 +
13 files changed, 999 insertions(+), 420 deletions(-)
copy drivers/net/intel/{igc/base/igc_i225.c => e1000/base/e1000_i225.c} (50%)
create mode 100644 drivers/net/intel/e1000/base/e1000_i225.hdrivers/net/intel/e1000/base/e1000_api.c +19 -0
@@ -354,6 +354,22 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_82576_VF_HV : mac->type = e1000_vfadapt;break ; +case E1000_DEV_ID_I225_LM : +case E1000_DEV_ID_I225_LMVP : +case E1000_DEV_ID_I225_V : +case E1000_DEV_ID_I225_K : +case E1000_DEV_ID_I225_I : +case E1000_DEV_ID_I225_IT : +case E1000_DEV_ID_I220_V : +case E1000_DEV_ID_I225_BLANK_NVM : +case E1000_DEV_ID_I226_K : +case E1000_DEV_ID_I226_LMVP : +case E1000_DEV_ID_I226_LM : +case E1000_DEV_ID_I226_V : +case E1000_DEV_ID_I226_IT : +case E1000_DEV_ID_I226_BLANK_NVM : + mac->type = e1000_i225; +break ;case E1000_DEV_ID_I350_VF :case E1000_DEV_ID_I350_VF_HV : mac->type = e1000_vfadapt_i350;
@@ -470,6 +486,9 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)case e1000_i211:e1000_init_function_pointers_i210 (hw);break ; +case e1000_i225: +e1000_init_function_pointers_i225 (hw); +break ;case e1000_vfadapt:e1000_init_function_pointers_vf (hw);break ;
drivers/net/intel/e1000/base/e1000_api.h +1 -0
@@ -19,6 +19,7 @@ extern void e1000_init_function_pointers_vf(struct e1000_hw *hw);extern void e1000_power_up_fiber_serdes_link (struct e1000_hw *hw);extern void e1000_shutdown_fiber_serdes_link (struct e1000_hw *hw);extern void e1000_init_function_pointers_i210 (struct e1000_hw *hw); +extern void e1000_init_function_pointers_i225 (struct e1000_hw *hw);s32 e1000_set_obff_timer (struct e1000_hw *hw,u32 itr);s32 e1000_set_mac_type (struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_defines.h +174 -1
276 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_hw.h +46 -0
94 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_i225.c renamed from drivers/net/intel/igc/base/igc_i225.c +411 -412
1,688 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_i225.h new file +110 -0
110 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_mac.c +19 -5
@@ -989,9 +989,13 @@ s32 e1000_setup_link_generic(struct e1000_hw *hw)* based on the EEPROM flow control settings. */ if (hw->fc.requested_mode == e1000_fc_default) { - ret_val =e1000_set_default_fc_generic (hw); -if (ret_val) -return ret_val; +if (hw->mac.type == e1000_i225) { + hw->fc.requested_mode = e1000_fc_full; + }else { + ret_val =e1000_set_default_fc_generic (hw); +if (ret_val) +return ret_val; + } }/* Save off the requested flow control mode for use later. Depending
@@ -1639,8 +1643,18 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed, status =E1000_READ_REG (hw,E1000_STATUS );if (status &E1000_STATUS_SPEED_1000 ) { - *speed =SPEED_1000 ; -DEBUGOUT ("1000 Mbs, " ); +/* For I225, STATUS will indicate 1G speed in both 1 Gbps +* and 2.5 Gbps link modes. An additional bit is used +* to differentiate between 1 Gbps and 2.5 Gbps. +*/ +if (hw->mac.type == e1000_i225 && + (status &E1000_STATUS_SPEED_2500 )) { + *speed =SPEED_2500 ; +DEBUGOUT ("2500 Mbs, " ); + }else { + *speed =SPEED_1000 ; +DEBUGOUT ("1000 Mbs, " ); + } }else if (status &E1000_STATUS_SPEED_100 ) { *speed =SPEED_100 ;DEBUGOUT ("100 Mbs, " );
drivers/net/intel/e1000/base/e1000_nvm.c +1 -0
@@ -1295,6 +1295,7 @@ void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)return ; }/* fall through */ +case e1000_i225:case e1000_i350: hw->nvm.ops.read (hw,NVM_ETRACK_HIWORD ,1 , &etrack_test);/* find combo image version */
drivers/net/intel/e1000/base/e1000_osdep.h +6 -0
@@ -117,9 +117,15 @@ static inline uint16_t e1000_read_addr16(volatile void *addr)#define E1000_READ_REG (hw, reg) \ e1000_read_addr(E1000_PCI_REG_ADDR((hw), (reg))) +#define E1000_READ_REG_LE_VALUE (hw, reg) \ + rte_read32(E1000_PCI_REG_ADDR((hw), (reg))) +#define E1000_WRITE_REG (hw, reg, value) \ E1000_PCI_REG_WRITE(E1000_PCI_REG_ADDR((hw), (reg)), (value)) +#define E1000_WRITE_REG_LE_VALUE (hw, reg, value) \ + rte_write32(value, E1000_PCI_REG_ADDR((hw), (reg))) +#define E1000_READ_REG_ARRAY (hw, reg, index) \ E1000_PCI_REG(E1000_PCI_REG_ARRAY_ADDR((hw), (reg), (index)))
drivers/net/intel/e1000/base/e1000_phy.c +135 -2
209 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_phy.h +17 -0
@@ -86,6 +86,8 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw);s32 e1000_get_cable_length_82577 (struct e1000_hw *hw);s32 e1000_write_phy_reg_gs40g (struct e1000_hw *hw,u32 offset,u16 data);s32 e1000_read_phy_reg_gs40g (struct e1000_hw *hw,u32 offset,u16 *data); +s32 e1000_write_phy_reg_gpy (struct e1000_hw *hw,u32 offset,u16 data); +s32 e1000_read_phy_reg_gpy (struct e1000_hw *hw,u32 offset,u16 *data);s32 e1000_read_phy_reg_mphy (struct e1000_hw *hw,u32 address,u32 *data);s32 e1000_write_phy_reg_mphy (struct e1000_hw *hw,u32 address,u32 data,bool line_override);
@@ -120,6 +122,21 @@ s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr,#define GS40G_MAC_SPEED_1G 0X0006#define GS40G_COPPER_SPEC 0x0010 +#define E1000_I225_PHPM 0x0E14/* I225 PHY Power Management */ +#define E1000_I225_PHPM_DIS_1000_D3 0x0008/* Disable 1G in D3 */ +#define E1000_I225_PHPM_LINK_ENERGY 0x0010/* Link Energy Detect */ +#define E1000_I225_PHPM_GO_LINKD 0x0020/* Go Link Disconnect */ +#define E1000_I225_PHPM_DIS_1000 0x0040/* Disable 1G globally */ +#define E1000_I225_PHPM_SPD_B2B_EN 0x0080/* Smart Power Down Back2Back */ +#define E1000_I225_PHPM_RST_COMPL 0x0100/* PHY Reset Completed */ +#define E1000_I225_PHPM_DIS_100_D3 0x0200/* Disable 100M in D3 */ +#define E1000_I225_PHPM_ULP 0x0400/* Ultra Low-Power Mode */ +#define E1000_I225_PHPM_DIS_2500 0x0800/* Disable 2.5G globally */ +#define E1000_I225_PHPM_DIS_2500_D3 0x1000/* Disable 2.5G in D3 */ +/* GPY211 - I225 defines */ +#define GPY_MMD_MASK 0xFFFF0000 +#define GPY_MMD_SHIFT 16 +#define GPY_REG_MASK 0x0000FFFF/* BM/HV Specific Registers */ #define BM_PORT_CTRL_PAGE 769#define BM_WUC_PAGE 800
drivers/net/intel/e1000/base/e1000_regs.h +59 -0
103 lines not on this page · raw message
drivers/net/intel/e1000/base/meson.build +1 -0
@@ -12,6 +12,7 @@ sources = [ 'e1000_82575.c', 'e1000_api.c', 'e1000_i210.c', + 'e1000_i225.c', 'e1000_ich8lan.c', 'e1000_mac.c', 'e1000_manage.c',
Signature · 1 line
2.43.5
PATCH v3 2/36 net/igc: merge with net/e1000
In reply to Anatoly BurakovIGC and E1000 drivers are derived from the same base code. Now that e1000 code has enabled support for i225 devices, move IGC ethdev code to e1000 directory (renaming references to base code from igc_* to e1000_*).
This patch also disables build of igc driver, as it is no longer able to be built because the ethdev part was moved to e1000. It is effectively removed from DPDK at this point.
---
MAINTAINERS | 8 +-
devtools/libabigail.abignore | 1 +
doc/guides/nics/igc.rst | 2 +-
doc/guides/rel_notes/release_25_03.rst | 13 +-
drivers/net/intel/e1000/base/README | 4 +-
drivers/net/intel/{igc => e1000}/igc_ethdev.c | 910 +++++++++---------
drivers/net/intel/{igc => e1000}/igc_ethdev.h | 32 +-
drivers/net/intel/{igc => e1000}/igc_filter.c | 84 +-
drivers/net/intel/{igc => e1000}/igc_filter.h | 0
drivers/net/intel/{igc => e1000}/igc_flow.c | 2 +-
drivers/net/intel/{igc => e1000}/igc_flow.h | 0
drivers/net/intel/{igc => e1000}/igc_logs.c | 2 +-
drivers/net/intel/{igc => e1000}/igc_txrx.c | 376 ++++----
drivers/net/intel/{igc => e1000}/igc_txrx.h | 6 +-
drivers/net/intel/e1000/meson.build | 11 +
drivers/net/meson.build | 1 -
16 files changed, 736 insertions(+), 716 deletions(-)
rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)MAINTAINERS +2 -6
@@ -789,6 +789,8 @@ F: doc/guides/nics/e1000em.rst F: doc/guides/nics/intel_vf.rst F: doc/guides/nics/features/e1000.ini F: doc/guides/nics/features/igb*.ini +F: doc/guides/nics/features/igc.ini +F: doc/guides/nics/igc.rst Intel ixgbe M: Anatoly Burakov <[email protected]>
@@ -846,12 +848,6 @@ F: drivers/net/intel/cpfl/ F: doc/guides/nics/cpfl.rst F: doc/guides/nics/features/cpfl.ini -Intel igc -T: git://dpdk.org/next/dpdk-next-net-intel -F: drivers/net/intel/igc/ -F: doc/guides/nics/igc.rst -F: doc/guides/nics/features/igc.ini - Intel ipn3ke M: Rosen Xu <[email protected]> T: git://dpdk.org/next/dpdk-next-net-intel
devtools/libabigail.abignore +1 -0
@@ -25,6 +25,7 @@ ; ; SKIP_LIBRARY=librte_common_mlx5_glue ; SKIP_LIBRARY=librte_net_mlx4_glue +; SKIP_LIBRARY=librte_net_igc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Experimental APIs exceptions ;
doc/guides/nics/igc.rst +1 -1
@@ -4,7 +4,7 @@ IGC Poll Mode Driver ====================== -The IGC PMD (**librte_net_igc**) provides poll mode driver support for Foxville +The IGC PMD (**librte_net_e1000**) provides poll mode driver support for Foxville I225 and I226 Series Network Adapters. - For information about I225, please refer to: `Intel® Ethernet Controller I225 Series
doc/guides/rel_notes/release_25_03.rst +12 -1
@@ -93,6 +93,9 @@ New Features Added network driver for the Yunsilicon metaScale serials NICs. +* **Updated Intel e1000 driver.** + + * Added support for the Intel i225-series NICs (previously handled by net/igc). Removed Items -------------
@@ -126,12 +129,20 @@ API Changes ``__rte_packed_begin`` / ``__rte_packed_end``. * build: The Intel networking drivers: - cpfl, e1000, fm10k, i40e, iavf, ice, idpf, igc, ipn3ke and ixgbe, + cpfl, e1000, fm10k, i40e, iavf, ice, idpf, ipn3ke and ixgbe, have been moved from ``drivers/net`` to a new ``drivers/net/intel`` directory. The resulting build output, including the driver filenames, is the same, but to enable/disable these drivers via Meson option requires use of the new paths. For example, ``-Denable_drivers=/net/i40e`` becomes ``-Denable_drivers=/net/intel/i40e``. +* build: The Intel IGC networking driver was merged with e1000 driver and is no + longer provided as a separate driver. The resulting build output will not have + the ``librte_net_igc.*`` driver files any more, but the ``librte_net_e1000.*`` + driver files will provide support all of the devices and features of the old + driver. In addition, to enable/disable the driver via Meson option, the path + has changed from ``-Denable_drivers=net/igc`` to + ``-Denable_drivers=net/intel/e1000``. + ABI Changes -----------
drivers/net/intel/e1000/base/README +3 -1
@@ -2,7 +2,7 @@ * Copyright(c) 2010-2020 Intel Corporation */ -This directory contains source code of FreeBSD em & igb drivers of version +This directory contains source code of FreeBSD em, igb, and igc drivers of version cid-gigabit.2020.06.05.tar.gz released by ND. The sub-directory of base/ contains the original source package.
@@ -24,6 +24,8 @@ This driver is valid for the product(s) listed below * Intel® Ethernet Controller I350 Series * Intel® Ethernet Controller I210 Series * Intel® Ethernet Controller I211 +* Intel® Ethernet Controller I225 +* Intel® Ethernet Controller I226 * Intel® Ethernet Controller I354 Series * Intel® Ethernet Controller DH89XXCC Series
drivers/net/intel/e1000/igc_ethdev.c renamed from drivers/net/intel/igc/igc_ethdev.c +455 -455
1,880 lines not on this page · raw message
drivers/net/intel/e1000/igc_ethdev.h renamed from drivers/net/intel/igc/igc_ethdev.h +16 -16
@@ -9,10 +9,10 @@#include <rte_flow.h> #include <rte_time.h> -#include "base/igc_osdep.h" -#include "base/igc_hw.h" -#include "base/igc_i225.h" -#include "base/igc_api.h" +#include "base/e1000_osdep.h" +#include "base/e1000_hw.h" +#include "base/e1000_i225.h" +#include "base/e1000_api.h" #ifdef __cplusplusextern "C" {
@@ -55,13 +55,13 @@ extern "C" {#define IGC_RX_DESCRIPTOR_MULTIPLE 8#define IGC_RXD_ALIGN ((uint16_t)(IGC_ALIGN / \ - sizeof(union igc_adv_rx_desc))) + sizeof(union e1000_adv_rx_desc)))#define IGC_TXD_ALIGN ((uint16_t)(IGC_ALIGN / \ - sizeof(union igc_adv_tx_desc))) + sizeof(union e1000_adv_tx_desc)))#define IGC_MIN_TXD IGC_TX_DESCRIPTOR_MULTIPLE -#define IGC_MAX_TXD ((uint16_t)(0x80000 / sizeof(union igc_adv_tx_desc))) +#define IGC_MAX_TXD ((uint16_t)(0x80000 / sizeof(union e1000_adv_tx_desc)))#define IGC_MIN_RXD IGC_RX_DESCRIPTOR_MULTIPLE -#define IGC_MAX_RXD ((uint16_t)(0x80000 / sizeof(union igc_adv_rx_desc))) +#define IGC_MAX_RXD ((uint16_t)(0x80000 / sizeof(union e1000_adv_rx_desc)))#define IGC_TX_MAX_SEG UINT8_MAX#define IGC_TX_MAX_MTU_SEG UINT8_MAX
@@ -224,8 +224,8 @@ TAILQ_HEAD(igc_flow_list, rte_flow);* Structure to store private data for each driver instance (for each port). */ struct igc_adapter { -struct igc_hw hw; -struct igc_hw_stats stats; +struct e1000_hw hw; +struct e1000_hw_stats stats;struct igc_hw_queue_stats queue_stats;int16_t txq_stats_map[IGC_QUEUE_PAIRS_NUM ];int16_t rxq_stats_map[IGC_QUEUE_PAIRS_NUM ];
@@ -268,27 +268,27 @@ struct igc_adapter { (&((struct igc_adapter *)(_dev)->data->dev_private)->flow_list)static inline void -igc_read_reg_check_set_bits (struct igc_hw *hw,uint32_t reg,uint32_t bits) +igc_read_reg_check_set_bits (struct e1000_hw *hw,uint32_t reg,uint32_t bits) { -uint32_t reg_val =IGC_READ_REG (hw, reg); +uint32_t reg_val =E1000_READ_REG (hw, reg); bits |= reg_val;if (bits == reg_val)return ;/* no need to write back */ -IGC_WRITE_REG (hw, reg, bits); +E1000_WRITE_REG (hw, reg, bits); }static inline void -igc_read_reg_check_clear_bits (struct igc_hw *hw,uint32_t reg,uint32_t bits) +igc_read_reg_check_clear_bits (struct e1000_hw *hw,uint32_t reg,uint32_t bits) { -uint32_t reg_val =IGC_READ_REG (hw, reg); +uint32_t reg_val =E1000_READ_REG (hw, reg); bits = reg_val & ~bits;if (bits == reg_val)return ;/* no need to write back */ -IGC_WRITE_REG (hw, reg, bits); +E1000_WRITE_REG (hw, reg, bits); }#ifdef __cplusplus
drivers/net/intel/e1000/igc_filter.c renamed from drivers/net/intel/igc/igc_filter.c +42 -42
190 lines not on this page · raw message
drivers/net/intel/e1000/igc_filter.h renamed from drivers/net/intel/igc/igc_filter.h +0 -0
drivers/net/intel/e1000/igc_flow.c renamed from drivers/net/intel/igc/igc_flow.c +1 -1
@@ -3,7 +3,7 @@*/ #include "rte_malloc.h" -#include "igc_logs.h" +#include "e1000_logs.h" #include "igc_txrx.h" #include "igc_filter.h" #include "igc_flow.h"
drivers/net/intel/e1000/igc_flow.h renamed from drivers/net/intel/igc/igc_flow.h +0 -0
drivers/net/intel/e1000/igc_logs.c renamed from drivers/net/intel/igc/igc_logs.c +1 -1
@@ -4,7 +4,7 @@#include <rte_common.h> -#include "igc_logs.h" +#include "e1000_logs.h" RTE_LOG_REGISTER_SUFFIX (igc_logtype_init, init,INFO );RTE_LOG_REGISTER_SUFFIX (igc_logtype_driver, driver,INFO );
drivers/net/intel/e1000/igc_txrx.c renamed from drivers/net/intel/igc/igc_txrx.c +188 -188
759 lines not on this page · raw message
drivers/net/intel/e1000/igc_txrx.h renamed from drivers/net/intel/igc/igc_txrx.h +3 -3
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.5
Part of the diff is not shown here. View the raw message.
PATCH v3 3/36 net/igc: remove the driver
In reply to Anatoly BurakovNow that e1000 and igc drivers have been merged, remove the igc driver directory. This removes:
- igc base driver directory together with all files in it
- igc logs header file
- igc and igc base meson build files
- igc README file
--- drivers/net/intel/igc/base/README | 29 - drivers/net/intel/igc/base/igc_82571.h | 36 - drivers/net/intel/igc/base/igc_82575.h | 351 -- drivers/net/intel/igc/base/igc_api.c | 1853 --------- drivers/net/intel/igc/base/igc_api.h | 111 - drivers/net/intel/igc/base/igc_base.c | 190 - drivers/net/intel/igc/base/igc_base.h | 127 - drivers/net/intel/igc/base/igc_defines.h | 1671 -------- drivers/net/intel/igc/base/igc_hw.h | 1059 ------ drivers/net/intel/igc/base/igc_i225.c | 1380 ------- drivers/net/intel/igc/base/igc_i225.h | 110 - drivers/net/intel/igc/base/igc_ich8lan.h | 296 -- drivers/net/intel/igc/base/igc_mac.c | 2102 ---------- drivers/net/intel/igc/base/igc_mac.h | 64 - drivers/net/intel/igc/base/igc_manage.c | 547 --- drivers/net/intel/igc/base/igc_manage.h | 65 - drivers/net/intel/igc/base/igc_nvm.c | 1324 ------- drivers/net/intel/igc/base/igc_nvm.h | 69 - drivers/net/intel/igc/base/igc_osdep.c | 64 - drivers/net/intel/igc/base/igc_osdep.h | 163 - drivers/net/intel/igc/base/igc_phy.c | 4418 ---------------------- drivers/net/intel/igc/base/igc_phy.h | 337 -- drivers/net/intel/igc/base/igc_regs.h | 732 ---- drivers/net/intel/igc/base/meson.build | 19 - drivers/net/intel/igc/igc_logs.h | 43 - drivers/net/intel/igc/meson.build | 21 - 26 files changed, 17181 deletions(-) delete mode 100644 drivers/net/intel/igc/base/README delete mode 100644 drivers/net/intel/igc/base/igc_82571.h delete mode 100644 drivers/net/intel/igc/base/igc_82575.h delete mode 100644 drivers/net/intel/igc/base/igc_api.c delete mode 100644 drivers/net/intel/igc/base/igc_api.h delete mode 100644 drivers/net/intel/igc/base/igc_base.c delete mode 100644 drivers/net/intel/igc/base/igc_base.h delete mode 100644 drivers/net/intel/igc/base/igc_defines.h delete mode 100644 drivers/net/intel/igc/base/igc_hw.h delete mode 100644 drivers/net/intel/igc/base/igc_i225.c delete mode 100644 drivers/net/intel/igc/base/igc_i225.h delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h delete mode 100644 drivers/net/intel/igc/base/igc_mac.c delete mode 100644 drivers/net/intel/igc/base/igc_mac.h delete mode 100644 drivers/net/intel/igc/base/igc_manage.c delete mode 100644 drivers/net/intel/igc/base/igc_manage.h delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h delete mode 100644 drivers/net/intel/igc/base/igc_phy.c delete mode 100644 drivers/net/intel/igc/base/igc_phy.h delete mode 100644 drivers/net/intel/igc/base/igc_regs.h delete mode 100644 drivers/net/intel/igc/base/meson.build delete mode 100644 drivers/net/intel/igc/igc_logs.h delete mode 100644 drivers/net/intel/igc/meson.build
drivers/net/intel/igc/base/README deleted +0 -29
@@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2020 Intel Corporation - */ - -Intel® IGC driver -================== - -This directory contains source code of FreeBSD igc driver of version -2019.10.18 released by the team which develops basic drivers for any -i225 NIC. -The directory of base/ contains the original source package. -This driver is valid for the product(s) listed below - -* Intel® Ethernet Network Adapters I225 - -Updating the driver -=================== - -NOTE: -- To avoid namespace issues with e1000 PMD, all prefix e1000_ or E1000_ -of the definition, macro and file names ware replaced with igc_ or IGC_. -- Since some codes are not required, they have been removed from the -base codes, such as the I350 and I210 series NICs related codes. -- Some registers are used by the base codes but not defined in the base -codes, so they ware added to them. -- OS and DPDK specified definitions and macros ware added in following -files: - igc_osdep.h - igc_osdep.c
drivers/net/intel/igc/base/igc_82571.h deleted +0 -36
@@ -1,36 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2001-2020 Intel Corporation -*/ - -#ifndef _IGC_82571_H_ -#define _IGC_82571_H_ - -#define ID_LED_RESERVED_F746 0xF746 -#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \ - (ID_LED_OFF1_ON2 << 8) | \ - (ID_LED_DEF1_DEF2 << 4) | \ - (ID_LED_DEF1_DEF2)) - -#define IGC_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 -#define AN_RETRY_COUNT 5/* Autoneg Retry Count value */ - -/* Intr Throttling - RW */ -#define IGC_EITR_82574 (_n) (0x000E8 + (0x4 * (_n))) - -#define IGC_EIAC_82574 0x000DC/* Ext. Interrupt Auto Clear - RW */ -#define IGC_EIAC_MASK_82574 0x01F00000 - -#define IGC_IVAR_INT_ALLOC_VALID 0x8 - -/* Manageability Operation Mode mask */ -#define IGC_NVM_INIT_CTRL2_MNGM 0x6000 - -#define IGC_BASE1000T_STATUS 10 -#define IGC_IDLE_ERROR_COUNT_MASK 0xFF -#define IGC_RECEIVE_ERROR_COUNTER 21 -#define IGC_RECEIVE_ERROR_MAX 0xFFFF -bool igc_check_phy_82574 (struct igc_hw *hw); -bool igc_get_laa_state_82571 (struct igc_hw *hw); -void igc_set_laa_state_82571 (struct igc_hw *hw,bool state); - -#endif
drivers/net/intel/igc/base/igc_82575.h deleted +0 -351
351 lines not on this page · raw message
drivers/net/intel/igc/base/igc_api.c deleted +0 -1853
1,853 lines not on this page · raw message
drivers/net/intel/igc/base/igc_api.h deleted +0 -111
111 lines not on this page · raw message
drivers/net/intel/igc/base/igc_base.c deleted +0 -190
190 lines not on this page · raw message
drivers/net/intel/igc/base/igc_base.h deleted +0 -127
127 lines not on this page · raw message
drivers/net/intel/igc/base/igc_defines.h deleted +0 -1671
303 lines not on this page · raw message
drivers/net/intel/igc/base/igc_hw.h deleted +0 -1059
1,059 lines not on this page · raw message
drivers/net/intel/igc/base/igc_i225.c deleted +0 -1380
1,380 lines not on this page · raw message
drivers/net/intel/igc/base/igc_i225.h deleted +0 -110
110 lines not on this page · raw message
drivers/net/intel/igc/base/igc_ich8lan.h deleted +0 -296
296 lines not on this page · raw message
drivers/net/intel/igc/base/igc_mac.c deleted +0 -2102
2,102 lines not on this page · raw message
drivers/net/intel/igc/base/igc_mac.h deleted +0 -64
64 lines not on this page · raw message
drivers/net/intel/igc/base/igc_manage.c deleted +0 -547
547 lines not on this page · raw message
drivers/net/intel/igc/base/igc_manage.h deleted +0 -65
65 lines not on this page · raw message
drivers/net/intel/igc/base/igc_nvm.c deleted +0 -1324
1,324 lines not on this page · raw message
drivers/net/intel/igc/base/igc_nvm.h deleted +0 -69
69 lines not on this page · raw message
drivers/net/intel/igc/base/igc_osdep.c deleted +0 -64
64 lines not on this page · raw message
drivers/net/intel/igc/base/igc_osdep.h deleted +0 -163
163 lines not on this page · raw message
drivers/net/intel/igc/base/igc_phy.c deleted +0 -4418
4,418 lines not on this page · raw message
drivers/net/intel/igc/base/igc_phy.h deleted +0 -337
337 lines not on this page · raw message
drivers/net/intel/igc/base/igc_regs.h deleted +0 -732
732 lines not on this page · raw message
drivers/net/intel/igc/base/meson.build deleted +0 -19
Lines of this file are not shown. View the raw message.
drivers/net/intel/igc/igc_logs.h deleted +0 -43
43 lines not on this page · raw message
drivers/net/intel/igc/meson.build deleted +0 -21
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.5
Part of the diff is not shown here. View the raw message.
PATCH v3 4/36 net/e1000/base: remove unused parameter workaround
In reply to Anatoly BurakovCurrently, e1000 base code is compiled with removing warning for unused parameters. The e1000 codebase does define a few macros to suppress unused parameters explicitly and dilligently uses them where they are needed, but the definitions for these macros are empty in e1000 osdep file, which is probably the reason why the workaround for the warning was added in the first place.
We address that by making them meaningful by using RTE_SET_USED macro, so that we can use them for their intended purposes. The meson file workaround can now be removed. After removing the workaround, there is a bunch of warnings coming from osdep.c file, so fix those too.
While we're at it, also fix trailing whitespace as well as unnecessary FreeBSD license header tags that were used internally at the time the code was generated.
--- drivers/net/intel/e1000/base/e1000_osdep.c | 11 +++++++---- drivers/net/intel/e1000/base/e1000_osdep.h | 23 ++++++++++++++++------ drivers/net/intel/e1000/base/meson.build | 12 +---------- 3 files changed, 25 insertions(+), 21 deletions(-)
drivers/net/intel/e1000/base/e1000_osdep.c +7 -4
@@ -1,12 +1,11 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2001 - 2015 Intel Corporation */ -/*$FreeBSD$*/ #include "e1000_api.h" /* -* NOTE: the following routines using the e1000 +* NOTE: the following routines using the e1000 * naming style are provided to the shared * code but are OS specific */
@@ -14,24 +13,26 @@void e1000_write_pci_cfg (struct e1000_hw *hw,u32 reg,u16 *value) { -return ; +UNREFERENCED_3PARAMETER (hw, reg, value); }void e1000_read_pci_cfg (struct e1000_hw *hw,u32 reg,u16 *value) { +UNREFERENCED_2PARAMETER (hw, reg); *value =0 ; -return ; }void e1000_pci_set_mwi (struct e1000_hw *hw) { +UNREFERENCED_1PARAMETER (hw); }void e1000_pci_clear_mwi (struct e1000_hw *hw) { +UNREFERENCED_1PARAMETER (hw); }
@@ -41,6 +42,7 @@ e1000_pci_clear_mwi(struct e1000_hw *hw)int32_t e1000_read_pcie_cap_reg (struct e1000_hw *hw,u32 reg,u16 *value) { +UNREFERENCED_3PARAMETER (hw, reg, value);return E1000_NOT_IMPLEMENTED ; }
@@ -50,5 +52,6 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)int32_t e1000_write_pcie_cap_reg (struct e1000_hw *hw,u32 reg,u16 *value) { +UNREFERENCED_3PARAMETER (hw, reg, value);return E1000_NOT_IMPLEMENTED ; }
drivers/net/intel/e1000/base/e1000_osdep.h +17 -6
@@ -1,7 +1,6 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2001 - 2015 Intel Corporation */ -/*$FreeBSD$*/ #ifndef _E1000_OSDEP_H_#define _E1000_OSDEP_H_
@@ -35,12 +34,24 @@#define DEBUGOUT7 (S , ...) DEBUGOUT(S, ##__VA_ARGS__)#ifndef UNREFERENCED_PARAMETER -#define UNREFERENCED_PARAMETER (_p) +#define UNREFERENCED_PARAMETER (_p) RTE_SET_USED(_p)#endif -#define UNREFERENCED_1PARAMETER (_p) -#define UNREFERENCED_2PARAMETER (_p, _q) -#define UNREFERENCED_3PARAMETER (_p, _q, _r) -#define UNREFERENCED_4PARAMETER (_p, _q, _r, _s) +#define UNREFERENCED_1PARAMETER (_p) RTE_SET_USED(_p) +#define UNREFERENCED_2PARAMETER (_p, _q) do { \ + RTE_SET_USED(_p); \ + RTE_SET_USED(_q); \ +} while (0) +#define UNREFERENCED_3PARAMETER (_p, _q, _r) do { \ + RTE_SET_USED(_p); \ + RTE_SET_USED(_q); \ + RTE_SET_USED(_r); \ +} while (0) +#define UNREFERENCED_4PARAMETER (_p, _q, _r, _s) do { \ + RTE_SET_USED(_p); \ + RTE_SET_USED(_q); \ + RTE_SET_USED(_r); \ + RTE_SET_USED(_s); \ +} while (0)#define FALSE 0#define TRUE 1
drivers/net/intel/e1000/base/meson.build +1 -11
@@ -23,17 +23,7 @@ sources = [ 'e1000_vf.c', ] -error_cflags = [ - '-Wno-unused-parameter', -] -c_args = cflags -foreach flag: error_cflags - if cc.has_argument(flag) - c_args += flag - endif -endforeach - base_lib = static_library('e1000_base', sources, dependencies: static_rte_eal, - c_args: c_args) + c_args: cflags) base_objs = base_lib.extract_all_objects(recursive: true)
Signature · 1 line
2.43.5
PATCH v3 5/36 net/e1000: add missing i225 devices
In reply to Anatoly BurakovAdd missing i225 devices to the list of supported devices by IGC driver, as well as resort the device list to match sorting order of definitions in the base code.
--- drivers/net/intel/e1000/base/e1000_api.c | 5 +++-- drivers/net/intel/e1000/base/e1000_hw.h | 18 ++++++++++-------- drivers/net/intel/e1000/base/e1000_phy.c | 5 ++++- drivers/net/intel/e1000/igc_ethdev.c | 14 +++++++++----- 4 files changed, 26 insertions(+), 16 deletions(-)
drivers/net/intel/e1000/base/e1000_api.c +3 -2
@@ -362,11 +362,12 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_I225_IT :case E1000_DEV_ID_I220_V :case E1000_DEV_ID_I225_BLANK_NVM : -case E1000_DEV_ID_I226_K : -case E1000_DEV_ID_I226_LMVP :case E1000_DEV_ID_I226_LM :case E1000_DEV_ID_I226_V :case E1000_DEV_ID_I226_IT : +case E1000_DEV_ID_I226_K : +case E1000_DEV_ID_I221_V : +case E1000_DEV_ID_I226_LMVP :case E1000_DEV_ID_I226_BLANK_NVM : mac->type = e1000_i225;break ;
drivers/net/intel/e1000/base/e1000_hw.h +10 -8
@@ -169,19 +169,21 @@ struct e1000_hw;#define E1000_DEV_ID_I210_SGMII_FLASHLESS 0x15F6#define E1000_DEV_ID_I211_COPPER 0x1539#define E1000_DEV_ID_I225_LM 0x15F2 -#define E1000_DEV_ID_I225_LMVP 0x5502#define E1000_DEV_ID_I225_V 0x15F3#define E1000_DEV_ID_I225_K 0x3100 -#define E1000_DEV_ID_I225_I 0x15F8 +#define E1000_DEV_ID_I225_K2 0x3101 +#define E1000_DEV_ID_I225_LMVP 0x5502#define E1000_DEV_ID_I225_IT 0x0D9F +#define E1000_DEV_ID_I225_I 0x15F8#define E1000_DEV_ID_I220_V 0x15F7#define E1000_DEV_ID_I225_BLANK_NVM 0x15FD -#define E1000_DEV_ID_I226_K 0x3102 -#define E1000_DEV_ID_I226_LMVP 0x5503 -#define E1000_DEV_ID_I226_LM 0x125B -#define E1000_DEV_ID_I226_V 0x125C -#define E1000_DEV_ID_I226_IT 0x125D -#define E1000_DEV_ID_I226_BLANK_NVM 0x125F +#define E1000_DEV_ID_I226_LM 0x125B +#define E1000_DEV_ID_I226_V 0x125C +#define E1000_DEV_ID_I226_IT 0x125D +#define E1000_DEV_ID_I226_K 0x3102 +#define E1000_DEV_ID_I221_V 0x125E +#define E1000_DEV_ID_I226_LMVP 0x5503 +#define E1000_DEV_ID_I226_BLANK_NVM 0x125F#define E1000_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40#define E1000_DEV_ID_I354_SGMII 0x1F41#define E1000_DEV_ID_I354_BACKPLANE_2_5GBPS 0x1F45
drivers/net/intel/e1000/base/e1000_phy.c +4 -1
@@ -1910,6 +1910,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)case M88E1512_E_PHY_ID :case I210_I_PHY_ID :case I225_I_PHY_ID : +case I226_LM_PHY_ID : reset_dsp = false;break ;default :
@@ -1951,7 +1952,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)return E1000_SUCCESS ;if (hw->phy.id ==I210_I_PHY_ID )return E1000_SUCCESS ; -if (hw->phy.id ==I225_I_PHY_ID ) +if (hw->phy.id ==I225_I_PHY_ID || hw->phy.id ==I226_LM_PHY_ID )return E1000_SUCCESS ;if ((hw->phy.id ==M88E1543_E_PHY_ID ) || (hw->phy.id ==M88E1512_E_PHY_ID ))
@@ -2510,6 +2511,7 @@ s32 e1000_get_cable_length_m88_gen2(struct e1000_hw *hw) phy->cable_length = phy_data / (is_cm ?100 :1 );break ;case I225_I_PHY_ID : +case I226_LM_PHY_ID :break ;case M88E1543_E_PHY_ID :case M88E1512_E_PHY_ID :
@@ -3091,6 +3093,7 @@ enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id) phy_type = e1000_phy_i210;break ;case I225_I_PHY_ID : +case I226_LM_PHY_ID : phy_type = e1000_phy_i225;break ;default :
drivers/net/intel/e1000/igc_ethdev.c +9 -5
@@ -107,16 +107,20 @@ static const struct rte_eth_desc_lim tx_desc_lim = {static const struct rte_pci_id pci_id_igc_map[] = { {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_LM ) }, - {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_LMVP ) }, {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_V ) }, - {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_I ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_K ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_K2 ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_LMVP ) }, {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_IT ) }, - {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_K ) }, - {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_K ) }, - {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_LMVP ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_I ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I220_V ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I225_BLANK_NVM ) }, {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_LM ) }, {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_V ) }, {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_IT ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_K ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I221_V ) }, + {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_LMVP ) }, {RTE_PCI_DEVICE (IGC_INTEL_VENDOR_ID ,E1000_DEV_ID_I226_BLANK_NVM ) }, { .vendor_id =0 ,/* sentinel */ }, };
Signature · 1 line
2.43.5
PATCH v3 6/36 net/e1000: add missing hardware support
In reply to Anatoly BurakovSome hardware device ID's from i210 and i219 series were added over the years, but they were never added to the table of support PCI ID's for EM and IGB drivers respectively. This commit adds the missing device ID's to the table.
---
Notes:
This commit is not considered a bugfix because while the hardware in question is now treated as supported by the driver, it was never validated.
drivers/net/intel/e1000/em_ethdev.c | 8 ++++++++ drivers/net/intel/e1000/igb_ethdev.c | 1 + 2 files changed, 9 insertions(+)
drivers/net/intel/e1000/em_ethdev.c +8 -0
@@ -155,6 +155,14 @@ static const struct rte_pci_id pci_id_em_map[] = { { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_V6) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_LM7) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_V7) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM8) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V8) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM9) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V9) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM16) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V16) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM17) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V17) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM22) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V22) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM23) },
drivers/net/intel/e1000/igb_ethdev.c +1 -0
@@ -293,6 +293,7 @@ static const struct rte_pci_id pci_id_igb_map[] = { { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_FLASHLESS) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SERDES_FLASHLESS) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII_FLASHLESS) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I211_COPPER) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_BACKPLANE_1GBPS) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_SGMII) },
Signature · 1 line
2.43.5
PATCH v3 7/36 net/e1000: add support for more I219 devices
In reply to Anatoly BurakovFrom: Vitaly Lifshits <[email protected]>
Add support for new hardware ID's from the I219 series.
--- drivers/net/intel/e1000/base/e1000_api.c | 32 +++++++++++++++++ drivers/net/intel/e1000/base/e1000_hw.h | 36 +++++++++++++++++--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 21 ++++++++++++ drivers/net/intel/e1000/em_ethdev.c | 28 ++++++++++++++- 4 files changed, 112 insertions(+), 5 deletions(-)
drivers/net/intel/e1000/base/e1000_api.c +32 -0
@@ -278,6 +278,8 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_PCH_SPT_I219_V4 :case E1000_DEV_ID_PCH_SPT_I219_LM5 :case E1000_DEV_ID_PCH_SPT_I219_V5 : +case E1000_DEV_ID_PCH_CMP_I219_LM12 : +case E1000_DEV_ID_PCH_CMP_I219_V12 : mac->type = e1000_pch_spt;break ;case E1000_DEV_ID_PCH_CNP_I219_LM6 :
@@ -288,8 +290,18 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_PCH_ICP_I219_V8 :case E1000_DEV_ID_PCH_ICP_I219_LM9 :case E1000_DEV_ID_PCH_ICP_I219_V9 : +case E1000_DEV_ID_PCH_CMP_I219_LM10 : +case E1000_DEV_ID_PCH_CMP_I219_V10 : +case E1000_DEV_ID_PCH_CMP_I219_LM11 : +case E1000_DEV_ID_PCH_CMP_I219_V11 : mac->type = e1000_pch_cnp;break ; +case E1000_DEV_ID_PCH_TGP_I219_LM13 : +case E1000_DEV_ID_PCH_TGP_I219_V13 : +case E1000_DEV_ID_PCH_TGP_I219_LM14 : +case E1000_DEV_ID_PCH_TGP_I219_V14 : +case E1000_DEV_ID_PCH_TGP_I219_LM15 : +case E1000_DEV_ID_PCH_TGP_I219_V15 :case E1000_DEV_ID_PCH_ADL_I219_LM16 :case E1000_DEV_ID_PCH_ADL_I219_V16 :case E1000_DEV_ID_PCH_RPL_I219_LM23 :
@@ -302,6 +314,24 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_PCH_RPL_I219_V22 : mac->type = e1000_pch_adp;break ; +case E1000_DEV_ID_PCH_MTP_I219_LM18 : +case E1000_DEV_ID_PCH_MTP_I219_V18 : +case E1000_DEV_ID_PCH_MTP_I219_LM19 : +case E1000_DEV_ID_PCH_MTP_I219_V19 : +case E1000_DEV_ID_PCH_LNL_I219_LM20 : +case E1000_DEV_ID_PCH_LNL_I219_V20 : +case E1000_DEV_ID_PCH_ARL_I219_LM24 : +case E1000_DEV_ID_PCH_ARL_I219_V24 : + mac->type = e1000_pch_mtp; +break ; +case E1000_DEV_ID_PCH_PTP_I219_LM25 : +case E1000_DEV_ID_PCH_PTP_I219_V25 : +case E1000_DEV_ID_PCH_WCL_I219_LM27 : +case E1000_DEV_ID_PCH_WCL_I219_V27 : +case E1000_DEV_ID_PCH_NVL_I219_LM29 : +case E1000_DEV_ID_PCH_NVL_I219_V29 : + mac->type = e1000_pch_ptp; +break ;case E1000_DEV_ID_82575EB_COPPER :case E1000_DEV_ID_82575EB_FIBER_SERDES :case E1000_DEV_ID_82575GB_QUAD_COPPER :
@@ -474,6 +504,8 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)case e1000_pch_cnp:case e1000_pch_adp:case e1000_pch_tgp: +case e1000_pch_mtp: +case e1000_pch_ptp:e1000_init_function_pointers_ich8lan (hw);break ;case e1000_82575:
drivers/net/intel/e1000/base/e1000_hw.h +32 -4
@@ -124,14 +124,40 @@ struct e1000_hw;#define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0#define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1#define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 +#define E1000_DEV_ID_PCH_CMP_I219_LM10 0x0D4E +#define E1000_DEV_ID_PCH_CMP_I219_V10 0x0D4F +#define E1000_DEV_ID_PCH_CMP_I219_LM11 0x0D4C +#define E1000_DEV_ID_PCH_CMP_I219_V11 0x0D4D +#define E1000_DEV_ID_PCH_CMP_I219_LM12 0x0D53 +#define E1000_DEV_ID_PCH_CMP_I219_V12 0x0D55 +#define E1000_DEV_ID_PCH_TGP_I219_LM13 0x15FB +#define E1000_DEV_ID_PCH_TGP_I219_V13 0x15FC +#define E1000_DEV_ID_PCH_TGP_I219_LM14 0x15F9 +#define E1000_DEV_ID_PCH_TGP_I219_V14 0x15FA +#define E1000_DEV_ID_PCH_TGP_I219_LM15 0x15F4 +#define E1000_DEV_ID_PCH_TGP_I219_V15 0x15F5#define E1000_DEV_ID_PCH_ADL_I219_LM16 0x1A1E#define E1000_DEV_ID_PCH_ADL_I219_V16 0x1A1F#define E1000_DEV_ID_PCH_ADL_I219_LM17 0x1A1C#define E1000_DEV_ID_PCH_ADL_I219_V17 0x1A1D -#define E1000_DEV_ID_PCH_RPL_I219_LM23 0x0DC5 -#define E1000_DEV_ID_PCH_RPL_I219_V23 0x0DC6 -#define E1000_DEV_ID_PCH_RPL_I219_LM22 0x0DC7 -#define E1000_DEV_ID_PCH_RPL_I219_V22 0x0DC8 +#define E1000_DEV_ID_PCH_MTP_I219_LM18 0x550A +#define E1000_DEV_ID_PCH_MTP_I219_V18 0x550B +#define E1000_DEV_ID_PCH_MTP_I219_LM19 0x550C +#define E1000_DEV_ID_PCH_MTP_I219_V19 0x550D +#define E1000_DEV_ID_PCH_LNL_I219_LM20 0x550E +#define E1000_DEV_ID_PCH_LNL_I219_V20 0x550F +#define E1000_DEV_ID_PCH_RPL_I219_LM22 0x0DC7 +#define E1000_DEV_ID_PCH_RPL_I219_V22 0x0DC8 +#define E1000_DEV_ID_PCH_RPL_I219_LM23 0x0DC5 +#define E1000_DEV_ID_PCH_RPL_I219_V23 0x0DC6 +#define E1000_DEV_ID_PCH_ARL_I219_LM24 0x57A0 +#define E1000_DEV_ID_PCH_ARL_I219_V24 0x57A1 +#define E1000_DEV_ID_PCH_PTP_I219_LM25 0x57B3 +#define E1000_DEV_ID_PCH_PTP_I219_V25 0x57B4 +#define E1000_DEV_ID_PCH_WCL_I219_LM27 0x57B7 +#define E1000_DEV_ID_PCH_WCL_I219_V27 0x57B8 +#define E1000_DEV_ID_PCH_NVL_I219_LM29 0x57B9 +#define E1000_DEV_ID_PCH_NVL_I219_V29 0x57BA#define E1000_DEV_ID_82576 0x10C9#define E1000_DEV_ID_82576_FIBER 0x10E6#define E1000_DEV_ID_82576_SERDES 0x10E7
@@ -237,6 +263,8 @@ enum e1000_mac_type { e1000_pch_spt, e1000_pch_cnp, e1000_pch_adp, + e1000_pch_mtp, + e1000_pch_ptp, e1000_pch_tgp, e1000_82575, e1000_82576,
drivers/net/intel/e1000/base/e1000_ich8lan.c +21 -0
@@ -314,7 +314,10 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)case e1000_pch_lpt:case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp:if (e1000_phy_is_accessible_pchlan (hw))break ;
@@ -464,7 +467,10 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)case e1000_pch_lpt:case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp:/* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */
@@ -768,7 +774,10 @@ STATIC s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)case e1000_pch_lpt:case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp:/* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan;
@@ -1757,7 +1766,10 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw)case e1000_pch_lpt:case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp: hw->phy.ops.init_params = e1000_init_phy_params_pchlan;break ;default :
@@ -2223,7 +2235,10 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)case e1000_pch_lpt:case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp: sw_cfg_mask =E1000_FEXTNVM_SW_CONFIG_ICH8M ;break ;default :
@@ -3344,7 +3359,10 @@ STATIC s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)switch (hw->mac.type) {case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp: bank1_offset = nvm->flash_bank_size; act_offset =E1000_ICH_NVM_SIG_WORD ;
@@ -4316,7 +4334,10 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)case e1000_pch_lpt:case e1000_pch_spt:case e1000_pch_cnp: +case e1000_pch_tgp:case e1000_pch_adp: +case e1000_pch_mtp: +case e1000_pch_ptp: word =NVM_COMPAT ; valid_csum_mask =NVM_COMPAT_VALID_CSUM ;break ;
drivers/net/intel/e1000/em_ethdev.c +27 -1
@@ -159,14 +159,34 @@ static const struct rte_pci_id pci_id_em_map[] = { { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V8) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM9) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V9) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM10) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V10) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM11) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V11) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM12) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V12) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM13) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V13) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM14) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V14) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM15) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V15) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM16) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V16) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM17) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V17) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_LM18) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_V18) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_LM19) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_V19) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LNL_I219_LM20) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LNL_I219_V20) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM22) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V22) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM23) }, { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V23) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ARL_I219_LM24) }, + { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ARL_I219_V24) }, { .vendor_id = 0, /* sentinel */ }, };
@@ -501,6 +521,8 @@ em_set_pba(struct e1000_hw *hw)case e1000_pch_cnp:case e1000_pch_adp:case e1000_pch_tgp: +case e1000_pch_mtp: +case e1000_pch_ptp: pba =E1000_PBA_26K ;break ;default :
@@ -873,7 +895,9 @@ em_hardware_init(struct e1000_hw *hw) hw->mac.type == e1000_pch_spt || hw->mac.type == e1000_pch_cnp || hw->mac.type == e1000_pch_adp || - hw->mac.type == e1000_pch_tgp) { + hw->mac.type == e1000_pch_tgp || + hw->mac.type == e1000_pch_mtp || + hw->mac.type == e1000_pch_ptp) { hw->fc.requested_mode = e1000_fc_full; }
@@ -1056,6 +1080,8 @@ em_get_max_pktlen(struct rte_eth_dev *dev)case e1000_pch_cnp:case e1000_pch_adp:case e1000_pch_tgp: +case e1000_pch_mtp: +case e1000_pch_ptp:case e1000_82574:case e1000_80003es2lan:/* 9K Jumbo Frame size */ case e1000_82583:
Signature · 1 line
2.43.5
Re: [PATCH v3 07/36] net/e1000: add support for more I219 devices
Quoted 7 lines · Anatoly Burakov
From: Vitaly Lifshits <[email protected]>
Add support for new hardware ID's from the I219 series.
Signed-off-by Vitaly Lifshits <[email protected]>Signed-off-by Anatoly Burakov <[email protected]>---
Should i219 be added to the base code README as a supported device family? If so, I can just add on apply, if no other issues with this set.
/Bruce
Quoted 6 lines
drivers/net/intel/e1000/base/e1000_api.c | 32 +++++++++++++++++ drivers/net/intel/e1000/base/e1000_hw.h | 36 +++++++++++++++++--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 21 ++++++++++++ drivers/net/intel/e1000/em_ethdev.c | 28 ++++++++++++++- 4 files changed, 112 insertions(+), 5 deletions(-)
Re: [PATCH v3 07/36] net/e1000: add support for more I219 devices
Quoted 11 lines · Bruce Richardson
Quoted 7 lines · Anatoly Burakov
From: Vitaly Lifshits <[email protected]>
Add support for new hardware ID's from the I219 series.
Signed-off-by Vitaly Lifshits <[email protected]>Signed-off-by Anatoly Burakov <[email protected]>---
Should i219 be added to the base code README as a supported device family? If so, I can just add on apply, if no other issues with this set.
i219 NICs were already supported by the driver. This is just adding missing *kinds* of i219 NICs. However, I can see that the support for i219 was called out in 17.02 release notes:
31d4210971c54952afc9a1455ca40861634206e0 net/e1000/base: announce supported devices
Document all supported NICs.
Add Intel I219 NICs support in release note.
It was not added to the list of supported NICs in igb documentation. So, yes, I think it is worth calling out support in this patch.
Quoted 9 lines
/Bruce
Quoted 6 lines
drivers/net/intel/e1000/base/e1000_api.c | 32 +++++++++++++++++ drivers/net/intel/e1000/base/e1000_hw.h | 36 +++++++++++++++++--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 21 ++++++++++++ drivers/net/intel/e1000/em_ethdev.c | 28 ++++++++++++++- 4 files changed, 112 insertions(+), 5 deletions(-)
Signature · 2 lines
Thanks, Anatoly
Re: [PATCH v3 07/36] net/e1000: add support for more I219 devices
Quoted 20 lines · Anatoly
Quoted 11 lines · Bruce Richardson
Quoted 7 lines · Anatoly Burakov
From: Vitaly Lifshits <[email protected]>
Add support for new hardware ID's from the I219 series.
Signed-off-by Vitaly Lifshits <[email protected]>Signed-off-by Anatoly Burakov <[email protected]>---
Should i219 be added to the base code README as a supported device family? If so, I can just add on apply, if no other issues with this set.
i219 NICs were already supported by the driver. This is just adding missing *kinds* of i219 NICs. However, I can see that the support for i219 was called out in 17.02 release notes:
31d4210971c54952afc9a1455ca40861634206e0net/e1000/base: announce supported devices
Quoted 8 lines
Document all supported NICs.
Add Intel I219 NICs support in release note.Signed-off-by Wenzhuo Lu <[email protected]>It was not added to the list of supported NICs in igb documentation. So, yes, I think it is worth calling out support in this patch.
For i219, I see that it is actually in the list of devices given in the REAME, with the list in that doc not being in sorted order, but more in order of which sub-driver (e1000, igb and igc) supports them. The original e1000 driver is the one supporting i219, so it's earlier in the list, which is why I missed it.
For other docs, the e1000 driver guide doesn't call out the various families of HW NICs supported, so no minor update needed there either it seem. I'll therefore take this patch as-is.
/Bruce
PATCH v3 8/36 net/e1000/base: correct formatting differences
In reply to Anatoly BurakovThere are some mismatches between what's in the internal driver shared code, and what is the case in net/e1000. This patch fixes the following issues:
- Unneeded #ifndef clause
- Missing comments
- Duplicate definitions
- Moved definitions
- Extraneous fall-through comments
- Function comments not matching function names
- Typos in comments
- Wrong or misleading indentation
- Differences in whitespace
- Missing parentheses
- Extra line breaks
--- drivers/net/intel/e1000/base/e1000_82575.c | 8 ---- drivers/net/intel/e1000/base/e1000_82575.h | 29 ------------ drivers/net/intel/e1000/base/e1000_api.c | 2 - drivers/net/intel/e1000/base/e1000_base.c | 4 +- drivers/net/intel/e1000/base/e1000_defines.h | 50 +++++++++++++++----- drivers/net/intel/e1000/base/e1000_i225.c | 24 +++++----- drivers/net/intel/e1000/base/e1000_mac.c | 4 +- drivers/net/intel/e1000/base/e1000_nvm.c | 7 +-- drivers/net/intel/e1000/base/e1000_osdep.h | 12 ----- drivers/net/intel/e1000/base/e1000_phy.c | 10 ++-- drivers/net/intel/e1000/base/e1000_regs.h | 21 ++------ 11 files changed, 63 insertions(+), 108 deletions(-)
drivers/net/intel/e1000/base/e1000_82575.c +0 -8
@@ -1497,21 +1497,14 @@ STATIC s32 e1000_setup_copper_link_82575(struct e1000_hw *hw) }switch (hw->phy.type) {case e1000_phy_i210: -/* Fall through */ case e1000_phy_m88:switch (hw->phy.id) {case I347AT4_E_PHY_ID : -/* Fall through */ case M88E1112_E_PHY_ID : -/* Fall through */ case M88E1340M_E_PHY_ID : -/* Fall through */ case M88E1543_E_PHY_ID : -/* Fall through */ case M88E1512_E_PHY_ID : -/* Fall through */ case I210_I_PHY_ID : -/* Fall through */ ret_val =e1000_copper_link_setup_m88_gen2 (hw);break ;default :
@@ -1721,7 +1714,6 @@ STATIC s32 e1000_get_media_type_82575(struct e1000_hw *hw) dev_spec->sgmii_active = true;break ; } -/* Fall through for I2C based SGMII */ /* Fall through */ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES :/* read media type from SFP EEPROM */
drivers/net/intel/e1000/base/e1000_82575.h +0 -29
@@ -90,11 +90,8 @@ struct e1000_adv_context_desc { };/* SRRCTL bit definitions */ -#define E1000_SRRCTL_BSIZEPKT_SHIFT 10/* Shift _right_ */ #define E1000_SRRCTL_BSIZEHDRSIZE_MASK 0x00000F00 -#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT 2/* Shift _left_ */ #define E1000_SRRCTL_DESCTYPE_LEGACY 0x00000000 -#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT 0x04000000#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION 0x06000000
@@ -210,36 +207,10 @@ struct e1000_adv_context_desc {#define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000#define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000 -/* Adv Transmit Descriptor Config Masks */ -#define E1000_ADVTXD_DTYP_CTXT 0x00200000/* Advanced Context Descriptor */ -#define E1000_ADVTXD_DTYP_DATA 0x00300000/* Advanced Data Descriptor */ -#define E1000_ADVTXD_DCMD_EOP 0x01000000/* End of Packet */ -#define E1000_ADVTXD_DCMD_IFCS 0x02000000/* Insert FCS (Ethernet CRC) */ -#define E1000_ADVTXD_DCMD_RS 0x08000000/* Report Status */ -#define E1000_ADVTXD_DCMD_DDTYP_ISCSI 0x10000000/* DDP hdr type or iSCSI */ -#define E1000_ADVTXD_DCMD_DEXT 0x20000000/* Descriptor extension (1=Adv) */ -#define E1000_ADVTXD_DCMD_VLE 0x40000000/* VLAN pkt enable */ -#define E1000_ADVTXD_DCMD_TSE 0x80000000/* TCP Seg enable */ -#define E1000_ADVTXD_MAC_LINKSEC 0x00040000/* Apply LinkSec on pkt */ -#define E1000_ADVTXD_MAC_TSTAMP 0x00080000/* IEEE1588 Timestamp pkt */ -#define E1000_ADVTXD_STAT_SN_CRC 0x00000002/* NXTSEQ/SEED prsnt in WB */ -#define E1000_ADVTXD_IDX_SHIFT 4/* Adv desc Index shift */ -#define E1000_ADVTXD_POPTS_ISCO_1ST 0x00000000/* 1st TSO of iSCSI PDU */ -#define E1000_ADVTXD_POPTS_ISCO_MDL 0x00000800/* Middle TSO of iSCSI PDU */ -#define E1000_ADVTXD_POPTS_ISCO_LAST 0x00001000/* Last TSO of iSCSI PDU */ -/* 1st & Last TSO-full iSCSI PDU*/ -#define E1000_ADVTXD_POPTS_ISCO_FULL 0x00001800 -#define E1000_ADVTXD_POPTS_IPSEC 0x00000400/* IPSec offload request */ -#define E1000_ADVTXD_PAYLEN_SHIFT 14/* Adv desc PAYLEN shift */ - -/* Additional Transmit Descriptor Control definitions */ -#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000/* Ena specific Tx Queue */ #define E1000_TXDCTL_SWFLSH 0x04000000/* Tx Desc. wbk flushing */ /* Tx Queue Arbitration Priority 0=low, 1=high */ #define E1000_TXDCTL_PRIORITY 0x08000000 -/* Additional Receive Descriptor Control definitions */ -#define E1000_RXDCTL_QUEUE_ENABLE 0x02000000/* Ena specific Rx Queue */ #define E1000_RXDCTL_SWFLSH 0x04000000/* Rx Desc. wbk flushing */ /* Direct Cache Access (DCA) definitions */
drivers/net/intel/e1000/base/e1000_api.c +0 -2
@@ -405,7 +405,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_I350_VF_HV : mac->type = e1000_vfadapt_i350;break ; -case E1000_DEV_ID_I354_BACKPLANE_1GBPS :case E1000_DEV_ID_I354_SGMII :case E1000_DEV_ID_I354_BACKPLANE_2_5GBPS :
@@ -1421,4 +1420,3 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)if (hw->mac.ops.shutdown_serdes) hw->mac.ops.shutdown_serdes (hw); } -
drivers/net/intel/e1000/base/e1000_base.c +2 -2
@@ -81,8 +81,8 @@ s32 e1000_init_hw_base(struct e1000_hw *hw)/* Setup link and flow control */ ret_val = mac->ops.setup_link (hw); - -/* Clear all of the statistics registers (clear on read). It is +/* +* Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link * because the symbol error count will increment wildly if there * is no link.
drivers/net/intel/e1000/base/e1000_defines.h +37 -13
88 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_i225.c +12 -12
@@ -557,8 +557,8 @@ static s32 __e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,/* A check for invalid values: offset too large, too many words, * too many words for the offset, and not enough words. */ -if (offset >= nvm->word_size || words > (nvm->word_size - offset) || - words ==0 ) { +if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || + (words ==0 )) {DEBUGOUT ("nvm parameter(s) out of bounds\n" ); ret_val = -E1000_ERR_NVM ; goto out;
@@ -695,8 +695,7 @@ s32 e1000_read_invm_version_i225(struct e1000_hw *hw,s32 e1000_validate_nvm_checksum_i225 (struct e1000_hw *hw) {s32 status =E1000_SUCCESS ; -s32 (*read_op_ptr)(struct e1000_hw *hw,u16 offset, -u16 count,u16 *data); +s32 (*read_op_ptr)(struct e1000_hw *,u16 ,u16 ,u16 *);DEBUGFUNC ("e1000_validate_nvm_checksum_i225" );
@@ -1012,22 +1011,23 @@ static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)/* Check if using copper interface with EEE enabled or if the * link speed is 10 Mbps. */ -if (hw->phy.media_type == e1000_media_type_copper && - !hw->dev_spec._i225.eee_disable && - speed !=SPEED_10 ) { +if ((hw->phy.media_type == e1000_media_type_copper) && + !(hw->dev_spec._i225.eee_disable) && + (speed !=SPEED_10 )) {/* EEE enabled, so send LTRMAX threshold. */ ltrc =E1000_READ_REG (hw,E1000_LTRC ) |E1000_LTRC_EEEMS_EN ;E1000_WRITE_REG (hw,E1000_LTRC , ltrc);/* Calculate tw_system (nsec). */ -if (speed ==SPEED_100 ) +if (speed ==SPEED_100 ) { tw_system = ((E1000_READ_REG (hw,E1000_EEE_SU ) & -E1000_TW_SYSTEM_100_MASK ) >> -E1000_TW_SYSTEM_100_SHIFT ) *500 ; -else +E1000_TW_SYSTEM_100_MASK ) >> +E1000_TW_SYSTEM_100_SHIFT ) *500 ; + }else { tw_system = (E1000_READ_REG (hw,E1000_EEE_SU ) & -E1000_TW_SYSTEM_1000_MASK ) *500 ; +E1000_TW_SYSTEM_1000_MASK ) *500 ; + } }else { tw_system =0 ; }
drivers/net/intel/e1000/base/e1000_mac.c +2 -2
@@ -1647,7 +1647,7 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,* and 2.5 Gbps link modes. An additional bit is used * to differentiate between 1 Gbps and 2.5 Gbps. */ -if (hw->mac.type == e1000_i225 && +if ((hw->mac.type == e1000_i225) && (status &E1000_STATUS_SPEED_2500 )) { *speed =SPEED_2500 ;DEBUGOUT ("2500 Mbs, " );
@@ -1675,7 +1675,7 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed, }/** -* e1000_get_speed_and_duplex_fiber_generic - Retrieve current speed/duplex +* e1000_get_speed_and_duplex_fiber_serdes_generic - return fiber defaults * @hw: pointer to the HW structure * @speed: stores the current speed * @duplex: stores the current duplex
drivers/net/intel/e1000/base/e1000_nvm.c +2 -5
@@ -30,7 +30,7 @@ void e1000_init_nvm_ops_generic(struct e1000_hw *hw) }/** -* e1000_null_nvm_read - No-op function, return 0 +* e1000_null_read_nvm - No-op function, return 0 * @hw: pointer to the HW structure * @a: dummy variable * @b: dummy variable
@@ -136,8 +136,7 @@ STATIC void e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count) mask =0x01 << (count -1 );if (nvm->type == e1000_nvm_eeprom_microwire) eecd &= ~E1000_EECD_DO ; -else -if (nvm->type == e1000_nvm_eeprom_spi) +else if (nvm->type == e1000_nvm_eeprom_spi) eecd |=E1000_EECD_DO ; do {
@@ -1361,5 +1360,3 @@ void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers) eeprom_verl; } } - -
drivers/net/intel/e1000/base/e1000_osdep.h +0 -12
@@ -111,18 +111,6 @@ static inline uint16_t e1000_read_addr16(volatile void *addr)return rte_le_to_cpu_16 (E1000_PCI_REG16 (addr)); } -/* Necessary defines */ -#define E1000_MRQC_ENABLE_MASK 0x00000007 -#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000 -#define E1000_ALL_FULL_DUPLEX ( \ - ADVERTISE_10_FULL | ADVERTISE_100_FULL | ADVERTISE_1000_FULL) - -#define M88E1543_E_PHY_ID 0x01410EA0 -#define ULP_SUPPORT - -#define E1000_RCTL_DTYP_MASK 0x00000C00/* Descriptor type mask */ -#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000 -/* Register READ/WRITE macros */ #define E1000_READ_REG (hw, reg) \
drivers/net/intel/e1000/base/e1000_phy.c +5 -5
@@ -770,7 +770,7 @@ s32 e1000_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data) }/** -* e1000_write_phy_reg_igp - Write igp PHY register +* __e1000_write_phy_reg_igp - Write igp PHY register * @hw: pointer to the HW structure * @offset: register offset to write to * @data: data to write at register offset
@@ -1014,7 +1014,7 @@ STATIC s32 e1000_set_master_slave_mode(struct e1000_hw *hw)break ;case e1000_ms_auto: phy_data &= ~CR_1000T_MS_ENABLE ; -/* fall-through */ +break ;default :break ; }
@@ -4429,7 +4429,7 @@ s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) {DEBUGFUNC ("e1000_read_xmdio_reg" ); -return __e1000_access_xmdio_reg (hw, addr, dev_addr, data, true); +return __e1000_access_xmdio_reg (hw, addr, dev_addr, data, true); }/**
@@ -4443,6 +4443,6 @@ s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) {DEBUGFUNC ("e1000_write_xmdio_reg" ); -return __e1000_access_xmdio_reg (hw, addr, dev_addr, &data, - false); +return __e1000_access_xmdio_reg (hw, addr, dev_addr, &data, + false); }
drivers/net/intel/e1000/base/e1000_regs.h +3 -18
@@ -5,11 +5,14 @@#ifndef _E1000_REGS_H_#define _E1000_REGS_H_ +/* General Register Descriptions */ #define E1000_CTRL 0x00000/* Device Control - RW */ #define E1000_CTRL_DUP 0x00004/* Device Control Duplicate (Shadow) - RW */ #define E1000_STATUS 0x00008/* Device Status - RO */ #define E1000_EECD 0x00010/* EEPROM/Flash Control - RW */ #define E1000_EERD 0x00014/* EEPROM Read - RW */ +#define E1000_EEWR 0x0102C/* EEPROM Write Register - RW */ +/* NVM Register Descriptions */ #define E1000_CTRL_EXT 0x00018/* Extended Device Control - RW */ #define E1000_FLA 0x0001C/* Flash Access - RW */ #define E1000_MDIC 0x00020/* MDI Control - RW */
@@ -96,7 +99,6 @@#define E1000_EEARBC_I210 0x12024/* EEPROM Auto Read Bus Control */ #define E1000_EEARBC_I225 0x12024/* EEPROM Auto Read Bus Control */ #define E1000_FLASHT 0x01028/* FLASH Timer Register */ -#define E1000_EEWR 0x0102C/* EEPROM Write Register - RW */ #define E1000_FLSWCTL 0x01030/* FLASH control register */ #define E1000_FLSWDATA 0x01034/* FLASH data register */ #define E1000_FLSWCNT 0x01038/* FLASH Access Counter */
@@ -267,7 +269,6 @@ (0x054E0 + ((_i - 16) * 8)))#define E1000_RAH (_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \ (0x054E4 + ((_i - 16) * 8))) -#define E1000_VLAPQF 0x055B0/* VLAN Priority Queue Filter VLAPQF */ #define E1000_SHRAL (_i) (0x05438 + ((_i) * 8))
@@ -719,7 +720,6 @@#define E1000_LTRMINV 0x5BB0/* LTR Minimum Value */ #define E1000_LTRMAXV 0x5BB4/* LTR Maximum Value */ -/* IEEE 1588 TIMESYNCH */ #define E1000_TRGTTIML0 0x0B644/* Target Time Register 0 Low - RW */ #define E1000_TRGTTIMH0 0x0B648/* Target Time Register 0 High - RW */
@@ -729,21 +729,6 @@#define E1000_FREQOUT1 0x0B658/* Frequency Out 1 Control Register - RW */ #define E1000_TSSDP 0x0003C/* Time Sync SDP Configuration Register - RW */ -#define E1000_LTRC_EEEMS_EN (1 << 5) -#define E1000_TW_SYSTEM_100_MASK 0xff00 -#define E1000_TW_SYSTEM_100_SHIFT 8 -#define E1000_TW_SYSTEM_1000_MASK 0xff -#define E1000_LTRMINV_SCALE_1024 0x02 -#define E1000_LTRMINV_SCALE_32768 0x03 -#define E1000_LTRMAXV_SCALE_1024 0x02 -#define E1000_LTRMAXV_SCALE_32768 0x03 -#define E1000_LTRMINV_LTRV_MASK 0x1ff -#define E1000_LTRMINV_LSNP_REQ 0x80 -#define E1000_LTRMINV_SCALE_SHIFT 10 -#define E1000_LTRMAXV_LTRV_MASK 0x1ff -#define E1000_LTRMAXV_LSNP_REQ 0x80 -#define E1000_LTRMAXV_SCALE_SHIFT 10 -#define E1000_MRQC_ENABLE_MASK 0x00000007#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000#define E1000_RCTL_DTYP_MASK 0x00000C00/* Descriptor type mask */
Signature · 1 line
2.43.5
PATCH v3 9/36 net/e1000/base: add missing definitions
In reply to Anatoly BurakovSome definitions that are present in the base code are missing from DPDK. This patch adds the following definitions:
- EEPROM R/W v2 modes
- BAR ctrl CSR shift size
- I225 flash access register
- EEE-related registers
--- drivers/net/intel/e1000/base/e1000_defines.h | 5 +++++ drivers/net/intel/e1000/base/e1000_regs.h | 4 ++++ 2 files changed, 9 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +5 -0
@@ -948,6 +948,11 @@#define E1000_EEE_SU_LPI_CLK_STP 0x00800000/* EEE LPI Clock Stop */ #define E1000_EEE_LP_ADV_DEV_I225 7/* EEE LP Adv Device */ #define E1000_EEE_LP_ADV_ADDR_I225 61/* EEE LP Adv Register */ +#define E1000_EEE_LP_ADV_2_5G 0/* EEE LP Adv 2.5G */ +#define E1000_EEE_LP_ADV_1G 2/* EEE LP Adv 1G */ +#define E1000_EEE_LP_ADV_100M 1/* EEE LP Adv 100M */ +#define E1000_ANEG_EEE_AN_LPAB1_I225 26/* EEE LP Ability 1 Offset */ +#define E1000_ANEG_EEE_AN_LPAB2_I225 0x2A/* EEE LP Ability 2 Offset */ /* PCI Express Control */ #define E1000_GCR_RXD_NO_SNOOP 0x00000001
drivers/net/intel/e1000/base/e1000_regs.h +4 -0
@@ -12,6 +12,8 @@#define E1000_EECD 0x00010/* EEPROM/Flash Control - RW */ #define E1000_EERD 0x00014/* EEPROM Read - RW */ #define E1000_EEWR 0x0102C/* EEPROM Write Register - RW */ +#define E1000_EERD_V2 0x12014/* EEprom mode read - RW */ +#define E1000_EEWR_V2 0x12018/* EEprom mode write - RW */ /* NVM Register Descriptions */ #define E1000_CTRL_EXT 0x00018/* Extended Device Control - RW */ #define E1000_FLA 0x0001C/* Flash Access - RW */
@@ -23,6 +25,7 @@#define E1000_BARCTRL 0x5BBC/* BAR ctrl reg */ #define E1000_BARCTRL_FLSIZE 0x0700/* BAR ctrl Flsize */ #define E1000_BARCTRL_CSRSIZE 0x2000/* BAR ctrl CSR size */ +#define E1000_BARCTRL_CSRSIZE_SHIFT 13#define E1000_MPHY_ADDR_CTRL 0x0024/* GbE MPHY Address Control */ #define E1000_MPHY_DATA 0x0E10/* GBE MPHY Data */ #define E1000_MPHY_STAT 0x0E0C/* GBE MPHY Statistics */
@@ -33,6 +36,7 @@#define E1000_FCAL 0x00028/* Flow Control Address Low - RW */ #define E1000_FCAH 0x0002C/* Flow Control Address High -RW */ #define E1000_FEXT 0x0002C/* Future Extended - RW */ +#define E1000_I225_FLA 0x1201C/* FLASH access register */ #define E1000_I225_FLSWCTL 0x12048/* FLASH control register */ #define E1000_I225_FLSWDATA 0x1204C/* FLASH data register */ #define E1000_I225_FLSWCNT 0x12050/* FLASH Access Counter */
Signature · 1 line
2.43.5
PATCH v3 10/36 net/e1000/base: read PCIe bus info in i225
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
Call e1000_get_bus_info_pcie_generic from i225 to read PCIe bus info.
--- drivers/net/intel/e1000/base/e1000_i225.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_i225.c +2 -1
@@ -94,7 +94,8 @@ static s32 e1000_init_mac_params_i225(struct e1000_hw *hw) mac->mta_reg_count =128 ;/* Set rar entry count */ mac->rar_entry_count =E1000_RAR_ENTRIES_BASE ; - +/* bus type/speed/width */ + mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;/* reset */ mac->ops.reset_hw = e1000_reset_hw_i225;/* hw initialization */
Signature · 1 line
2.43.5
PATCH v3 11/36 net/e1000/base: rename VLAN PQF macros
In reply to Anatoly BurakovFrom: Sasha Neftin <[email protected]>
Align VLAN PQF naming convention to base code usage, as well as fix typos.
--- drivers/net/intel/e1000/base/e1000_defines.h | 6 +++--- drivers/net/intel/e1000/base/e1000_regs.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +3 -3
@@ -1510,9 +1510,9 @@#define E1000_MAX_MAC_HDR_LEN 127#define E1000_MAX_NETWORK_HDR_LEN 511 -#define E1000_VLAPQF_QUEUE_SEL (_n, q_idx) ((q_idx) << ((_n) * 4)) -#define E1000_VLAPQF_P_VALID (_n) (0x1 << (3 + (_n) * 4)) -#define E1000_VLAPQF_QUEUE_MASK 0x03 +#define E1000_VLANPQF_QSEL (_n, q_idx) ((q_idx) << ((_n) * 4)) +#define E1000_VLANPQF_VALID (_n) (0x1 << (3 + (_n) * 4)) +#define E1000_VLANPQF_QUEUE_MASK 0x03#define E1000_VFTA_BLOCK_SIZE 8/* SerDes Control */ #define E1000_GEN_CTL_READY 0x80000000
drivers/net/intel/e1000/base/e1000_regs.h +1 -1
@@ -273,7 +273,7 @@ (0x054E0 + ((_i - 16) * 8)))#define E1000_RAH (_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \ (0x054E4 + ((_i - 16) * 8))) -#define E1000_VLAPQF 0x055B0/* VLAN Priority Queue Filter VLAPQF */ +#define E1000_VLANPQF 0x055B0/* VLAN Priority Queue Filter VLANPQF */ #define E1000_SHRAL (_i) (0x05438 + ((_i) * 8))#define E1000_SHRAH (_i) (0x0543C + ((_i) * 8))
Signature · 1 line
2.43.5
PATCH v3 12/36 net/e1000/base: add PHY power management control
In reply to Anatoly BurakovFrom: Sasha Neftin <[email protected]>
PHY power management control is expected to provide a reliable and accurate indication of PHY reset completion, which allows us to decrease the delay time after a PHY reset.
--- drivers/net/intel/e1000/base/e1000_defines.h | 2 ++ drivers/net/intel/e1000/base/e1000_phy.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +2 -0
@@ -1100,6 +1100,8 @@#define PHY_CONTROL_LB 0x4000/* PHY Loopback bit */ +#define E1000_PHY_RST_COMP 0x0100/* Internal PHY reset completion */ +/* NVM Control */ #define E1000_EECD_SK 0x00000001/* NVM Clock */ #define E1000_EECD_CS 0x00000002/* NVM Chip Select */
drivers/net/intel/e1000/base/e1000_phy.c +15 -1
@@ -2918,6 +2918,10 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)if (ret_val)return ret_val; +if (hw->mac.type == e1000_i225) { +E1000_READ_REG (hw,E1000_I225_PHPM ); + } + ctrl =E1000_READ_REG (hw,E1000_CTRL );E1000_WRITE_REG (hw,E1000_CTRL , ctrl |E1000_CTRL_PHY_RST );E1000_WRITE_FLUSH (hw);
@@ -2927,7 +2931,17 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)E1000_WRITE_REG (hw,E1000_CTRL , ctrl);E1000_WRITE_FLUSH (hw); -usec_delay (150 ); +if (hw->mac.type == e1000_i225) { +u32 phpm =0 , timeout =10000 ; +/* SW should guarantee 100us for the completion of the PHY reset */ +usec_delay (100 ); +do { + phpm =E1000_READ_REG (hw,E1000_I225_PHPM ); + timeout--; +usec_delay (1 ); + }while (!(phpm &E1000_PHY_RST_COMP ) && timeout); + } +usec_delay (100 ); phy->ops.release (hw);
Signature · 1 line
2.43.5
PATCH v3 13/36 net/e1000/base: remove unused function
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
Integrated NVM is not supported on i225 and can be removed.
--- drivers/net/intel/e1000/base/e1000_i225.c | 98 +---------------------- drivers/net/intel/e1000/base/e1000_i225.h | 2 - 2 files changed, 1 insertion(+), 99 deletions(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -97
@@ -65,7 +65,7 @@ static s32 e1000_init_nvm_params_i225(struct e1000_hw *hw) nvm->ops.validate = e1000_validate_nvm_checksum_i225; nvm->ops.update = e1000_update_nvm_checksum_i225; }else { - hw->nvm.type = e1000_nvm_invm; + hw->nvm.type = e1000_nvm_none; nvm->ops.write = e1000_null_write_nvm; nvm->ops.validate = e1000_null_ops_generic; nvm->ops.update = e1000_null_ops_generic;
@@ -591,102 +591,6 @@ static s32 __e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,return ret_val; } -/* e1000_read_invm_version_i225 - Reads iNVM version and image type -* @hw: pointer to the HW structure -* @invm_ver: version structure for the version read -* -* Reads iNVM version and image type. -*/ -s32 e1000_read_invm_version_i225 (struct e1000_hw *hw, -struct e1000_fw_version *invm_ver) -{ -u32 *record =NULL ; -u32 *next_record =NULL ; -u32 i =0 ; -u32 invm_dword =0 ; -u32 invm_blocks =E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / -E1000_INVM_RECORD_SIZE_IN_BYTES ); -u32 buffer[E1000_INVM_SIZE ]; -s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND ; -u16 version =0 ; - -DEBUGFUNC ("e1000_read_invm_version_i225" ); - -/* Read iNVM memory */ -for (i =0 ; i <E1000_INVM_SIZE ; i++) { - invm_dword =E1000_READ_REG (hw,E1000_INVM_DATA_REG (i)); - buffer[i] = invm_dword; - } - -/* Read version number */ -for (i =1 ; i < invm_blocks; i++) { - record = &buffer[invm_blocks - i]; - next_record = &buffer[invm_blocks - i +1 ]; - -/* Check if we have first version location used */ -if (i ==1 && (*record &E1000_INVM_VER_FIELD_ONE ) ==0 ) { - version =0 ; - status =E1000_SUCCESS ; -break ; - } -/* Check if we have second version location used */ -else if ((i ==1 ) && - ((*record &E1000_INVM_VER_FIELD_TWO ) ==0 )) { - version = (*record &E1000_INVM_VER_FIELD_ONE ) >>3 ; - status =E1000_SUCCESS ; -break ; - } -/* Check if we have odd version location -* used and it is the last one used -*/ -else if ((((*record &E1000_INVM_VER_FIELD_ONE ) ==0 ) && - ((*record &0x3 ) ==0 )) || (((*record &0x3 ) !=0 ) && - (i !=1 ))) { - version = (*next_record &E1000_INVM_VER_FIELD_TWO ) - >>13 ; - status =E1000_SUCCESS ; -break ; - } -/* Check if we have even version location -* used and it is the last one used -*/ -else if (((*record &E1000_INVM_VER_FIELD_TWO ) ==0 ) && - ((*record &0x3 ) ==0 )) { - version = (*record &E1000_INVM_VER_FIELD_ONE ) >>3 ; - status =E1000_SUCCESS ; -break ; - } - } - -if (status ==E1000_SUCCESS ) { - invm_ver->invm_major = (version &E1000_INVM_MAJOR_MASK ) - >>E1000_INVM_MAJOR_SHIFT ; - invm_ver->invm_minor = version &E1000_INVM_MINOR_MASK ; - } -/* Read Image Type */ -for (i =1 ; i < invm_blocks; i++) { - record = &buffer[invm_blocks - i]; - next_record = &buffer[invm_blocks - i +1 ]; - -/* Check if we have image type in first location used */ -if (i ==1 && (*record &E1000_INVM_IMGTYPE_FIELD ) ==0 ) { - invm_ver->invm_img_type =0 ; - status =E1000_SUCCESS ; -break ; - } -/* Check if we have image type in first location used */ -else if ((((*record &0x3 ) ==0 ) && - ((*record &E1000_INVM_IMGTYPE_FIELD ) ==0 )) || - ((((*record &0x3 ) !=0 ) && (i !=1 )))) { - invm_ver->invm_img_type = - (*next_record &E1000_INVM_IMGTYPE_FIELD ) >>23 ; - status =E1000_SUCCESS ; -break ; - } - } -return status; -} -/* e1000_validate_nvm_checksum_i225 - Validate EEPROM checksum * @hw: pointer to the HW structure *
drivers/net/intel/e1000/base/e1000_i225.h +0 -2
@@ -13,8 +13,6 @@ s32 e1000_write_nvm_srwr_i225(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);s32 e1000_read_nvm_srrd_i225 (struct e1000_hw *hw,u16 offset,u16 words,u16 *data); -s32 e1000_read_invm_version_i225 (struct e1000_hw *hw, -struct e1000_fw_version *invm_ver);s32 e1000_set_flsw_flash_burst_counter_i225 (struct e1000_hw *hw,u32 burst_counter); s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,
Signature · 1 line
2.43.5
PATCH v3 14/36 net/e1000/base: add LED blink support for i225
In reply to Anatoly BurakovFrom: Menachem Fogel <[email protected]>
Implement LED blinking for i225.
--- .mailmap | 1 + drivers/net/intel/e1000/base/e1000_i225.c | 44 +++++++++++++++++++++++ drivers/net/intel/e1000/base/e1000_i225.h | 8 +++++ 3 files changed, 53 insertions(+)
.mailmap +1 -0
@@ -991,6 +991,7 @@ Maxime Gouin <[email protected]> Maxime Leroy <[email protected]> Md Fahad Iqbal Polash <[email protected]> Megha Ajmera <[email protected]> +Menachem Fogel <[email protected]> Meijuan Zhao <[email protected]> Meir Levi <[email protected]> Meir Tseitlin <[email protected]>
drivers/net/intel/e1000/base/e1000_i225.c +44 -0
56 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_i225.h +8 -0
@@ -17,6 +17,8 @@ s32 e1000_set_flsw_flash_burst_counter_i225(struct e1000_hw *hw, u32 burst_counter);s32 e1000_write_erase_flash_command_i225 (struct e1000_hw *hw,u32 opcode,u32 address); +s32 e1000_id_led_init_i225 (struct e1000_hw *hw); +s32 e1000_blink_led_i225 (struct e1000_hw *hw);s32 e1000_check_for_link_i225 (struct e1000_hw *hw);s32 e1000_acquire_swfw_sync_i225 (struct e1000_hw *hw,u16 mask);void e1000_release_swfw_sync_i225 (struct e1000_hw *hw,u16 mask);
@@ -105,4 +107,10 @@ s32 e1000_set_eee_i225(struct e1000_hw *hw, bool adv2p5G, bool adv1G,#define E1000_RXDADV_PKTTYPE_ETQF_MASK 0x00000070/* ETQF has 8 indices */ #define E1000_RXDADV_PKTTYPE_ETQF_SHIFT 4/* Right-shift 4 bits */ +/* LED Control */ +#define E1000_GLOBAL_BLINK_MODE 0x00000020/*Blink at 200 ms on and 200 ms off.*/ +#define E1000_LED1_MODE_MASK 0x00000F00 +#define E1000_LED1_BLINK 0x00008000 +#define E1000_LED2_MODE_MASK 0x000F0000 +#endif
Signature · 1 line
2.43.5
PATCH v3 15/36 net/e1000/base: add PHY reset support for i225
In reply to Anatoly BurakovFrom: Evgeny Efimov <[email protected]>
Use PHY reset generic implementation for i225.
--- drivers/net/intel/e1000/base/e1000_i225.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_i225.c +1 -0
@@ -165,6 +165,7 @@ static s32 e1000_init_phy_params_i225(struct e1000_hw *hw) phy->ops.check_reset_block = e1000_check_reset_block_generic; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.release = e1000_release_phy_base; + phy->ops.reset = e1000_phy_hw_reset_generic; ctrl_ext =E1000_READ_REG (hw,E1000_CTRL_EXT );
Signature · 1 line
2.43.5
PATCH v3 16/36 net/e1000/base: make i225 set LTR non-static
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
Some tools need access to the function, so make it non-static.
--- drivers/net/intel/e1000/base/e1000_i225.c | 2 +- drivers/net/intel/e1000/base/e1000_i225.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -1
@@ -907,7 +907,7 @@ s32 e1000_pool_flash_update_done_i225(struct e1000_hw *hw)* Set the LTR thresholds based on the link speed (Mbps), EEE, and DMAC * settings, otherwise specify that there is no LTR requirement. */ -static s32 e1000_set_ltr_i225 (struct e1000_hw *hw,bool link) +s32 e1000_set_ltr_i225 (struct e1000_hw *hw,bool link) {u16 speed, duplex;u32 tw_system, ltrc, ltrv, ltr_min, ltr_max, scale_min, scale_max;
drivers/net/intel/e1000/base/e1000_i225.h +1 -0
@@ -20,6 +20,7 @@ s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,s32 e1000_id_led_init_i225 (struct e1000_hw *hw);s32 e1000_blink_led_i225 (struct e1000_hw *hw);s32 e1000_check_for_link_i225 (struct e1000_hw *hw); +s32 e1000_set_ltr_i225 (struct e1000_hw *hw,bool link);s32 e1000_acquire_swfw_sync_i225 (struct e1000_hw *hw,u16 mask);void e1000_release_swfw_sync_i225 (struct e1000_hw *hw,u16 mask);s32 e1000_init_hw_i225 (struct e1000_hw *hw);
Signature · 1 line
2.43.5
PATCH v3 17/36 net/e1000/base: correct disable k1 logic
In reply to Anatoly BurakovFrom: Vitaly Lifshits <[email protected]>
Starting from MTP PHY type there is a synchronization issue between the PHY's clock and PCH's synopsis PHY. This causes Tx packets corruptions.
The workaround to this issue is to change P0s power down state from P0/P0s to P1 prior to disabling K1.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +12 -0
@@ -2427,6 +2427,18 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)DEBUGFUNC ("e1000_configure_k1_ich8lan" ); +/* Due to clock synchronization issue on MTL and above prior to +* disabling k1 it is required to disable P0s state +*/ +if ((!k1_enable) && (hw->mac.type >= e1000_pch_mtp)) { +u32 fextnvm12 =E1000_READ_REG (hw,E1000_FEXTNVM12 ); + fextnvm12 |= (1 <<23 ); + fextnvm12 &= ~((1 <<22 )); +E1000_WRITE_REG (hw,E1000_FEXTNVM12 , fextnvm12); + +usec_delay (100 ); + } + ret_val =e1000_read_kmrn_reg_locked (hw,E1000_KMRNCTRLSTA_K1_CONFIG , &kmrn_reg);if (ret_val)
Signature · 1 line
2.43.5
PATCH v3 18/36 net/e1000/base: workaround for packet loss
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
On some MAC types, packet loss is observed due to wake DMA clock gating. Disable wake DMA clock for some MAC types to avoid packet loss.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 7 +++++++ drivers/net/intel/e1000/base/e1000_ich8lan.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +7 -0
@@ -5050,6 +5050,7 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) {struct e1000_mac_info *mac = &hw->mac;u32 ctrl_ext, txdctl, snoop; +u32 mac_reg;s32 ret_val;u16 i;
@@ -5110,6 +5111,12 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) snoop = (u32 ) ~(PCIE_NO_SNOOP_ALL );e1000_set_pcie_no_snoop_generic (hw, snoop); +/* Enable workaround for packet loss issue on TGL/ADL platforms */ +if (mac->type == e1000_pch_tgp || mac->type == e1000_pch_adp) { + mac_reg =E1000_READ_REG (hw,E1000_FFLT_DBG ); + mac_reg |=E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK ; +E1000_WRITE_REG (hw,E1000_FFLT_DBG , mac_reg); + } ctrl_ext =E1000_READ_REG (hw,E1000_CTRL_EXT ); ctrl_ext |=E1000_CTRL_EXT_RO_DIS ;E1000_WRITE_REG (hw,E1000_CTRL_EXT , ctrl_ext);
drivers/net/intel/e1000/base/e1000_ich8lan.h +1 -1
@@ -277,7 +277,7 @@#define E1000_PCH_RAICC (_n) (0x05F50 + ((_n) * 4))#define E1000_PCI_VENDOR_ID_REGISTER 0x00 - +#define E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK 0x1000#define E1000_PCI_REVISION_ID_REG 0x08void e1000_set_kmrn_lock_loss_workaround_ich8lan (struct e1000_hw *hw,bool state);
Signature · 1 line
2.43.5
PATCH v3 19/36 net/e1000/base: add EEE common API function
In reply to Anatoly BurakovFrom: Evgeny Efimov <[email protected]>
Add enable/disable EEE API to base code.
--- drivers/net/intel/e1000/base/e1000_api.c | 17 +++++++++++++++++ drivers/net/intel/e1000/base/e1000_api.h | 1 + drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_i225.c | 2 ++ 4 files changed, 21 insertions(+)
drivers/net/intel/e1000/base/e1000_api.c +17 -0
@@ -1420,3 +1420,20 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)if (hw->mac.ops.shutdown_serdes) hw->mac.ops.shutdown_serdes (hw); } + +/** +* e1000_set_eee - Set EEE +* @hw: pointer to the HW structure +* @adv2p5G: boolean flag enabling 2.5G EEE advertisement +* @adv1G: boolean flag enabling 1G EEE advertisement +* @adv100M: boolean flag enabling 100M EEE advertisement +* +* Enable/disable EEE based on setting in dev_spec structure. +**/ +s32 e1000_set_eee (struct e1000_hw *hw,bool adv2p5G,bool adv1G,bool adv100M) +{ +if (hw->mac.ops.set_eee) +return hw->mac.ops.set_eee (hw, adv2p5G, adv1G, adv100M); + +return -E1000_ERR_CONFIG ; +}
drivers/net/intel/e1000/base/e1000_api.h +1 -0
@@ -88,6 +88,7 @@ s32 e1000_mng_write_cmd_header(struct e1000_hw *hw, struct e1000_host_mng_command_header *hdr);s32 e1000_mng_write_dhcp_info (struct e1000_hw *hw,u8 *buffer,u16 length);u32 e1000_translate_register_82542 (u32 reg); +s32 e1000_set_eee (struct e1000_hw *hw,bool adv2p5G,bool adv1G,bool adv100M);
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
@@ -748,6 +748,7 @@ struct e1000_mac_operations {void (*update_mc_addr_list)(struct e1000_hw *,u8 *,u32 );s32 (*reset_hw)(struct e1000_hw *);s32 (*init_hw)(struct e1000_hw *); +s32 (*set_eee)(struct e1000_hw *,bool ,bool ,bool );void (*shutdown_serdes)(struct e1000_hw *);void (*power_up_serdes)(struct e1000_hw *);s32 (*setup_link)(struct e1000_hw *);
drivers/net/intel/e1000/base/e1000_i225.c +2 -0
@@ -94,6 +94,8 @@ static s32 e1000_init_mac_params_i225(struct e1000_hw *hw) mac->mta_reg_count =128 ;/* Set rar entry count */ mac->rar_entry_count =E1000_RAR_ENTRIES_BASE ; +/* Set EEE */ + mac->ops.set_eee = e1000_set_eee_i225;/* bus type/speed/width */ mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;/* reset */
Signature · 1 line
2.43.5
PATCH v3 20/36 net/e1000/base: add queue select definitions
In reply to Anatoly BurakovFrom: Sasha Neftin <[email protected]>
Add definitions for address select mask (selects source address to be used in the address filtering), as well as queue select (indicates which Rx queue should get the packet matching this MAC address).
--- drivers/net/intel/e1000/base/e1000_defines.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +7 -0
@@ -685,6 +685,13 @@*/ #define E1000_RAR_ENTRIES 15#define E1000_RAH_AV 0x80000000/* Receive descriptor valid */ +#define E1000_RAH_RAH_MASK 0x0000FFFF +#define E1000_RAH_ASEL_MASK 0x00030000 +#define E1000_RAH_ASEL_SRC_ADD 0x00010000 +#define E1000_RAH_QSEL_MASK 0x000C0000 +#define E1000_RAH_QSEL_SHIFT 18 +#define E1000_RAH_ASEL_SRC_ADDR 0x00010000 +#define E1000_RAH_QSEL_ENABLE 0x10000000#define E1000_RAL_MAC_ADDR_LEN 4#define E1000_RAH_MAC_ADDR_LEN 2#define E1000_RAH_QUEUE_MASK_82575 0x000C0000
Signature · 1 line
2.43.5
PATCH v3 21/36 net/e1000/base: add profile information field
In reply to Anatoly BurakovFrom: Sasha Neftin <[email protected]>
Some tools require device profile information to be present, so add it.
--- drivers/net/intel/e1000/base/e1000_hw.h | 1 + 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
@@ -1056,6 +1056,7 @@ struct e1000_dev_spec_i225 {struct e1000_hw {void *back; +u8 pf_id;/* device profile info */ u8 *hw_addr;u8 *flash_address;unsigned long io_base;
Signature · 1 line
2.43.5
PATCH v3 22/36 net/e1000/base: add LPI counters
In reply to Anatoly BurakovFrom: Sasha Neftin <[email protected]>
Add new fields in structure to indicate if EEE LPI entries have been observed on Tx and Rx path.
--- drivers/net/intel/e1000/base/e1000_hw.h | 2 ++ drivers/net/intel/e1000/base/e1000_mac.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/net/intel/e1000/base/e1000_hw.h +2 -0
@@ -645,6 +645,8 @@ struct e1000_hw_stats {u64 o2bspc;u64 b2ospc;u64 b2ogprc; +u64 tlpic; +u64 rlpic; };struct e1000_vf_stats {
drivers/net/intel/e1000/base/e1000_mac.c +2 -0
@@ -670,6 +670,8 @@ void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw)E1000_READ_REG (hw,E1000_TPT );E1000_READ_REG (hw,E1000_MPTC );E1000_READ_REG (hw,E1000_BPTC ); +E1000_READ_REG (hw,E1000_TLPIC ); +E1000_READ_REG (hw,E1000_RLPIC ); }/**
Signature · 1 line
2.43.5
PATCH v3 23/36 net/e1000/base: improve code flow in ICH8LAN
In reply to Anatoly BurakovFrom: Piotr Pietruszewski <[email protected]>
This change rearranges the ICH8LAN code to have less indentation levels.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 84 ++++++++++---------- 1 file changed, 43 insertions(+), 41 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +43 -41
@@ -1392,49 +1392,51 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)if (ret_val) goto release;/* CSC interrupt received due to ULP Indication */ -if ((phy_reg &I218_ULP_CONFIG1_IND ) || force) { - phy_reg &= ~(I218_ULP_CONFIG1_IND | -I218_ULP_CONFIG1_STICKY_ULP | -I218_ULP_CONFIG1_RESET_TO_SMBUS | -I218_ULP_CONFIG1_WOL_HOST | -I218_ULP_CONFIG1_INBAND_EXIT | -I218_ULP_CONFIG1_EN_ULP_LANPHYPC | -I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST | -I218_ULP_CONFIG1_DISABLE_SMB_PERST ); -e1000_write_phy_reg_hv_locked (hw,I218_ULP_CONFIG1 , phy_reg); - -/* Commit ULP changes by starting auto ULP configuration */ - phy_reg |=I218_ULP_CONFIG1_START ; -e1000_write_phy_reg_hv_locked (hw,I218_ULP_CONFIG1 , phy_reg); - -/* Clear Disable SMBus Release on PERST# in MAC */ - mac_reg =E1000_READ_REG (hw,E1000_FEXTNVM7 ); - mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST ; -E1000_WRITE_REG (hw,E1000_FEXTNVM7 , mac_reg); - -if (!force) { - hw->phy.ops.release (hw); - -if (hw->mac.autoneg) -e1000_phy_setup_autoneg (hw); -else -e1000_setup_copper_link_generic (hw); - -e1000_sw_lcd_config_ich8lan (hw); - -e1000_oem_bits_config_ich8lan (hw, true); - -/* Set ULP state to unknown and return non-zero to -* indicate no link (yet) and re-enter on the next LSC -* to finish disabling ULP flow. -*/ - hw->dev_spec.ich8lan.ulp_state = - e1000_ulp_state_unknown; - -return 1 ; - } +if (!((phy_reg &I218_ULP_CONFIG1_IND ) || force)) + goto omit_ulp_irq_hanlder; + + phy_reg &= ~(I218_ULP_CONFIG1_IND | +I218_ULP_CONFIG1_STICKY_ULP | +I218_ULP_CONFIG1_RESET_TO_SMBUS | +I218_ULP_CONFIG1_WOL_HOST | +I218_ULP_CONFIG1_INBAND_EXIT | +I218_ULP_CONFIG1_EN_ULP_LANPHYPC | +I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST | +I218_ULP_CONFIG1_DISABLE_SMB_PERST ); +e1000_write_phy_reg_hv_locked (hw,I218_ULP_CONFIG1 , phy_reg); + +/* Commit ULP changes by starting auto ULP configuration */ + phy_reg |=I218_ULP_CONFIG1_START ; +e1000_write_phy_reg_hv_locked (hw,I218_ULP_CONFIG1 , phy_reg); + +/* Clear Disable SMBus Release on PERST# in MAC */ + mac_reg =E1000_READ_REG (hw,E1000_FEXTNVM7 ); + mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST ; +E1000_WRITE_REG (hw,E1000_FEXTNVM7 , mac_reg); + +if (!force) { + hw->phy.ops.release (hw); + +if (hw->mac.autoneg) +e1000_phy_setup_autoneg (hw); +else +e1000_setup_copper_link_generic (hw); + +e1000_sw_lcd_config_ich8lan (hw); + +e1000_oem_bits_config_ich8lan (hw, true); + +/* Set ULP state to unknown and return non-zero to +* indicate no link (yet) and re-enter on the next LSC +* to finish disabling ULP flow. +*/ + hw->dev_spec.ich8lan.ulp_state = + e1000_ulp_state_unknown; + +return 1 ; } +omit_ulp_irq_hanlder:/* Re-enable Tx */ mac_reg =E1000_READ_REG (hw,E1000_TCTL ); mac_reg |=E1000_TCTL_EN ;
Signature · 1 line
2.43.5
PATCH v3 24/36 net/e1000/base: add definition for EXFWSM register
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
Add Extended Firmware Semaphore (EXFWSM) register definition.
--- drivers/net/intel/e1000/base/e1000_defines.h | 3 ++- drivers/net/intel/e1000/base/e1000_regs.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +2 -1
@@ -481,7 +481,8 @@/* Low Power IDLE Control */ #define E1000_LPIC_LPIET_SHIFT 24/* Low Power Idle Entry Time */ - +#define E1000_EXFWSM_DPG_EXIT_DONE 0x00000001 +#define E1000_EXFWSM_POWER_UP_FROM_ULP_IND 0x00000002/* PBA constants */ #define E1000_PBA_8K 0x0008/* 8KB */ #define E1000_PBA_10K 0x000A/* 10KB */
drivers/net/intel/e1000/base/e1000_regs.h +1 -0
@@ -538,6 +538,7 @@#define E1000_FACTPS 0x05B30#define E1000_SWSM 0x05B50/* SW Semaphore */ #define E1000_FWSM 0x05B54/* FW Semaphore */ +#define E1000_EXFWSM 0x05B58/* Extended FW Semaphore */ /* Driver-only SW semaphore (not used by BOOT agents) */ #define E1000_SWSM2 0x05B58#define E1000_DCA_ID 0x05B70/* DCA Requester ID Information - RO */
Signature · 1 line
2.43.5
PATCH v3 25/36 net/e1000/base: use longer ULP exit timeout on more HW
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
Add some definitions related to ULP WoL, and set longer ULP exit timeout on more MAC types.
--- drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 +- drivers/net/intel/e1000/base/e1000_ich8lan.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
@@ -1021,6 +1021,7 @@ struct e1000_dev_spec_ich8lan {u16 eee_lp_ability;enum e1000_ulp_state ulp_state;bool ulp_capability_disabled; +bool wake_on_ulp_exit;bool during_suspend_flow;bool during_dpg_exit;u16 lat_enc;
drivers/net/intel/e1000/base/e1000_ich8lan.c +1 -1
@@ -1293,7 +1293,7 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)E1000_WRITE_REG (hw,E1000_H2ME , mac_reg); } -if (hw->mac.type == e1000_pch_cnp) +if (hw->mac.type >= e1000_pch_cnp) ulp_exit_timeout =100 ; while (E1000_READ_REG(hw, E1000_FWSM) &
drivers/net/intel/e1000/base/e1000_ich8lan.h +1 -0
@@ -48,6 +48,7 @@#define E1000_H2ME 0x05B50/* Host to ME */ #define E1000_H2ME_ULP 0x00000800/* ULP Indication Bit */ +#define E1000_H2ME_HOST_WOL_ON_ULP_EXIT 0x00000008/* Host WOL on ULP exit */ #define E1000_H2ME_ENFORCE_SETTINGS 0x00001000/* Enforce Settings */ #define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \
Signature · 1 line
2.43.5
PATCH v3 26/36 net/e1000/base: make PHY wakeup access non-static
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
Mark e1000_access_phy_wakeup_reg_bm function as non-static.
--- drivers/net/intel/e1000/base/e1000_phy.c | 6 ++---- drivers/net/intel/e1000/base/e1000_phy.h | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +2 -4
@@ -5,8 +5,6 @@#include "e1000_api.h" STATIC s32 e1000_wait_autoneg(struct e1000_hw *hw); -STATIC s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, -u16 *data,bool read,bool page_set); STATIC u32 e1000_get_phy_addr_for_hv_page(u32 page); STATIC s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,u16 *data,bool read);
@@ -3498,8 +3496,8 @@ s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)* the PHY page is set to BM_WUC_PAGE (i.e. a function in the call stack * is responsible for calls to e1000_[enable|disable]_phy_wakeup_reg_bm()). **/ -STATIC s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, -u16 *data,bool read,bool page_set) +s32 e1000_access_phy_wakeup_reg_bm (struct e1000_hw *hw,u32 offset, +u16 *data,bool read,bool page_set) {s32 ret_val;u16 reg =BM_PHY_REG_NUM (offset);
drivers/net/intel/e1000/base/e1000_phy.h +2 -0
@@ -62,6 +62,8 @@ s32 e1000_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);s32 e1000_read_phy_reg_bm (struct e1000_hw *hw,u32 offset,u16 *data);s32 e1000_enable_phy_wakeup_reg_access_bm (struct e1000_hw *hw,u16 *phy_reg);s32 e1000_disable_phy_wakeup_reg_access_bm (struct e1000_hw *hw,u16 *phy_reg); +s32 e1000_access_phy_wakeup_reg_bm (struct e1000_hw *hw,u32 offset, +u16 *data,bool read,bool page_set);s32 e1000_read_phy_reg_bm2 (struct e1000_hw *hw,u32 offset,u16 *data);s32 e1000_write_phy_reg_bm2 (struct e1000_hw *hw,u32 offset,u16 data);void e1000_power_up_phy_copper (struct e1000_hw *hw);
Signature · 1 line
2.43.5
PATCH v3 27/36 net/e1000/base: make debug prints more informative
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
PHY page and register notation traditionally uses decimal numbering. This patch aligns the debug prints to this notation, as well as moves prints to after we get a value of interest to us.
--- drivers/net/intel/e1000/base/e1000_phy.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +10 -8
@@ -690,7 +690,7 @@ s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page) {DEBUGFUNC ("e1000_set_page_igp" ); -DEBUGOUT1 ("Setting page 0x%x\n" , page); +DEBUGOUT2 ("Setting page %d (0x%x)\n" , page >>IGP_PAGE_SHIFT , page); hw->phy.addr =1 ;
@@ -3521,8 +3521,6 @@ s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, } } -DEBUGOUT2 ("Accessing PHY page %d reg 0x%x\n" , page, reg); -/* Write the Wakeup register page offset value using opcode 0x11 */ ret_val =e1000_write_phy_reg_mdic (hw,BM_WUC_ADDRESS_OPCODE , reg);if (ret_val) {
@@ -3534,10 +3532,14 @@ s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,/* Read the Wakeup register page value using opcode 0x12 */ ret_val =e1000_read_phy_reg_mdic (hw,BM_WUC_DATA_OPCODE , data); +DEBUGOUT3 ("Read PHY page %d reg %d value 0x%04x\n" , + page, reg, *data); }else {/* Write the Wakeup register page value using opcode 0x12 */ ret_val =e1000_write_phy_reg_mdic (hw,BM_WUC_DATA_OPCODE , *data); +DEBUGOUT3 ("Wrote PHY page %d reg %d value 0x%04x\n" , + page, reg, *data); }if (ret_val) {
@@ -3645,11 +3647,11 @@ STATIC s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, } } -DEBUGOUT3 ("reading PHY page %d (or 0x%x shifted) reg 0x%x\n" , page, - page <<IGP_PAGE_SHIFT , reg); - ret_val =e1000_read_phy_reg_mdic (hw,MAX_PHY_REG_ADDRESS & reg, data); +DEBUGOUT3 ("read PHY page %d reg %d value 0x%04x\n" , + page, reg, *data); + out:if (!locked) hw->phy.ops.release (hw);
@@ -3771,8 +3773,8 @@ STATIC s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, } } -DEBUGOUT3 ("writing PHY page %d (or 0x%x shifted) reg 0x%x\n" , page, - page <<IGP_PAGE_SHIFT , reg); +DEBUGOUT3 ("writing PHY page %d reg %d value 0x%04x\n" , + page, reg, data); ret_val =e1000_write_phy_reg_mdic (hw,MAX_PHY_REG_ADDRESS & reg, data);
Signature · 1 line
2.43.5
PATCH v3 28/36 net/e1000/base: add WoL definitions
In reply to Anatoly BurakovFrom: Adam Ludkiewicz <[email protected]>
Define constants for WoL control on i210 NICs.
--- drivers/net/intel/e1000/base/e1000_i210.h | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/intel/e1000/base/e1000_i210.h +4 -0
@@ -66,6 +66,7 @@ enum E1000_INVM_STRUCTURE_TYPE {/* PLL Defines */ #define E1000_PCI_PMCSR 0x44#define E1000_PCI_PMCSR_D3 0x03 +#define E1000_PCI_PMCSR_PME_EN 0x100#define E1000_MAX_PLL_TRIES 5#define E1000_PHY_PLL_UNCONF 0xFF#define E1000_PHY_PLL_FREQ_PAGE 0xFC0000
@@ -74,4 +75,7 @@ enum E1000_INVM_STRUCTURE_TYPE {#define E1000_INVM_AUTOLOAD 0x0A#define E1000_INVM_PLL_WO_VAL 0x0010 +#define E1000_NVM_CTRL_WORD_2 0x0F +#define E1000_NVM_APMPME_ENABLE 0x8000 +#endif
Signature · 1 line
2.43.5
PATCH v3 29/36 net/e1000/base: hardcode bus parameters for ICH8
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
Current implementation of e1000_get_bus_info_ich8lan first attempts to call e1000_get_bus_info_pcie_generic, and hard codes the bus width if the latter does not return a valid value.
However, e1000_get_bus_info_pcie_generic will always fail on an ICH device, since no PCIe capability is present in the ICH config space. Therefore, there is no need to call it at all. Instead, we set the bus parameters to their appropriate default values.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +6 -7
@@ -4885,21 +4885,20 @@ STATIC s32 e1000_id_led_init_pchlan(struct e1000_hw *hw) STATIC s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw) {struct e1000_bus_info *bus = &hw->bus; -s32 ret_val;DEBUGFUNC ("e1000_get_bus_info_ich8lan" ); - ret_val =e1000_get_bus_info_pcie_generic (hw); -/* ICH devices are "PCI Express"-ish. They have * a configuration space, but do not contain -* PCI Express Capability registers, so bus width +* PCI Express Capability registers, so bus parameters * must be hardcoded. */ -if (bus->width == e1000_bus_width_unknown) - bus->width = e1000_bus_width_pcie_x1; + bus->type = e1000_bus_type_pci_express; + bus->width = e1000_bus_width_pcie_x1; + bus->speed = e1000_bus_speed_unknown; + bus->func =0 ; -return ret_val; +return E1000_SUCCESS ; }/**
Signature · 1 line
2.43.5
PATCH v3 30/36 net/e1000/base: improve NVM checksum handling
In reply to Anatoly BurakovFrom: Sasha Neftin <[email protected]>
When reading NVM checksum, we may encounter the following scenarios:
- Checksum may be invalid, and can be updated
- Checksum may be invalid but cannot be updated because NVM is read-only
For the latter case, we should just ignore invalid checksum and not attempt to update it.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 24 ++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +17 -7
@@ -4366,13 +4366,23 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)return ret_val;if (!(data & valid_csum_mask)) { - data |= valid_csum_mask; - ret_val = hw->nvm.ops.write (hw, word,1 , &data); -if (ret_val) -return ret_val; - ret_val = hw->nvm.ops.update (hw); -if (ret_val) -return ret_val; +DEBUGOUT ("NVM checksum valid bit not set" ); + +if (hw->mac.type < e1000_pch_tgp) { + data |= valid_csum_mask; + ret_val = hw->nvm.ops.write (hw, word,1 , &data); +if (ret_val) +return ret_val; + ret_val = hw->nvm.ops.update (hw); +if (ret_val) +return ret_val; + }else if (hw->mac.type == e1000_pch_tgp) { +/* Tiger Lake systems may have uninitialized NVM +* checksum. Since the NVM cannot be updated by +* software, do not validate the checksum. +*/ +return E1000_SUCCESS ; + } }return e1000_validate_nvm_checksum_generic (hw);
Signature · 1 line
2.43.5
PATCH v3 31/36 net/e1000/base: remove redundant access to RO register
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
Remove workaround for hardware synchronization before reset. The original bug that was fixed by this workaround was root caused later and fixed in other ways.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +0 -17
@@ -4924,7 +4924,6 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)u16 kum_cfg;u32 ctrl, reg;s32 ret_val; -u16 pci_cfg;DEBUGFUNC ("e1000_reset_hw_ich8lan" );
@@ -4986,27 +4985,11 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) } ret_val =e1000_acquire_swflag_ich8lan (hw); -/* Read from EXTCNF_CTRL in e1000_acquire_swflag_ich8lan function -* may occur during global reset and cause system hang. -* Configuration space access creates the needed delay. -* Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER value -* insures configuration space read is done before global reset. -*/ -e1000_read_pci_cfg (hw,E1000_PCI_VENDOR_ID_REGISTER , &pci_cfg); -E1000_WRITE_REG (hw,E1000_STRAP , pci_cfg);DEBUGOUT ("Issuing a global reset to ich8lan\n" );E1000_WRITE_REG (hw,E1000_CTRL , (ctrl |E1000_CTRL_RST ));/* cannot issue a flush here because it hangs the hardware */ msec_delay (20 ); -/* Configuration space access improve HW level time sync mechanism. -* Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER -* value to insure configuration space read is done -* before any access to mac register. -*/ -e1000_read_pci_cfg (hw,E1000_PCI_VENDOR_ID_REGISTER , &pci_cfg); -E1000_WRITE_REG (hw,E1000_STRAP , pci_cfg); -/* Set Phy Config Counter to 50msec */ if (hw->mac.type == e1000_pch2lan) { reg =E1000_READ_REG (hw,E1000_FEXTNVM3 );
Signature · 1 line
2.43.5
PATCH v3 32/36 net/e1000/base: remove non-inclusive language
In reply to Anatoly BurakovFrom: Marcin Jurczak <[email protected]>
This patch removes non-inclusive language from the e1000 shared code and comments.
--- .../net/intel/e1000/base/e1000_80003es2lan.c | 8 ++-- drivers/net/intel/e1000/base/e1000_82571.c | 4 +- drivers/net/intel/e1000/base/e1000_82575.c | 8 ++-- drivers/net/intel/e1000/base/e1000_api.c | 8 ++-- drivers/net/intel/e1000/base/e1000_api.h | 2 +- drivers/net/intel/e1000/base/e1000_defines.h | 40 ++++++++-------- drivers/net/intel/e1000/base/e1000_hw.h | 4 +- drivers/net/intel/e1000/base/e1000_i225.c | 4 +- drivers/net/intel/e1000/base/e1000_ich8lan.c | 8 ++-- drivers/net/intel/e1000/base/e1000_mac.c | 22 ++++----- drivers/net/intel/e1000/base/e1000_mac.h | 2 +- drivers/net/intel/e1000/base/e1000_phy.c | 46 +++++++++---------- drivers/net/intel/e1000/base/e1000_regs.h | 2 +- drivers/net/intel/e1000/base/e1000_vf.c | 2 +- 14 files changed, 81 insertions(+), 79 deletions(-)
drivers/net/intel/e1000/base/e1000_80003es2lan.c +4 -4
@@ -797,9 +797,9 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)/* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ - ret_val =e1000_disable_pcie_master_generic (hw); + ret_val =e1000_disable_pcie_primary_generic (hw);if (ret_val) -DEBUGOUT ("PCI-E Master disable polling has failed.\n" ); +DEBUGOUT ("PCI-E Primary disable polling has failed.\n" );DEBUGOUT ("Masking off all interrupts\n" );E1000_WRITE_REG (hw,E1000_IMC ,0xffffffff );
@@ -820,7 +820,7 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)E1000_WRITE_REG (hw,E1000_CTRL , ctrl |E1000_CTRL_RST );e1000_release_phy_80003es2lan (hw); -/* Disable IBIST slave mode (far-end loopback) */ +/* Disable IBIST secondary mode (far-end loopback) */ ret_val =e1000_read_kmrn_reg_80003es2lan (hw,E1000_KMRNCTRLSTA_INBAND_PARAM , &kum_reg_data);if (!ret_val) {
@@ -886,7 +886,7 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)if (ret_val)return ret_val; -/* Disable IBIST slave mode (far-end loopback) */ +/* Disable IBIST secondary mode (far-end loopback) */ ret_val =e1000_read_kmrn_reg_80003es2lan (hw,E1000_KMRNCTRLSTA_INBAND_PARAM , &kum_reg_data);
drivers/net/intel/e1000/base/e1000_82571.c +2 -2
@@ -1042,9 +1042,9 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)/* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ - ret_val =e1000_disable_pcie_master_generic (hw); + ret_val =e1000_disable_pcie_primary_generic (hw);if (ret_val) -DEBUGOUT ("PCI-E Master disable polling has failed.\n" ); +DEBUGOUT ("PCI-E Primary disable polling has failed.\n" );DEBUGOUT ("Masking off all interrupts\n" );E1000_WRITE_REG (hw,E1000_IMC ,0xffffffff );
drivers/net/intel/e1000/base/e1000_82575.c +4 -4
@@ -1361,9 +1361,9 @@ STATIC s32 e1000_reset_hw_82575(struct e1000_hw *hw)* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ - ret_val =e1000_disable_pcie_master_generic (hw); + ret_val =e1000_disable_pcie_primary_generic (hw);if (ret_val) -DEBUGOUT ("PCI-E Master disable polling has failed.\n" ); +DEBUGOUT ("PCI-E Primary disable polling has failed.\n" );/* set the completion timeout for interface */ ret_val =e1000_set_pcie_completion_timeout (hw);
@@ -2290,9 +2290,9 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ - ret_val =e1000_disable_pcie_master_generic (hw); + ret_val =e1000_disable_pcie_primary_generic (hw);if (ret_val) -DEBUGOUT ("PCI-E Master disable polling has failed.\n" ); +DEBUGOUT ("PCI-E Primary disable polling has failed.\n" );DEBUGOUT ("Masking off all interrupts\n" );E1000_WRITE_REG (hw,E1000_IMC ,0xffffffff );
drivers/net/intel/e1000/base/e1000_api.c +4 -4
@@ -858,16 +858,16 @@ void e1000_update_adaptive(struct e1000_hw *hw) }/** -* e1000_disable_pcie_master - Disable PCI-Express master access +* e1000_disable_pcie_primary - Disable PCI-Express primary access * @hw: pointer to the HW structure * -* Disables PCI-Express master access and verifies there are no pending +* Disables PCI-Express primary access and verifies there are no pending * requests. Currently no func pointer exists and all implementations are * handled in the generic version of this function. **/ -s32 e1000_disable_pcie_master (struct e1000_hw *hw) +s32 e1000_disable_pcie_primary (struct e1000_hw *hw) { -return e1000_disable_pcie_master_generic (hw); +return e1000_disable_pcie_primary_generic (hw); }/**
drivers/net/intel/e1000/base/e1000_api.h +1 -1
@@ -37,7 +37,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw);s32 e1000_init_hw (struct e1000_hw *hw);s32 e1000_setup_link (struct e1000_hw *hw);s32 e1000_get_speed_and_duplex (struct e1000_hw *hw,u16 *speed,u16 *duplex); -s32 e1000_disable_pcie_master (struct e1000_hw *hw); +s32 e1000_disable_pcie_primary (struct e1000_hw *hw);void e1000_config_collision_dist (struct e1000_hw *hw);int e1000_rar_set (struct e1000_hw *hw,u8 *addr,u32 index);u32 e1000_hash_mc_addr (struct e1000_hw *hw,u8 *mc_addr);
drivers/net/intel/e1000/base/e1000_defines.h +21 -19
@@ -235,7 +235,7 @@/* Device Control */ #define E1000_CTRL_FD 0x00000001/* Full duplex.0=half; 1=full */ #define E1000_CTRL_PRIOR 0x00000004/* Priority on PCI. 0=rx,1=fair */ -#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004/*Blocks new Master reqs */ +#define E1000_CTRL_GIO_PRIMARY_DISABLE 0x00000004/*Blocks new Primary reqs */ #define E1000_CTRL_LRST 0x00000008/* Link reset. 0=normal,1=reset */ #define E1000_CTRL_ASDE 0x00000020/* Auto-speed detect enable */ #define E1000_CTRL_SLU 0x00000040/* Set link up (Force Link) */
@@ -313,7 +313,7 @@#define E1000_STATUS_SPEED_2500 0x00400000#define E1000_STATUS_LAN_INIT_DONE 0x00000200/* Lan Init Compltn by NVM */ #define E1000_STATUS_PHYRA 0x00000400/* PHY Reset Asserted */ -#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000/* Master request status */ +#define E1000_STATUS_GIO_PRIMARY_ENABLE 0x00080000/* Primary request status */ #define E1000_STATUS_PCI66 0x00000800/* In 66Mhz slot */ #define E1000_STATUS_BUS64 0x00001000/* In 64 bit slot */ #define E1000_STATUS_2P5_SKU 0x00001000/* Val of 2.5GBE SKU strap */
@@ -707,7 +707,7 @@#define E1000_ERR_MAC_INIT 5#define E1000_ERR_PHY_TYPE 6#define E1000_ERR_RESET 9 -#define E1000_ERR_MASTER_REQUESTS_PENDING 10 +#define E1000_ERR_PRIMARY_REQUESTS_PENDING 10#define E1000_ERR_HOST_INTERFACE_COMMAND 11#define E1000_BLK_PHY_RESET 12#define E1000_ERR_SWFW_SYNC 13
@@ -724,8 +724,8 @@#define COPPER_LINK_UP_LIMIT 10#define PHY_AUTO_NEG_LIMIT 45#define PHY_FORCE_LIMIT 20 -/* Number of 100 microseconds we wait for PCI Express master disable */ -#define MASTER_DISABLE_TIMEOUT 800 +/* Number of 100 microseconds we wait for PCI Express primary disable */ +#define PRIMARY_DISABLE_TIMEOUT 800/* Number of milliseconds we wait for PHY configuration done after MAC reset */ #define PHY_CFG_TIMEOUT 100/* Number of 2 milliseconds we wait for acquiring MDIO ownership. */
@@ -936,7 +936,7 @@#define E1000_EEE_LP_ADV_ADDR_I350 0x040F/* EEE LP Advertisement */ #define E1000_M88E1543_PAGE_ADDR 0x16/* Page Offset Register */ #define E1000_M88E1543_EEE_CTRL_1 0x0 -#define E1000_M88E1543_EEE_CTRL_1_MS 0x0001/* EEE Master/Slave */ +#define E1000_M88E1543_EEE_CTRL_1_MS 0x0001/* EEE Primary/Secondary */ #define E1000_M88E1543_FIBER_CTRL 0x0/* Fiber Control Register */ #define E1000_EEE_ADV_DEV_I354 7#define E1000_EEE_ADV_ADDR_I354 60
@@ -1063,14 +1063,16 @@#define CR_1000T_FD_CAPS 0x0200/* Advertise 1000T FD capability */ /* 1=Repeater/switch device port 0=DTE device */ #define CR_1000T_REPEATER_DTE 0x0400 -/* 1=Configure PHY as Master 0=Configure PHY as Slave */ +/* 1=Configure PHY as Primary 0=Configure PHY as Secondary */ #define CR_1000T_MS_VALUE 0x0800 -/* 1=Master/Slave manual config value 0=Automatic Master/Slave config */ +/* 1=Primary/Secondary manual config value +* 0=Automatic Primary/Secondary config +*/ #define CR_1000T_MS_ENABLE 0x1000#define CR_1000T_TEST_MODE_NORMAL 0x0000/* Normal Operation */ #define CR_1000T_TEST_MODE_1 0x2000/* Transmit Waveform test */ -#define CR_1000T_TEST_MODE_2 0x4000/* Master Transmit Jitter test */ -#define CR_1000T_TEST_MODE_3 0x6000/* Slave Transmit Jitter test */ +#define CR_1000T_TEST_MODE_2 0x4000/* Primary Transmit Jitter test */ +#define CR_1000T_TEST_MODE_3 0x6000/* Secondary Transmit Jitter test */ #define CR_1000T_TEST_MODE_4 0x8000/* Transmitter Distortion test */ /* 1000BASE-T Status Register */
@@ -1080,8 +1082,8 @@#define SR_1000T_LP_FD_CAPS 0x0800/* LP is 1000T FD capable */ #define SR_1000T_REMOTE_RX_STATUS 0x1000/* Remote receiver OK */ #define SR_1000T_LOCAL_RX_STATUS 0x2000/* Local receiver OK */ -#define SR_1000T_MS_CONFIG_RES 0x4000/* 1=Local Tx Master, 0=Slave */ -#define SR_1000T_MS_CONFIG_FAULT 0x8000/* Master/Slave config fault */ +#define SR_1000T_MS_CONFIG_RES 0x4000/* 1=Local Tx Primary, 0=Secondary */ +#define SR_1000T_MS_CONFIG_FAULT 0x8000/* Primary/Secondary config fault */ #define SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT 5
@@ -1426,15 +1428,15 @@#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7/* Number of times we will attempt to autonegotiate before downshifting if we -* are the master +* are the primary */ -#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00 -#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000 +#define M88E1000_EPSCR_PRIMARY_DOWNSHIFT_MASK 0x0C00 +#define M88E1000_EPSCR_PRIMARY_DOWNSHIFT_1X 0x0000/* Number of times we will attempt to autonegotiate before downshifting if we -* are the slave +* are the secondary */ -#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300 -#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X 0x0100 +#define M88E1000_EPSCR_SECONDARY_DOWNSHIFT_MASK 0x0300 +#define M88E1000_EPSCR_SECONDARY_DOWNSHIFT_1X 0x0100#define M88E1000_EPSCR_TX_CLK_25 0x0070/* 25 MHz TX_CLK */ /* Intel I347AT4 Registers */
@@ -1445,7 +1447,7 @@/* I347AT4 Extended PHY Specific Control Register */ /* Number of times we will attempt to autonegotiate before downshifting if we -* are the master +* are the primary */ #define I347AT4_PSCR_DOWNSHIFT_ENABLE 0x0800#define I347AT4_PSCR_DOWNSHIFT_MASK 0x7000
drivers/net/intel/e1000/base/e1000_hw.h +2 -2
@@ -391,8 +391,8 @@ enum e1000_dsp_config {enum e1000_ms_type { e1000_ms_hw_default =0 , - e1000_ms_force_master, - e1000_ms_force_slave, + e1000_ms_force_primary, + e1000_ms_force_secondary, e1000_ms_auto };
drivers/net/intel/e1000/base/e1000_i225.c +2 -2
@@ -209,9 +209,9 @@ static s32 e1000_reset_hw_i225(struct e1000_hw *hw)* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ - ret_val =e1000_disable_pcie_master_generic (hw); + ret_val =e1000_disable_pcie_primary_generic (hw);if (ret_val) -DEBUGOUT ("PCI-E Master disable polling has failed.\n" ); +DEBUGOUT ("PCI-E Primary disable polling has failed.\n" );DEBUGOUT ("Masking off all interrupts\n" );E1000_WRITE_REG (hw,E1000_IMC ,0xffffffff );
drivers/net/intel/e1000/base/e1000_ich8lan.c +4 -4
@@ -151,8 +151,8 @@ union ich8_hws_flash_regacc {struct ich8_flracc {u32 grra:8 ;/* 0:7 GbE region Read Access */ u32 grwa:8 ;/* 8:15 GbE region Write Access */ -u32 gmrag:8 ;/* 23:16 GbE Master Read Access Grant */ -u32 gmwag:8 ;/* 31:24 GbE Master Write Access Grant */ +u32 gmrag:8 ;/* 23:16 GbE Primary Read Access Grant */ +u32 gmwag:8 ;/* 31:24 GbE Primary Write Access Grant */ } hsf_flregacc;u16 regval; };
@@ -4930,9 +4930,9 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)/* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ - ret_val =e1000_disable_pcie_master_generic (hw); + ret_val =e1000_disable_pcie_primary_generic (hw);if (ret_val) -DEBUGOUT ("PCI-E Master disable polling has failed.\n" ); +DEBUGOUT ("PCI-E Primary disable polling has failed.\n" );DEBUGOUT ("Masking off all interrupts\n" );E1000_WRITE_REG (hw,E1000_IMC ,0xffffffff );
drivers/net/intel/e1000/base/e1000_mac.c +11 -11
@@ -2063,33 +2063,33 @@ void e1000_set_pcie_no_snoop_generic(struct e1000_hw *hw, u32 no_snoop) }/** -* e1000_disable_pcie_master_generic - Disables PCI-express master access +* e1000_disable_pcie_primary_generic - Disables PCI-express primary access * @hw: pointer to the HW structure * * Returns E1000_SUCCESS if successful, else returns -10 -* (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused -* the master requests to be disabled. +* (-E1000_ERR_PRIMARY_REQUESTS_PENDING) if primary disable bit has not caused +* the primary requests to be disabled. * -* Disables PCI-Express master access and verifies there are no pending +* Disables PCI-Express primary access and verifies there are no pending * requests. **/ -s32 e1000_disable_pcie_master_generic (struct e1000_hw *hw) +s32 e1000_disable_pcie_primary_generic (struct e1000_hw *hw) {u32 ctrl; -s32 timeout =MASTER_DISABLE_TIMEOUT ; +s32 timeout =PRIMARY_DISABLE_TIMEOUT ; -DEBUGFUNC ("e1000_disable_pcie_master_generic" ); +DEBUGFUNC ("e1000_disable_pcie_primary_generic" );if (hw->bus.type != e1000_bus_type_pci_express)return E1000_SUCCESS ; ctrl =E1000_READ_REG (hw,E1000_CTRL ); - ctrl |=E1000_CTRL_GIO_MASTER_DISABLE ; + ctrl |=E1000_CTRL_GIO_PRIMARY_DISABLE ;E1000_WRITE_REG (hw,E1000_CTRL , ctrl);while (timeout) {if (!(E1000_READ_REG (hw,E1000_STATUS ) & -E1000_STATUS_GIO_MASTER_ENABLE ) || +E1000_STATUS_GIO_PRIMARY_ENABLE ) ||E1000_REMOVED (hw->hw_addr))break ;usec_delay (100 );
@@ -2097,8 +2097,8 @@ s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw) }if (!timeout) { -DEBUGOUT ("Master requests are pending.\n" ); -return -E1000_ERR_MASTER_REQUESTS_PENDING ; +DEBUGOUT ("Primary requests are pending.\n" ); +return -E1000_ERR_PRIMARY_REQUESTS_PENDING ; }return E1000_SUCCESS ;
drivers/net/intel/e1000/base/e1000_mac.h +1 -1
@@ -22,7 +22,7 @@ s32 e1000_cleanup_led_generic(struct e1000_hw *hw);s32 e1000_commit_fc_settings_generic (struct e1000_hw *hw);s32 e1000_poll_fiber_serdes_link_generic (struct e1000_hw *hw);s32 e1000_config_fc_after_link_up_generic (struct e1000_hw *hw); -s32 e1000_disable_pcie_master_generic (struct e1000_hw *hw); +s32 e1000_disable_pcie_primary_generic (struct e1000_hw *hw);s32 e1000_force_mac_fc_generic (struct e1000_hw *hw);s32 e1000_get_auto_rd_done_generic (struct e1000_hw *hw);s32 e1000_get_bus_info_pci_generic (struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_phy.c +23 -23
125 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_regs.h +1 -1
@@ -283,7 +283,7 @@#define E1000_FFMT_REG (_i) (0x09000 + ((_i) * 8))#define E1000_FFVT_REG (_i) (0x09800 + ((_i) * 8))#define E1000_FFLT_REG (_i) (0x05F00 + ((_i) * 8)) -#define E1000_PBSLAC 0x03100/* Pkt Buffer Slave Access Control */ +#define E1000_PBSLAC 0x03100/* Pkt Buffer Access Control */ #define E1000_PBSLAD (_n) (0x03110 + (0x4 * (_n)))/* Pkt Buffer DWORD */ #define E1000_TXPBS 0x03404/* Tx Packet Buffer Size - RW */ /* Same as TXPBS, renamed for newer Si - RW */
drivers/net/intel/e1000/base/e1000_vf.c +1 -1
@@ -175,7 +175,7 @@ STATIC s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw)DEBUGFUNC ("e1000_get_bus_info_pcie_vf" ); -/* Do not set type PCI-E because we don't want disable master to run */ +/* Do not set type PCI-E because we don't want disable primary to run */ bus->type = e1000_bus_type_reserved; bus->speed = e1000_bus_speed_2500;
Signature · 1 line
2.43.5
PATCH v3 33/36 net/e1000/base: introduce PHY ID retry mechanism
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
On some customer platforms it was observed that invalid PHY ID (0x0000) was returned on first try. This patch introduces PHY ID retry mechanism to perform retries on PHY ID read for up to a second. Because the original code was intentionally not checking PHY ID due to a different issue, this fix only checks if PHY ID is non-zero, but otherwise considers any PHY ID as valid.
In addition, IEEE standard defines format of PHY ID, so extract these bits from PHY ID value.
--- drivers/net/intel/e1000/base/e1000_defines.h | 1 + drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_i225.c | 44 +++++++++++++++++++- 3 files changed, 44 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +1 -0
@@ -1382,6 +1382,7 @@#define BCM54616_E_PHY_ID 0x03625D10#define M88_VENDOR 0x0141#define I225_I_PHY_ID 0x67C9DC00 +#define I225_I_PHY_ID_MASK 0xFFFFFC00#define I226_LM_PHY_ID 0x67C9DC10/* M88E1000 Specific Registers */
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
@@ -1049,6 +1049,7 @@ struct e1000_dev_spec_vf {struct e1000_dev_spec_i225 {bool global_device_reset;bool eee_disable; +bool wait_for_valid_phy_id_read;bool clear_semaphore_once;bool module_plugged;u8 media_port;
drivers/net/intel/e1000/base/e1000_i225.c +42 -2
60 lines not on this page · raw message
Signature · 1 line
2.43.5
PATCH v3 34/36 net/e1000/base: add PHY read/write retry mechanism
In reply to Anatoly BurakovFrom: Nir Efrati <[email protected]>
Sporadic MDI errors are observed on some platforms. To address them, a read/write retry mechanism is introduced. Set the initial retry counter to 3 with an option to disable/enable the mechanism for some specific flows that errors are expected.
--- drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_ich8lan.c | 34 ++++ drivers/net/intel/e1000/base/e1000_phy.c | 195 ++++++++++++------- drivers/net/intel/e1000/base/e1000_phy.h | 2 + 4 files changed, 157 insertions(+), 75 deletions(-)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
@@ -888,6 +888,7 @@ struct e1000_phy_info {u32 id;u32 reset_delay_us;/* in usec */ u32 revision; +u32 current_retry_counter;enum e1000_media_type media_type;
drivers/net/intel/e1000/base/e1000_ich8lan.c +34 -0
@@ -217,11 +217,19 @@ STATIC bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)/* Only unforce SMBus if ME is not active */ if (!(E1000_READ_REG (hw,E1000_FWSM ) &E1000_ICH_FWSM_FW_VALID )) { +/* Switching PHY interface always returns MDI error +* so disable retry mechanism to avoid wasting time +*/ +u32 phy_retries =0 ; +e1000_disable_phy_retry_mechanism (hw, &phy_retries); +/* Unforce SMBus mode in PHY */ hw->phy.ops.read_reg_locked (hw,CV_SMB_CTRL , &phy_reg); phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS ; hw->phy.ops.write_reg_locked (hw,CV_SMB_CTRL , phy_reg); +e1000_enable_phy_retry_mechanism (hw, phy_retries); +/* Unforce SMBus mode in MAC */ mac_reg =E1000_READ_REG (hw,E1000_CTRL_EXT ); mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS ;
@@ -287,6 +295,7 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) {u32 mac_reg, fwsm =E1000_READ_REG (hw,E1000_FWSM );s32 ret_val; +u32 phy_retries =0 ;DEBUGFUNC ("e1000_init_phy_workarounds_pchlan" );
@@ -306,6 +315,11 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) goto out; } +/* There is no guarantee that the PHY is accessible at this time +* so disable retry mechanism to avoid wasting time +*/ +e1000_disable_phy_retry_mechanism (hw, &phy_retries); +/* The MAC-PHY interconnect may be in SMBus mode. If the PHY is * inaccessible and resetting the PHY is not blocked, toggle the * LANPHYPC Value bit to force the interconnect to PCIe mode.
@@ -374,6 +388,8 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)break ; } +e1000_enable_phy_retry_mechanism (hw, phy_retries); + hw->phy.ops.release (hw);if (!ret_val) {
@@ -450,6 +466,8 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) phy->id = e1000_phy_unknown; +if (hw->mac.type == e1000_pch_mtp) + phy->current_retry_counter =2 ; ret_val =e1000_init_phy_workarounds_pchlan (hw);if (ret_val)return ret_val;
@@ -1141,6 +1159,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)if (hw->dev_spec.ich8lan.smbus_disable) goto skip_smbus; +/* Switching PHY interface always returns MDI error +* so disable retry mechanism to avoid wasting time +*/ +u32 phy_retries =0 ; +e1000_disable_phy_retry_mechanism (hw, &phy_retries); +/* Force SMBus mode in PHY */ ret_val =e1000_read_phy_reg_hv_locked (hw,CV_SMB_CTRL , &phy_reg);if (ret_val)
@@ -1148,6 +1172,8 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) phy_reg |=CV_SMB_CTRL_FORCE_SMBUS ;e1000_write_phy_reg_hv_locked (hw,CV_SMB_CTRL , phy_reg); +e1000_enable_phy_retry_mechanism (hw, phy_retries); +/* Force SMBus mode in MAC */ mac_reg =E1000_READ_REG (hw,E1000_CTRL_EXT ); mac_reg |=E1000_CTRL_EXT_FORCE_SMBUS ;
@@ -1353,6 +1379,12 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)/* Toggle LANPHYPC Value bit */ e1000_toggle_lanphypc_pch_lpt (hw); +/* Switching PHY interface always returns MDI error +* so disable retry mechanism to avoid wasting time +*/ +u32 phy_retries =0 ; +e1000_disable_phy_retry_mechanism (hw, &phy_retries); +/* Unforce SMBus mode in PHY */ ret_val =e1000_read_phy_reg_hv_locked (hw,CV_SMB_CTRL , &phy_reg);if (ret_val) {
@@ -1373,6 +1405,8 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS ;e1000_write_phy_reg_hv_locked (hw,CV_SMB_CTRL , phy_reg); +e1000_enable_phy_retry_mechanism (hw, phy_retries); +/* Unforce SMBus mode in MAC */ mac_reg =E1000_READ_REG (hw,E1000_CTRL_EXT ); mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS ;
drivers/net/intel/e1000/base/e1000_phy.c +120 -75
230 lines not on this page · raw message
drivers/net/intel/e1000/base/e1000_phy.h +2 -0
@@ -68,6 +68,8 @@ s32 e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);s32 e1000_write_phy_reg_bm2 (struct e1000_hw *hw,u32 offset,u16 data);void e1000_power_up_phy_copper (struct e1000_hw *hw);void e1000_power_down_phy_copper (struct e1000_hw *hw); +void e1000_disable_phy_retry_mechanism (struct e1000_hw *hw,u32 *phy_retries_original); +void e1000_enable_phy_retry_mechanism (struct e1000_hw *hw,u32 phy_retries_original);s32 e1000_read_phy_reg_mdic (struct e1000_hw *hw,u32 offset,u16 *data);s32 e1000_write_phy_reg_mdic (struct e1000_hw *hw,u32 offset,u16 data);s32 e1000_read_phy_reg_i2c (struct e1000_hw *hw,u32 offset,u16 *data);
Signature · 1 line
2.43.5
PATCH v3 35/36 net/e1000/base: rename NVM version variable
In reply to Anatoly BurakovFrom: Piotr Kubaj <[email protected]>
Rename version to nvm_version to avoid shadowing global variables on some systems.
--- .mailmap | 2 +- drivers/net/intel/e1000/base/e1000_i210.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-)
.mailmap +1 -1
@@ -1206,7 +1206,7 @@ Piotr Azarewicz <[email protected]> <[email protected]> Piotr Bartosiewicz <[email protected]> Piotr Bronowski <[email protected]> Piotr Gardocki <[email protected]> -Piotr Kubaj <[email protected]> +Piotr Kubaj <[email protected]> <[email protected]> Piotr Kwapulinski <[email protected]> Piotr Pietruszewski <[email protected]> Piotr Raczynski <[email protected]>
drivers/net/intel/e1000/base/e1000_i210.c +7 -7
@@ -479,7 +479,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw, E1000_INVM_RECORD_SIZE_IN_BYTES);u32 buffer[E1000_INVM_SIZE ];s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND ; -u16 version =0 ; +u16 nvm_version =0 ;DEBUGFUNC ("e1000_read_invm_version" );
@@ -496,14 +496,14 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,/* Check if we have first version location used */ if ((i ==1 ) && ((*record &E1000_INVM_VER_FIELD_ONE ) ==0 )) { - version =0 ; + nvm_version =0 ; status =E1000_SUCCESS ;break ; }/* Check if we have second version location used */ else if ((i ==1 ) && ((*record &E1000_INVM_VER_FIELD_TWO ) ==0 )) { - version = (*record &E1000_INVM_VER_FIELD_ONE ) >>3 ; + nvm_version = (*record &E1000_INVM_VER_FIELD_ONE ) >>3 ; status =E1000_SUCCESS ;break ; }
@@ -514,7 +514,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,else if ((((*record &E1000_INVM_VER_FIELD_ONE ) ==0 ) && ((*record &0x3 ) ==0 )) || (((*record &0x3 ) !=0 ) && (i !=1 ))) { - version = (*next_record &E1000_INVM_VER_FIELD_TWO ) + nvm_version = (*next_record &E1000_INVM_VER_FIELD_TWO ) >>13 ; status =E1000_SUCCESS ;break ;
@@ -525,16 +525,16 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,*/ else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && ((*record & 0x3) == 0)) { - version = (*record &E1000_INVM_VER_FIELD_ONE ) >>3 ; + nvm_version = (*record &E1000_INVM_VER_FIELD_ONE ) >>3 ; status =E1000_SUCCESS ;break ; } }if (status ==E1000_SUCCESS ) { - invm_ver->invm_major = (version &E1000_INVM_MAJOR_MASK ) + invm_ver->invm_major = (nvm_version &E1000_INVM_MAJOR_MASK ) >>E1000_INVM_MAJOR_SHIFT ; - invm_ver->invm_minor = version &E1000_INVM_MINOR_MASK ; + invm_ver->invm_minor = nvm_version &E1000_INVM_MINOR_MASK ; }/* Read Image Type */ for (i =1 ; i < invm_blocks; i++) {
Signature · 1 line
2.43.5
PATCH v3 36/36 net/e1000: update e1000 documentation
In reply to Anatoly BurakovNow that the base code has been brought up to date, update the docs to call this out.
--- doc/guides/rel_notes/release_25_03.rst | 1 + drivers/net/intel/e1000/base/README | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_25_03.rst +1 -0
@@ -96,6 +96,7 @@ New Features * **Updated Intel e1000 driver.** * Added support for the Intel i225-series NICs (previously handled by net/igc). + * Updated base code to the latest version. Removed Items -------------
drivers/net/intel/e1000/base/README +3 -3
@@ -2,9 +2,9 @@ * Copyright(c) 2010-2020 Intel Corporation */ -This directory contains source code of FreeBSD em, igb, and igc drivers of version -cid-gigabit.2020.06.05.tar.gz released by ND. The sub-directory of base/ -contains the original source package. +This directory contains source code of FreeBSD em, igb, and igc drivers of +snapshot generated on 2025-01-24-09.44. The sub-directory of base/ contains the +original source package. This driver is valid for the product(s) listed below * Intel® Ethernet Controller 82540
Signature · 1 line
2.43.5
Re: [PATCH v3 36/36] net/e1000: update e1000 documentation
Quoted 26 lines · Anatoly Burakov
Now that the base code has been brought up to date, update the docs to call this out.
Signed-off-by Anatoly Burakov <[email protected]>--- doc/guides/rel_notes/release_25_03.rst | 1 + drivers/net/intel/e1000/base/README | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-)doc/guides/rel_notes/release_25_03.rst +1
-0@@ -96,6 +96,7 @@ New Features * **Updated Intel e1000 driver.** * Added support for the Intel i225-series NICs (previously handled by net/igc). + * Updated base code to the latest version. Removed Items -------------drivers/net/intel/e1000/base/README +0
-0
drivers/net/intel/e1000/base/README line 8
Quoted 10 lines
drivers/net/intel/e1000/base/README +3
-3@@ -2,9 +2,9 @@ * Copyright(c) 2010-2020 Intel Corporation */ -This directory contains source code of FreeBSD em, igb, and igc drivers of version -cid-gigabit.2020.06.05.tar.gz released by ND. The sub-directory of base/ -contains the original source package. +This directory contains source code of FreeBSD em, igb, and igc drivers of +snapshot generated on 2025-01-24-09.44. The sub-directory of base/ contains the +original source package.
I'm going to reword this on apply to something more similar to the other base driver READMEs, since a) it's no longer a driver from FreeBSD and b) this README is already in the "base" subdirectory.
"This directory contains source code of the base driver code for em/igb/igc, with this snapshot generated on 2025-01-24-09.44."
Regards,
/Bruce
Bruce Richardson
AppliedQuoted 15 lines · Anatoly Burakov
Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).
After the merge is done, base code is also updated to latest snapshot.
v2 -> v3:
- Fixes to drivers were separated out as a separate patchset [1]
- Fixed signoffs and authorship
- Fixed check-git-log and check-meson warnings
- Added libabigail ignore for the removed driver
- Added release notes
- UpdatedMAINTAINERSfile
Quoted 5 lines
v1 -> v2:
- igc code is now a direct copy from IGC rather than a rebuild-from-source
- i225-related fixes are now separate, not squashed
- removed unused args warning workaround
Thanks for all the work, Anatoly.
Applied to dpdk-next-net-intel.
/Bruce