Skip to content

Commit aab99b6

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-07-23 This series contains updates to ice driver only. Jake refactors ice_discover_caps() to reduce the number of AdminQ calls made. Splits ice_parse_caps() to separate functions to update function and device capabilities separately to allow for updating outside of initialization. Akeem adds power management support. Paul G refactors FC and FEC code to aid in restoring of PHY settings on media insertion. Implements lenient mode and link override support. Adds link debug info and formats existing debug info to be more readable. Adds support to check and report additional autoneg capabilities. Implements the capability to detect media cage in order to differentiate AUI types as Direct Attach or backplane. Bruce implements Total Port Shutdown for devices that support it. Lev renames low_power_ctrl field to lower_power_ctrl_an to be more descriptive of the field. Doug reports AOC types as media type fiber. Paul S adds code to handle 1G SGMII PHY type. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 2d6be17 + c2b3522 commit aab99b6

13 files changed

Lines changed: 2323 additions & 648 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ enum ice_state {
222222
__ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */
223223
__ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */
224224
__ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */
225+
__ICE_LINK_DEFAULT_OVERRIDE_PENDING,
226+
__ICE_PHY_INIT_COMPLETE,
225227
__ICE_STATE_NBITS /* must be last */
226228
};
227229

@@ -357,12 +359,14 @@ enum ice_pf_flags {
357359
ICE_FLAG_FD_ENA,
358360
ICE_FLAG_ADV_FEATURES,
359361
ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA,
362+
ICE_FLAG_TOTAL_PORT_SHUTDOWN_ENA,
360363
ICE_FLAG_NO_MEDIA,
361364
ICE_FLAG_FW_LLDP_AGENT,
362365
ICE_FLAG_ETHTOOL_CTXT, /* set when ethtool holds RTNL lock */
363366
ICE_FLAG_LEGACY_RX,
364367
ICE_FLAG_VF_TRUE_PROMISC_ENA,
365368
ICE_FLAG_MDD_AUTO_RESET_VF,
369+
ICE_FLAG_LINK_LENIENT_MODE_ENA,
366370
ICE_PF_FLAGS_NBITS /* must be last */
367371
};
368372

@@ -423,6 +427,8 @@ struct ice_pf {
423427
u16 empr_count; /* EMP reset count */
424428
u16 pfr_count; /* PF reset count */
425429

430+
u8 wol_ena : 1; /* software state of WoL */
431+
u32 wakeup_reason; /* last wakeup reason */
426432
struct ice_hw_port_stats stats;
427433
struct ice_hw_port_stats stats_prev;
428434
struct ice_hw hw;
@@ -435,6 +441,10 @@ struct ice_pf {
435441
u32 tx_timeout_recovery_level;
436442
char int_name[ICE_INT_NAME_STR_LEN];
437443
u32 sw_int_count;
444+
445+
__le64 nvm_phy_type_lo; /* NVM PHY type low */
446+
__le64 nvm_phy_type_hi; /* NVM PHY type high */
447+
struct ice_link_default_override_tlv link_dflt_override;
438448
};
439449

440450
struct ice_netdev_priv {
@@ -568,6 +578,7 @@ int ice_schedule_reset(struct ice_pf *pf, enum ice_reset_req reset);
568578
void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
569579
const char *ice_stat_str(enum ice_status stat_err);
570580
const char *ice_aq_str(enum ice_aq_err aq_err);
581+
bool ice_is_wol_supported(struct ice_pf *pf);
571582
int
572583
ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
573584
bool is_tun);

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

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,11 @@ struct ice_aqc_get_phy_caps_data {
961961
#define ICE_AQC_GET_PHY_EN_MOD_QUAL BIT(5)
962962
#define ICE_AQC_PHY_EN_AUTO_FEC BIT(7)
963963
#define ICE_AQC_PHY_CAPS_MASK ICE_M(0xff, 0)
964-
u8 low_power_ctrl;
964+
u8 low_power_ctrl_an;
965965
#define ICE_AQC_PHY_EN_D3COLD_LOW_POWER_AUTONEG BIT(0)
966+
#define ICE_AQC_PHY_AN_EN_CLAUSE28 BIT(1)
967+
#define ICE_AQC_PHY_AN_EN_CLAUSE73 BIT(2)
968+
#define ICE_AQC_PHY_AN_EN_CLAUSE37 BIT(3)
966969
__le16 eee_cap;
967970
#define ICE_AQC_PHY_EEE_EN_100BASE_TX BIT(0)
968971
#define ICE_AQC_PHY_EEE_EN_1000BASE_T BIT(1)
@@ -983,12 +986,14 @@ struct ice_aqc_get_phy_caps_data {
983986
#define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN BIT(6)
984987
#define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN BIT(7)
985988
#define ICE_AQC_PHY_FEC_MASK ICE_M(0xdf, 0)
986-
u8 rsvd1; /* Byte 35 reserved */
989+
u8 module_compliance_enforcement;
990+
#define ICE_AQC_MOD_ENFORCE_STRICT_MODE BIT(0)
987991
u8 extended_compliance_code;
988992
#define ICE_MODULE_TYPE_TOTAL_BYTE 3
989993
u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE];
990994
#define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0
991995
#define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80
996+
#define ICE_AQC_MOD_TYPE_IDENT 1
992997
#define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0)
993998
#define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1)
994999
#define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4)
@@ -1032,11 +1037,11 @@ struct ice_aqc_set_phy_cfg_data {
10321037
#define ICE_AQ_PHY_ENA_AUTO_LINK_UPDT BIT(5)
10331038
#define ICE_AQ_PHY_ENA_LESM BIT(6)
10341039
#define ICE_AQ_PHY_ENA_AUTO_FEC BIT(7)
1035-
u8 low_power_ctrl;
1040+
u8 low_power_ctrl_an;
10361041
__le16 eee_cap; /* Value from ice_aqc_get_phy_caps */
10371042
__le16 eeer_value;
10381043
u8 link_fec_opt; /* Use defines from ice_aqc_get_phy_caps */
1039-
u8 rsvd1;
1044+
u8 module_compliance_enforcement;
10401045
};
10411046

10421047
/* Set MAC Config command data structure (direct 0x0603) */
@@ -1147,6 +1152,7 @@ struct ice_aqc_get_link_status_data {
11471152
#define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2
11481153
#define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3
11491154
__le16 link_speed;
1155+
#define ICE_AQ_LINK_SPEED_M 0x7FF
11501156
#define ICE_AQ_LINK_SPEED_10MB BIT(0)
11511157
#define ICE_AQ_LINK_SPEED_100MB BIT(1)
11521158
#define ICE_AQ_LINK_SPEED_1000MB BIT(2)
@@ -1189,6 +1195,57 @@ struct ice_aqc_set_mac_lb {
11891195
u8 reserved[15];
11901196
};
11911197

1198+
struct ice_aqc_link_topo_addr {
1199+
u8 lport_num;
1200+
u8 lport_num_valid;
1201+
#define ICE_AQC_LINK_TOPO_PORT_NUM_VALID BIT(0)
1202+
u8 node_type_ctx;
1203+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_S 0
1204+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_M (0xF << ICE_AQC_LINK_TOPO_NODE_TYPE_S)
1205+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_PHY 0
1206+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL 1
1207+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_MUX_CTRL 2
1208+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_LED_CTRL 3
1209+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_LED 4
1210+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_THERMAL 5
1211+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE 6
1212+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ 7
1213+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM 8
1214+
#define ICE_AQC_LINK_TOPO_NODE_CTX_S 4
1215+
#define ICE_AQC_LINK_TOPO_NODE_CTX_M \
1216+
(0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S)
1217+
#define ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL 0
1218+
#define ICE_AQC_LINK_TOPO_NODE_CTX_BOARD 1
1219+
#define ICE_AQC_LINK_TOPO_NODE_CTX_PORT 2
1220+
#define ICE_AQC_LINK_TOPO_NODE_CTX_NODE 3
1221+
#define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED 4
1222+
#define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE 5
1223+
u8 index;
1224+
__le16 handle;
1225+
#define ICE_AQC_LINK_TOPO_HANDLE_S 0
1226+
#define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)
1227+
/* Used to decode the handle field */
1228+
#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_M BIT(9)
1229+
#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM BIT(9)
1230+
#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ 0
1231+
#define ICE_AQC_LINK_TOPO_HANDLE_NODE_S 0
1232+
/* In case of a Mezzanine type */
1233+
#define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_NODE_M \
1234+
(0x3F << ICE_AQC_LINK_TOPO_HANDLE_NODE_S)
1235+
#define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_S 6
1236+
#define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_M (0x7 << ICE_AQC_LINK_TOPO_HANDLE_MEZZ_S)
1237+
/* In case of a LOM type */
1238+
#define ICE_AQC_LINK_TOPO_HANDLE_LOM_NODE_M \
1239+
(0x1FF << ICE_AQC_LINK_TOPO_HANDLE_NODE_S)
1240+
};
1241+
1242+
/* Get Link Topology Handle (direct, 0x06E0) */
1243+
struct ice_aqc_get_link_topo {
1244+
struct ice_aqc_link_topo_addr addr;
1245+
u8 node_part_num;
1246+
u8 rsvd[9];
1247+
};
1248+
11921249
/* Set Port Identification LED (direct, 0x06E9) */
11931250
struct ice_aqc_set_port_id_led {
11941251
u8 lport_num;
@@ -1759,6 +1816,7 @@ struct ice_aq_desc {
17591816
struct ice_aqc_set_event_mask set_event_mask;
17601817
struct ice_aqc_get_link_status get_link_status;
17611818
struct ice_aqc_event_lan_overflow lan_overflow;
1819+
struct ice_aqc_get_link_topo get_link_topo;
17621820
} params;
17631821
};
17641822

@@ -1858,6 +1916,7 @@ enum ice_adminq_opc {
18581916
ice_aqc_opc_get_link_status = 0x0607,
18591917
ice_aqc_opc_set_event_mask = 0x0613,
18601918
ice_aqc_opc_set_mac_lb = 0x0620,
1919+
ice_aqc_opc_get_link_topo = 0x06E0,
18611920
ice_aqc_opc_set_port_id_led = 0x06E9,
18621921
ice_aqc_opc_sff_eeprom = 0x06EE,
18631922

0 commit comments

Comments
 (0)