Lines Matching refs:adapter
151 static void ixgbe_enable_queue(struct adapter *adapter, u32 vector);
152 static void ixgbe_disable_queue(struct adapter *adapter, u32 vector);
157 static void ixgbe_config_dmac(struct adapter *adapter);
158 static void ixgbe_configure_ivars(struct adapter *adapter);
159 static void ixgbe_set_ivar(struct adapter *adapter, u8 entry, u8 vector,
168 static void ixgbe_initialize_rss_mapping(struct adapter *adapter);
173 static void ixgbe_init_device_features(struct adapter *adapter);
174 static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
176 static void ixgbe_update_stats_counters(struct adapter *adapter);
178 static void ixgbe_get_slot_info(struct adapter *);
179 static void ixgbe_check_wol_support(struct adapter *adapter);
180 static void ixgbe_enable_rx_drop(struct adapter *);
181 static void ixgbe_disable_rx_drop(struct adapter *);
183 static void ixgbe_add_hw_stats(struct adapter *adapter);
184 static int ixgbe_set_flowcntl(struct adapter *, int);
185 static int ixgbe_set_advertise(struct adapter *, int);
186 static int ixgbe_get_advertise(struct adapter *);
188 static void ixgbe_config_gpie(struct adapter *adapter);
189 static void ixgbe_config_delay_values(struct adapter *adapter);
236 "ix", ix_methods, sizeof(struct adapter),
290 "ixgbe_if", ixgbe_if_methods, sizeof(struct adapter)
401 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_tx_queues_alloc() local
402 if_softc_ctx_t scctx = adapter->shared; in ixgbe_if_tx_queues_alloc()
406 MPASS(adapter->num_tx_queues > 0); in ixgbe_if_tx_queues_alloc()
407 MPASS(adapter->num_tx_queues == ntxqsets); in ixgbe_if_tx_queues_alloc()
411 adapter->tx_queues = in ixgbe_if_tx_queues_alloc()
414 if (!adapter->tx_queues) { in ixgbe_if_tx_queues_alloc()
420 for (i = 0, que = adapter->tx_queues; i < ntxqsets; i++, que++) { in ixgbe_if_tx_queues_alloc()
424 txr->me = ixgbe_vf_que_index(adapter->iov_mode, adapter->pool, in ixgbe_if_tx_queues_alloc()
427 txr->adapter = que->adapter = adapter; in ixgbe_if_tx_queues_alloc()
428 adapter->active_queues |= (u64)1 << txr->me; in ixgbe_if_tx_queues_alloc()
447 if (adapter->feat_en & IXGBE_FEATURE_FDIR) in ixgbe_if_tx_queues_alloc()
453 adapter->num_tx_queues); in ixgbe_if_tx_queues_alloc()
470 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_rx_queues_alloc() local
474 MPASS(adapter->num_rx_queues > 0); in ixgbe_if_rx_queues_alloc()
475 MPASS(adapter->num_rx_queues == nrxqsets); in ixgbe_if_rx_queues_alloc()
479 adapter->rx_queues = in ixgbe_if_rx_queues_alloc()
482 if (!adapter->rx_queues) { in ixgbe_if_rx_queues_alloc()
488 for (i = 0, que = adapter->rx_queues; i < nrxqsets; i++, que++) { in ixgbe_if_rx_queues_alloc()
492 rxr->me = ixgbe_vf_que_index(adapter->iov_mode, adapter->pool, in ixgbe_if_rx_queues_alloc()
495 rxr->adapter = que->adapter = adapter; in ixgbe_if_rx_queues_alloc()
506 adapter->num_rx_queues); in ixgbe_if_rx_queues_alloc()
517 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_queues_free() local
518 struct ix_tx_queue *tx_que = adapter->tx_queues; in ixgbe_if_queues_free()
519 struct ix_rx_queue *rx_que = adapter->rx_queues; in ixgbe_if_queues_free()
523 for (i = 0; i < adapter->num_tx_queues; i++, tx_que++) { in ixgbe_if_queues_free()
532 free(adapter->tx_queues, M_IXGBE); in ixgbe_if_queues_free()
533 adapter->tx_queues = NULL; in ixgbe_if_queues_free()
536 free(adapter->rx_queues, M_IXGBE); in ixgbe_if_queues_free()
537 adapter->rx_queues = NULL; in ixgbe_if_queues_free()
545 ixgbe_initialize_rss_mapping(struct adapter *adapter) in ixgbe_initialize_rss_mapping() argument
547 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_initialize_rss_mapping()
553 if (adapter->feat_en & IXGBE_FEATURE_RSS) { in ixgbe_initialize_rss_mapping()
564 switch (adapter->hw.mac.type) { in ixgbe_initialize_rss_mapping()
579 if (j == adapter->num_rx_queues) in ixgbe_initialize_rss_mapping()
582 if (adapter->feat_en & IXGBE_FEATURE_RSS) { in ixgbe_initialize_rss_mapping()
589 queue_id = queue_id % adapter->num_rx_queues; in ixgbe_initialize_rss_mapping()
614 if (adapter->feat_en & IXGBE_FEATURE_RSS) in ixgbe_initialize_rss_mapping()
649 mrqc |= ixgbe_get_mrqc(adapter->iov_mode); in ixgbe_initialize_rss_mapping()
661 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_initialize_receive_units() local
662 if_softc_ctx_t scctx = adapter->shared; in ixgbe_initialize_receive_units()
663 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_initialize_receive_units()
679 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { in ixgbe_initialize_receive_units()
693 bufsz = (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> in ixgbe_initialize_receive_units()
697 for (i = 0, que = adapter->rx_queues; i < adapter->num_rx_queues; i++, que++) { in ixgbe_initialize_receive_units()
723 if (adapter->num_rx_queues > 1 && in ixgbe_initialize_receive_units()
724 adapter->hw.fc.requested_mode == ixgbe_fc_none) { in ixgbe_initialize_receive_units()
740 if (adapter->hw.mac.type != ixgbe_mac_82598EB) { in ixgbe_initialize_receive_units()
750 ixgbe_initialize_rss_mapping(adapter); in ixgbe_initialize_receive_units()
752 if (adapter->num_rx_queues > 1) { in ixgbe_initialize_receive_units()
774 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_initialize_transmit_units() local
775 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_initialize_transmit_units()
776 if_softc_ctx_t scctx = adapter->shared; in ixgbe_initialize_transmit_units()
781 for (i = 0, que = adapter->tx_queues; i < adapter->num_tx_queues; in ixgbe_initialize_transmit_units()
841 ixgbe_get_mtqc(adapter->iov_mode)); in ixgbe_initialize_transmit_units()
869 struct adapter *adapter; in ixgbe_if_attach_pre() local
880 adapter = iflib_get_softc(ctx); in ixgbe_if_attach_pre()
881 adapter->hw.back = adapter; in ixgbe_if_attach_pre()
882 adapter->ctx = ctx; in ixgbe_if_attach_pre()
883 adapter->dev = dev; in ixgbe_if_attach_pre()
884 scctx = adapter->shared = iflib_get_softc_ctx(ctx); in ixgbe_if_attach_pre()
885 adapter->media = iflib_get_media(ctx); in ixgbe_if_attach_pre()
886 hw = &adapter->hw; in ixgbe_if_attach_pre()
923 ixgbe_init_device_features(adapter); in ixgbe_if_attach_pre()
926 ixgbe_check_wol_support(adapter); in ixgbe_if_attach_pre()
929 if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { in ixgbe_if_attach_pre()
931 ixgbe_check_fan_failure(adapter, esdp, FALSE); in ixgbe_if_attach_pre()
949 adapter->sfp_probe = TRUE; in ixgbe_if_attach_pre()
962 if (ixgbe_validate_eeprom_checksum(&adapter->hw, NULL) < 0) { in ixgbe_if_attach_pre()
987 switch (adapter->hw.mac.type) { in ixgbe_if_attach_pre()
1012 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { in ixgbe_if_attach_pre()
1032 ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); in ixgbe_if_attach_pre()
1034 IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT, ctrl_ext); in ixgbe_if_attach_pre()
1053 struct adapter *adapter; in ixgbe_if_attach_post() local
1058 adapter = iflib_get_softc(ctx); in ixgbe_if_attach_post()
1059 hw = &adapter->hw; in ixgbe_if_attach_post()
1062 if (adapter->intr_type == IFLIB_INTR_LEGACY && in ixgbe_if_attach_post()
1063 (adapter->feat_cap & IXGBE_FEATURE_LEGACY_IRQ) == 0) { in ixgbe_if_attach_post()
1070 adapter->mta = malloc(sizeof(*adapter->mta) * in ixgbe_if_attach_post()
1072 if (adapter->mta == NULL) { in ixgbe_if_attach_post()
1079 ixgbe_set_advertise(adapter, ixgbe_advertise_speed); in ixgbe_if_attach_post()
1087 ixgbe_initialize_iov(adapter); in ixgbe_if_attach_post()
1098 ixgbe_update_stats_counters(adapter); in ixgbe_if_attach_post()
1099 ixgbe_add_hw_stats(adapter); in ixgbe_if_attach_post()
1102 ixgbe_get_slot_info(adapter); in ixgbe_if_attach_post()
1108 ixgbe_bypass_init(adapter); in ixgbe_if_attach_post()
1111 adapter->dmac = 0; in ixgbe_if_attach_post()
1113 adapter->advertise = ixgbe_get_advertise(adapter); in ixgbe_if_attach_post()
1115 if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) in ixgbe_if_attach_post()
1136 ixgbe_check_wol_support(struct adapter *adapter) in ixgbe_check_wol_support() argument
1138 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_wol_support()
1142 adapter->wol_support = hw->wol_enabled = 0; in ixgbe_check_wol_support()
1147 adapter->wol_support = hw->wol_enabled = 1; in ixgbe_check_wol_support()
1150 adapter->wufc = IXGBE_READ_REG(hw, IXGBE_WUFC); in ixgbe_check_wol_support()
1164 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_setup_interface() local
1170 adapter->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; in ixgbe_setup_interface()
1172 adapter->phy_layer = ixgbe_get_supported_physical_layer(&adapter->hw); in ixgbe_setup_interface()
1177 ifmedia_set(adapter->media, IFM_ETHER | IFM_AUTO); in ixgbe_setup_interface()
1188 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_get_counter() local
1193 return (adapter->ipackets); in ixgbe_if_get_counter()
1195 return (adapter->opackets); in ixgbe_if_get_counter()
1197 return (adapter->ibytes); in ixgbe_if_get_counter()
1199 return (adapter->obytes); in ixgbe_if_get_counter()
1201 return (adapter->imcasts); in ixgbe_if_get_counter()
1203 return (adapter->omcasts); in ixgbe_if_get_counter()
1207 return (adapter->iqdrops); in ixgbe_if_get_counter()
1211 return (adapter->ierrors); in ixgbe_if_get_counter()
1223 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_i2c_req() local
1224 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_i2c_req()
1242 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_add_media_types() local
1243 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_add_media_types()
1247 layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); in ixgbe_add_media_types()
1251 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_T, 0, NULL); in ixgbe_add_media_types()
1253 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); in ixgbe_add_media_types()
1255 ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); in ixgbe_add_media_types()
1257 ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T, 0, NULL); in ixgbe_add_media_types()
1261 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_TWINAX, 0, in ixgbe_add_media_types()
1265 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_LR, 0, NULL); in ixgbe_add_media_types()
1267 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_LX, 0, in ixgbe_add_media_types()
1271 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_SR, 0, NULL); in ixgbe_add_media_types()
1273 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_SX, 0, in ixgbe_add_media_types()
1276 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); in ixgbe_add_media_types()
1278 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); in ixgbe_add_media_types()
1282 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_KR, 0, NULL); in ixgbe_add_media_types()
1284 ifmedia_add( adapter->media, IFM_ETHER | IFM_10G_KX4, 0, NULL); in ixgbe_add_media_types()
1286 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_KX, 0, NULL); in ixgbe_add_media_types()
1288 ifmedia_add(adapter->media, IFM_ETHER | IFM_2500_KX, 0, NULL); in ixgbe_add_media_types()
1293 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_SR, 0, NULL); in ixgbe_add_media_types()
1298 ifmedia_add(adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); in ixgbe_add_media_types()
1303 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_CX, 0, NULL); in ixgbe_add_media_types()
1308 ifmedia_add(adapter->media, IFM_ETHER | IFM_2500_SX, 0, NULL); in ixgbe_add_media_types()
1315 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, in ixgbe_add_media_types()
1317 ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); in ixgbe_add_media_types()
1320 ifmedia_add(adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); in ixgbe_add_media_types()
1358 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_config_link() local
1359 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_config_link()
1366 adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; in ixgbe_config_link()
1370 err = ixgbe_check_link(hw, &adapter->link_speed, in ixgbe_config_link()
1371 &adapter->link_up, FALSE); in ixgbe_config_link()
1382 adapter->link_up); in ixgbe_config_link()
1390 ixgbe_update_stats_counters(struct adapter *adapter) in ixgbe_update_stats_counters() argument
1392 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_update_stats_counters()
1393 struct ixgbe_hw_stats *stats = &adapter->stats.pf; in ixgbe_update_stats_counters()
1493 IXGBE_SET_IPACKETS(adapter, stats->gprc); in ixgbe_update_stats_counters()
1494 IXGBE_SET_OPACKETS(adapter, stats->gptc); in ixgbe_update_stats_counters()
1495 IXGBE_SET_IBYTES(adapter, stats->gorc); in ixgbe_update_stats_counters()
1496 IXGBE_SET_OBYTES(adapter, stats->gotc); in ixgbe_update_stats_counters()
1497 IXGBE_SET_IMCASTS(adapter, stats->mprc); in ixgbe_update_stats_counters()
1498 IXGBE_SET_OMCASTS(adapter, stats->mptc); in ixgbe_update_stats_counters()
1499 IXGBE_SET_COLLISIONS(adapter, 0); in ixgbe_update_stats_counters()
1500 IXGBE_SET_IQDROPS(adapter, total_missed_rx); in ixgbe_update_stats_counters()
1501 IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->rlec); in ixgbe_update_stats_counters()
1510 ixgbe_add_hw_stats(struct adapter *adapter) in ixgbe_add_hw_stats() argument
1512 device_t dev = iflib_get_dev(adapter->ctx); in ixgbe_add_hw_stats()
1518 struct ixgbe_hw_stats *stats = &adapter->stats.pf; in ixgbe_add_hw_stats()
1528 CTLFLAG_RD, &adapter->dropped_pkts, "Driver dropped packets"); in ixgbe_add_hw_stats()
1530 CTLFLAG_RD, &adapter->watchdog_events, "Watchdog timeouts"); in ixgbe_add_hw_stats()
1532 CTLFLAG_RD, &adapter->link_irq, "Link MSI-X IRQ Handled"); in ixgbe_add_hw_stats()
1534 for (i = 0, tx_que = adapter->tx_queues; i < adapter->num_tx_queues; i++, tx_que++) { in ixgbe_add_hw_stats()
1554 for (i = 0, rx_que = adapter->rx_queues; i < adapter->num_rx_queues; i++, rx_que++) { in ixgbe_add_hw_stats()
1562 CTLTYPE_UINT | CTLFLAG_RW, &adapter->rx_queues[i], in ixgbe_add_hw_stats()
1563 sizeof(&adapter->rx_queues[i]), in ixgbe_add_hw_stats()
1567 CTLFLAG_RD, &(adapter->rx_queues[i].irqs), in ixgbe_add_hw_stats()
1700 val = IXGBE_READ_REG(&txr->adapter->hw, IXGBE_TDH(txr->me)); in ixgbe_sysctl_tdh_handler()
1723 val = IXGBE_READ_REG(&txr->adapter->hw, IXGBE_TDT(txr->me)); in ixgbe_sysctl_tdt_handler()
1746 val = IXGBE_READ_REG(&rxr->adapter->hw, IXGBE_RDH(rxr->me)); in ixgbe_sysctl_rdh_handler()
1769 val = IXGBE_READ_REG(&rxr->adapter->hw, IXGBE_RDT(rxr->me)); in ixgbe_sysctl_rdt_handler()
1788 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_vlan_register() local
1793 adapter->shadow_vfta[index] |= (1 << bit); in ixgbe_if_vlan_register()
1794 ++adapter->num_vlans; in ixgbe_if_vlan_register()
1806 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_vlan_unregister() local
1811 adapter->shadow_vfta[index] &= ~(1 << bit); in ixgbe_if_vlan_unregister()
1812 --adapter->num_vlans; in ixgbe_if_vlan_unregister()
1824 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_setup_vlan_hw_support() local
1825 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_vlan_hw_support()
1837 if (adapter->num_vlans == 0) in ixgbe_setup_vlan_hw_support()
1842 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbe_setup_vlan_hw_support()
1843 rxr = &adapter->rx_queues[i].rxr; in ixgbe_setup_vlan_hw_support()
1861 if (adapter->shadow_vfta[i] != 0) in ixgbe_setup_vlan_hw_support()
1863 adapter->shadow_vfta[i]); in ixgbe_setup_vlan_hw_support()
1883 ixgbe_get_slot_info(struct adapter *adapter) in ixgbe_get_slot_info() argument
1885 device_t dev = iflib_get_dev(adapter->ctx); in ixgbe_get_slot_info()
1886 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_get_slot_info()
1982 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_msix_intr_assign() local
1983 struct ix_rx_queue *rx_que = adapter->rx_queues; in ixgbe_if_msix_intr_assign()
1991 for (int i = 0; i < adapter->num_rx_queues; i++, vector++, rx_que++) { in ixgbe_if_msix_intr_assign()
2001 adapter->num_rx_queues = i + 1; in ixgbe_if_msix_intr_assign()
2006 adapter->active_queues |= (u64)(1 << rx_que->msix); in ixgbe_if_msix_intr_assign()
2007 if (adapter->feat_en & IXGBE_FEATURE_RSS) { in ixgbe_if_msix_intr_assign()
2022 if (adapter->num_rx_queues > 1) in ixgbe_if_msix_intr_assign()
2027 for (int i = 0; i < adapter->num_tx_queues; i++) { in ixgbe_if_msix_intr_assign()
2029 tx_que = &adapter->tx_queues[i]; in ixgbe_if_msix_intr_assign()
2030 tx_que->msix = i % adapter->num_rx_queues; in ixgbe_if_msix_intr_assign()
2032 &adapter->rx_queues[tx_que->msix].que_irq, in ixgbe_if_msix_intr_assign()
2036 error = iflib_irq_alloc_generic(ctx, &adapter->irq, rid, in ixgbe_if_msix_intr_assign()
2037 IFLIB_INTR_ADMIN, ixgbe_msix_link, adapter, 0, "aq"); in ixgbe_if_msix_intr_assign()
2044 adapter->vector = vector; in ixgbe_if_msix_intr_assign()
2048 iflib_irq_free(ctx, &adapter->irq); in ixgbe_if_msix_intr_assign()
2049 rx_que = adapter->rx_queues; in ixgbe_if_msix_intr_assign()
2050 for (int i = 0; i < adapter->num_rx_queues; i++, rx_que++) in ixgbe_if_msix_intr_assign()
2063 struct adapter *adapter = que->adapter; in ixgbe_msix_que() local
2064 struct ifnet *ifp = iflib_get_ifp(que->adapter->ctx); in ixgbe_msix_que()
2070 ixgbe_disable_queue(adapter, que->msix); in ixgbe_msix_que()
2085 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_media_status() local
2086 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_media_status()
2094 if (!adapter->link_active) in ixgbe_if_media_status()
2098 layer = adapter->phy_layer; in ixgbe_if_media_status()
2104 switch (adapter->link_speed) { in ixgbe_if_media_status()
2120 switch (adapter->link_speed) { in ixgbe_if_media_status()
2126 switch (adapter->link_speed) { in ixgbe_if_media_status()
2135 switch (adapter->link_speed) { in ixgbe_if_media_status()
2145 switch (adapter->link_speed) { in ixgbe_if_media_status()
2154 switch (adapter->link_speed) { in ixgbe_if_media_status()
2165 switch (adapter->link_speed) { in ixgbe_if_media_status()
2179 switch (adapter->link_speed) { in ixgbe_if_media_status()
2192 switch (adapter->link_speed) { in ixgbe_if_media_status()
2206 switch (adapter->link_speed) { in ixgbe_if_media_status()
2241 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_media_change() local
2243 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_media_change()
2306 adapter->advertise = in ixgbe_if_media_change()
2326 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_promisc_set() local
2331 rctl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); in ixgbe_if_promisc_set()
2340 IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, rctl); in ixgbe_if_promisc_set()
2344 IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, rctl); in ixgbe_if_promisc_set()
2348 IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, rctl); in ixgbe_if_promisc_set()
2359 struct adapter *adapter = arg; in ixgbe_msix_link() local
2360 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_msix_link()
2364 ++adapter->link_irq; in ixgbe_msix_link()
2379 adapter->task_requests |= IXGBE_REQUEST_TASK_LSC; in ixgbe_msix_link()
2382 if (adapter->hw.mac.type != ixgbe_mac_82598EB) { in ixgbe_msix_link()
2383 if ((adapter->feat_en & IXGBE_FEATURE_FDIR) && in ixgbe_msix_link()
2386 if (!atomic_cmpset_int(&adapter->fdir_reinit, 0, 1)) in ixgbe_msix_link()
2390 adapter->task_requests |= IXGBE_REQUEST_TASK_FDIR; in ixgbe_msix_link()
2393 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_msix_link()
2399 if (adapter->feat_en & IXGBE_FEATURE_TEMP_SENSOR) { in ixgbe_msix_link()
2400 switch (adapter->hw.mac.type) { in ixgbe_msix_link()
2411 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_msix_link()
2413 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_msix_link()
2422 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_msix_link()
2424 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_msix_link()
2432 if ((adapter->feat_en & IXGBE_FEATURE_SRIOV) && in ixgbe_msix_link()
2434 adapter->task_requests |= IXGBE_REQUEST_TASK_MBX; in ixgbe_msix_link()
2446 adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; in ixgbe_msix_link()
2453 adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; in ixgbe_msix_link()
2458 if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { in ixgbe_msix_link()
2459 ixgbe_check_fan_failure(adapter, eicr, TRUE); in ixgbe_msix_link()
2467 adapter->task_requests |= IXGBE_REQUEST_TASK_PHY; in ixgbe_msix_link()
2470 return (adapter->task_requests != 0) ? FILTER_SCHEDULE_THREAD : FILTER_HANDLED; in ixgbe_msix_link()
2483 reg = IXGBE_READ_REG(&que->adapter->hw, IXGBE_EITR(que->msix)); in ixgbe_sysctl_interrupt_rate_handler()
2500 IXGBE_WRITE_REG(&que->adapter->hw, IXGBE_EITR(que->msix), reg); in ixgbe_sysctl_interrupt_rate_handler()
2511 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_add_device_sysctls() local
2513 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_add_device_sysctls()
2522 CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_flowcntl, "I", in ixgbe_add_device_sysctls()
2526 CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_advertise, "I", in ixgbe_add_device_sysctls()
2532 CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_power_state, in ixgbe_add_device_sysctls()
2536 CTLTYPE_STRING | CTLFLAG_RD, adapter, 0, in ixgbe_add_device_sysctls()
2542 CTLTYPE_U16 | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_dmac, in ixgbe_add_device_sysctls()
2548 CTLTYPE_INT | CTLFLAG_RW, adapter, 0, in ixgbe_add_device_sysctls()
2552 CTLTYPE_U32 | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_wufc, in ixgbe_add_device_sysctls()
2566 CTLTYPE_U16 | CTLFLAG_RD, adapter, 0, ixgbe_sysctl_phy_temp, in ixgbe_add_device_sysctls()
2570 "overtemp_occurred", CTLTYPE_U16 | CTLFLAG_RD, adapter, 0, in ixgbe_add_device_sysctls()
2575 if (adapter->feat_cap & IXGBE_FEATURE_EEE) { in ixgbe_add_device_sysctls()
2577 CTLTYPE_INT | CTLFLAG_RW, adapter, 0, in ixgbe_add_device_sysctls()
2588 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_allocate_pci_resources() local
2593 adapter->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in ixgbe_allocate_pci_resources()
2596 if (!(adapter->pci_mem)) { in ixgbe_allocate_pci_resources()
2602 adapter->osdep.mem_bus_space_tag = rman_get_bustag(adapter->pci_mem); in ixgbe_allocate_pci_resources()
2603 adapter->osdep.mem_bus_space_handle = in ixgbe_allocate_pci_resources()
2604 rman_get_bushandle(adapter->pci_mem); in ixgbe_allocate_pci_resources()
2606 adapter->hw.hw_addr = (u8 *)&adapter->osdep.mem_bus_space_handle; in ixgbe_allocate_pci_resources()
2623 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_detach() local
2637 ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); in ixgbe_if_detach()
2639 IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT, ctrl_ext); in ixgbe_if_detach()
2642 free(adapter->mta, M_IXGBE); in ixgbe_if_detach()
2655 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_setup_low_power_mode() local
2656 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_low_power_mode()
2680 IXGBE_WRITE_REG(hw, IXGBE_WUFC, adapter->wufc); in ixgbe_setup_low_power_mode()
2741 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_resume() local
2744 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_resume()
2776 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_mtu_set() local
2784 adapter->max_frame_size = mtu + IXGBE_MTU_HDR; in ixgbe_if_mtu_set()
2796 struct adapter *sc = iflib_get_softc(ctx); in ixgbe_if_crcstrip_set()
2849 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_init() local
2852 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_init()
2864 ixgbe_align_all_queue_indices(adapter); in ixgbe_if_init()
2867 ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, IXGBE_RAH_AV); in ixgbe_if_init()
2871 ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); in ixgbe_if_init()
2876 ixgbe_initialize_iov(adapter); in ixgbe_if_init()
2884 adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx); in ixgbe_if_init()
2893 adapter->task_requests = 0; in ixgbe_if_init()
2896 ixgbe_config_gpie(adapter); in ixgbe_if_init()
2903 mhadd |= adapter->max_frame_size << IXGBE_MHADD_MFS_SHIFT; in ixgbe_if_init()
2908 for (i = 0, tx_que = adapter->tx_queues; i < adapter->num_tx_queues; i++, tx_que++) { in ixgbe_if_init()
2926 for (i = 0, rx_que = adapter->rx_queues; i < adapter->num_rx_queues; i++, rx_que++) { in ixgbe_if_init()
2960 ixgbe_configure_ivars(adapter); in ixgbe_if_init()
2969 ixgbe_set_ivar(adapter, 0, 0, 0); in ixgbe_if_init()
2970 ixgbe_set_ivar(adapter, 0, 0, 1); in ixgbe_if_init()
2974 ixgbe_init_fdir(adapter); in ixgbe_if_init()
2990 IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); in ixgbe_if_init()
2999 ixgbe_config_delay_values(adapter); in ixgbe_if_init()
3008 ixgbe_config_dmac(adapter); in ixgbe_if_init()
3014 if (adapter->feat_en & IXGBE_FEATURE_SRIOV) { in ixgbe_if_init()
3032 ixgbe_set_ivar(struct adapter *adapter, u8 entry, u8 vector, s8 type) in ixgbe_set_ivar() argument
3034 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_set_ivar()
3049 IXGBE_WRITE_REG(&adapter->hw, IXGBE_IVAR(index), ivar); in ixgbe_set_ivar()
3078 ixgbe_configure_ivars(struct adapter *adapter) in ixgbe_configure_ivars() argument
3080 struct ix_rx_queue *rx_que = adapter->rx_queues; in ixgbe_configure_ivars()
3081 struct ix_tx_queue *tx_que = adapter->tx_queues; in ixgbe_configure_ivars()
3091 adapter->dmac = 0; in ixgbe_configure_ivars()
3095 for (int i = 0; i < adapter->num_rx_queues; i++, rx_que++) { in ixgbe_configure_ivars()
3099 ixgbe_set_ivar(adapter, rxr->me, rx_que->msix, 0); in ixgbe_configure_ivars()
3102 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(rx_que->msix), newitr); in ixgbe_configure_ivars()
3104 for (int i = 0; i < adapter->num_tx_queues; i++, tx_que++) { in ixgbe_configure_ivars()
3108 ixgbe_set_ivar(adapter, txr->me, tx_que->msix, 1); in ixgbe_configure_ivars()
3111 ixgbe_set_ivar(adapter, 1, adapter->vector, -1); in ixgbe_configure_ivars()
3118 ixgbe_config_gpie(struct adapter *adapter) in ixgbe_config_gpie() argument
3120 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_config_gpie()
3125 if (adapter->intr_type == IFLIB_INTR_MSIX) { in ixgbe_config_gpie()
3134 if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) in ixgbe_config_gpie()
3138 if (adapter->feat_en & IXGBE_FEATURE_TEMP_SENSOR) in ixgbe_config_gpie()
3164 ixgbe_config_delay_values(struct adapter *adapter) in ixgbe_config_delay_values() argument
3166 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_config_delay_values()
3169 frame = adapter->max_frame_size; in ixgbe_config_delay_values()
3213 struct adapter *adapter = arg; in ixgbe_mc_filter_apply() local
3214 struct ixgbe_mc_addr *mta = adapter->mta; in ixgbe_mc_filter_apply()
3222 mta[count].vmdq = adapter->pool; in ixgbe_mc_filter_apply()
3230 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_multi_set() local
3239 mta = adapter->mta; in ixgbe_if_multi_set()
3242 mcnt = if_multi_apply(iflib_get_ifp(ctx), ixgbe_mc_filter_apply, adapter); in ixgbe_if_multi_set()
3244 fctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); in ixgbe_if_multi_set()
3255 IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); in ixgbe_if_multi_set()
3259 ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, in ixgbe_if_multi_set()
3294 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_timer() local
3300 if (adapter->sfp_probe) in ixgbe_if_timer()
3304 ixgbe_check_link(&adapter->hw, &adapter->link_speed, in ixgbe_if_timer()
3305 &adapter->link_up, 0); in ixgbe_if_timer()
3320 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_sfp_probe() local
3321 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sfp_probe()
3331 adapter->sfp_probe = FALSE; in ixgbe_sfp_probe()
3354 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_handle_mod() local
3355 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_handle_mod()
3359 if (adapter->hw.need_crosstalk_fix) { in ixgbe_handle_mod()
3395 adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; in ixgbe_handle_mod()
3399 adapter->task_requests &= ~(IXGBE_REQUEST_TASK_MSF); in ixgbe_handle_mod()
3410 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_handle_msf() local
3411 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_handle_msf()
3416 adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); in ixgbe_handle_msf()
3425 ifmedia_removeall(adapter->media); in ixgbe_handle_msf()
3426 ixgbe_add_media_types(adapter->ctx); in ixgbe_handle_msf()
3427 ifmedia_set(adapter->media, IFM_ETHER | IFM_AUTO); in ixgbe_handle_msf()
3437 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_handle_phy() local
3438 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_handle_phy()
3443 …device_printf(adapter->dev, "CRITICAL: EXTERNAL PHY OVER TEMP!! PHY will downshift to lower power… in ixgbe_handle_phy()
3445 device_printf(adapter->dev, in ixgbe_handle_phy()
3458 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_stop() local
3459 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_stop()
3472 adapter->link_up = FALSE; in ixgbe_if_stop()
3476 ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); in ixgbe_if_stop()
3491 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_update_admin_status() local
3494 if (adapter->link_up) { in ixgbe_if_update_admin_status()
3495 if (adapter->link_active == FALSE) { in ixgbe_if_update_admin_status()
3498 ((adapter->link_speed == 128) ? 10 : 1), in ixgbe_if_update_admin_status()
3500 adapter->link_active = TRUE; in ixgbe_if_update_admin_status()
3502 ixgbe_fc_enable(&adapter->hw); in ixgbe_if_update_admin_status()
3504 ixgbe_config_dmac(adapter); in ixgbe_if_update_admin_status()
3508 if (adapter->feat_en & IXGBE_FEATURE_SRIOV) in ixgbe_if_update_admin_status()
3509 ixgbe_ping_all_vfs(adapter); in ixgbe_if_update_admin_status()
3512 if (adapter->link_active == TRUE) { in ixgbe_if_update_admin_status()
3516 adapter->link_active = FALSE; in ixgbe_if_update_admin_status()
3517 if (adapter->feat_en & IXGBE_FEATURE_SRIOV) in ixgbe_if_update_admin_status()
3518 ixgbe_ping_all_vfs(adapter); in ixgbe_if_update_admin_status()
3523 if (adapter->task_requests & IXGBE_REQUEST_TASK_MOD) in ixgbe_if_update_admin_status()
3525 if (adapter->task_requests & IXGBE_REQUEST_TASK_MSF) in ixgbe_if_update_admin_status()
3527 if (adapter->task_requests & IXGBE_REQUEST_TASK_MBX) in ixgbe_if_update_admin_status()
3529 if (adapter->task_requests & IXGBE_REQUEST_TASK_FDIR) in ixgbe_if_update_admin_status()
3531 if (adapter->task_requests & IXGBE_REQUEST_TASK_PHY) in ixgbe_if_update_admin_status()
3533 adapter->task_requests = 0; in ixgbe_if_update_admin_status()
3535 ixgbe_update_stats_counters(adapter); in ixgbe_if_update_admin_status()
3542 ixgbe_config_dmac(struct adapter *adapter) in ixgbe_config_dmac() argument
3544 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_config_dmac()
3550 if (dcfg->watchdog_timer ^ adapter->dmac || in ixgbe_config_dmac()
3551 dcfg->link_speed ^ adapter->link_speed) { in ixgbe_config_dmac()
3552 dcfg->watchdog_timer = adapter->dmac; in ixgbe_config_dmac()
3554 dcfg->link_speed = adapter->link_speed; in ixgbe_config_dmac()
3570 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_enable_intr() local
3571 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_if_enable_intr()
3572 struct ix_rx_queue *que = adapter->rx_queues; in ixgbe_if_enable_intr()
3577 switch (adapter->hw.mac.type) { in ixgbe_if_enable_intr()
3615 if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) in ixgbe_if_enable_intr()
3618 if (adapter->feat_en & IXGBE_FEATURE_SRIOV) in ixgbe_if_enable_intr()
3621 if (adapter->feat_en & IXGBE_FEATURE_FDIR) in ixgbe_if_enable_intr()
3627 if (adapter->intr_type == IFLIB_INTR_MSIX) { in ixgbe_if_enable_intr()
3632 if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) in ixgbe_if_enable_intr()
3642 for (int i = 0; i < adapter->num_rx_queues; i++, que++) in ixgbe_if_enable_intr()
3643 ixgbe_enable_queue(adapter, que->msix); in ixgbe_if_enable_intr()
3655 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_disable_intr() local
3657 if (adapter->intr_type == IFLIB_INTR_MSIX) in ixgbe_if_disable_intr()
3658 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, 0); in ixgbe_if_disable_intr()
3659 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { in ixgbe_if_disable_intr()
3660 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); in ixgbe_if_disable_intr()
3662 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000); in ixgbe_if_disable_intr()
3663 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0); in ixgbe_if_disable_intr()
3664 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0); in ixgbe_if_disable_intr()
3666 IXGBE_WRITE_FLUSH(&adapter->hw); in ixgbe_if_disable_intr()
3676 struct ixgbe_hw *hw = &((struct adapter *)iflib_get_softc(ctx))->hw; in ixgbe_link_intr_enable()
3688 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_if_rx_queue_intr_enable() local
3689 struct ix_rx_queue *que = &adapter->rx_queues[rxqid]; in ixgbe_if_rx_queue_intr_enable()
3691 ixgbe_enable_queue(adapter, que->rxr.me); in ixgbe_if_rx_queue_intr_enable()
3700 ixgbe_enable_queue(struct adapter *adapter, u32 vector) in ixgbe_enable_queue() argument
3702 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_enable_queue()
3723 ixgbe_disable_queue(struct adapter *adapter, u32 vector) in ixgbe_disable_queue() argument
3725 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_disable_queue()
3748 struct adapter *adapter = arg; in ixgbe_intr() local
3749 struct ix_rx_queue *que = adapter->rx_queues; in ixgbe_intr()
3750 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_intr()
3751 if_ctx_t ctx = adapter->ctx; in ixgbe_intr()
3765 device_printf(adapter->dev, in ixgbe_intr()
3785 adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; in ixgbe_intr()
3792 adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; in ixgbe_intr()
3799 adapter->task_requests |= IXGBE_REQUEST_TASK_PHY; in ixgbe_intr()
3810 struct adapter *adapter = iflib_get_softc(ctx); in ixgbe_free_pci_resources() local
3811 struct ix_rx_queue *que = adapter->rx_queues; in ixgbe_free_pci_resources()
3815 if (adapter->intr_type == IFLIB_INTR_MSIX) in ixgbe_free_pci_resources()
3816 iflib_irq_free(ctx, &adapter->irq); in ixgbe_free_pci_resources()
3819 for (int i = 0; i < adapter->num_rx_queues; i++, que++) { in ixgbe_free_pci_resources()
3824 if (adapter->pci_mem != NULL) in ixgbe_free_pci_resources()
3826 rman_get_rid(adapter->pci_mem), adapter->pci_mem); in ixgbe_free_pci_resources()
3837 struct adapter *adapter; in ixgbe_sysctl_flowcntl() local
3840 adapter = (struct adapter *)arg1; in ixgbe_sysctl_flowcntl()
3841 fc = adapter->hw.fc.current_mode; in ixgbe_sysctl_flowcntl()
3848 if (fc == adapter->hw.fc.current_mode) in ixgbe_sysctl_flowcntl()
3851 return ixgbe_set_flowcntl(adapter, fc); in ixgbe_sysctl_flowcntl()
3864 ixgbe_set_flowcntl(struct adapter *adapter, int fc) in ixgbe_set_flowcntl() argument
3870 adapter->hw.fc.requested_mode = fc; in ixgbe_set_flowcntl()
3871 if (adapter->num_rx_queues > 1) in ixgbe_set_flowcntl()
3872 ixgbe_disable_rx_drop(adapter); in ixgbe_set_flowcntl()
3875 adapter->hw.fc.requested_mode = ixgbe_fc_none; in ixgbe_set_flowcntl()
3876 if (adapter->num_rx_queues > 1) in ixgbe_set_flowcntl()
3877 ixgbe_enable_rx_drop(adapter); in ixgbe_set_flowcntl()
3884 adapter->hw.fc.disable_fc_autoneg = TRUE; in ixgbe_set_flowcntl()
3885 ixgbe_fc_enable(&adapter->hw); in ixgbe_set_flowcntl()
3900 ixgbe_enable_rx_drop(struct adapter *adapter) in ixgbe_enable_rx_drop() argument
3902 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_enable_rx_drop()
3906 for (int i = 0; i < adapter->num_rx_queues; i++) { in ixgbe_enable_rx_drop()
3907 rxr = &adapter->rx_queues[i].rxr; in ixgbe_enable_rx_drop()
3914 for (int i = 0; i < adapter->num_vfs; i++) { in ixgbe_enable_rx_drop()
3925 ixgbe_disable_rx_drop(struct adapter *adapter) in ixgbe_disable_rx_drop() argument
3927 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_disable_rx_drop()
3931 for (int i = 0; i < adapter->num_rx_queues; i++) { in ixgbe_disable_rx_drop()
3932 rxr = &adapter->rx_queues[i].rxr; in ixgbe_disable_rx_drop()
3939 for (int i = 0; i < adapter->num_vfs; i++) { in ixgbe_disable_rx_drop()
3953 struct adapter *adapter; in ixgbe_sysctl_advertise() local
3956 adapter = (struct adapter *)arg1; in ixgbe_sysctl_advertise()
3957 advertise = adapter->advertise; in ixgbe_sysctl_advertise()
3963 return ixgbe_set_advertise(adapter, advertise); in ixgbe_sysctl_advertise()
3976 ixgbe_set_advertise(struct adapter *adapter, int advertise) in ixgbe_set_advertise() argument
3978 device_t dev = iflib_get_dev(adapter->ctx); in ixgbe_set_advertise()
3986 if (adapter->advertise == advertise) /* no change */ in ixgbe_set_advertise()
3989 hw = &adapter->hw; in ixgbe_set_advertise()
4047 adapter->advertise = advertise; in ixgbe_set_advertise()
4063 ixgbe_get_advertise(struct adapter *adapter) in ixgbe_get_advertise() argument
4065 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_get_advertise()
4106 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_dmac() local
4107 struct ifnet *ifp = iflib_get_ifp(adapter->ctx); in ixgbe_sysctl_dmac()
4111 newval = adapter->dmac; in ixgbe_sysctl_dmac()
4119 adapter->dmac = 0; in ixgbe_sysctl_dmac()
4123 adapter->dmac = 1000; in ixgbe_sysctl_dmac()
4134 adapter->dmac = newval; in ixgbe_sysctl_dmac()
4161 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_power_state() local
4162 device_t dev = adapter->dev; in ixgbe_sysctl_power_state()
4200 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_wol_enable() local
4201 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sysctl_wol_enable()
4213 if (new_wol_enabled > 0 && !adapter->wol_support) in ixgbe_sysctl_wol_enable()
4241 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_wufc() local
4245 new_wufc = adapter->wufc; in ixgbe_sysctl_wufc()
4250 if (new_wufc == adapter->wufc) in ixgbe_sysctl_wufc()
4257 new_wufc |= (0xffffff & adapter->wufc); in ixgbe_sysctl_wufc()
4258 adapter->wufc = new_wufc; in ixgbe_sysctl_wufc()
4270 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_print_rss_config() local
4271 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sysctl_print_rss_config()
4272 device_t dev = adapter->dev; in ixgbe_sysctl_print_rss_config()
4285 switch (adapter->hw.mac.type) { in ixgbe_sysctl_print_rss_config()
4328 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_phy_temp() local
4329 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sysctl_phy_temp()
4333 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_sysctl_phy_temp()
4340 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_sysctl_phy_temp()
4360 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_phy_overtemp_occurred() local
4361 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sysctl_phy_overtemp_occurred()
4365 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_sysctl_phy_overtemp_occurred()
4372 device_printf(iflib_get_dev(adapter->ctx), in ixgbe_sysctl_phy_overtemp_occurred()
4395 struct adapter *adapter = (struct adapter *)arg1; in ixgbe_sysctl_eee_state() local
4396 device_t dev = adapter->dev; in ixgbe_sysctl_eee_state()
4397 struct ifnet *ifp = iflib_get_ifp(adapter->ctx); in ixgbe_sysctl_eee_state()
4401 curr_eee = new_eee = !!(adapter->feat_en & IXGBE_FEATURE_EEE); in ixgbe_sysctl_eee_state()
4412 if (!(adapter->feat_cap & IXGBE_FEATURE_EEE)) in ixgbe_sysctl_eee_state()
4419 retval = ixgbe_setup_eee(&adapter->hw, new_eee); in ixgbe_sysctl_eee_state()
4432 adapter->feat_en |= IXGBE_FEATURE_EEE; in ixgbe_sysctl_eee_state()
4434 adapter->feat_en &= ~IXGBE_FEATURE_EEE; in ixgbe_sysctl_eee_state()
4443 ixgbe_init_device_features(struct adapter *adapter) in ixgbe_init_device_features() argument
4445 adapter->feat_cap = IXGBE_FEATURE_NETMAP in ixgbe_init_device_features()
4452 switch (adapter->hw.mac.type) { in ixgbe_init_device_features()
4454 if (adapter->hw.device_id == IXGBE_DEV_ID_82598AT) in ixgbe_init_device_features()
4455 adapter->feat_cap |= IXGBE_FEATURE_FAN_FAIL; in ixgbe_init_device_features()
4458 adapter->feat_cap |= IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4459 adapter->feat_cap |= IXGBE_FEATURE_FDIR; in ixgbe_init_device_features()
4460 if ((adapter->hw.device_id == IXGBE_DEV_ID_X540_BYPASS) && in ixgbe_init_device_features()
4461 (adapter->hw.bus.func == 0)) in ixgbe_init_device_features()
4462 adapter->feat_cap |= IXGBE_FEATURE_BYPASS; in ixgbe_init_device_features()
4465 adapter->feat_cap |= IXGBE_FEATURE_TEMP_SENSOR; in ixgbe_init_device_features()
4466 adapter->feat_cap |= IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4467 adapter->feat_cap |= IXGBE_FEATURE_FDIR; in ixgbe_init_device_features()
4470 adapter->feat_cap |= IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4471 adapter->feat_cap |= IXGBE_FEATURE_FDIR; in ixgbe_init_device_features()
4474 adapter->feat_cap |= IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4475 adapter->feat_cap |= IXGBE_FEATURE_FDIR; in ixgbe_init_device_features()
4476 adapter->feat_cap &= ~IXGBE_FEATURE_LEGACY_IRQ; in ixgbe_init_device_features()
4477 if ((adapter->hw.device_id == IXGBE_DEV_ID_X550EM_A_1G_T) || in ixgbe_init_device_features()
4478 (adapter->hw.device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L)) { in ixgbe_init_device_features()
4479 adapter->feat_cap |= IXGBE_FEATURE_TEMP_SENSOR; in ixgbe_init_device_features()
4480 adapter->feat_cap |= IXGBE_FEATURE_EEE; in ixgbe_init_device_features()
4484 adapter->feat_cap |= IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4485 adapter->feat_cap |= IXGBE_FEATURE_FDIR; in ixgbe_init_device_features()
4486 if ((adapter->hw.device_id == IXGBE_DEV_ID_82599_BYPASS) && in ixgbe_init_device_features()
4487 (adapter->hw.bus.func == 0)) in ixgbe_init_device_features()
4488 adapter->feat_cap |= IXGBE_FEATURE_BYPASS; in ixgbe_init_device_features()
4489 if (adapter->hw.device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) in ixgbe_init_device_features()
4490 adapter->feat_cap &= ~IXGBE_FEATURE_LEGACY_IRQ; in ixgbe_init_device_features()
4498 if (adapter->feat_cap & IXGBE_FEATURE_FAN_FAIL) in ixgbe_init_device_features()
4499 adapter->feat_en |= IXGBE_FEATURE_FAN_FAIL; in ixgbe_init_device_features()
4501 if (adapter->feat_cap & IXGBE_FEATURE_NETMAP) in ixgbe_init_device_features()
4502 adapter->feat_en |= IXGBE_FEATURE_NETMAP; in ixgbe_init_device_features()
4504 if (adapter->feat_cap & IXGBE_FEATURE_EEE) in ixgbe_init_device_features()
4505 adapter->feat_en |= IXGBE_FEATURE_EEE; in ixgbe_init_device_features()
4507 if (adapter->feat_cap & IXGBE_FEATURE_TEMP_SENSOR) in ixgbe_init_device_features()
4508 adapter->feat_en |= IXGBE_FEATURE_TEMP_SENSOR; in ixgbe_init_device_features()
4513 if (adapter->feat_cap & IXGBE_FEATURE_FDIR) in ixgbe_init_device_features()
4514 adapter->feat_en |= IXGBE_FEATURE_FDIR; in ixgbe_init_device_features()
4516 device_printf(adapter->dev, "Device does not support Flow Director. Leaving disabled."); in ixgbe_init_device_features()
4523 adapter->feat_cap &= ~IXGBE_FEATURE_MSIX; in ixgbe_init_device_features()
4525 if ((adapter->feat_cap & IXGBE_FEATURE_RSS) && ixgbe_enable_rss) in ixgbe_init_device_features()
4526 adapter->feat_en |= IXGBE_FEATURE_RSS; in ixgbe_init_device_features()
4530 if (!(adapter->feat_cap & IXGBE_FEATURE_MSIX)) { in ixgbe_init_device_features()
4531 adapter->feat_cap &= ~IXGBE_FEATURE_RSS; in ixgbe_init_device_features()
4532 adapter->feat_cap &= ~IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4533 adapter->feat_en &= ~IXGBE_FEATURE_RSS; in ixgbe_init_device_features()
4534 adapter->feat_en &= ~IXGBE_FEATURE_SRIOV; in ixgbe_init_device_features()
4542 ixgbe_check_fan_failure(struct adapter *adapter, u32 reg, bool in_interrupt) in ixgbe_check_fan_failure() argument
4546 mask = (in_interrupt) ? IXGBE_EICR_GPI_SDP1_BY_MAC(&adapter->hw) : in ixgbe_check_fan_failure()
4550 device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n"); in ixgbe_check_fan_failure()