Lines Matching +full:eee +full:- +full:pcs
3 Copyright (c) 2013-2018, Intel Corporation
115 "CL108 RS-FEC",
116 "CL74 FC-FEC/BASE-R",
127 * ixl_set_state - Set the specified state
141 * ixl_clear_state - Clear the specified state
155 * ixl_test_state - Test the specified state
170 * ixl_testandset_state - Test and set the specified state
193 u8 oem_ver = (u8)(hw->nvm.oem_ver >> 24); in ixl_nvm_version_str()
194 u16 oem_build = (u16)((hw->nvm.oem_ver >> 16) & 0xFFFF); in ixl_nvm_version_str()
195 u8 oem_patch = (u8)(hw->nvm.oem_ver & 0xFF); in ixl_nvm_version_str()
199 hw->aq.fw_maj_ver, hw->aq.fw_min_ver, hw->aq.fw_build, in ixl_nvm_version_str()
200 hw->aq.api_maj_ver, hw->aq.api_min_ver, in ixl_nvm_version_str()
201 (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >> in ixl_nvm_version_str()
203 (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >> in ixl_nvm_version_str()
205 hw->nvm.eetrack, in ixl_nvm_version_str()
212 struct i40e_hw *hw = &pf->hw; in ixl_print_nvm_version()
213 device_t dev = pf->dev; in ixl_print_nvm_version()
224 * ixl_get_fw_mode - Check the state of FW
236 struct i40e_hw *hw = &pf->hw; in ixl_get_fw_mode()
241 if (pf->recovery_mode) in ixl_get_fw_mode()
261 * ixl_pf_reset - Reset the PF
272 struct i40e_hw *hw = &pf->hw; in ixl_pf_reset()
279 ixl_set_state(&pf->state, IXL_STATE_RECOVERY_MODE); in ixl_pf_reset()
293 ixl_set_state(&pf->state, IXL_STATE_RECOVERY_MODE); in ixl_pf_reset()
298 device_printf(pf->dev, in ixl_pf_reset()
301 device_printf(pf->dev, "PF reset failure %s\n", in ixl_pf_reset()
307 * ixl_setup_hmc - Setup LAN Host Memory Cache
317 struct i40e_hw *hw = &pf->hw; in ixl_setup_hmc()
320 status = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, in ixl_setup_hmc()
321 hw->func_caps.num_rx_qp, 0, 0); in ixl_setup_hmc()
323 device_printf(pf->dev, "init_lan_hmc failed: %s\n", in ixl_setup_hmc()
330 device_printf(pf->dev, "configure_lan_hmc failed: %s\n", in ixl_setup_hmc()
339 * ixl_shutdown_hmc - Shutdown LAN Host Memory Cache
348 struct i40e_hw *hw = &pf->hw; in ixl_shutdown_hmc()
352 if (hw->hmc.hmc_obj == NULL) in ixl_shutdown_hmc()
357 device_printf(pf->dev, in ixl_shutdown_hmc()
381 struct i40e_hw *hw = &pf->hw; in ixl_get_hw_capabilities()
382 device_t dev = pf->dev; in ixl_get_hw_capabilities()
389 hw->func_caps.iwarp = 0; in ixl_get_hw_capabilities()
405 if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) && in ixl_get_hw_capabilities()
413 i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_get_hw_capabilities()
422 if (i2c_intfc_num != -1) in ixl_get_hw_capabilities()
423 pf->has_i2c = true; in ixl_get_hw_capabilities()
426 switch (pf->i2c_access_method) { in ixl_get_hw_capabilities()
428 if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { in ixl_get_hw_capabilities()
429 pf->read_i2c_byte = ixl_read_i2c_byte_aq; in ixl_get_hw_capabilities()
430 pf->write_i2c_byte = ixl_write_i2c_byte_aq; in ixl_get_hw_capabilities()
432 pf->read_i2c_byte = ixl_read_i2c_byte_reg; in ixl_get_hw_capabilities()
433 pf->write_i2c_byte = ixl_write_i2c_byte_reg; in ixl_get_hw_capabilities()
438 pf->read_i2c_byte = ixl_read_i2c_byte_aq; in ixl_get_hw_capabilities()
439 pf->write_i2c_byte = ixl_write_i2c_byte_aq; in ixl_get_hw_capabilities()
442 pf->read_i2c_byte = ixl_read_i2c_byte_reg; in ixl_get_hw_capabilities()
443 pf->write_i2c_byte = ixl_write_i2c_byte_reg; in ixl_get_hw_capabilities()
446 pf->read_i2c_byte = ixl_read_i2c_byte_bb; in ixl_get_hw_capabilities()
447 pf->write_i2c_byte = ixl_write_i2c_byte_bb; in ixl_get_hw_capabilities()
456 ixl_set_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); in ixl_get_hw_capabilities()
460 "PF-ID[%d]: VFs %d, MSI-X %d, VF MSI-X %d, QPs %d, %s\n", in ixl_get_hw_capabilities()
461 hw->pf_id, hw->func_caps.num_vfs, hw->func_caps.num_msix_vectors, in ixl_get_hw_capabilities()
462 hw->func_caps.num_msix_vectors_vf, hw->func_caps.num_tx_qp, in ixl_get_hw_capabilities()
463 (hw->func_caps.mdio_port_mode == 2) ? "I2C" : in ixl_get_hw_capabilities()
464 (hw->func_caps.mdio_port_mode == 1 && pf->has_i2c) ? "MDIO & I2C" : in ixl_get_hw_capabilities()
465 (hw->func_caps.mdio_port_mode == 1) ? "MDIO dedicated" : in ixl_get_hw_capabilities()
475 device_t dev = pf->dev; in ixl_set_initial_advertised_speeds()
482 err = ixl_set_advertised_speeds(pf, pf->supported_speeds, true); in ixl_set_initial_advertised_speeds()
484 /* Non-fatal error */ in ixl_set_initial_advertised_speeds()
490 pf->advertised_speed = in ixl_set_initial_advertised_speeds()
491 ixl_convert_sysctl_aq_link_speed(pf->supported_speeds, false); in ixl_set_initial_advertised_speeds()
498 struct i40e_hw *hw = &pf->hw; in ixl_teardown_hw_structs()
499 device_t dev = pf->dev; in ixl_teardown_hw_structs()
502 if (hw->hmc.hmc_obj) { in ixl_teardown_hw_structs()
520 ixl_pf_qmgr_release(&pf->qmgr, &pf->qtag); in ixl_teardown_hw_structs()
538 bcopy(macaddr, f->macaddr, ETHER_ADDR_LEN); in ixl_new_filter()
539 f->vlan = vlan; in ixl_new_filter()
546 * ixl_free_filters - Free all filters in given list
547 * headp - pointer to list head
571 struct ixl_vsi *vsi = ama->vsi; in ixl_add_maddr()
576 f = ixl_find_filter(&vsi->ftl, macaddr, IXL_VLAN_ANY); in ixl_add_maddr()
580 f = ixl_new_filter(&ama->to_add, macaddr, IXL_VLAN_ANY); in ixl_add_maddr()
582 device_printf(vsi->dev, "WARNING: no filter available!!\n"); in ixl_add_maddr()
585 f->flags |= IXL_FILTER_MC; in ixl_add_maddr()
598 * ixl_add_multi - Add multicast filters to the hardware
608 if_t ifp = vsi->ifp; in ixl_add_multi()
609 struct i40e_hw *hw = vsi->hw; in ixl_add_multi()
618 status = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, in ixl_add_multi()
645 if (ixl_ether_is_equal(f->macaddr, (u8 *)LLADDR(sdl))) in ixl_match_maddr()
652 * ixl_dis_multi_promisc - Disable multicast promiscuous mode
657 * and the VSI, then re-add multicast filters.
663 struct ifnet *ifp = vsi->ifp; in ixl_dis_multi_promisc()
664 struct i40e_hw *hw = vsi->hw; in ixl_dis_multi_promisc()
679 status = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, in ixl_dis_multi_promisc()
694 * ixl_del_multi - Delete multicast filters from the hardware
706 if_t ifp = vsi->ifp; in ixl_del_multi()
714 LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, fn) { in ixl_del_multi()
715 if ((f->flags & IXL_FILTER_MC) == 0) in ixl_del_multi()
742 struct i40e_hw *hw = &pf->hw; in ixl_link_up_msg()
743 if_t ifp = pf->vsi.ifp; in ixl_link_up_msg()
747 fec_abilities = hw->phy.link_info.req_fec_info; in ixl_link_up_msg()
756 if (hw->phy.link_info.fec_info & I40E_AQ_CONFIG_FEC_RS_ENA) in ixl_link_up_msg()
758 else if (hw->phy.link_info.fec_info & I40E_AQ_CONFIG_FEC_KR_ENA) in ixl_link_up_msg()
765 ixl_link_speed_string(hw->phy.link_info.link_speed), in ixl_link_up_msg()
767 (hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED) ? "True" : "False", in ixl_link_up_msg()
768 (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_TX && in ixl_link_up_msg()
769 hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_RX) ? in ixl_link_up_msg()
770 ixl_fc_string[3] : (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_TX) ? in ixl_link_up_msg()
771 ixl_fc_string[2] : (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_RX) ? in ixl_link_up_msg()
781 struct i40e_hw *hw = &pf->hw; in ixl_configure_intr0_msix()
784 /* First set up the adminq - vector 0 */ in ixl_configure_intr0_msix()
800 * This means we won't use MSI-X vector 0 for a queue interrupt in ixl_configure_intr0_msix()
801 * in MSI-X mode. in ixl_configure_intr0_msix()
897 * - this will need to be more robust when more complex
904 struct i40e_hw *hw = &pf->hw; in ixl_switch_config()
905 struct ixl_vsi *vsi = &pf->vsi; in ixl_switch_config()
906 device_t dev = iflib_get_dev(vsi->ctx); in ixl_switch_config()
918 " aq_error %d\n", ret, pf->hw.aq.asq_last_status); in ixl_switch_config()
921 if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) { in ixl_switch_config()
924 LE16_TO_CPU(sw_config->header.num_reported), in ixl_switch_config()
925 LE16_TO_CPU(sw_config->header.num_total)); in ixl_switch_config()
927 i < LE16_TO_CPU(sw_config->header.num_reported); i++) { in ixl_switch_config()
929 "-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i, in ixl_switch_config()
930 sw_config->element[i].element_type, in ixl_switch_config()
931 LE16_TO_CPU(sw_config->element[i].seid), in ixl_switch_config()
932 LE16_TO_CPU(sw_config->element[i].uplink_seid), in ixl_switch_config()
933 LE16_TO_CPU(sw_config->element[i].downlink_seid)); in ixl_switch_config()
937 vsi->uplink_seid = LE16_TO_CPU(sw_config->element[0].uplink_seid); in ixl_switch_config()
938 vsi->downlink_seid = LE16_TO_CPU(sw_config->element[0].downlink_seid); in ixl_switch_config()
939 vsi->seid = LE16_TO_CPU(sw_config->element[0].seid); in ixl_switch_config()
950 tree = device_get_sysctl_tree(vsi->dev); in ixl_vsi_add_sysctls()
952 vsi->vsi_node = SYSCTL_ADD_NODE(&vsi->sysctl_ctx, child, OID_AUTO, sysctl_name, in ixl_vsi_add_sysctls()
955 vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); in ixl_vsi_add_sysctls()
956 ixl_add_sysctls_eth_stats(&vsi->sysctl_ctx, vsi_list, &vsi->eth_stats); in ixl_vsi_add_sysctls()
959 SYSCTL_ADD_UQUAD(&vsi->sysctl_ctx, vsi_list, OID_AUTO, "rx_errors", in ixl_vsi_add_sysctls()
960 CTLFLAG_RD, &vsi->ierrors, in ixl_vsi_add_sysctls()
964 ixl_vsi_add_queues_stats(vsi, &vsi->sysctl_ctx); in ixl_vsi_add_sysctls()
975 device_t dev = pf->dev; in ixl_sysctl_pf_tx_itr()
979 requested_tx_itr = pf->tx_itr; in ixl_sysctl_pf_tx_itr()
981 if ((error) || (req->newptr == NULL)) in ixl_sysctl_pf_tx_itr()
983 if (pf->dynamic_tx_itr) { in ixl_sysctl_pf_tx_itr()
995 pf->tx_itr = requested_tx_itr; in ixl_sysctl_pf_tx_itr()
1009 device_t dev = pf->dev; in ixl_sysctl_pf_rx_itr()
1013 requested_rx_itr = pf->rx_itr; in ixl_sysctl_pf_rx_itr()
1015 if ((error) || (req->newptr == NULL)) in ixl_sysctl_pf_rx_itr()
1017 if (pf->dynamic_rx_itr) { in ixl_sysctl_pf_rx_itr()
1029 pf->rx_itr = requested_rx_itr; in ixl_sysctl_pf_rx_itr()
1044 struct i40e_eth_stats *eth_stats = &stats->eth; in ixl_add_sysctls_mac_stats()
1049 {&stats->crc_errors, "crc_errors", "CRC Errors"}, in ixl_add_sysctls_mac_stats()
1050 {&stats->illegal_bytes, "illegal_bytes", "Illegal Byte Errors"}, in ixl_add_sysctls_mac_stats()
1051 {&stats->mac_local_faults, "local_faults", "MAC Local Faults"}, in ixl_add_sysctls_mac_stats()
1052 {&stats->mac_remote_faults, "remote_faults", "MAC Remote Faults"}, in ixl_add_sysctls_mac_stats()
1053 {&stats->rx_length_errors, "rx_length_errors", "Receive Length Errors"}, in ixl_add_sysctls_mac_stats()
1055 {&stats->rx_size_64, "rx_frames_64", "64 byte frames received"}, in ixl_add_sysctls_mac_stats()
1056 {&stats->rx_size_127, "rx_frames_65_127", "65-127 byte frames received"}, in ixl_add_sysctls_mac_stats()
1057 {&stats->rx_size_255, "rx_frames_128_255", "128-255 byte frames received"}, in ixl_add_sysctls_mac_stats()
1058 {&stats->rx_size_511, "rx_frames_256_511", "256-511 byte frames received"}, in ixl_add_sysctls_mac_stats()
1059 {&stats->rx_size_1023, "rx_frames_512_1023", "512-1023 byte frames received"}, in ixl_add_sysctls_mac_stats()
1060 {&stats->rx_size_1522, "rx_frames_1024_1522", "1024-1522 byte frames received"}, in ixl_add_sysctls_mac_stats()
1061 {&stats->rx_size_big, "rx_frames_big", "1523-9522 byte frames received"}, in ixl_add_sysctls_mac_stats()
1062 {&stats->rx_undersize, "rx_undersize", "Undersized packets received"}, in ixl_add_sysctls_mac_stats()
1063 {&stats->rx_fragments, "rx_fragmented", "Fragmented packets received"}, in ixl_add_sysctls_mac_stats()
1064 {&stats->rx_oversize, "rx_oversized", "Oversized packets received"}, in ixl_add_sysctls_mac_stats()
1065 {&stats->rx_jabber, "rx_jabber", "Received Jabber"}, in ixl_add_sysctls_mac_stats()
1066 {&stats->checksum_error, "checksum_errors", "Checksum Errors"}, in ixl_add_sysctls_mac_stats()
1068 {&stats->tx_size_64, "tx_frames_64", "64 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1069 {&stats->tx_size_127, "tx_frames_65_127", "65-127 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1070 {&stats->tx_size_255, "tx_frames_128_255", "128-255 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1071 {&stats->tx_size_511, "tx_frames_256_511", "256-511 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1072 {&stats->tx_size_1023, "tx_frames_512_1023", "512-1023 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1073 {&stats->tx_size_1522, "tx_frames_1024_1522", "1024-1522 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1074 {&stats->tx_size_big, "tx_frames_big", "1523-9522 byte frames transmitted"}, in ixl_add_sysctls_mac_stats()
1076 {&stats->link_xon_tx, "xon_txd", "Link XON transmitted"}, in ixl_add_sysctls_mac_stats()
1077 {&stats->link_xon_rx, "xon_recvd", "Link XON received"}, in ixl_add_sysctls_mac_stats()
1078 {&stats->link_xoff_tx, "xoff_txd", "Link XOFF transmitted"}, in ixl_add_sysctls_mac_stats()
1079 {&stats->link_xoff_rx, "xoff_recvd", "Link XOFF received"}, in ixl_add_sysctls_mac_stats()
1085 while (entry->stat != 0) in ixl_add_sysctls_mac_stats()
1087 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, entry->name, in ixl_add_sysctls_mac_stats()
1088 CTLFLAG_RD, entry->stat, in ixl_add_sysctls_mac_stats()
1089 entry->description); in ixl_add_sysctls_mac_stats()
1097 struct i40e_hw *hw = &pf->hw; in ixl_set_rss_key()
1098 struct ixl_vsi *vsi = &pf->vsi; in ixl_set_rss_key()
1099 device_t dev = pf->dev; in ixl_set_rss_key()
1110 if (hw->mac.type == I40E_MAC_X722) { in ixl_set_rss_key()
1113 status = i40e_aq_set_rss_key(hw, vsi->vsi_num, &key_data); in ixl_set_rss_key()
1118 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_set_rss_key()
1131 struct i40e_hw *hw = &pf->hw; in ixl_set_rss_pctypes()
1153 if (hw->mac.type == I40E_MAC_X722) in ixl_set_rss_pctypes()
1188 bcopy(vsi->hw->mac.perm_addr, e.mac_addr, ETHER_ADDR_LEN); in ixl_del_default_hw_filters()
1191 i40e_aq_remove_macvlan(vsi->hw, vsi->seid, &e, 1, NULL); in ixl_del_default_hw_filters()
1194 bcopy(vsi->hw->mac.perm_addr, e.mac_addr, ETHER_ADDR_LEN); in ixl_del_default_hw_filters()
1198 i40e_aq_remove_macvlan(vsi->hw, vsi->seid, &e, 1, NULL); in ixl_del_default_hw_filters()
1210 struct ixl_pf *pf = (struct ixl_pf *)vsi->back; in ixl_init_filters()
1215 LIST_INIT(&vsi->ftl); in ixl_init_filters()
1216 vsi->num_hw_filters = 0; in ixl_init_filters()
1219 i40e_aq_set_vsi_broadcast(&pf->hw, vsi->seid, TRUE, NULL); in ixl_init_filters()
1226 ixl_add_filter(vsi, vsi->hw->mac.addr, IXL_VLAN_ANY); in ixl_init_filters()
1230 * non-firmware transmitters. in ixl_init_filters()
1234 i40e_add_filter_to_drop_tx_flow_control_frames(vsi->hw, vsi->seid); in ixl_init_filters()
1236 if (pf->enable_tx_fc_filter) in ixl_init_filters()
1237 i40e_add_filter_to_drop_tx_flow_control_frames(vsi->hw, vsi->seid); in ixl_init_filters()
1244 struct i40e_hw *hw = vsi->hw; in ixl_reconfigure_filters()
1254 LIST_CONCAT(&tmp, &vsi->ftl, ixl_mac_filter, ftle); in ixl_reconfigure_filters()
1255 cnt = vsi->num_hw_filters; in ixl_reconfigure_filters()
1256 vsi->num_hw_filters = 0; in ixl_reconfigure_filters()
1261 * When the vsi is allocated for the VFs, both vsi->hw and vsi->ifp in ixl_reconfigure_filters()
1269 ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); in ixl_reconfigure_filters()
1271 if ((if_getcapenable(vsi->ifp) & IFCAP_VLAN_HWFILTER) == 0) in ixl_reconfigure_filters()
1277 ixl_add_vlan_filters(vsi, hw->mac.addr); in ixl_reconfigure_filters()
1294 pf = vsi->back; in ixl_add_filter()
1295 dev = pf->dev; in ixl_add_filter()
1302 f = ixl_find_filter(&vsi->ftl, macaddr, vlan); in ixl_add_filter()
1312 if (f->vlan != IXL_VLAN_ANY) in ixl_add_filter()
1313 f->flags |= IXL_FILTER_VLAN; in ixl_add_filter()
1315 vsi->num_macs++; in ixl_add_filter()
1322 if ((vlan != IXL_VLAN_ANY) && (vsi->num_vlans == 1)) { in ixl_add_filter()
1323 tmp = ixl_find_filter(&vsi->ftl, macaddr, IXL_VLAN_ANY); in ixl_add_filter()
1348 * ixl_add_vlan_filters - Add MAC/VLAN filters for all registered VLANs
1365 if (vsi->num_vlans == 0 || vsi->num_vlans > IXL_MAX_VLAN_FILTERS) { in ixl_add_vlan_filters()
1372 f = ixl_find_filter(&vsi->ftl, macaddr, 0); in ixl_add_vlan_filters()
1376 device_printf(vsi->dev, "WARNING: no filter available!!\n"); in ixl_add_vlan_filters()
1383 bit_ffs_at(vsi->vlans_map, i, IXL_VLANS_MAP_LEN, &vlan); in ixl_add_vlan_filters()
1384 if (vlan == -1) in ixl_add_vlan_filters()
1388 f = ixl_find_filter(&vsi->ftl, macaddr, vlan); in ixl_add_vlan_filters()
1394 device_printf(vsi->dev, "WARNING: no filter available!!\n"); in ixl_add_vlan_filters()
1411 ixl_dbg_filter((struct ixl_pf *)vsi->back, in ixl_del_filter()
1415 f = ixl_find_filter(&vsi->ftl, macaddr, vlan); in ixl_del_filter()
1422 if (f->vlan == IXL_VLAN_ANY && (f->flags & IXL_FILTER_VLAN) != 0) in ixl_del_filter()
1423 vsi->num_macs--; in ixl_del_filter()
1426 if (vlan == IXL_VLAN_ANY || vsi->num_vlans > 0) { in ixl_del_filter()
1431 /* It's the last vlan, we need to switch back to a non-vlan filter */ in ixl_del_filter()
1432 tmp = ixl_find_filter(&vsi->ftl, macaddr, 0); in ixl_del_filter()
1444 * ixl_del_all_vlan_filters - Delete all VLAN filters with given MAC
1462 LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, tmp) { in ixl_del_all_vlan_filters()
1463 if ((f->flags & IXL_FILTER_MC) != 0 || in ixl_del_all_vlan_filters()
1464 !ixl_ether_is_equal(f->macaddr, macaddr)) in ixl_del_all_vlan_filters()
1472 ixl_dbg_filter((struct ixl_pf *)vsi->back, in ixl_del_all_vlan_filters()
1488 if (ixl_ether_is_equal(f->macaddr, macaddr) && in ixl_find_filter()
1489 (f->vlan == vlan)) { in ixl_find_filter()
1513 pf = vsi->back; in ixl_add_hw_filters()
1514 dev = vsi->dev; in ixl_add_hw_filters()
1515 hw = &pf->hw; in ixl_add_hw_filters()
1533 bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN); in ixl_add_hw_filters()
1534 if (f->vlan == IXL_VLAN_ANY) { in ixl_add_hw_filters()
1535 b->vlan_tag = 0; in ixl_add_hw_filters()
1536 b->flags = I40E_AQC_MACVLAN_ADD_IGNORE_VLAN; in ixl_add_hw_filters()
1538 b->vlan_tag = f->vlan; in ixl_add_hw_filters()
1539 b->flags = 0; in ixl_add_hw_filters()
1541 b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; in ixl_add_hw_filters()
1546 b->match_method = I40E_AQC_MM_ERR_NO_RES; in ixl_add_hw_filters()
1548 MAC_FORMAT_ARGS(f->macaddr)); in ixl_add_hw_filters()
1562 status = i40e_aq_add_macvlan(hw, vsi->seid, a, j, NULL); in ixl_add_hw_filters()
1564 LIST_CONCAT(&vsi->ftl, to_add, ixl_mac_filter, ftle); in ixl_add_hw_filters()
1565 vsi->num_hw_filters += j; in ixl_add_hw_filters()
1572 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_add_hw_filters()
1583 MAC_FORMAT_ARGS(f->macaddr), in ixl_add_hw_filters()
1584 f->vlan); in ixl_add_hw_filters()
1587 LIST_INSERT_HEAD(&vsi->ftl, f, ftle); in ixl_add_hw_filters()
1588 vsi->num_hw_filters++; in ixl_add_hw_filters()
1613 pf = vsi->back; in ixl_del_hw_filters()
1614 hw = &pf->hw; in ixl_del_hw_filters()
1615 dev = vsi->dev; in ixl_del_hw_filters()
1628 bcopy(f->macaddr, e->mac_addr, ETHER_ADDR_LEN); in ixl_del_hw_filters()
1629 e->flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH; in ixl_del_hw_filters()
1630 if (f->vlan == IXL_VLAN_ANY) { in ixl_del_hw_filters()
1631 e->vlan_tag = 0; in ixl_del_hw_filters()
1632 e->flags |= I40E_AQC_MACVLAN_DEL_IGNORE_VLAN; in ixl_del_hw_filters()
1634 e->vlan_tag = f->vlan; in ixl_del_hw_filters()
1638 MAC_FORMAT_ARGS(f->macaddr)); in ixl_del_hw_filters()
1654 status = i40e_aq_remove_macvlan(hw, vsi->seid, d, j, NULL); in ixl_del_hw_filters()
1659 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_del_hw_filters()
1670 vsi->num_hw_filters -= j; in ixl_del_hw_filters()
1681 struct i40e_hw *hw = &pf->hw; in ixl_enable_tx_ring()
1706 device_printf(pf->dev, "TX queue %d still disabled!\n", in ixl_enable_tx_ring()
1717 struct i40e_hw *hw = &pf->hw; in ixl_enable_rx_ring()
1740 device_printf(pf->dev, "RX queue %d still disabled!\n", in ixl_enable_rx_ring()
1767 struct i40e_hw *hw = &pf->hw; in ixl_disable_tx_ring()
1792 device_printf(pf->dev, "TX queue %d still enabled!\n", in ixl_disable_tx_ring()
1806 struct i40e_hw *hw = &pf->hw; in ixl_disable_rx_ring()
1828 device_printf(pf->dev, "RX queue %d still enabled!\n", in ixl_disable_rx_ring()
1852 struct i40e_hw *hw = &pf->hw; in ixl_handle_tx_mdd_event()
1853 device_t dev = pf->dev; in ixl_handle_tx_mdd_event()
1884 pf_mdet_num = hw->pf_id; in ixl_handle_tx_mdd_event()
1889 for (int i = 0; i < pf->num_vfs; i++) { in ixl_handle_tx_mdd_event()
1890 vf = &(pf->vfs[i]); in ixl_handle_tx_mdd_event()
1895 vf->num_mdd_events++; in ixl_handle_tx_mdd_event()
1904 " on TX queue %d, pf number %d (PF-%d), vf number %d (VF-%d)\n", in ixl_handle_tx_mdd_event()
1909 " on TX queue %d, pf number %d, vf number %d (VF-%d)\n", in ixl_handle_tx_mdd_event()
1914 " on TX queue %d, pf number %d (PF-%d)\n", in ixl_handle_tx_mdd_event()
1925 struct i40e_hw *hw = &pf->hw; in ixl_handle_rx_mdd_event()
1926 device_t dev = pf->dev; in ixl_handle_rx_mdd_event()
1958 pf_mdet_num = hw->pf_id; in ixl_handle_rx_mdd_event()
1963 for (int i = 0; i < pf->num_vfs; i++) { in ixl_handle_rx_mdd_event()
1964 vf = &(pf->vfs[i]); in ixl_handle_rx_mdd_event()
1969 vf->num_mdd_events++; in ixl_handle_rx_mdd_event()
1978 " on RX queue %d, pf number %d (PF-%d), (VF-%d)\n", in ixl_handle_rx_mdd_event()
1983 " on RX queue %d, pf number %d, (VF-%d)\n", in ixl_handle_rx_mdd_event()
1988 " on RX queue %d, pf number %d (PF-%d)\n", in ixl_handle_rx_mdd_event()
2005 struct i40e_hw *hw = &pf->hw; in ixl_handle_mdd_event()
2015 ixl_clear_state(&pf->state, IXL_STATE_MDD_PENDING); in ixl_handle_mdd_event()
2017 /* re-enable mdd interrupt cause */ in ixl_handle_mdd_event()
2069 struct ixl_vsi *vsi = &pf->vsi; in ixl_handle_empr_reset()
2070 bool is_up = !!(if_getdrvflags(vsi->ifp) & IFF_DRV_RUNNING); in ixl_handle_empr_reset()
2083 ixl_set_state(&pf->state, IXL_STATE_RECOVERY_MODE); in ixl_handle_empr_reset()
2084 device_printf(pf->dev, in ixl_handle_empr_reset()
2086 pf->link_up = FALSE; in ixl_handle_empr_reset()
2092 ixl_clear_state(&pf->state, IXL_STATE_RESETTING); in ixl_handle_empr_reset()
2098 struct i40e_hw *hw = &pf->hw; in ixl_update_stats_counters()
2099 struct ixl_vsi *vsi = &pf->vsi; in ixl_update_stats_counters()
2101 u64 prev_link_xoff_rx = pf->stats.link_xoff_rx; in ixl_update_stats_counters()
2103 struct i40e_hw_port_stats *nsd = &pf->stats; in ixl_update_stats_counters()
2104 struct i40e_hw_port_stats *osd = &pf->stats_offsets; in ixl_update_stats_counters()
2107 ixl_stat_update32(hw, I40E_GLPRT_CRCERRS(hw->port), in ixl_update_stats_counters()
2108 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2109 &osd->crc_errors, &nsd->crc_errors); in ixl_update_stats_counters()
2110 ixl_stat_update32(hw, I40E_GLPRT_ILLERRC(hw->port), in ixl_update_stats_counters()
2111 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2112 &osd->illegal_bytes, &nsd->illegal_bytes); in ixl_update_stats_counters()
2113 ixl_stat_update48(hw, I40E_GLPRT_GORCL(hw->port), in ixl_update_stats_counters()
2114 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2115 &osd->eth.rx_bytes, &nsd->eth.rx_bytes); in ixl_update_stats_counters()
2116 ixl_stat_update48(hw, I40E_GLPRT_GOTCL(hw->port), in ixl_update_stats_counters()
2117 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2118 &osd->eth.tx_bytes, &nsd->eth.tx_bytes); in ixl_update_stats_counters()
2119 ixl_stat_update32(hw, I40E_GLPRT_RDPC(hw->port), in ixl_update_stats_counters()
2120 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2121 &osd->eth.rx_discards, in ixl_update_stats_counters()
2122 &nsd->eth.rx_discards); in ixl_update_stats_counters()
2123 ixl_stat_update48(hw, I40E_GLPRT_UPRCL(hw->port), in ixl_update_stats_counters()
2124 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2125 &osd->eth.rx_unicast, in ixl_update_stats_counters()
2126 &nsd->eth.rx_unicast); in ixl_update_stats_counters()
2127 ixl_stat_update48(hw, I40E_GLPRT_UPTCL(hw->port), in ixl_update_stats_counters()
2128 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2129 &osd->eth.tx_unicast, in ixl_update_stats_counters()
2130 &nsd->eth.tx_unicast); in ixl_update_stats_counters()
2131 ixl_stat_update48(hw, I40E_GLPRT_MPRCL(hw->port), in ixl_update_stats_counters()
2132 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2133 &osd->eth.rx_multicast, in ixl_update_stats_counters()
2134 &nsd->eth.rx_multicast); in ixl_update_stats_counters()
2135 ixl_stat_update48(hw, I40E_GLPRT_MPTCL(hw->port), in ixl_update_stats_counters()
2136 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2137 &osd->eth.tx_multicast, in ixl_update_stats_counters()
2138 &nsd->eth.tx_multicast); in ixl_update_stats_counters()
2139 ixl_stat_update48(hw, I40E_GLPRT_BPRCL(hw->port), in ixl_update_stats_counters()
2140 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2141 &osd->eth.rx_broadcast, in ixl_update_stats_counters()
2142 &nsd->eth.rx_broadcast); in ixl_update_stats_counters()
2143 ixl_stat_update48(hw, I40E_GLPRT_BPTCL(hw->port), in ixl_update_stats_counters()
2144 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2145 &osd->eth.tx_broadcast, in ixl_update_stats_counters()
2146 &nsd->eth.tx_broadcast); in ixl_update_stats_counters()
2148 ixl_stat_update32(hw, I40E_GLPRT_TDOLD(hw->port), in ixl_update_stats_counters()
2149 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2150 &osd->tx_dropped_link_down, in ixl_update_stats_counters()
2151 &nsd->tx_dropped_link_down); in ixl_update_stats_counters()
2152 ixl_stat_update32(hw, I40E_GLPRT_MLFC(hw->port), in ixl_update_stats_counters()
2153 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2154 &osd->mac_local_faults, in ixl_update_stats_counters()
2155 &nsd->mac_local_faults); in ixl_update_stats_counters()
2156 ixl_stat_update32(hw, I40E_GLPRT_MRFC(hw->port), in ixl_update_stats_counters()
2157 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2158 &osd->mac_remote_faults, in ixl_update_stats_counters()
2159 &nsd->mac_remote_faults); in ixl_update_stats_counters()
2160 ixl_stat_update32(hw, I40E_GLPRT_RLEC(hw->port), in ixl_update_stats_counters()
2161 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2162 &osd->rx_length_errors, in ixl_update_stats_counters()
2163 &nsd->rx_length_errors); in ixl_update_stats_counters()
2166 ixl_stat_update32(hw, I40E_GLPRT_LXONRXC(hw->port), in ixl_update_stats_counters()
2167 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2168 &osd->link_xon_rx, &nsd->link_xon_rx); in ixl_update_stats_counters()
2169 ixl_stat_update32(hw, I40E_GLPRT_LXONTXC(hw->port), in ixl_update_stats_counters()
2170 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2171 &osd->link_xon_tx, &nsd->link_xon_tx); in ixl_update_stats_counters()
2172 ixl_stat_update32(hw, I40E_GLPRT_LXOFFRXC(hw->port), in ixl_update_stats_counters()
2173 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2174 &osd->link_xoff_rx, &nsd->link_xoff_rx); in ixl_update_stats_counters()
2175 ixl_stat_update32(hw, I40E_GLPRT_LXOFFTXC(hw->port), in ixl_update_stats_counters()
2176 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2177 &osd->link_xoff_tx, &nsd->link_xoff_tx); in ixl_update_stats_counters()
2183 if (pf->stats.link_xoff_rx != prev_link_xoff_rx) in ixl_update_stats_counters()
2184 vsi->shared->isc_pause_frames = 1; in ixl_update_stats_counters()
2187 ixl_stat_update48(hw, I40E_GLPRT_PRC64L(hw->port), in ixl_update_stats_counters()
2188 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2189 &osd->rx_size_64, &nsd->rx_size_64); in ixl_update_stats_counters()
2190 ixl_stat_update48(hw, I40E_GLPRT_PRC127L(hw->port), in ixl_update_stats_counters()
2191 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2192 &osd->rx_size_127, &nsd->rx_size_127); in ixl_update_stats_counters()
2193 ixl_stat_update48(hw, I40E_GLPRT_PRC255L(hw->port), in ixl_update_stats_counters()
2194 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2195 &osd->rx_size_255, &nsd->rx_size_255); in ixl_update_stats_counters()
2196 ixl_stat_update48(hw, I40E_GLPRT_PRC511L(hw->port), in ixl_update_stats_counters()
2197 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2198 &osd->rx_size_511, &nsd->rx_size_511); in ixl_update_stats_counters()
2199 ixl_stat_update48(hw, I40E_GLPRT_PRC1023L(hw->port), in ixl_update_stats_counters()
2200 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2201 &osd->rx_size_1023, &nsd->rx_size_1023); in ixl_update_stats_counters()
2202 ixl_stat_update48(hw, I40E_GLPRT_PRC1522L(hw->port), in ixl_update_stats_counters()
2203 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2204 &osd->rx_size_1522, &nsd->rx_size_1522); in ixl_update_stats_counters()
2205 ixl_stat_update48(hw, I40E_GLPRT_PRC9522L(hw->port), in ixl_update_stats_counters()
2206 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2207 &osd->rx_size_big, &nsd->rx_size_big); in ixl_update_stats_counters()
2210 ixl_stat_update48(hw, I40E_GLPRT_PTC64L(hw->port), in ixl_update_stats_counters()
2211 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2212 &osd->tx_size_64, &nsd->tx_size_64); in ixl_update_stats_counters()
2213 ixl_stat_update48(hw, I40E_GLPRT_PTC127L(hw->port), in ixl_update_stats_counters()
2214 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2215 &osd->tx_size_127, &nsd->tx_size_127); in ixl_update_stats_counters()
2216 ixl_stat_update48(hw, I40E_GLPRT_PTC255L(hw->port), in ixl_update_stats_counters()
2217 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2218 &osd->tx_size_255, &nsd->tx_size_255); in ixl_update_stats_counters()
2219 ixl_stat_update48(hw, I40E_GLPRT_PTC511L(hw->port), in ixl_update_stats_counters()
2220 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2221 &osd->tx_size_511, &nsd->tx_size_511); in ixl_update_stats_counters()
2222 ixl_stat_update48(hw, I40E_GLPRT_PTC1023L(hw->port), in ixl_update_stats_counters()
2223 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2224 &osd->tx_size_1023, &nsd->tx_size_1023); in ixl_update_stats_counters()
2225 ixl_stat_update48(hw, I40E_GLPRT_PTC1522L(hw->port), in ixl_update_stats_counters()
2226 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2227 &osd->tx_size_1522, &nsd->tx_size_1522); in ixl_update_stats_counters()
2228 ixl_stat_update48(hw, I40E_GLPRT_PTC9522L(hw->port), in ixl_update_stats_counters()
2229 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2230 &osd->tx_size_big, &nsd->tx_size_big); in ixl_update_stats_counters()
2232 ixl_stat_update32(hw, I40E_GLPRT_RUC(hw->port), in ixl_update_stats_counters()
2233 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2234 &osd->rx_undersize, &nsd->rx_undersize); in ixl_update_stats_counters()
2235 ixl_stat_update32(hw, I40E_GLPRT_RFC(hw->port), in ixl_update_stats_counters()
2236 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2237 &osd->rx_fragments, &nsd->rx_fragments); in ixl_update_stats_counters()
2240 ixl_stat_update32(hw, I40E_GLPRT_ROC(hw->port), in ixl_update_stats_counters()
2241 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2242 &osd->rx_oversize, &rx_roc); in ixl_update_stats_counters()
2248 * Also need to add BIT(7) to hw->port value while indexing in ixl_update_stats_counters()
2250 * SR-IOV is enabled. Indexes 128..143 are for PFs. in ixl_update_stats_counters()
2254 I40E_GL_RXERR1L(hw->pf_id + BIT(7)), in ixl_update_stats_counters()
2255 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2256 &osd->rx_err1, in ixl_update_stats_counters()
2259 nsd->rx_oversize = rx_roc + rx_err1; in ixl_update_stats_counters()
2261 ixl_stat_update32(hw, I40E_GLPRT_RJC(hw->port), in ixl_update_stats_counters()
2262 pf->stat_offsets_loaded, in ixl_update_stats_counters()
2263 &osd->rx_jabber, &nsd->rx_jabber); in ixl_update_stats_counters()
2264 /* EEE */ in ixl_update_stats_counters()
2267 i40e_lpi_stat_update(hw, pf->stat_offsets_loaded, in ixl_update_stats_counters()
2268 &osd->tx_lpi_count, &nsd->tx_lpi_count, in ixl_update_stats_counters()
2269 &osd->rx_lpi_count, &nsd->rx_lpi_count); in ixl_update_stats_counters()
2271 pf->stat_offsets_loaded = true; in ixl_update_stats_counters()
2277 for (int i = 0; i < pf->num_vfs; i++) { in ixl_update_stats_counters()
2278 vf = &pf->vfs[i]; in ixl_update_stats_counters()
2279 if (vf->vf_flags & VF_FLAG_ENABLED) in ixl_update_stats_counters()
2280 ixl_update_eth_stats(&pf->vfs[i].vsi); in ixl_update_stats_counters()
2285 * Update VSI-specific ethernet statistics counters.
2290 struct ixl_pf *pf = (struct ixl_pf *)vsi->back; in ixl_update_eth_stats()
2291 struct i40e_hw *hw = &pf->hw; in ixl_update_eth_stats()
2294 u16 stat_idx = vsi->info.stat_counter_idx; in ixl_update_eth_stats()
2296 es = &vsi->eth_stats; in ixl_update_eth_stats()
2297 oes = &vsi->eth_stats_offsets; in ixl_update_eth_stats()
2301 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2302 &oes->tx_errors, &es->tx_errors); in ixl_update_eth_stats()
2304 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2305 &oes->rx_discards, &es->rx_discards); in ixl_update_eth_stats()
2308 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2309 &oes->rx_bytes, &es->rx_bytes); in ixl_update_eth_stats()
2311 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2312 &oes->rx_unicast, &es->rx_unicast); in ixl_update_eth_stats()
2314 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2315 &oes->rx_multicast, &es->rx_multicast); in ixl_update_eth_stats()
2317 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2318 &oes->rx_broadcast, &es->rx_broadcast); in ixl_update_eth_stats()
2321 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2322 &oes->tx_bytes, &es->tx_bytes); in ixl_update_eth_stats()
2324 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2325 &oes->tx_unicast, &es->tx_unicast); in ixl_update_eth_stats()
2327 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2328 &oes->tx_multicast, &es->tx_multicast); in ixl_update_eth_stats()
2330 vsi->stat_offsets_loaded, in ixl_update_eth_stats()
2331 &oes->tx_broadcast, &es->tx_broadcast); in ixl_update_eth_stats()
2332 vsi->stat_offsets_loaded = true; in ixl_update_eth_stats()
2344 pf = vsi->back; in ixl_update_vsi_stats()
2345 es = &vsi->eth_stats; in ixl_update_vsi_stats()
2346 nsd = &pf->stats; in ixl_update_vsi_stats()
2350 tx_discards = es->tx_discards + nsd->tx_dropped_link_down; in ixl_update_vsi_stats()
2353 for (int i = 0; i < vsi->num_rx_queues; i++) in ixl_update_vsi_stats()
2354 csum_errs += vsi->rx_queues[i].rxr.csum_errs; in ixl_update_vsi_stats()
2355 nsd->checksum_error = csum_errs; in ixl_update_vsi_stats()
2358 IXL_SET_IPACKETS(vsi, es->rx_unicast + in ixl_update_vsi_stats()
2359 es->rx_multicast + in ixl_update_vsi_stats()
2360 es->rx_broadcast); in ixl_update_vsi_stats()
2361 IXL_SET_OPACKETS(vsi, es->tx_unicast + in ixl_update_vsi_stats()
2362 es->tx_multicast + in ixl_update_vsi_stats()
2363 es->tx_broadcast); in ixl_update_vsi_stats()
2364 IXL_SET_IBYTES(vsi, es->rx_bytes); in ixl_update_vsi_stats()
2365 IXL_SET_OBYTES(vsi, es->tx_bytes); in ixl_update_vsi_stats()
2366 IXL_SET_IMCASTS(vsi, es->rx_multicast); in ixl_update_vsi_stats()
2367 IXL_SET_OMCASTS(vsi, es->tx_multicast); in ixl_update_vsi_stats()
2369 IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes + in ixl_update_vsi_stats()
2370 nsd->checksum_error + nsd->rx_length_errors + in ixl_update_vsi_stats()
2371 nsd->rx_undersize + nsd->rx_fragments + nsd->rx_oversize + in ixl_update_vsi_stats()
2372 nsd->rx_jabber); in ixl_update_vsi_stats()
2373 IXL_SET_OERRORS(vsi, es->tx_errors); in ixl_update_vsi_stats()
2374 IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); in ixl_update_vsi_stats()
2376 IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); in ixl_update_vsi_stats()
2386 bzero(&pf->stats, sizeof(struct i40e_hw_port_stats)); in ixl_pf_reset_stats()
2387 bzero(&pf->stats_offsets, sizeof(struct i40e_hw_port_stats)); in ixl_pf_reset_stats()
2388 pf->stat_offsets_loaded = false; in ixl_pf_reset_stats()
2397 bzero(&vsi->eth_stats, sizeof(struct i40e_eth_stats)); in ixl_vsi_reset_stats()
2398 bzero(&vsi->eth_stats_offsets, sizeof(struct i40e_eth_stats)); in ixl_vsi_reset_stats()
2399 vsi->stat_offsets_loaded = false; in ixl_vsi_reset_stats()
2419 *stat = new_data - *offset; in _ixl_stat_update_helper()
2421 *stat = (new_data + mask) - *offset + 1; in _ixl_stat_update_helper()
2441 * ixl_stat_update64 - read and update a 64 bit stat from the chip.
2468 *stat = (u32)(new_data - *offset); in ixl_stat_update32()
2470 *stat = (u32)((new_data + ((u64)1 << 32)) - *offset); in ixl_stat_update32()
2479 device_t dev = pf->dev; in ixl_add_sysctls_recovery_mode()
2494 * in "sysctl -a" output. */ in ixl_add_sysctls_recovery_mode()
2502 &pf->hw.debug_mask, 0, "Shared code debug message level"); in ixl_add_sysctls_recovery_mode()
2506 &pf->dbg_mask, 0, "Non-shared code debug message level"); in ixl_add_sysctls_recovery_mode()
2531 pf, 0, ixl_sysctl_queue_interrupt_table, "A", "View MSI-X indices for TX/RX queues"); in ixl_add_sysctls_recovery_mode()
2537 "View MSI-X control registers for RX queues"); in ixl_add_sysctls_recovery_mode()
2543 device_t dev = pf->dev; in ixl_add_device_sysctls()
2544 struct i40e_hw *hw = &pf->hw; in ixl_add_device_sysctls()
2603 &pf->dynamic_rx_itr, 0, "Enable dynamic RX ITR"); in ixl_add_device_sysctls()
2607 &pf->dynamic_tx_itr, 0, "Enable dynamic TX ITR"); in ixl_add_device_sysctls()
2610 if (i40e_is_25G_device(hw->device_id)) { in ixl_add_device_sysctls()
2650 OID_AUTO, "eee", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, in ixl_add_device_sysctls()
2651 "Energy Efficient Ethernet (EEE) Sysctls"); in ixl_add_device_sysctls()
2657 "Enable Energy Efficient Ethernet (EEE)"); in ixl_add_device_sysctls()
2660 CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.tx_lpi_status, 0, in ixl_add_device_sysctls()
2664 CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.rx_lpi_status, 0, in ixl_add_device_sysctls()
2668 CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.tx_lpi_count, in ixl_add_device_sysctls()
2672 CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.rx_lpi_count, in ixl_add_device_sysctls()
2682 * in "sysctl -a" output. */ in ixl_add_device_sysctls()
2690 &pf->hw.debug_mask, 0, "Shared code debug message level"); in ixl_add_device_sysctls()
2694 &pf->dbg_mask, 0, "Non-shared code debug message level"); in ixl_add_device_sysctls()
2774 pf, 0, ixl_sysctl_queue_interrupt_table, "A", "View MSI-X indices for TX/RX queues"); in ixl_add_device_sysctls()
2780 if (pf->has_i2c) { in ixl_add_device_sysctls()
2808 queues = (int)ixl_pf_qmgr_get_num_free(&pf->qmgr); in ixl_sysctl_unallocated_queues()
2867 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_current_speed()
2874 ixl_link_speed_string(hw->phy.link_info.link_speed)), in ixl_sysctl_current_speed()
2881 * Converts 8-bit speeds value to and from sysctl flags and
2913 struct i40e_hw *hw = &pf->hw; in ixl_set_advertised_speeds()
2914 device_t dev = pf->dev; in ixl_set_advertised_speeds()
2926 hw->aq.asq_last_status); in ixl_set_advertised_speeds()
2952 hw->aq.asq_last_status); in ixl_set_advertised_speeds()
2962 ** 0x1 - 100 Mb
2963 ** 0x2 - 1G
2964 ** 0x4 - 10G
2965 ** 0x8 - 20G
2966 ** 0x10 - 25G
2967 ** 0x20 - 40G
2968 ** 0x40 - 2.5G
2969 ** 0x80 - 5G
2975 int supported = ixl_convert_sysctl_aq_link_speed(pf->supported_speeds, false); in ixl_sysctl_supported_speeds()
2983 ** 0x1 - advertise 100 Mb
2984 ** 0x2 - advertise 1G
2985 ** 0x4 - advertise 10G
2986 ** 0x8 - advertise 20G
2987 ** 0x10 - advertise 25G
2988 ** 0x20 - advertise 40G
2989 ** 0x40 - advertise 2.5G
2990 ** 0x80 - advertise 5G
2998 device_t dev = pf->dev; in ixl_sysctl_set_advertise()
3004 requested_ls = pf->advertised_speed; in ixl_sysctl_set_advertise()
3006 if ((error) || (req->newptr == NULL)) in ixl_sysctl_set_advertise()
3018 ixl_convert_sysctl_aq_link_speed(pf->supported_speeds, false)); in ixl_sysctl_set_advertise()
3024 if ((converted_speeds | pf->supported_speeds) != pf->supported_speeds) { in ixl_sysctl_set_advertise()
3027 ixl_convert_sysctl_aq_link_speed(pf->supported_speeds, false)); in ixl_sysctl_set_advertise()
3035 pf->advertised_speed = requested_ls; in ixl_sysctl_set_advertise()
3074 struct i40e_hw *hw = &pf->hw; in ixl_get_bus_info()
3075 device_t dev = pf->dev; in ixl_get_bus_info()
3081 if (hw->mac.type == I40E_MAC_X722) in ixl_get_bus_info()
3093 ((hw->bus.speed == i40e_bus_speed_8000) ? "8.0GT/s": in ixl_get_bus_info()
3094 (hw->bus.speed == i40e_bus_speed_5000) ? "5.0GT/s": in ixl_get_bus_info()
3095 (hw->bus.speed == i40e_bus_speed_2500) ? "2.5GT/s":"Unknown"), in ixl_get_bus_info()
3096 (hw->bus.width == i40e_bus_width_pcie_x8) ? "Width x8" : in ixl_get_bus_info()
3097 (hw->bus.width == i40e_bus_width_pcie_x4) ? "Width x4" : in ixl_get_bus_info()
3098 (hw->bus.width == i40e_bus_width_pcie_x2) ? "Width x2" : in ixl_get_bus_info()
3099 (hw->bus.width == i40e_bus_width_pcie_x1) ? "Width x1" : in ixl_get_bus_info()
3106 if (hw->bus.speed >= i40e_bus_speed_8000 in ixl_get_bus_info()
3107 && hw->bus.width >= i40e_bus_width_pcie_x8) in ixl_get_bus_info()
3110 num_ports = bitcount32(hw->func_caps.valid_functions); in ixl_get_bus_info()
3111 max_speed = ixl_max_aq_speed_to_value(pf->supported_speeds) / 1000000; in ixl_get_bus_info()
3113 if ((num_ports * max_speed) > hw->bus.speed * hw->bus.width) { in ixl_get_bus_info()
3114 device_printf(dev, "PCI-Express bandwidth available" in ixl_get_bus_info()
3118 " PCI-e link with more lanes and/or higher" in ixl_get_bus_info()
3127 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_show_fw()
3141 u8 nvma_ptr = nvma->config & 0xFF; in ixl_print_nvm_cmd()
3142 u8 nvma_flags = (nvma->config & 0xF00) >> 8; in ixl_print_nvm_cmd()
3145 switch (nvma->command) { in ixl_print_nvm_cmd()
3148 nvma->offset == 0 && nvma->data_size == 1) { in ixl_print_nvm_cmd()
3158 device_printf(dev, "NVMUPD: unknown command: 0x%08x\n", nvma->command); in ixl_print_nvm_cmd()
3163 cmd_str, nvma_ptr, nvma_flags, nvma->offset, nvma->data_size); in ixl_print_nvm_cmd()
3169 struct i40e_hw *hw = &pf->hw; in ixl_handle_nvmupd_cmd()
3171 device_t dev = pf->dev; in ixl_handle_nvmupd_cmd()
3180 ifd_len = ifd->ifd_len; in ixl_handle_nvmupd_cmd()
3183 ifd->ifd_data == NULL) { in ixl_handle_nvmupd_cmd()
3189 ifd->ifd_data); in ixl_handle_nvmupd_cmd()
3194 err = copyin(ifd->ifd_data, nvma, ifd_len); in ixl_handle_nvmupd_cmd()
3202 if (pf->dbg_mask & IXL_DBG_NVMUPD) in ixl_handle_nvmupd_cmd()
3219 return (-EBUSY); in ixl_handle_nvmupd_cmd()
3222 if (nvma->data_size < 1 || nvma->data_size > 4096) { in ixl_handle_nvmupd_cmd()
3236 exp_len = nvma_size + nvma->data_size - 1; /* One byte is kept in struct */ in ixl_handle_nvmupd_cmd()
3241 err = copyin(ifd->ifd_data, nvma, ifd_len); in ixl_handle_nvmupd_cmd()
3252 status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); in ixl_handle_nvmupd_cmd()
3255 err = copyout(nvma, ifd->ifd_data, ifd_len); in ixl_handle_nvmupd_cmd()
3264 if (status != 0 && (pf->dbg_mask & IXL_DBG_NVMUPD) != 0) in ixl_handle_nvmupd_cmd()
3269 * -EPERM is actually ERESTART, which the kernel interprets as it needing in ixl_handle_nvmupd_cmd()
3270 * to run this ioctl again. So use -EACCES for -EPERM instead. in ixl_handle_nvmupd_cmd()
3272 if (perrno == -EPERM) in ixl_handle_nvmupd_cmd()
3273 return (-EACCES); in ixl_handle_nvmupd_cmd()
3281 struct i40e_hw *hw = &pf->hw; in ixl_find_i2c_interface()
3290 & BIT(hw->port); in ixl_find_i2c_interface()
3295 return (-1); in ixl_find_i2c_interface()
3301 struct i40e_hw *hw = &pf->hw; in ixl_set_link()
3302 device_t dev = pf->dev; in ixl_set_link()
3315 hw->aq.asq_last_status); in ixl_set_link()
3329 hw->aq.asq_last_status); in ixl_set_link()
3348 switch (pf->fc) { in ixl_set_link()
3374 hw->aq.asq_last_status); in ixl_set_link()
3383 hw->aq.asq_last_status); in ixl_set_link()
3393 "1000BASE-KX", in ixl_phy_type_string()
3394 "10GBASE-KX4", in ixl_phy_type_string()
3395 "10GBASE-KR", in ixl_phy_type_string()
3396 "40GBASE-KR4", in ixl_phy_type_string()
3402 "40GBASE-CR4", in ixl_phy_type_string()
3403 "10GBASE-CR1", in ixl_phy_type_string()
3409 "100BASE-TX", in ixl_phy_type_string()
3410 "1000BASE-T", in ixl_phy_type_string()
3411 "10GBASE-T", in ixl_phy_type_string()
3412 "10GBASE-SR", in ixl_phy_type_string()
3413 "10GBASE-LR", in ixl_phy_type_string()
3414 "10GBASE-SFP+Cu", in ixl_phy_type_string()
3415 "10GBASE-CR1", in ixl_phy_type_string()
3416 "40GBASE-CR4", in ixl_phy_type_string()
3417 "40GBASE-SR4", in ixl_phy_type_string()
3418 "40GBASE-LR4", in ixl_phy_type_string()
3419 "1000BASE-SX", in ixl_phy_type_string()
3420 "1000BASE-LX", in ixl_phy_type_string()
3421 "1000BASE-T Optical", in ixl_phy_type_string()
3422 "20GBASE-KR2", in ixl_phy_type_string()
3426 "25GBASE-KR", in ixl_phy_type_string()
3427 "25GBASE-CR", in ixl_phy_type_string()
3428 "25GBASE-SR", in ixl_phy_type_string()
3429 "25GBASE-LR", in ixl_phy_type_string()
3430 "25GBASE-AOC", in ixl_phy_type_string()
3431 "25GBASE-ACC", in ixl_phy_type_string()
3432 "2.5GBASE-T", in ixl_phy_type_string()
3433 "5GBASE-T" in ixl_phy_type_string()
3446 device_t dev = pf->dev; in ixl_aq_get_link_status()
3447 struct i40e_hw *hw = &pf->hw; in ixl_aq_get_link_status()
3455 link_status->command_flags = CPU_TO_LE16(I40E_AQ_LSE_ENABLE); in ixl_aq_get_link_status()
3461 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_aq_get_link_status()
3473 return ixl_phy_type_string(val - 0x1F, true); in ixl_phy_type_string_ls()
3482 device_t dev = pf->dev; in ixl_sysctl_link_status()
3532 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_phy_abilities()
3533 device_t dev = pf->dev; in ixl_sysctl_phy_abilities()
3551 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_phy_abilities()
3595 "EEE cap : %04x\n" in ixl_sysctl_phy_abilities()
3624 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_phy_statistics()
3625 device_t dev = pf->dev; in ixl_sysctl_phy_statistics()
3635 if (hw->mac.type == I40E_MAC_X722) { in ixl_sysctl_phy_statistics()
3637 "PCS Link Control Register: unavailable\n" in ixl_sysctl_phy_statistics()
3638 "PCS Link Status 1: unavailable\n" in ixl_sysctl_phy_statistics()
3639 "PCS Link Status 2: unavailable\n" in ixl_sysctl_phy_statistics()
3641 "Auto-Negotiation (AN) Status: unavailable\n" in ixl_sysctl_phy_statistics()
3642 "KR PCS Status: unavailable\n" in ixl_sysctl_phy_statistics()
3648 "PCS Link Control Register: %#010X\n" in ixl_sysctl_phy_statistics()
3649 "PCS Link Status 1: %#010X\n" in ixl_sysctl_phy_statistics()
3650 "PCS Link Status 2: %#010X\n" in ixl_sysctl_phy_statistics()
3652 "Auto-Negotiation (AN) Status: %#010X\n" in ixl_sysctl_phy_statistics()
3653 "KR PCS Status: %#010X\n" in ixl_sysctl_phy_statistics()
3679 struct ixl_vsi *vsi = &pf->vsi; in ixl_sysctl_sw_filter_list()
3681 device_t dev = pf->dev; in ixl_sysctl_sw_filter_list()
3696 LIST_FOREACH(f, &vsi->ftl, ftle) in ixl_sysctl_sw_filter_list()
3702 LIST_FOREACH(f, &vsi->ftl, ftle) { in ixl_sysctl_sw_filter_list()
3705 MAC_FORMAT_ARGS(f->macaddr), f->vlan, f->flags); in ixl_sysctl_sw_filter_list()
3715 if (pf->num_vfs > 0) { in ixl_sysctl_sw_filter_list()
3717 for (int i = 0; i < pf->num_vfs; i++) { in ixl_sysctl_sw_filter_list()
3718 vf = &pf->vfs[i]; in ixl_sysctl_sw_filter_list()
3719 if (!(vf->vf_flags & VF_FLAG_ENABLED)) in ixl_sysctl_sw_filter_list()
3722 vsi = &vf->vsi; in ixl_sysctl_sw_filter_list()
3724 sbuf_printf(buf, "VF-%d Filters:\n", vf->vf_num); in ixl_sysctl_sw_filter_list()
3725 LIST_FOREACH(f, &vsi->ftl, ftle) in ixl_sysctl_sw_filter_list()
3731 LIST_FOREACH(f, &vsi->ftl, ftle) { in ixl_sysctl_sw_filter_list()
3734 MAC_FORMAT_ARGS(f->macaddr), f->vlan, f->flags); in ixl_sysctl_sw_filter_list()
3757 return ((int)one->resource_type - (int)two->resource_type); in ixl_res_alloc_cmp()
3770 "S-tag", in ixl_switch_res_type_string()
3799 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_hw_res_alloc()
3800 device_t dev = pf->dev; in ixl_sysctl_hw_res_alloc()
3823 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_hw_res_alloc()
3836 " Type | Guaranteed | Total | Used | Un-allocated\n" in ixl_sysctl_hw_res_alloc()
3846 if (i < num_entries - 1) in ixl_sysctl_hw_res_alloc()
3873 * power-on; these include the EMP, Ports, PFs and VFs.
3889 seid - IXL_SW_SEID_MAC_START); in ixl_switch_element_string()
3894 seid - IXL_SW_SEID_PF_START); in ixl_switch_element_string()
3899 seid - IXL_SW_SEID_VF_START); in ixl_switch_element_string()
3936 return ((int)one->seid - (int)two->seid); in ixl_sw_cfg_elem_seid_cmp()
3943 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_switch_config()
3944 device_t dev = pf->dev; in ixl_sysctl_switch_config()
3968 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_switch_config()
3984 qsort(sw_config->element, sw_config->header.num_reported, in ixl_sysctl_switch_config()
3990 sbuf_printf(buf, "# of reported elements: %d\n", sw_config->header.num_reported); in ixl_sysctl_switch_config()
3991 sbuf_printf(buf, "total # of elements: %d\n", sw_config->header.num_total); in ixl_sysctl_switch_config()
3993 * Revision -- all elements are revision 1 for now in ixl_sysctl_switch_config()
3998 for (int i = 0; i < sw_config->header.num_reported; i++) { in ixl_sysctl_switch_config()
3999 elem = &sw_config->element[i]; in ixl_sysctl_switch_config()
4002 sbuf_printf(buf, "%4d", elem->seid); in ixl_sysctl_switch_config()
4005 elem->element_type, elem->seid)); in ixl_sysctl_switch_config()
4007 sbuf_printf(buf, "%4d", elem->uplink_seid); in ixl_sysctl_switch_config()
4010 0, elem->uplink_seid)); in ixl_sysctl_switch_config()
4012 sbuf_printf(buf, "%4d", elem->downlink_seid); in ixl_sysctl_switch_config()
4015 0, elem->downlink_seid)); in ixl_sysctl_switch_config()
4017 sbuf_printf(buf, "%8d", elem->connection_type); in ixl_sysctl_switch_config()
4018 if (i < sw_config->header.num_reported - 1) in ixl_sysctl_switch_config()
4036 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_switch_vlans()
4037 device_t dev = pf->dev; in ixl_sysctl_switch_vlans()
4038 int requested_vlan = -1; in ixl_sysctl_switch_vlans()
4043 if ((error) || (req->newptr == NULL)) in ixl_sysctl_switch_vlans()
4046 if ((hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) == 0) { in ixl_sysctl_switch_vlans()
4051 hw->switch_tag = requested_vlan; in ixl_sysctl_switch_vlans()
4054 hw->switch_tag, hw->first_tag, hw->second_tag); in ixl_sysctl_switch_vlans()
4060 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_switch_vlans()
4070 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_hkey()
4071 device_t dev = pf->dev; in ixl_sysctl_hkey()
4088 if (hw->mac.type == I40E_MAC_X722) { in ixl_sysctl_hkey()
4089 status = i40e_aq_get_rss_key(hw, pf->vsi.vsi_num, &key_data); in ixl_sysctl_hkey()
4092 i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_hkey()
4125 width = (rem > 0 && i == lines - 1) in ixl_sbuf_print_bytes()
4134 for (k = 0; k < (byte_stride - width); k++) in ixl_sbuf_print_bytes()
4150 if (j == width - 1) in ixl_sbuf_print_bytes()
4160 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_hlut()
4161 device_t dev = pf->dev; in ixl_sysctl_hlut()
4176 if (hw->mac.type == I40E_MAC_X722) { in ixl_sysctl_hlut()
4177 status = i40e_aq_get_rss_lut(hw, pf->vsi.vsi_num, TRUE, hlut, sizeof(hlut)); in ixl_sysctl_hlut()
4180 i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_hlut()
4182 for (int i = 0; i < hw->func_caps.rss_table_size >> 2; i++) { in ixl_sysctl_hlut()
4201 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_hena()
4213 * 1 - Disable link management on this port
4214 * 0 - Re-enable link management
4222 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_fw_link_management()
4223 device_t dev = pf->dev; in ixl_sysctl_fw_link_management()
4224 int requested_mode = -1; in ixl_sysctl_fw_link_management()
4230 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fw_link_management()
4244 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_fw_link_management()
4255 * Temperature 96-97 22-23
4256 * Vcc 98-99 26-27
4257 * TX power 102-103 34-35..40-41
4258 * RX power 104-105 50-51..56-57
4264 device_t dev = pf->dev; in ixl_sysctl_read_i2c_diag_data()
4269 if (req->oldptr == NULL) { in ixl_sysctl_read_i2c_diag_data()
4274 error = pf->read_i2c_byte(pf, 0, 0xA0, &output); in ixl_sysctl_read_i2c_diag_data()
4284 * - Internally calibrated data in ixl_sysctl_read_i2c_diag_data()
4285 * - Diagnostic monitoring is implemented in ixl_sysctl_read_i2c_diag_data()
4287 pf->read_i2c_byte(pf, 92, 0xA0, &output); in ixl_sysctl_read_i2c_diag_data()
4296 pf->read_i2c_byte(pf, offset, 0xA2, &output); in ixl_sysctl_read_i2c_diag_data()
4300 pf->read_i2c_byte(pf, offset, 0xA2, &output); in ixl_sysctl_read_i2c_diag_data()
4311 pf->read_i2c_byte(pf, offset, 0xA0, &output); in ixl_sysctl_read_i2c_diag_data()
4315 pf->read_i2c_byte(pf, offset, 0xA0, &output); in ixl_sysctl_read_i2c_diag_data()
4320 pf->read_i2c_byte(pf, offset, 0xA0, &output); in ixl_sysctl_read_i2c_diag_data()
4324 pf->read_i2c_byte(pf, offset, 0xA0, &output); in ixl_sysctl_read_i2c_diag_data()
4341 * Input: 32-bit value:
4342 * bits 0-7: device address (0xA0 or 0xA2)
4343 * bits 8-15: offset (0-255)
4344 * bits 16-31: unused
4345 * Output: 8-bit value read
4351 device_t dev = pf->dev; in ixl_sysctl_read_i2c_byte()
4352 int input = -1, error = 0; in ixl_sysctl_read_i2c_byte()
4357 if ((error) || (req->newptr == NULL)) in ixl_sysctl_read_i2c_byte()
4366 error = pf->read_i2c_byte(pf, offset, dev_addr, &output); in ixl_sysctl_read_i2c_byte()
4377 * Input: 32-bit value:
4378 * bits 0-7: device address (0xA0 or 0xA2)
4379 * bits 8-15: offset (0-255)
4380 * bits 16-23: value to write
4381 * bits 24-31: unused
4382 * Output: 8-bit value written
4388 device_t dev = pf->dev; in ixl_sysctl_write_i2c_byte()
4389 int input = -1, error = 0; in ixl_sysctl_write_i2c_byte()
4394 if ((error) || (req->newptr == NULL)) in ixl_sysctl_write_i2c_byte()
4404 error = pf->write_i2c_byte(pf, offset, dev_addr, value); in ixl_sysctl_write_i2c_byte()
4416 device_t dev = pf->dev; in ixl_get_fec_config()
4417 struct i40e_hw *hw = &pf->hw; in ixl_get_fec_config()
4429 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_get_fec_config()
4433 *is_set = !!(abilities->fec_cfg_curr_mod_ext_info & bit_pos); in ixl_get_fec_config()
4441 device_t dev = pf->dev; in ixl_set_fec_config()
4442 struct i40e_hw *hw = &pf->hw; in ixl_set_fec_config()
4448 config.fec_config = abilities->fec_cfg_curr_mod_ext_info & ~(bit_pos); in ixl_set_fec_config()
4451 if (config.fec_config != abilities->fec_cfg_curr_mod_ext_info) { in ixl_set_fec_config()
4453 config.phy_type = abilities->phy_type; in ixl_set_fec_config()
4454 config.phy_type_ext = abilities->phy_type_ext; in ixl_set_fec_config()
4455 config.link_speed = abilities->link_speed; in ixl_set_fec_config()
4456 config.eee_capability = abilities->eee_capability; in ixl_set_fec_config()
4457 config.eeer = abilities->eeer_val; in ixl_set_fec_config()
4458 config.low_power_ctrl = abilities->d3_lpan; in ixl_set_fec_config()
4465 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_set_fec_config()
4485 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fec_fc_ability()
4503 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fec_rs_ability()
4521 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fec_fc_request()
4539 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fec_rs_request()
4557 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fec_auto_enable()
4567 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_dump_debug_data()
4568 device_t dev = pf->dev; in ixl_sysctl_dump_debug_data()
4608 i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_sysctl_dump_debug_data()
4657 struct i40e_hw *hw = &pf->hw; in ixl_start_fw_lldp()
4662 switch (hw->aq.asq_last_status) { in ixl_start_fw_lldp()
4664 device_printf(pf->dev, in ixl_start_fw_lldp()
4668 device_printf(pf->dev, in ixl_start_fw_lldp()
4674 device_printf(pf->dev, in ixl_start_fw_lldp()
4677 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_start_fw_lldp()
4682 ixl_clear_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); in ixl_start_fw_lldp()
4689 struct i40e_hw *hw = &pf->hw; in ixl_stop_fw_lldp()
4690 device_t dev = pf->dev; in ixl_stop_fw_lldp()
4693 if (hw->func_caps.npar_enable != 0) { in ixl_stop_fw_lldp()
4699 if ((hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE) == 0) { in ixl_stop_fw_lldp()
4707 if (hw->aq.asq_last_status != I40E_AQ_RC_EPERM) { in ixl_stop_fw_lldp()
4711 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_stop_fw_lldp()
4719 ixl_set_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); in ixl_stop_fw_lldp()
4729 state = new_state = !ixl_test_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); in ixl_sysctl_fw_lldp()
4733 if ((error) || (req->newptr == NULL)) in ixl_sysctl_fw_lldp()
4755 state = new_state = ixl_test_state(&pf->state, IXL_STATE_EEE_ENABLED); in ixl_sysctl_eee_enable()
4759 if ((sysctl_handle_status) || (req->newptr == NULL)) in ixl_sysctl_eee_enable()
4767 cmd_status = i40e_enable_eee(&pf->hw, (bool)(!!new_state)); in ixl_sysctl_eee_enable()
4772 ixl_clear_state(&pf->state, IXL_STATE_EEE_ENABLED); in ixl_sysctl_eee_enable()
4774 ixl_set_state(&pf->state, IXL_STATE_EEE_ENABLED); in ixl_sysctl_eee_enable()
4789 state = ixl_test_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); in ixl_sysctl_set_link_active()
4792 if ((error) || (req->newptr == NULL)) in ixl_sysctl_set_link_active()
4796 ixl_clear_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); in ixl_sysctl_set_link_active()
4798 ixl_set_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); in ixl_sysctl_set_link_active()
4807 struct i40e_hw *hw = &pf->hw; in ixl_attach_get_link_status()
4808 device_t dev = pf->dev; in ixl_attach_get_link_status()
4811 if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || in ixl_attach_get_link_status()
4812 (hw->aq.fw_maj_ver < 4)) { in ixl_attach_get_link_status()
4819 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_attach_get_link_status()
4825 hw->phy.get_link_info = TRUE; in ixl_attach_get_link_status()
4826 status = i40e_get_link_status(hw, &pf->link_up); in ixl_attach_get_link_status()
4831 i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_attach_get_link_status()
4836 ixl_set_state(&pf->state, IXL_STATE_LINK_POLLING); in ixl_attach_get_link_status()
4837 pf->link_poll_start = getsbinuptime(); in ixl_attach_get_link_status()
4840 ixl_dbg_link(pf, "%s link_up: %d\n", __func__, pf->link_up); in ixl_attach_get_link_status()
4843 if (pf->fc == -1) in ixl_attach_get_link_status()
4844 pf->fc = hw->fc.current_mode; in ixl_attach_get_link_status()
4857 if ((error) || (req->newptr == NULL)) in ixl_sysctl_do_pf_reset()
4861 ixl_set_state(&pf->state, IXL_STATE_PF_RESET_REQ); in ixl_sysctl_do_pf_reset()
4870 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_do_core_reset()
4875 if ((error) || (req->newptr == NULL)) in ixl_sysctl_do_core_reset()
4887 struct i40e_hw *hw = &pf->hw; in ixl_sysctl_do_global_reset()
4892 if ((error) || (req->newptr == NULL)) in ixl_sysctl_do_global_reset()
4902 * to MSI-X vectors.
4908 struct ixl_vsi *vsi = &pf->vsi; in ixl_sysctl_queue_interrupt_table()
4909 struct i40e_hw *hw = vsi->hw; in ixl_sysctl_queue_interrupt_table()
4910 device_t dev = pf->dev; in ixl_sysctl_queue_interrupt_table()
4914 struct ixl_rx_queue *rx_que = vsi->rx_queues; in ixl_sysctl_queue_interrupt_table()
4915 struct ixl_tx_queue *tx_que = vsi->tx_queues; in ixl_sysctl_queue_interrupt_table()
4924 for (int i = 0; i < vsi->num_rx_queues; i++) { in ixl_sysctl_queue_interrupt_table()
4925 rx_que = &vsi->rx_queues[i]; in ixl_sysctl_queue_interrupt_table()
4928 i, rx_que->msix, in ixl_sysctl_queue_interrupt_table()
4929 rd32(hw, I40E_PFINT_LNKLSTN(rx_que->msix - 1)), in ixl_sysctl_queue_interrupt_table()
4930 rd32(hw, I40E_QINT_RQCTL(rx_que->msix - 1))); in ixl_sysctl_queue_interrupt_table()
4932 for (int i = 0; i < vsi->num_tx_queues; i++) { in ixl_sysctl_queue_interrupt_table()
4933 tx_que = &vsi->tx_queues[i]; in ixl_sysctl_queue_interrupt_table()
4935 i, tx_que->msix, in ixl_sysctl_queue_interrupt_table()
4936 rd32(hw, I40E_QINT_TQCTL(tx_que->msix - 1))); in ixl_sysctl_queue_interrupt_table()
4951 struct ixl_vsi *vsi = &pf->vsi; in ixl_sysctl_debug_queue_int_ctln()
4952 struct i40e_hw *hw = vsi->hw; in ixl_sysctl_debug_queue_int_ctln()
4953 device_t dev = pf->dev; in ixl_sysctl_debug_queue_int_ctln()
4957 struct ixl_rx_queue *rx_que = vsi->rx_queues; in ixl_sysctl_debug_queue_int_ctln()
4966 for (int i = 0; i < vsi->num_rx_queues; i++) { in ixl_sysctl_debug_queue_int_ctln()
4967 rx_que = &vsi->rx_queues[i]; in ixl_sysctl_debug_queue_int_ctln()
4970 i, rx_que->msix, in ixl_sysctl_debug_queue_int_ctln()
4971 rd32(hw, I40E_PFINT_DYN_CTLN(rx_que->msix - 1))); in ixl_sysctl_debug_queue_int_ctln()