Skip to content

Commit dbc0fd4

Browse files
committed
Merge branch 'intel-wired-lan-driver-updates-for-2023-10-25-ice'
Jacob Keller says: ==================== Intel Wired LAN Driver Updates for 2023-10-25 (ice) This series extends the ice driver with basic support for the E830 device line. It does not include support for all device features, but enables basic functionality to load and pass traffic. Alice adds the 200G speed and PHY types supported by E830 hardware. Dan extends the DDP package logic to support the E830 package segment. Paul adds the basic registers and macros used by E830 hardware, and adds support for handling variable length link status information from firmware. Pawel removes some redundant zeroing of the PCI IDs list, and extends the list to include the E830 device IDs. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents edd6815 + ba20ecb commit dbc0fd4

File tree

12 files changed

+650
-171
lines changed

12 files changed

+650
-171
lines changed

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,15 @@ struct ice_aqc_get_phy_caps {
10991099
#define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2)
11001100
#define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3)
11011101
#define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4)
1102-
#define ICE_PHY_TYPE_HIGH_MAX_INDEX 4
1102+
#define ICE_PHY_TYPE_HIGH_200G_CR4_PAM4 BIT_ULL(5)
1103+
#define ICE_PHY_TYPE_HIGH_200G_SR4 BIT_ULL(6)
1104+
#define ICE_PHY_TYPE_HIGH_200G_FR4 BIT_ULL(7)
1105+
#define ICE_PHY_TYPE_HIGH_200G_LR4 BIT_ULL(8)
1106+
#define ICE_PHY_TYPE_HIGH_200G_DR4 BIT_ULL(9)
1107+
#define ICE_PHY_TYPE_HIGH_200G_KR4_PAM4 BIT_ULL(10)
1108+
#define ICE_PHY_TYPE_HIGH_200G_AUI4_AOC_ACC BIT_ULL(11)
1109+
#define ICE_PHY_TYPE_HIGH_200G_AUI4 BIT_ULL(12)
1110+
#define ICE_PHY_TYPE_HIGH_MAX_INDEX 12
11031111

11041112
struct ice_aqc_get_phy_caps_data {
11051113
__le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
@@ -1319,11 +1327,41 @@ struct ice_aqc_get_link_status_data {
13191327
#define ICE_AQ_LINK_SPEED_40GB BIT(8)
13201328
#define ICE_AQ_LINK_SPEED_50GB BIT(9)
13211329
#define ICE_AQ_LINK_SPEED_100GB BIT(10)
1330+
#define ICE_AQ_LINK_SPEED_200GB BIT(11)
13221331
#define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15)
1323-
__le32 reserved3; /* Aligns next field to 8-byte boundary */
1324-
__le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
1325-
__le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */
1326-
};
1332+
/* Aligns next field to 8-byte boundary */
1333+
__le16 reserved3;
1334+
u8 ext_fec_status;
1335+
/* RS 272 FEC enabled */
1336+
#define ICE_AQ_LINK_RS_272_FEC_EN BIT(0)
1337+
u8 reserved4;
1338+
/* Use values from ICE_PHY_TYPE_LOW_* */
1339+
__le64 phy_type_low;
1340+
/* Use values from ICE_PHY_TYPE_HIGH_* */
1341+
__le64 phy_type_high;
1342+
#define ICE_AQC_LS_DATA_SIZE_V1 \
1343+
offsetofend(struct ice_aqc_get_link_status_data, phy_type_high)
1344+
/* Get link status v2 link partner data */
1345+
__le64 lp_phy_type_low;
1346+
__le64 lp_phy_type_high;
1347+
u8 lp_fec_adv;
1348+
#define ICE_AQ_LINK_LP_10G_KR_FEC_CAP BIT(0)
1349+
#define ICE_AQ_LINK_LP_25G_KR_FEC_CAP BIT(1)
1350+
#define ICE_AQ_LINK_LP_RS_528_FEC_CAP BIT(2)
1351+
#define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3)
1352+
#define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4)
1353+
#define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5)
1354+
u8 lp_fec_req;
1355+
#define ICE_AQ_LINK_LP_10G_KR_FEC_REQ BIT(0)
1356+
#define ICE_AQ_LINK_LP_25G_KR_FEC_REQ BIT(1)
1357+
#define ICE_AQ_LINK_LP_RS_528_FEC_REQ BIT(2)
1358+
#define ICE_AQ_LINK_LP_KR_272_FEC_REQ BIT(3)
1359+
u8 lp_flowcontrol;
1360+
#define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0)
1361+
#define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1)
1362+
#define ICE_AQC_LS_DATA_SIZE_V2 \
1363+
offsetofend(struct ice_aqc_get_link_status_data, lp_flowcontrol)
1364+
} __packed;
13271365

13281366
/* Set event mask command (direct 0x0613) */
13291367
struct ice_aqc_set_event_mask {

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 68 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
2-
/* Copyright (c) 2018, Intel Corporation. */
2+
/* Copyright (c) 2018-2023, Intel Corporation. */
33

44
#include "ice_common.h"
55
#include "ice_sched.h"
@@ -154,6 +154,12 @@ static int ice_set_mac_type(struct ice_hw *hw)
154154
case ICE_DEV_ID_E823L_SFP:
155155
hw->mac_type = ICE_MAC_GENERIC;
156156
break;
157+
case ICE_DEV_ID_E830_BACKPLANE:
158+
case ICE_DEV_ID_E830_QSFP56:
159+
case ICE_DEV_ID_E830_SFP:
160+
case ICE_DEV_ID_E830_SFP_DD:
161+
hw->mac_type = ICE_MAC_E830;
162+
break;
157163
default:
158164
hw->mac_type = ICE_MAC_UNKNOWN;
159165
break;
@@ -645,6 +651,24 @@ static enum ice_media_type ice_get_media_type(struct ice_port_info *pi)
645651
return ICE_MEDIA_UNKNOWN;
646652
}
647653

654+
/**
655+
* ice_get_link_status_datalen
656+
* @hw: pointer to the HW struct
657+
*
658+
* Returns datalength for the Get Link Status AQ command, which is bigger for
659+
* newer adapter families handled by ice driver.
660+
*/
661+
static u16 ice_get_link_status_datalen(struct ice_hw *hw)
662+
{
663+
switch (hw->mac_type) {
664+
case ICE_MAC_E830:
665+
return ICE_AQC_LS_DATA_SIZE_V2;
666+
case ICE_MAC_E810:
667+
default:
668+
return ICE_AQC_LS_DATA_SIZE_V1;
669+
}
670+
}
671+
648672
/**
649673
* ice_aq_get_link_info
650674
* @pi: port information structure
@@ -683,8 +707,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
683707
resp->cmd_flags = cpu_to_le16(cmd_flags);
684708
resp->lport_num = pi->lport;
685709

686-
status = ice_aq_send_cmd(hw, &desc, &link_data, sizeof(link_data), cd);
687-
710+
status = ice_aq_send_cmd(hw, &desc, &link_data,
711+
ice_get_link_status_datalen(hw), cd);
688712
if (status)
689713
return status;
690714

@@ -759,8 +783,7 @@ static void
759783
ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw,
760784
struct ice_aqc_set_mac_cfg *cmd)
761785
{
762-
u16 fc_thres_val, tx_timer_val;
763-
u32 val;
786+
u32 val, fc_thres_m;
764787

765788
/* We read back the transmit timer and FC threshold value of
766789
* LFC. Thus, we will use index =
@@ -769,19 +792,32 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw,
769792
* Also, because we are operating on transmit timer and FC
770793
* threshold of LFC, we don't turn on any bit in tx_tmr_priority
771794
*/
772-
#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX
773-
774-
/* Retrieve the transmit timer */
775-
val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC));
776-
tx_timer_val = val &
777-
PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M;
778-
cmd->tx_tmr_value = cpu_to_le16(tx_timer_val);
779-
780-
/* Retrieve the FC threshold */
781-
val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC));
782-
fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M;
783-
784-
cmd->fc_refresh_threshold = cpu_to_le16(fc_thres_val);
795+
#define E800_IDX_OF_LFC E800_PRTMAC_HSEC_CTL_TX_PS_QNT_MAX
796+
#define E800_REFRESH_TMR E800_PRTMAC_HSEC_CTL_TX_PS_RFSH_TMR
797+
798+
if (hw->mac_type == ICE_MAC_E830) {
799+
/* Retrieve the transmit timer */
800+
val = rd32(hw, E830_PRTMAC_CL01_PS_QNT);
801+
cmd->tx_tmr_value =
802+
le16_encode_bits(val, E830_PRTMAC_CL01_PS_QNT_CL0_M);
803+
804+
/* Retrieve the fc threshold */
805+
val = rd32(hw, E830_PRTMAC_CL01_QNT_THR);
806+
fc_thres_m = E830_PRTMAC_CL01_QNT_THR_CL0_M;
807+
} else {
808+
/* Retrieve the transmit timer */
809+
val = rd32(hw,
810+
E800_PRTMAC_HSEC_CTL_TX_PS_QNT(E800_IDX_OF_LFC));
811+
cmd->tx_tmr_value =
812+
le16_encode_bits(val,
813+
E800_PRTMAC_HSEC_CTL_TX_PS_QNT_M);
814+
815+
/* Retrieve the fc threshold */
816+
val = rd32(hw,
817+
E800_REFRESH_TMR(E800_IDX_OF_LFC));
818+
fc_thres_m = E800_PRTMAC_HSEC_CTL_TX_PS_RFSH_TMR_M;
819+
}
820+
cmd->fc_refresh_threshold = le16_encode_bits(val, fc_thres_m);
785821
}
786822

787823
/**
@@ -2464,16 +2500,21 @@ ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
24642500
static void
24652501
ice_parse_fdir_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p)
24662502
{
2467-
u32 reg_val, val;
2503+
u32 reg_val, gsize, bsize;
24682504

24692505
reg_val = rd32(hw, GLQF_FD_SIZE);
2470-
val = (reg_val & GLQF_FD_SIZE_FD_GSIZE_M) >>
2471-
GLQF_FD_SIZE_FD_GSIZE_S;
2472-
func_p->fd_fltr_guar =
2473-
ice_get_num_per_func(hw, val);
2474-
val = (reg_val & GLQF_FD_SIZE_FD_BSIZE_M) >>
2475-
GLQF_FD_SIZE_FD_BSIZE_S;
2476-
func_p->fd_fltr_best_effort = val;
2506+
switch (hw->mac_type) {
2507+
case ICE_MAC_E830:
2508+
gsize = FIELD_GET(E830_GLQF_FD_SIZE_FD_GSIZE_M, reg_val);
2509+
bsize = FIELD_GET(E830_GLQF_FD_SIZE_FD_BSIZE_M, reg_val);
2510+
break;
2511+
case ICE_MAC_E810:
2512+
default:
2513+
gsize = FIELD_GET(E800_GLQF_FD_SIZE_FD_GSIZE_M, reg_val);
2514+
bsize = FIELD_GET(E800_GLQF_FD_SIZE_FD_BSIZE_M, reg_val);
2515+
}
2516+
func_p->fd_fltr_guar = ice_get_num_per_func(hw, gsize);
2517+
func_p->fd_fltr_best_effort = bsize;
24772518

24782519
ice_debug(hw, ICE_DBG_INIT, "func caps: fd_fltr_guar = %d\n",
24792520
func_p->fd_fltr_guar);
@@ -6069,6 +6110,7 @@ static const u32 ice_aq_to_link_speed[] = {
60696110
SPEED_40000,
60706111
SPEED_50000,
60716112
SPEED_100000, /* BIT(10) */
6113+
SPEED_200000,
60726114
};
60736115

60746116
/**

0 commit comments

Comments
 (0)