Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/if_ix.c
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | |||||
static int ixgbe_msix_que(void *arg); | static int ixgbe_msix_que(void *arg); | ||||
static void ixgbe_initialize_rss_mapping(struct adapter *adapter); | static void ixgbe_initialize_rss_mapping(struct adapter *adapter); | ||||
static void ixgbe_initialize_receive_units(if_ctx_t ctx); | static void ixgbe_initialize_receive_units(if_ctx_t ctx); | ||||
static void ixgbe_initialize_transmit_units(if_ctx_t ctx); | static void ixgbe_initialize_transmit_units(if_ctx_t ctx); | ||||
static int ixgbe_setup_interface(if_ctx_t ctx); | static int ixgbe_setup_interface(if_ctx_t ctx); | ||||
static void ixgbe_init_device_features(struct adapter *adapter); | static void ixgbe_init_device_features(struct adapter *adapter); | ||||
static void ixgbe_check_fan_failure(struct adapter *, u32, bool); | static void ixgbe_check_fan_failure(struct adapter *, u32, bool); | ||||
static void ixgbe_sbuf_nvm_versions(struct ixgbe_hw *, struct sbuf *); | |||||
static void ixgbe_print_nvm_versions(if_ctx_t ctx); | |||||
static void ixgbe_add_media_types(if_ctx_t ctx); | static void ixgbe_add_media_types(if_ctx_t ctx); | ||||
static void ixgbe_update_stats_counters(struct adapter *adapter); | static void ixgbe_update_stats_counters(struct adapter *adapter); | ||||
static void ixgbe_config_link(if_ctx_t ctx); | static void ixgbe_config_link(if_ctx_t ctx); | ||||
static void ixgbe_get_slot_info(struct adapter *); | static void ixgbe_get_slot_info(struct adapter *); | ||||
static void ixgbe_check_wol_support(struct adapter *adapter); | static void ixgbe_check_wol_support(struct adapter *adapter); | ||||
static void ixgbe_enable_rx_drop(struct adapter *); | static void ixgbe_enable_rx_drop(struct adapter *); | ||||
static void ixgbe_disable_rx_drop(struct adapter *); | static void ixgbe_disable_rx_drop(struct adapter *); | ||||
static void ixgbe_add_hw_stats(struct adapter *adapter); | static void ixgbe_add_hw_stats(struct adapter *adapter); | ||||
static int ixgbe_set_flowcntl(struct adapter *, int); | static int ixgbe_set_flowcntl(struct adapter *, int); | ||||
static int ixgbe_set_advertise(struct adapter *, int); | static int ixgbe_set_advertise(struct adapter *, int); | ||||
static int ixgbe_get_advertise(struct adapter *); | static int ixgbe_get_advertise(struct adapter *); | ||||
static void ixgbe_setup_vlan_hw_support(if_ctx_t ctx); | static void ixgbe_setup_vlan_hw_support(if_ctx_t ctx); | ||||
static void ixgbe_config_gpie(struct adapter *adapter); | static void ixgbe_config_gpie(struct adapter *adapter); | ||||
static void ixgbe_config_delay_values(struct adapter *adapter); | static void ixgbe_config_delay_values(struct adapter *adapter); | ||||
/* Sysctl handlers */ | /* Sysctl handlers */ | ||||
static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_print_nvm_versions(SYSCTL_HANDLER_ARGS); | |||||
#ifdef IXGBE_DEBUG | #ifdef IXGBE_DEBUG | ||||
static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); | ||||
#endif | #endif | ||||
static int ixgbe_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS); | ||||
static int ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS); | static int ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS); | ||||
▲ Show 20 Lines • Show All 907 Lines • ▼ Show 20 Lines | ixgbe_if_attach_post(if_ctx_t ctx) | ||||
ixgbe_get_slot_info(adapter); | ixgbe_get_slot_info(adapter); | ||||
/* | /* | ||||
* Do time init and sysctl init here, but | * Do time init and sysctl init here, but | ||||
* only on the first port of a bypass adapter. | * only on the first port of a bypass adapter. | ||||
*/ | */ | ||||
ixgbe_bypass_init(adapter); | ixgbe_bypass_init(adapter); | ||||
/* Display NVM and Option ROM versions */ | |||||
ixgbe_print_nvm_versions(ctx); | |||||
/* Set an initial dmac value */ | /* Set an initial dmac value */ | ||||
adapter->dmac = 0; | adapter->dmac = 0; | ||||
/* Set initial advertised speeds (if applicable) */ | /* Set initial advertised speeds (if applicable) */ | ||||
adapter->advertise = ixgbe_get_advertise(adapter); | adapter->advertise = ixgbe_get_advertise(adapter); | ||||
if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) | if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) | ||||
ixgbe_define_iov_schemas(dev, &error); | ixgbe_define_iov_schemas(dev, &error); | ||||
▲ Show 20 Lines • Show All 1,513 Lines • ▼ Show 20 Lines | SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "advertise_speed", | ||||
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
adapter, 0, ixgbe_sysctl_advertise, "I", | adapter, 0, ixgbe_sysctl_advertise, "I", | ||||
IXGBE_SYSCTL_DESC_ADV_SPEED); | IXGBE_SYSCTL_DESC_ADV_SPEED); | ||||
adapter->enable_aim = ixgbe_enable_aim; | adapter->enable_aim = ixgbe_enable_aim; | ||||
SYSCTL_ADD_INT(ctx_list, child, OID_AUTO, "enable_aim", CTLFLAG_RW, | SYSCTL_ADD_INT(ctx_list, child, OID_AUTO, "enable_aim", CTLFLAG_RW, | ||||
&adapter->enable_aim, 0, "Interrupt Moderation"); | &adapter->enable_aim, 0, "Interrupt Moderation"); | ||||
SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "nvm_versions", | |||||
krzysztof.galazka_intel.com: There is a 'fw_version' sysctl in ixl with the same purpose. Would it make sense to use same… | |||||
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, adapter, 0, | |||||
ixgbe_sysctl_print_nvm_versions, "A", "Prints NVM Versions"); | |||||
#ifdef IXGBE_DEBUG | #ifdef IXGBE_DEBUG | ||||
/* testing sysctls (for all devices) */ | /* testing sysctls (for all devices) */ | ||||
SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "power_state", | SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "power_state", | ||||
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
adapter, 0, ixgbe_sysctl_power_state, | adapter, 0, ixgbe_sysctl_power_state, | ||||
"I", "PCI Power State"); | "I", "PCI Power State"); | ||||
SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "print_rss_config", | SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "print_rss_config", | ||||
▲ Show 20 Lines • Show All 2,010 Lines • ▼ Show 20 Lines | ixgbe_check_fan_failure(struct adapter *adapter, u32 reg, bool in_interrupt) | ||||
u32 mask; | u32 mask; | ||||
mask = (in_interrupt) ? IXGBE_EICR_GPI_SDP1_BY_MAC(&adapter->hw) : | mask = (in_interrupt) ? IXGBE_EICR_GPI_SDP1_BY_MAC(&adapter->hw) : | ||||
IXGBE_ESDP_SDP1; | IXGBE_ESDP_SDP1; | ||||
if (reg & mask) | if (reg & mask) | ||||
device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n"); | device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n"); | ||||
} /* ixgbe_check_fan_failure */ | } /* ixgbe_check_fan_failure */ | ||||
/************************************************************************ | |||||
* ixgbe_sbuf_nvm_versions | |||||
************************************************************************/ | |||||
static void | |||||
ixgbe_sbuf_nvm_versions(struct ixgbe_hw *hw, struct sbuf *buf) | |||||
{ | |||||
struct ixgbe_nvm_version nvm_ver = {0}; | |||||
uint16_t phyfw = 0; | |||||
int status; | |||||
ixgbe_get_oem_prod_version(hw, &nvm_ver); /* OEM's NVM version */ | |||||
ixgbe_get_orom_version(hw, &nvm_ver); /* Option ROM */ | |||||
ixgbe_get_etk_id(hw, &nvm_ver); /* eTrack identifies a build in Intel's SCM */ | |||||
status = ixgbe_get_phy_firmware_version(hw, &phyfw); | |||||
if (nvm_ver.oem_valid) | |||||
sbuf_printf(buf, "NVM OEM V%d.%d R%d ", nvm_ver.oem_major, | |||||
nvm_ver.oem_minor, nvm_ver.oem_release); | |||||
if (nvm_ver.or_valid) | |||||
sbuf_printf(buf, "Option ROM V%d-b%d-p%d ", nvm_ver.or_major, | |||||
nvm_ver.or_build, nvm_ver.or_patch); | |||||
if (nvm_ver.etk_id != ((NVM_VER_INVALID << NVM_ETK_SHIFT) | NVM_VER_INVALID)) | |||||
sbuf_printf(buf, "eTrack 0x%08x ", nvm_ver.etk_id); | |||||
if (phyfw != 0 && status == IXGBE_SUCCESS) | |||||
sbuf_printf(buf, "PHY FW V%d ", phyfw); | |||||
sbuf_trim(buf); | |||||
} /* ixgbe_sbuf_nvm_versions */ | |||||
/************************************************************************ | |||||
* ixgbe_print_nvm_versions | |||||
************************************************************************/ | |||||
static void | |||||
ixgbe_print_nvm_versions(if_ctx_t ctx) | |||||
{ | |||||
struct adapter *adapter = iflib_get_softc(ctx); | |||||
struct ixgbe_hw *hw = &adapter->hw; | |||||
device_t dev = adapter->dev; | |||||
struct sbuf *buf; | |||||
int error = 0; | |||||
buf = sbuf_new_auto(); | |||||
if (!buf) { | |||||
device_printf(dev, "Could not allocate sbuf for output.\n"); | |||||
return; | |||||
} | |||||
ixgbe_sbuf_nvm_versions(hw, buf); | |||||
error = sbuf_finish(buf); | |||||
if (error) | |||||
device_printf(dev, "Error finishing sbuf: %d\n", error); | |||||
else if (sbuf_len(buf)) | |||||
device_printf(dev, "%s\n", sbuf_data(buf)); | |||||
sbuf_delete(buf); | |||||
} /* ixgbe_print_nvm_versions */ | |||||
/************************************************************************ | |||||
* ixgbe_sysctl_print_nvm_versions | |||||
************************************************************************/ | |||||
static int | |||||
ixgbe_sysctl_print_nvm_versions(SYSCTL_HANDLER_ARGS) | |||||
{ | |||||
struct adapter *adapter = (struct adapter *)arg1; | |||||
struct ixgbe_hw *hw = &adapter->hw; | |||||
device_t dev = adapter->dev; | |||||
struct sbuf *buf; | |||||
int error = 0; | |||||
buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); | |||||
if (!buf) { | |||||
device_printf(dev, "Could not allocate sbuf for output.\n"); | |||||
return (ENOMEM); | |||||
} | |||||
ixgbe_sbuf_nvm_versions(hw, buf); | |||||
error = sbuf_finish(buf); | |||||
if (error) | |||||
device_printf(dev, "Error finishing sbuf: %d\n", error); | |||||
sbuf_delete(buf); | |||||
return (0); | |||||
} /* ixgbe_sysctl_print_nvm_versions */ |
There is a 'fw_version' sysctl in ixl with the same purpose. Would it make sense to use same name?