Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ice subfunction in switchdev #1

Draft
wants to merge 71 commits into
base: dev-queue
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e3961a8
i40e: Fix waiting for queues of all VSIs to be disabled
Nov 8, 2023
ca7058c
i40e: Fix wrong mask used during DCB config
Nov 30, 2023
28b9042
e1000e: make lost bits explicit
jbrandeb Dec 6, 2023
5e9edb7
intel: add bit macro includes where needed
jbrandeb Dec 6, 2023
eac14c2
intel: legacy: field prep conversion
jbrandeb Dec 6, 2023
8298318
i40e: field prep conversion
jbrandeb Dec 6, 2023
4d0c9ea
iavf: field prep conversion
jbrandeb Dec 6, 2023
c9b0bc4
ice: field prep conversion
jbrandeb Dec 6, 2023
47fa112
ice: fix pre-shifted bit usage
jbrandeb Dec 6, 2023
a9f51cd
igc: field prep conversion
jbrandeb Dec 6, 2023
2ba11a9
intel: legacy: field get conversion
jbrandeb Dec 6, 2023
22ebca9
igc: field get conversion
jbrandeb Dec 6, 2023
db66b97
i40e: field get conversion
jbrandeb Dec 6, 2023
a1fdb70
iavf: field get conversion
jbrandeb Dec 6, 2023
71b3d11
ice: field get conversion
jbrandeb Dec 6, 2023
3e12962
ice: cleanup inconsistent code
jbrandeb Dec 6, 2023
ff8d465
idpf: refactor some missing field get/prep conversions
jbrandeb Dec 6, 2023
43fcdba
i40e: Use existing helper to find flow director VSI
Nov 24, 2023
d7c38ca
i40e: Introduce and use macros for iterating VSIs and VEBs
Nov 24, 2023
24b3c60
i40e: Add helpers to find VSI and VEB by SEID and use them
Nov 24, 2023
a926653
i40e: Fix broken support for floating VEBs
Nov 24, 2023
54e240f
i40e: Remove VEB recursion
Nov 24, 2023
b1b212c
i40e: Fix filter input checks to prevent config with invalid values
msudheer337 Nov 29, 2023
de993eb
i40e: Fix ST code value for Clause 45
Nov 29, 2023
f41f255
ice: fix theoretical out-of-bounds access in ethtool link modes
michich Nov 30, 2023
e733031
ice: replace ice_vf_recreate_vsi() with ice_vf_reconfig_vsi()
jacob-keller Nov 28, 2023
1c97970
ice: Schedule service task in IRQ top half
kolacinskikarol Nov 29, 2023
7e50184
ice: Enable SW interrupt from FW for LL TS
kolacinskikarol Nov 29, 2023
f7a780f
i40e: Fix VF disable behavior to block all traffic
CuriousPanCake Nov 29, 2023
baa7df1
igc: Report VLAN EtherType matching back to user
shifty91 Dec 1, 2023
d4d9606
igc: Check VLAN TCI mask
shifty91 Dec 1, 2023
bffeb02
ice: ice_base.c: Add const modifier to params and vars
jglaza Nov 29, 2023
8be074b
igc: Check VLAN EtherType mask
shifty91 Dec 6, 2023
996aeef
ice: remove rx_len_errors statistic
JanJSokolowski Dec 6, 2023
03df5b9
ice: stop trashing VF VSI aggregator node ID information
jacob-keller Dec 6, 2023
82e47fa
ice: introduce new E825C devices family
gnitka Dec 6, 2023
bc949fa
ice: Add helper function ice_is_generic_mac
gnitka Dec 6, 2023
ec34106
ice: add support for 3k signing DDP sections for E825C
gnitka Dec 6, 2023
454b792
ice: alter feature support check for SRIOV and LAG
dmertman Dec 7, 2023
fd8b56c
igc: Fix hicredit calculation
rodrigo-cadore-la Dec 8, 2023
889ac52
idpf: fix corrupted frames and skb leaks in singleq mode
alobakin Dec 11, 2023
eec8ffc
i40e: Use correct buffer size in i40e_dbg_command_read
KunWuChan Dec 8, 2023
6e63c72
ixgbe: report link state for VF devices
opanait-wr Dec 8, 2023
c40df7c
ice: Add support for devlink loopback param.
pkaminsk Dec 8, 2023
362e1c3
ice: Fix PF with enabled XDP going no-carrier after reset
walking-machine Dec 12, 2023
881fa42
ice: Fix some null pointer dereference issues in ice_ptp.c
KunWuChan Dec 12, 2023
cea16cf
ice: Add support for packet mirroring using hardware in switchdev mode
CuriousPanCake Dec 12, 2023
21ea412
e1000e: correct maximum frequency adjustment values
jacob-keller Dec 12, 2023
680a6ea
ice: Fix link_down_on_close message
Wieczerzycka Dec 15, 2023
099d5d2
ice: Shut down VSI with "link-down-on-close" enabled
nmkwan Dec 15, 2023
256aeac
idpf: enable WB_ON_ITR
jahay1 Dec 15, 2023
259fb7d
idpf: avoid compiler introduced padding in virtchnl2_rss_key struct
plinga1 Dec 15, 2023
77cb7c6
i40e: fix use-after-free in i40e_aqc_add_filters()
Dec 18, 2023
9b651e1
ice: dpll: fix phase offset value
kubalewski Dec 18, 2023
3e99bf1
i40e: Avoid unnecessary use of comma operator
horms Dec 17, 2023
82d6c87
ixgbe: Refactor overtemp event handling
jjagielsk Dec 18, 2023
087c173
ixgbe: Refactor returning internal error codes
jjagielsk Dec 18, 2023
0e6b636
ice: move devlink port code to a separate file
praczyns Nov 28, 2023
031dd96
ice: add new vsi type for subfunctions
praczyns Nov 28, 2023
6a28e96
ice: export ice ndo_ops functions
praczyns Nov 28, 2023
c8a2358
ice: add basic devlink subfunctions support
praczyns Nov 28, 2023
1587c3b
ice: add subfunctions ethtool ops
pawelchm-intel Nov 28, 2023
1ce240f
ice: add subfunction aux driver support
praczyns Nov 28, 2023
ed5a75d
ice: add auxiliary device sfnum attribute
praczyns Nov 28, 2023
85d91b7
ice: store SF data in VSI struct
Nov 28, 2023
1cebe06
ice: store representor ID in bridge port
Dec 14, 2023
9be40b4
ice: create port representor for SF
Nov 28, 2023
a23bc56
ice: check if SF is ready in ethtool ops
Nov 28, 2023
29aca87
ice: netdevice ops for SF representor
Nov 28, 2023
2deb9b1
ice: support subfunction devlink Tx topology
Nov 28, 2023
18df6ea
ice: basic support for VLAN in subfunctions
Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Documentation/networking/devlink/ice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Parameters
==========

.. list-table:: Generic parameters implemented
:widths: 5 5 90

* - Name
- Mode
Expand All @@ -22,6 +23,20 @@ Parameters
- runtime
- mutually exclusive with ``enable_roce``

.. list-table:: Driver specific parameters implemented
:widths: 5 5 90

* - Name
- Mode
- Description
* - ``loopback``
- runtime
- Controls loopback behavior by tuning scheduler bandwidth.
Supported values are ``enabled``, ``disabled``, ``prioritized``.
The latter allows for bandwidth higher than external port speed
when looping back traffic between VFs. Works with 8x10G and 4x25G
cards.

Info versions
=============

Expand Down
46 changes: 20 additions & 26 deletions drivers/net/ethernet/intel/e1000/e1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Shared functions for accessing and configuring the MAC
*/

#include <linux/bitfield.h>
#include "e1000.h"

static s32 e1000_check_downshift(struct e1000_hw *hw);
Expand Down Expand Up @@ -3260,8 +3261,7 @@ static s32 e1000_phy_igp_get_info(struct e1000_hw *hw,
return ret_val;

phy_info->mdix_mode =
(e1000_auto_x_mode) ((phy_data & IGP01E1000_PSSR_MDIX) >>
IGP01E1000_PSSR_MDIX_SHIFT);
(e1000_auto_x_mode)FIELD_GET(IGP01E1000_PSSR_MDIX, phy_data);

if ((phy_data & IGP01E1000_PSSR_SPEED_MASK) ==
IGP01E1000_PSSR_SPEED_1000MBPS) {
Expand All @@ -3272,11 +3272,11 @@ static s32 e1000_phy_igp_get_info(struct e1000_hw *hw,
if (ret_val)
return ret_val;

phy_info->local_rx = ((phy_data & SR_1000T_LOCAL_RX_STATUS) >>
SR_1000T_LOCAL_RX_STATUS_SHIFT) ?
phy_info->local_rx = FIELD_GET(SR_1000T_LOCAL_RX_STATUS,
phy_data) ?
e1000_1000t_rx_status_ok : e1000_1000t_rx_status_not_ok;
phy_info->remote_rx = ((phy_data & SR_1000T_REMOTE_RX_STATUS) >>
SR_1000T_REMOTE_RX_STATUS_SHIFT) ?
phy_info->remote_rx = FIELD_GET(SR_1000T_REMOTE_RX_STATUS,
phy_data) ?
e1000_1000t_rx_status_ok : e1000_1000t_rx_status_not_ok;

/* Get cable length */
Expand Down Expand Up @@ -3326,14 +3326,12 @@ static s32 e1000_phy_m88_get_info(struct e1000_hw *hw,
return ret_val;

phy_info->extended_10bt_distance =
((phy_data & M88E1000_PSCR_10BT_EXT_DIST_ENABLE) >>
M88E1000_PSCR_10BT_EXT_DIST_ENABLE_SHIFT) ?
FIELD_GET(M88E1000_PSCR_10BT_EXT_DIST_ENABLE, phy_data) ?
e1000_10bt_ext_dist_enable_lower :
e1000_10bt_ext_dist_enable_normal;

phy_info->polarity_correction =
((phy_data & M88E1000_PSCR_POLARITY_REVERSAL) >>
M88E1000_PSCR_POLARITY_REVERSAL_SHIFT) ?
FIELD_GET(M88E1000_PSCR_POLARITY_REVERSAL, phy_data) ?
e1000_polarity_reversal_disabled : e1000_polarity_reversal_enabled;

/* Check polarity status */
Expand All @@ -3347,27 +3345,25 @@ static s32 e1000_phy_m88_get_info(struct e1000_hw *hw,
return ret_val;

phy_info->mdix_mode =
(e1000_auto_x_mode) ((phy_data & M88E1000_PSSR_MDIX) >>
M88E1000_PSSR_MDIX_SHIFT);
(e1000_auto_x_mode)FIELD_GET(M88E1000_PSSR_MDIX, phy_data);

if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) {
/* Cable Length Estimation and Local/Remote Receiver Information
* are only valid at 1000 Mbps.
*/
phy_info->cable_length =
(e1000_cable_length) ((phy_data &
M88E1000_PSSR_CABLE_LENGTH) >>
M88E1000_PSSR_CABLE_LENGTH_SHIFT);
(e1000_cable_length)FIELD_GET(M88E1000_PSSR_CABLE_LENGTH,
phy_data);

ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data);
if (ret_val)
return ret_val;

phy_info->local_rx = ((phy_data & SR_1000T_LOCAL_RX_STATUS) >>
SR_1000T_LOCAL_RX_STATUS_SHIFT) ?
phy_info->local_rx = FIELD_GET(SR_1000T_LOCAL_RX_STATUS,
phy_data) ?
e1000_1000t_rx_status_ok : e1000_1000t_rx_status_not_ok;
phy_info->remote_rx = ((phy_data & SR_1000T_REMOTE_RX_STATUS) >>
SR_1000T_REMOTE_RX_STATUS_SHIFT) ?
phy_info->remote_rx = FIELD_GET(SR_1000T_REMOTE_RX_STATUS,
phy_data) ?
e1000_1000t_rx_status_ok : e1000_1000t_rx_status_not_ok;
}

Expand Down Expand Up @@ -3515,7 +3511,7 @@ s32 e1000_init_eeprom_params(struct e1000_hw *hw)
if (ret_val)
return ret_val;
eeprom_size =
(eeprom_size & EEPROM_SIZE_MASK) >> EEPROM_SIZE_SHIFT;
FIELD_GET(EEPROM_SIZE_MASK, eeprom_size);
/* 256B eeprom size was not supported in earlier hardware, so we
* bump eeprom_size up one to ensure that "1" (which maps to
* 256B) is never the result used in the shifting logic below.
Expand Down Expand Up @@ -4891,8 +4887,7 @@ static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length,
&phy_data);
if (ret_val)
return ret_val;
cable_length = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
M88E1000_PSSR_CABLE_LENGTH_SHIFT;
cable_length = FIELD_GET(M88E1000_PSSR_CABLE_LENGTH, phy_data);

/* Convert the enum value to ranged values */
switch (cable_length) {
Expand Down Expand Up @@ -5001,8 +4996,7 @@ static s32 e1000_check_polarity(struct e1000_hw *hw,
&phy_data);
if (ret_val)
return ret_val;
*polarity = ((phy_data & M88E1000_PSSR_REV_POLARITY) >>
M88E1000_PSSR_REV_POLARITY_SHIFT) ?
*polarity = FIELD_GET(M88E1000_PSSR_REV_POLARITY, phy_data) ?
e1000_rev_polarity_reversed : e1000_rev_polarity_normal;

} else if (hw->phy_type == e1000_phy_igp) {
Expand Down Expand Up @@ -5072,8 +5066,8 @@ static s32 e1000_check_downshift(struct e1000_hw *hw)
if (ret_val)
return ret_val;

hw->speed_downgraded = (phy_data & M88E1000_PSSR_DOWNSHIFT) >>
M88E1000_PSSR_DOWNSHIFT_SHIFT;
hw->speed_downgraded = FIELD_GET(M88E1000_PSSR_DOWNSHIFT,
phy_data);
}

return E1000_SUCCESS;
Expand Down
23 changes: 11 additions & 12 deletions drivers/net/ethernet/intel/e1000e/80003es2lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)

nvm->type = e1000_nvm_eeprom_spi;

size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
E1000_EECD_SIZE_EX_SHIFT);
size = (u16)FIELD_GET(E1000_EECD_SIZE_EX_MASK, eecd);

/* Added to a constant, "size" becomes the left-shift value
* for setting word_size.
Expand Down Expand Up @@ -1035,17 +1034,18 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
* iteration and increase the max iterations when
* polling the phy; this fixes erroneous timeouts at 10Mbps.
*/
ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4),
0xFFFF);
/* these next three accesses were always meant to use page 0x34 using
* GG82563_REG(0x34, N) but never did, so we've just corrected the call
* to not drop bits
*/
ret_val = e1000_write_kmrn_reg_80003es2lan(hw, 4, 0xFFFF);
if (ret_val)
return ret_val;
ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
&reg_data);
ret_val = e1000_read_kmrn_reg_80003es2lan(hw, 9, &reg_data);
if (ret_val)
return ret_val;
reg_data |= 0x3F;
ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
reg_data);
ret_val = e1000_write_kmrn_reg_80003es2lan(hw, 9, reg_data);
if (ret_val)
return ret_val;
ret_val =
Expand Down Expand Up @@ -1209,8 +1209,8 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
if (ret_val)
return ret_val;

kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
kmrnctrlsta = FIELD_PREP(E1000_KMRNCTRLSTA_OFFSET, offset) |
E1000_KMRNCTRLSTA_REN;
ew32(KMRNCTRLSTA, kmrnctrlsta);
e1e_flush();

Expand Down Expand Up @@ -1244,8 +1244,7 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
if (ret_val)
return ret_val;

kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
E1000_KMRNCTRLSTA_OFFSET) | data;
kmrnctrlsta = FIELD_PREP(E1000_KMRNCTRLSTA_OFFSET, offset) | data;
ew32(KMRNCTRLSTA, kmrnctrlsta);
e1e_flush();

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/intel/e1000e/82571.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
fallthrough;
default:
nvm->type = e1000_nvm_eeprom_spi;
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
E1000_EECD_SIZE_EX_SHIFT);
size = (u16)FIELD_GET(E1000_EECD_SIZE_EX_MASK, eecd);
/* Added to a constant, "size" becomes the left-shift value
* for setting word_size.
*/
Expand Down
20 changes: 20 additions & 0 deletions drivers/net/ethernet/intel/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,23 +360,43 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca);
* As a result, a shift of INCVALUE_SHIFT_n is used to fit a value of
* INCVALUE_n into the TIMINCA register allowing 32+8+(24-INCVALUE_SHIFT_n)
* bits to count nanoseconds leaving the rest for fractional nonseconds.
*
* Any given INCVALUE also has an associated maximum adjustment value. This
* maximum adjustment value is the largest increase (or decrease) which can be
* safely applied without overflowing the INCVALUE. Since INCVALUE has
* a maximum range of 24 bits, its largest value is 0xFFFFFF.
*
* To understand where the maximum value comes from, consider the following
* equation:
*
* new_incval = base_incval + (base_incval * adjustment) / 1billion
*
* To avoid overflow that means:
* max_incval = base_incval + (base_incval * max_adj) / billion
*
* Re-arranging:
* max_adj = floor(((max_incval - base_incval) * 1billion) / 1billion)
*/
#define INCVALUE_96MHZ 125
#define INCVALUE_SHIFT_96MHZ 17
#define INCPERIOD_SHIFT_96MHZ 2
#define INCPERIOD_96MHZ (12 >> INCPERIOD_SHIFT_96MHZ)
#define MAX_PPB_96MHZ 23999900 /* 23,999,900 ppb */

#define INCVALUE_25MHZ 40
#define INCVALUE_SHIFT_25MHZ 18
#define INCPERIOD_25MHZ 1
#define MAX_PPB_25MHZ 599999900 /* 599,999,900 ppb */

#define INCVALUE_24MHZ 125
#define INCVALUE_SHIFT_24MHZ 14
#define INCPERIOD_24MHZ 3
#define MAX_PPB_24MHZ 999999999 /* 999,999,999 ppb */

#define INCVALUE_38400KHZ 26
#define INCVALUE_SHIFT_38400KHZ 19
#define INCPERIOD_38400KHZ 1
#define MAX_PPB_38400KHZ 230769100 /* 230,769,100 ppb */

/* Another drawback of scaling the incvalue by a large factor is the
* 64-bit SYSTIM register overflows more quickly. This is dealt with
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/ethernet/intel/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ static void e1000_get_drvinfo(struct net_device *netdev,
*/
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
"%d.%d-%d",
(adapter->eeprom_vers & 0xF000) >> 12,
(adapter->eeprom_vers & 0x0FF0) >> 4,
FIELD_GET(0xF000, adapter->eeprom_vers),
FIELD_GET(0x0FF0, adapter->eeprom_vers),
(adapter->eeprom_vers & 0x000F));

strscpy(drvinfo->bus_info, pci_name(adapter->pdev),
Expand Down Expand Up @@ -925,8 +925,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
}

if (mac->type >= e1000_pch_lpt)
wlock_mac = (er32(FWSM) & E1000_FWSM_WLOCK_MAC_MASK) >>
E1000_FWSM_WLOCK_MAC_SHIFT;
wlock_mac = FIELD_GET(E1000_FWSM_WLOCK_MAC_MASK, er32(FWSM));

for (i = 0; i < mac->rar_entry_count; i++) {
if (mac->type >= e1000_pch_lpt) {
Expand Down
18 changes: 7 additions & 11 deletions drivers/net/ethernet/intel/e1000e/ich8lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,13 +1072,11 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)

lat_enc_d = (lat_enc & E1000_LTRV_VALUE_MASK) *
(1U << (E1000_LTRV_SCALE_FACTOR *
((lat_enc & E1000_LTRV_SCALE_MASK)
>> E1000_LTRV_SCALE_SHIFT)));
FIELD_GET(E1000_LTRV_SCALE_MASK, lat_enc)));

max_ltr_enc_d = (max_ltr_enc & E1000_LTRV_VALUE_MASK) *
(1U << (E1000_LTRV_SCALE_FACTOR *
((max_ltr_enc & E1000_LTRV_SCALE_MASK)
>> E1000_LTRV_SCALE_SHIFT)));
(1U << (E1000_LTRV_SCALE_FACTOR *
FIELD_GET(E1000_LTRV_SCALE_MASK, max_ltr_enc)));

if (lat_enc_d > max_ltr_enc_d)
lat_enc = max_ltr_enc;
Expand Down Expand Up @@ -2075,8 +2073,7 @@ static s32 e1000_write_smbus_addr(struct e1000_hw *hw)
{
u16 phy_data;
u32 strap = er32(STRAP);
u32 freq = (strap & E1000_STRAP_SMT_FREQ_MASK) >>
E1000_STRAP_SMT_FREQ_SHIFT;
u32 freq = FIELD_GET(E1000_STRAP_SMT_FREQ_MASK, strap);
s32 ret_val;

strap &= E1000_STRAP_SMBUS_ADDRESS_MASK;
Expand Down Expand Up @@ -2562,8 +2559,7 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw)
hw->phy.ops.write_reg_page(hw, BM_RAR_H(i),
(u16)(mac_reg & 0xFFFF));
hw->phy.ops.write_reg_page(hw, BM_RAR_CTRL(i),
(u16)((mac_reg & E1000_RAH_AV)
>> 16));
FIELD_GET(E1000_RAH_AV, mac_reg));
}

e1000_disable_phy_wakeup_reg_access_bm(hw, &phy_reg);
Expand Down Expand Up @@ -3205,7 +3201,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
&nvm_dword);
if (ret_val)
return ret_val;
sig_byte = (u8)((nvm_dword & 0xFF00) >> 8);
sig_byte = FIELD_GET(0xFF00, nvm_dword);
if ((sig_byte & E1000_ICH_NVM_VALID_SIG_MASK) ==
E1000_ICH_NVM_SIG_VALUE) {
*bank = 0;
Expand All @@ -3218,7 +3214,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
&nvm_dword);
if (ret_val)
return ret_val;
sig_byte = (u8)((nvm_dword & 0xFF00) >> 8);
sig_byte = FIELD_GET(0xFF00, nvm_dword);
if ((sig_byte & E1000_ICH_NVM_VALID_SIG_MASK) ==
E1000_ICH_NVM_SIG_VALUE) {
*bank = 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/e1000e/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw)
* for the device regardless of function swap state.
*/
reg = er32(STATUS);
bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT;
bus->func = FIELD_GET(E1000_STATUS_FUNC_MASK, reg);
}

/**
Expand Down
11 changes: 4 additions & 7 deletions drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,8 +1788,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data)
adapter->corr_errors +=
pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK;
adapter->uncorr_errors +=
(pbeccsts & E1000_PBECCSTS_UNCORR_ERR_CNT_MASK) >>
E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT;
FIELD_GET(E1000_PBECCSTS_UNCORR_ERR_CNT_MASK, pbeccsts);

/* Do the reset outside of interrupt context */
schedule_work(&adapter->reset_task);
Expand Down Expand Up @@ -1868,8 +1867,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data)
adapter->corr_errors +=
pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK;
adapter->uncorr_errors +=
(pbeccsts & E1000_PBECCSTS_UNCORR_ERR_CNT_MASK) >>
E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT;
FIELD_GET(E1000_PBECCSTS_UNCORR_ERR_CNT_MASK, pbeccsts);

/* Do the reset outside of interrupt context */
schedule_work(&adapter->reset_task);
Expand Down Expand Up @@ -5031,8 +5029,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter)
adapter->corr_errors +=
pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK;
adapter->uncorr_errors +=
(pbeccsts & E1000_PBECCSTS_UNCORR_ERR_CNT_MASK) >>
E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT;
FIELD_GET(E1000_PBECCSTS_UNCORR_ERR_CNT_MASK, pbeccsts);
}
}

Expand Down Expand Up @@ -6249,7 +6246,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
phy_reg |= BM_RCTL_MPE;
phy_reg &= ~(BM_RCTL_MO_MASK);
if (mac_reg & E1000_RCTL_MO_3)
phy_reg |= (((mac_reg & E1000_RCTL_MO_3) >> E1000_RCTL_MO_SHIFT)
phy_reg |= (FIELD_GET(E1000_RCTL_MO_3, mac_reg)
<< BM_RCTL_MO_SHIFT);
if (mac_reg & E1000_RCTL_BAM)
phy_reg |= BM_RCTL_BAM;
Expand Down
Loading