Lines Matching refs:lif
16 static void ionic_get_stats_strings(struct ionic_lif *lif, u8 *buf) in ionic_get_stats_strings() argument
21 ionic_stats_groups[i].get_strings(lif, &buf); in ionic_get_stats_strings()
27 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_stats() local
30 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_get_stats()
35 ionic_stats_groups[i].get_values(lif, &buf); in ionic_get_stats()
38 static int ionic_get_stats_count(struct ionic_lif *lif) in ionic_get_stats_count() argument
43 num_stats += ionic_stats_groups[i].get_count(lif); in ionic_get_stats_count()
50 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_sset_count() local
55 count = ionic_get_stats_count(lif); in ionic_get_sset_count()
64 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_strings() local
68 ionic_get_stats_strings(lif, buf); in ionic_get_strings()
76 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_drvinfo() local
77 struct ionic *ionic = lif->ionic; in ionic_get_drvinfo()
94 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_regs() local
101 idev = &lif->ionic->idev; in ionic_get_regs()
107 memcpy_fromio(p + offset, lif->ionic->idev.dev_info_regs->words, size); in ionic_get_regs()
117 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_link_ext_stats() local
119 if (lif->ionic->pdev->is_physfn) in ionic_get_link_ext_stats()
120 stats->link_down_events = lif->link_down_count; in ionic_get_link_ext_stats()
126 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_link_ksettings() local
127 struct ionic_dev *idev = &lif->ionic->idev; in ionic_get_link_ksettings()
227 dev_info(lif->ionic->dev, "unknown xcvr type pid=%d / 0x%x\n", in ionic_get_link_ksettings()
254 ks->base.speed = le32_to_cpu(lif->info->status.link_speed); in ionic_get_link_ksettings()
256 if (le16_to_cpu(lif->info->status.link_status)) in ionic_get_link_ksettings()
276 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_link_ksettings() local
277 struct ionic_dev *idev = &lif->ionic->idev; in ionic_set_link_ksettings()
278 struct ionic *ionic = lif->ionic; in ionic_set_link_ksettings()
281 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_set_link_ksettings()
310 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_pauseparam() local
315 pause_type = lif->ionic->idev.port_info->config.pause_type; in ionic_get_pauseparam()
325 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_pauseparam() local
326 struct ionic *ionic = lif->ionic; in ionic_set_pauseparam()
330 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_set_pauseparam()
343 if (requested_pause == lif->ionic->idev.port_info->config.pause_type) in ionic_set_pauseparam()
347 ionic_dev_cmd_port_pause(&lif->ionic->idev, requested_pause); in ionic_set_pauseparam()
359 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_fecparam() local
361 switch (lif->ionic->idev.port_info->config.fec_type) { in ionic_get_fecparam()
381 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_fecparam() local
385 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_set_fecparam()
388 if (lif->ionic->idev.port_info->config.an_enable) { in ionic_set_fecparam()
413 if (fec_type != lif->ionic->idev.port_info->config.fec_type) { in ionic_set_fecparam()
414 mutex_lock(&lif->ionic->dev_cmd_lock); in ionic_set_fecparam()
415 ionic_dev_cmd_port_fec(&lif->ionic->idev, fec_type); in ionic_set_fecparam()
416 ret = ionic_dev_cmd_wait(lif->ionic, DEVCMD_TIMEOUT); in ionic_set_fecparam()
417 mutex_unlock(&lif->ionic->dev_cmd_lock); in ionic_set_fecparam()
428 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_coalesce() local
430 coalesce->tx_coalesce_usecs = lif->tx_coalesce_usecs; in ionic_get_coalesce()
431 coalesce->rx_coalesce_usecs = lif->rx_coalesce_usecs; in ionic_get_coalesce()
433 if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) in ionic_get_coalesce()
434 coalesce->use_adaptive_tx_coalesce = test_bit(IONIC_LIF_F_TX_DIM_INTR, lif->state); in ionic_get_coalesce()
438 coalesce->use_adaptive_rx_coalesce = test_bit(IONIC_LIF_F_RX_DIM_INTR, lif->state); in ionic_get_coalesce()
448 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_coalesce() local
454 ident = &lif->ionic->ident; in ionic_set_coalesce()
462 if (!test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state) && in ionic_set_coalesce()
463 (coalesce->tx_coalesce_usecs != lif->rx_coalesce_usecs || in ionic_set_coalesce()
472 rx_coal = ionic_coal_usec_to_hw(lif->ionic, coalesce->rx_coalesce_usecs); in ionic_set_coalesce()
475 tx_coal = ionic_coal_usec_to_hw(lif->ionic, coalesce->tx_coalesce_usecs); in ionic_set_coalesce()
484 lif->rx_coalesce_usecs = coalesce->rx_coalesce_usecs; in ionic_set_coalesce()
485 lif->rx_coalesce_hw = rx_coal; in ionic_set_coalesce()
487 if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) in ionic_set_coalesce()
488 lif->tx_coalesce_usecs = coalesce->tx_coalesce_usecs; in ionic_set_coalesce()
490 lif->tx_coalesce_usecs = coalesce->rx_coalesce_usecs; in ionic_set_coalesce()
491 lif->tx_coalesce_hw = tx_coal; in ionic_set_coalesce()
494 set_bit(IONIC_LIF_F_RX_DIM_INTR, lif->state); in ionic_set_coalesce()
497 clear_bit(IONIC_LIF_F_RX_DIM_INTR, lif->state); in ionic_set_coalesce()
502 set_bit(IONIC_LIF_F_TX_DIM_INTR, lif->state); in ionic_set_coalesce()
505 clear_bit(IONIC_LIF_F_TX_DIM_INTR, lif->state); in ionic_set_coalesce()
509 if (test_bit(IONIC_LIF_F_UP, lif->state)) { in ionic_set_coalesce()
510 for (i = 0; i < lif->nxqs; i++) { in ionic_set_coalesce()
511 if (lif->rxqcqs[i]->flags & IONIC_QCQ_F_INTR) { in ionic_set_coalesce()
512 ionic_intr_coal_init(lif->ionic->idev.intr_ctrl, in ionic_set_coalesce()
513 lif->rxqcqs[i]->intr.index, in ionic_set_coalesce()
514 lif->rx_coalesce_hw); in ionic_set_coalesce()
515 lif->rxqcqs[i]->intr.dim_coal_hw = rx_dim; in ionic_set_coalesce()
518 if (lif->txqcqs[i]->flags & IONIC_QCQ_F_INTR) { in ionic_set_coalesce()
519 ionic_intr_coal_init(lif->ionic->idev.intr_ctrl, in ionic_set_coalesce()
520 lif->txqcqs[i]->intr.index, in ionic_set_coalesce()
521 lif->tx_coalesce_hw); in ionic_set_coalesce()
522 lif->txqcqs[i]->intr.dim_coal_hw = tx_dim; in ionic_set_coalesce()
530 static int ionic_validate_cmb_config(struct ionic_lif *lif, in ionic_validate_cmb_config() argument
536 if (!lif->ionic->idev.cmb_inuse && in ionic_validate_cmb_config()
538 netdev_info(lif->netdev, "CMB rings are not supported on this device\n"); in ionic_validate_cmb_config()
543 if (!(lif->qtype_info[IONIC_QTYPE_TXQ].features & IONIC_QIDENT_F_CMB)) { in ionic_validate_cmb_config()
544 netdev_info(lif->netdev, in ionic_validate_cmb_config()
554 if (!(lif->qtype_info[IONIC_QTYPE_RXQ].features & IONIC_QIDENT_F_CMB)) { in ionic_validate_cmb_config()
555 netdev_info(lif->netdev, in ionic_validate_cmb_config()
564 pages_have = lif->ionic->bars[IONIC_PCI_BAR_CMB].len / PAGE_SIZE; in ionic_validate_cmb_config()
566 netdev_info(lif->netdev, in ionic_validate_cmb_config()
575 static int ionic_cmb_rings_toggle(struct ionic_lif *lif, bool cmb_tx, bool cmb_rx) in ionic_cmb_rings_toggle() argument
580 if (netif_running(lif->netdev)) { in ionic_cmb_rings_toggle()
581 netdev_info(lif->netdev, "Please stop device to toggle CMB for tx/rx-push\n"); in ionic_cmb_rings_toggle()
585 ionic_init_queue_params(lif, &qparam); in ionic_cmb_rings_toggle()
588 pages_used = ionic_validate_cmb_config(lif, &qparam); in ionic_cmb_rings_toggle()
593 set_bit(IONIC_LIF_F_CMB_TX_RINGS, lif->state); in ionic_cmb_rings_toggle()
595 clear_bit(IONIC_LIF_F_CMB_TX_RINGS, lif->state); in ionic_cmb_rings_toggle()
598 set_bit(IONIC_LIF_F_CMB_RX_RINGS, lif->state); in ionic_cmb_rings_toggle()
600 clear_bit(IONIC_LIF_F_CMB_RX_RINGS, lif->state); in ionic_cmb_rings_toggle()
603 netdev_info(lif->netdev, "Enabling CMB %s %s rings - %d pages\n", in ionic_cmb_rings_toggle()
606 netdev_info(lif->netdev, "Disabling CMB rings\n"); in ionic_cmb_rings_toggle()
616 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_ringparam() local
619 ring->tx_pending = lif->ntxq_descs; in ionic_get_ringparam()
621 ring->rx_pending = lif->nrxq_descs; in ionic_get_ringparam()
622 kernel_ring->tx_push = test_bit(IONIC_LIF_F_CMB_TX_RINGS, lif->state); in ionic_get_ringparam()
623 kernel_ring->rx_push = test_bit(IONIC_LIF_F_CMB_RX_RINGS, lif->state); in ionic_get_ringparam()
631 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_ringparam() local
635 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_set_ringparam()
638 ionic_init_queue_params(lif, &qparam); in ionic_set_ringparam()
652 if (ring->tx_pending == lif->ntxq_descs && in ionic_set_ringparam()
653 ring->rx_pending == lif->nrxq_descs && in ionic_set_ringparam()
654 kernel_ring->tx_push == test_bit(IONIC_LIF_F_CMB_TX_RINGS, lif->state) && in ionic_set_ringparam()
655 kernel_ring->rx_push == test_bit(IONIC_LIF_F_CMB_RX_RINGS, lif->state)) in ionic_set_ringparam()
663 err = ionic_validate_cmb_config(lif, &qparam); in ionic_set_ringparam()
667 if (kernel_ring->tx_push != test_bit(IONIC_LIF_F_CMB_TX_RINGS, lif->state) || in ionic_set_ringparam()
668 kernel_ring->rx_push != test_bit(IONIC_LIF_F_CMB_RX_RINGS, lif->state)) { in ionic_set_ringparam()
669 err = ionic_cmb_rings_toggle(lif, kernel_ring->tx_push, in ionic_set_ringparam()
675 if (ring->tx_pending != lif->ntxq_descs) in ionic_set_ringparam()
677 lif->ntxq_descs, ring->tx_pending); in ionic_set_ringparam()
679 if (ring->rx_pending != lif->nrxq_descs) in ionic_set_ringparam()
681 lif->nrxq_descs, ring->rx_pending); in ionic_set_ringparam()
684 if (!netif_running(lif->netdev)) { in ionic_set_ringparam()
685 lif->ntxq_descs = ring->tx_pending; in ionic_set_ringparam()
686 lif->nrxq_descs = ring->rx_pending; in ionic_set_ringparam()
690 mutex_lock(&lif->queue_lock); in ionic_set_ringparam()
691 err = ionic_reconfigure_queues(lif, &qparam); in ionic_set_ringparam()
692 mutex_unlock(&lif->queue_lock); in ionic_set_ringparam()
702 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_channels() local
705 ch->max_combined = lif->ionic->ntxqs_per_lif; in ionic_get_channels()
706 ch->max_rx = lif->ionic->ntxqs_per_lif / 2; in ionic_get_channels()
707 ch->max_tx = lif->ionic->ntxqs_per_lif / 2; in ionic_get_channels()
710 if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) { in ionic_get_channels()
711 ch->rx_count = lif->nxqs; in ionic_get_channels()
712 ch->tx_count = lif->nxqs; in ionic_get_channels()
714 ch->combined_count = lif->nxqs; in ionic_get_channels()
721 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_channels() local
726 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_set_channels()
729 ionic_init_queue_params(lif, &qparam); in ionic_set_channels()
731 if ((ch->rx_count || ch->tx_count) && lif->xdp_prog) { in ionic_set_channels()
732 netdev_info(lif->netdev, "Split Tx/Rx interrupts not available when using XDP\n"); in ionic_set_channels()
746 max_cnt = lif->ionic->ntxqs_per_lif; in ionic_set_channels()
751 if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) in ionic_set_channels()
752 netdev_info(lif->netdev, "Sharing queue interrupts\n"); in ionic_set_channels()
753 else if (ch->combined_count == lif->nxqs) in ionic_set_channels()
756 if (lif->nxqs != ch->combined_count) in ionic_set_channels()
758 lif->nxqs, ch->combined_count); in ionic_set_channels()
767 if (!test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) in ionic_set_channels()
768 netdev_info(lif->netdev, "Splitting queue interrupts\n"); in ionic_set_channels()
769 else if (ch->rx_count == lif->nxqs) in ionic_set_channels()
772 if (lif->nxqs != ch->rx_count) in ionic_set_channels()
774 lif->nxqs, ch->rx_count); in ionic_set_channels()
780 err = ionic_validate_cmb_config(lif, &qparam); in ionic_set_channels()
785 if (!netif_running(lif->netdev)) { in ionic_set_channels()
786 lif->nxqs = qparam.nxqs; in ionic_set_channels()
789 set_bit(IONIC_LIF_F_SPLIT_INTR, lif->state); in ionic_set_channels()
791 clear_bit(IONIC_LIF_F_SPLIT_INTR, lif->state); in ionic_set_channels()
792 lif->tx_coalesce_usecs = lif->rx_coalesce_usecs; in ionic_set_channels()
793 lif->tx_coalesce_hw = lif->rx_coalesce_hw; in ionic_set_channels()
798 mutex_lock(&lif->queue_lock); in ionic_set_channels()
799 err = ionic_reconfigure_queues(lif, &qparam); in ionic_set_channels()
800 mutex_unlock(&lif->queue_lock); in ionic_set_channels()
810 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_rxnfc() local
815 info->data = lif->nxqs; in ionic_get_rxnfc()
828 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_rxfh_indir_size() local
830 return le16_to_cpu(lif->ionic->ident.lif.eth.rss_ind_tbl_sz); in ionic_get_rxfh_indir_size()
841 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_rxfh() local
845 tbl_sz = le16_to_cpu(lif->ionic->ident.lif.eth.rss_ind_tbl_sz); in ionic_get_rxfh()
847 rxfh->indir[i] = lif->rss_ind_tbl[i]; in ionic_get_rxfh()
851 memcpy(rxfh->key, lif->rss_hash_key, IONIC_RSS_HASH_KEY_SIZE); in ionic_get_rxfh()
862 struct ionic_lif *lif = netdev_priv(netdev); in ionic_set_rxfh() local
868 return ionic_lif_rss_config(lif, lif->rss_types, in ionic_set_rxfh()
876 struct ionic_lif *lif = netdev_priv(dev); in ionic_set_tunable() local
887 lif->rx_copybreak = (u16)rx_copybreak; in ionic_set_tunable()
899 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_tunable() local
903 *(u32 *)data = lif->rx_copybreak; in ionic_get_tunable()
916 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_module_info() local
917 struct ionic_dev *idev = &lif->ionic->idev; in ionic_get_module_info()
950 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_module_eeprom() local
951 struct ionic_dev *idev = &lif->ionic->idev; in ionic_get_module_eeprom()
982 struct ionic_lif *lif = netdev_priv(netdev); in ionic_get_ts_info() local
983 struct ionic *ionic = lif->ionic; in ionic_get_ts_info()
986 if (!lif->phc || !lif->phc->ptp) in ionic_get_ts_info()
989 info->phc_index = ptp_clock_index(lif->phc->ptp); in ionic_get_ts_info()
1002 if (ionic->ident.lif.eth.hwstamp_tx_modes & mask) in ionic_get_ts_info()
1006 if (ionic->ident.lif.eth.hwstamp_tx_modes & mask) in ionic_get_ts_info()
1015 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1019 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1023 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1027 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1031 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1035 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1039 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1043 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1047 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1051 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1055 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1059 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1063 if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) in ionic_get_ts_info()
1071 struct ionic_lif *lif = netdev_priv(netdev); in ionic_nway_reset() local
1072 struct ionic *ionic = lif->ionic; in ionic_nway_reset()
1075 if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) in ionic_nway_reset()