Lines Matching refs:pf
241 static void i40e_partition_setting_complaint(struct i40e_pf *pf) in i40e_partition_setting_complaint() argument
243 dev_info(&pf->pdev->dev, in i40e_partition_setting_complaint()
257 struct i40e_pf *pf) in i40e_get_settings_link_up() argument
341 if (pf->hw.mac.type == I40E_MAC_X722) { in i40e_get_settings_link_up()
395 struct i40e_pf *pf) in i40e_get_settings_link_down() argument
409 if (pf->hw.mac.type == I40E_MAC_X722) { in i40e_get_settings_link_down()
478 struct i40e_pf *pf = np->vsi->back; in i40e_get_settings() local
479 struct i40e_hw *hw = &pf->hw; in i40e_get_settings()
484 i40e_get_settings_link_up(hw, ecmd, netdev, pf); in i40e_get_settings()
486 i40e_get_settings_link_down(hw, ecmd, pf); in i40e_get_settings()
593 struct i40e_pf *pf = np->vsi->back; in i40e_set_settings() local
595 struct i40e_hw *hw = &pf->hw; in i40e_set_settings()
607 i40e_partition_setting_complaint(pf); in i40e_set_settings()
611 if (vsi != pf->vsi[pf->lan_vsi]) in i40e_set_settings()
769 struct i40e_pf *pf = np->vsi->back; in i40e_nway_reset() local
770 struct i40e_hw *hw = &pf->hw; in i40e_nway_reset()
793 struct i40e_pf *pf = np->vsi->back; in i40e_get_pauseparam() local
794 struct i40e_hw *hw = &pf->hw; in i40e_get_pauseparam()
828 struct i40e_pf *pf = np->vsi->back; in i40e_set_pauseparam() local
830 struct i40e_hw *hw = &pf->hw; in i40e_set_pauseparam()
842 i40e_partition_setting_complaint(pf); in i40e_set_pauseparam()
846 if (vsi != pf->vsi[pf->lan_vsi]) in i40e_set_pauseparam()
856 if (!test_bit(__I40E_DOWN, &pf->state) && in i40e_set_pauseparam()
908 if (!test_bit(__I40E_DOWN, &pf->state)) { in i40e_set_pauseparam()
911 if (!test_bit(__I40E_DOWN, &pf->state)) in i40e_set_pauseparam()
921 struct i40e_pf *pf = np->vsi->back; in i40e_get_msglevel() local
923 return pf->msg_enable; in i40e_get_msglevel()
929 struct i40e_pf *pf = np->vsi->back; in i40e_set_msglevel() local
932 pf->hw.debug_mask = data; in i40e_set_msglevel()
933 pf->msg_enable = data; in i40e_set_msglevel()
951 struct i40e_pf *pf = np->vsi->back; in i40e_get_regs() local
952 struct i40e_hw *hw = &pf->hw; in i40e_get_regs()
983 struct i40e_pf *pf = np->vsi->back; in i40e_get_eeprom() local
1007 dev_info(&pf->pdev->dev, in i40e_get_eeprom()
1025 dev_info(&pf->pdev->dev, in i40e_get_eeprom()
1045 dev_info(&pf->pdev->dev, in i40e_get_eeprom()
1051 dev_info(&pf->pdev->dev, in i40e_get_eeprom()
1056 dev_info(&pf->pdev->dev, in i40e_get_eeprom()
1089 struct i40e_pf *pf = np->vsi->back; in i40e_set_eeprom() local
1104 if (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state) || in i40e_set_eeprom()
1105 test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state)) in i40e_set_eeprom()
1111 dev_info(&pf->pdev->dev, in i40e_set_eeprom()
1125 struct i40e_pf *pf = vsi->back; in i40e_get_drvinfo() local
1130 strlcpy(drvinfo->fw_version, i40e_nvm_version_str(&pf->hw), in i40e_get_drvinfo()
1132 strlcpy(drvinfo->bus_info, pci_name(pf->pdev), in i40e_get_drvinfo()
1140 struct i40e_pf *pf = np->vsi->back; in i40e_get_ringparam() local
1141 struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; in i40e_get_ringparam()
1159 struct i40e_pf *pf = vsi->back; in i40e_set_ringparam() local
1185 while (test_and_set_bit(__I40E_CONFIG_BUSY, &pf->state)) in i40e_set_ringparam()
1307 clear_bit(__I40E_CONFIG_BUSY, &pf->state); in i40e_set_ringparam()
1316 struct i40e_pf *pf = vsi->back; in i40e_get_sset_count() local
1322 if (vsi == pf->vsi[pf->lan_vsi] && pf->hw.partition_id == 1) { in i40e_get_sset_count()
1325 if ((pf->lan_veb != I40E_NO_VEB) && in i40e_get_sset_count()
1326 (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)) in i40e_get_sset_count()
1345 struct i40e_pf *pf = vsi->back; in i40e_get_ethtool_stats() local
1396 if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1) in i40e_get_ethtool_stats()
1399 if ((pf->lan_veb != I40E_NO_VEB) && in i40e_get_ethtool_stats()
1400 (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)) { in i40e_get_ethtool_stats()
1401 struct i40e_veb *veb = pf->veb[pf->lan_veb]; in i40e_get_ethtool_stats()
1417 p = (char *)pf + i40e_gstrings_stats[j].stat_offset; in i40e_get_ethtool_stats()
1422 data[i++] = pf->stats.priority_xon_tx[j]; in i40e_get_ethtool_stats()
1423 data[i++] = pf->stats.priority_xoff_tx[j]; in i40e_get_ethtool_stats()
1426 data[i++] = pf->stats.priority_xon_rx[j]; in i40e_get_ethtool_stats()
1427 data[i++] = pf->stats.priority_xoff_rx[j]; in i40e_get_ethtool_stats()
1430 data[i++] = pf->stats.priority_xon_2_xoff[j]; in i40e_get_ethtool_stats()
1438 struct i40e_pf *pf = vsi->back; in i40e_get_strings() local
1477 if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1) in i40e_get_strings()
1480 if ((pf->lan_veb != I40E_NO_VEB) && in i40e_get_strings()
1481 (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)) { in i40e_get_strings()
1545 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_get_ts_info() local
1548 if (!(pf->flags & I40E_FLAG_PTP)) in i40e_get_ts_info()
1558 if (pf->ptp_clock) in i40e_get_ts_info()
1559 info->phc_index = ptp_clock_index(pf->ptp_clock); in i40e_get_ts_info()
1575 struct i40e_pf *pf = np->vsi->back; in i40e_link_test() local
1579 netif_info(pf, hw, netdev, "link test\n"); in i40e_link_test()
1580 status = i40e_get_link_status(&pf->hw, &link_up); in i40e_link_test()
1582 netif_err(pf, drv, netdev, "link query timed out, please retry test\n"); in i40e_link_test()
1598 struct i40e_pf *pf = np->vsi->back; in i40e_reg_test() local
1600 netif_info(pf, hw, netdev, "register test\n"); in i40e_reg_test()
1601 *data = i40e_diag_reg_test(&pf->hw); in i40e_reg_test()
1609 struct i40e_pf *pf = np->vsi->back; in i40e_eeprom_test() local
1611 netif_info(pf, hw, netdev, "eeprom test\n"); in i40e_eeprom_test()
1612 *data = i40e_diag_eeprom_test(&pf->hw); in i40e_eeprom_test()
1615 pf->hw.nvmupd_state = I40E_NVMUPD_STATE_INIT; in i40e_eeprom_test()
1623 struct i40e_pf *pf = np->vsi->back; in i40e_intr_test() local
1624 u16 swc_old = pf->sw_int_count; in i40e_intr_test()
1626 netif_info(pf, hw, netdev, "interrupt test\n"); in i40e_intr_test()
1627 wr32(&pf->hw, I40E_PFINT_DYN_CTL0, in i40e_intr_test()
1634 *data = (swc_old == pf->sw_int_count); in i40e_intr_test()
1642 struct i40e_pf *pf = np->vsi->back; in i40e_loopback_test() local
1644 netif_info(pf, hw, netdev, "loopback test not implemented\n"); in i40e_loopback_test()
1650 static inline bool i40e_active_vfs(struct i40e_pf *pf) in i40e_active_vfs() argument
1652 struct i40e_vf *vfs = pf->vf; in i40e_active_vfs()
1655 for (i = 0; i < pf->num_alloc_vfs; i++) in i40e_active_vfs()
1661 static inline bool i40e_active_vmdqs(struct i40e_pf *pf) in i40e_active_vmdqs() argument
1663 struct i40e_vsi **vsi = pf->vsi; in i40e_active_vmdqs()
1666 for (i = 0; i < pf->num_alloc_vsi; i++) { in i40e_active_vmdqs()
1681 struct i40e_pf *pf = np->vsi->back; in i40e_diag_test() local
1685 netif_info(pf, drv, netdev, "offline testing starting\n"); in i40e_diag_test()
1687 set_bit(__I40E_TESTING, &pf->state); in i40e_diag_test()
1689 if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) { in i40e_diag_test()
1690 dev_warn(&pf->pdev->dev, in i40e_diag_test()
1698 clear_bit(__I40E_TESTING, &pf->state); in i40e_diag_test()
1712 i40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED)); in i40e_diag_test()
1730 clear_bit(__I40E_TESTING, &pf->state); in i40e_diag_test()
1731 i40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED)); in i40e_diag_test()
1737 netif_info(pf, drv, netdev, "online testing starting\n"); in i40e_diag_test()
1751 netif_info(pf, drv, netdev, "testing finished\n"); in i40e_diag_test()
1758 struct i40e_pf *pf = np->vsi->back; in i40e_get_wol() local
1759 struct i40e_hw *hw = &pf->hw; in i40e_get_wol()
1769 wol->wolopts = (pf->wol_en ? WAKE_MAGIC : 0); in i40e_get_wol()
1781 struct i40e_pf *pf = np->vsi->back; in i40e_set_wol() local
1783 struct i40e_hw *hw = &pf->hw; in i40e_set_wol()
1788 i40e_partition_setting_complaint(pf); in i40e_set_wol()
1792 if (vsi != pf->vsi[pf->lan_vsi]) in i40e_set_wol()
1805 if (pf->wol_en != !!wol->wolopts) { in i40e_set_wol()
1806 pf->wol_en = !!wol->wolopts; in i40e_set_wol()
1807 device_set_wakeup_enable(&pf->pdev->dev, pf->wol_en); in i40e_set_wol()
1817 struct i40e_pf *pf = np->vsi->back; in i40e_set_phys_id() local
1818 struct i40e_hw *hw = &pf->hw; in i40e_set_phys_id()
1823 pf->led_status = i40e_led_get(hw); in i40e_set_phys_id()
1832 i40e_led_set(hw, pf->led_status, false); in i40e_set_phys_id()
1881 struct i40e_pf *pf = vsi->back; in i40e_set_coalesce() local
1882 struct i40e_hw *hw = &pf->hw; in i40e_set_coalesce()
1891 netif_info(pf, drv, netdev, "tx-usecs-high is not used, please program rx-usecs-high\n"); in i40e_set_coalesce()
1896 netif_info(pf, drv, netdev, "Invalid value, rx-usecs-high range is 0-235\n"); in i40e_set_coalesce()
1907 netif_info(pf, drv, netdev, "rx-usecs=0, need to disable adaptive-rx for a complete disable\n"); in i40e_set_coalesce()
1909 netif_info(pf, drv, netdev, "Invalid value, rx-usecs range is 0-8160\n"); in i40e_set_coalesce()
1921 netif_info(pf, drv, netdev, "tx-usecs=0, need to disable adaptive-tx for a complete disable\n"); in i40e_set_coalesce()
1923 netif_info(pf, drv, netdev, in i40e_set_coalesce()
1960 static int i40e_get_rss_hash_opts(struct i40e_pf *pf, struct ethtool_rxnfc *cmd) in i40e_get_rss_hash_opts() argument
1964 if (pf->vsi[pf->lan_vsi]->rxnfc.data != 0) { in i40e_get_rss_hash_opts()
1965 cmd->data = pf->vsi[pf->lan_vsi]->rxnfc.data; in i40e_get_rss_hash_opts()
1966 cmd->flow_type = pf->vsi[pf->lan_vsi]->rxnfc.flow_type; in i40e_get_rss_hash_opts()
2011 static int i40e_get_ethtool_fdir_all(struct i40e_pf *pf, in i40e_get_ethtool_fdir_all() argument
2020 cmd->data = i40e_get_fd_cnt_all(pf); in i40e_get_ethtool_fdir_all()
2023 &pf->fdir_filter_list, fdir_node) { in i40e_get_ethtool_fdir_all()
2046 static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf, in i40e_get_ethtool_fdir_entry() argument
2055 &pf->fdir_filter_list, fdir_node) { in i40e_get_ethtool_fdir_entry()
2083 if (rule->dest_vsi != pf->vsi[pf->lan_vsi]->id) { in i40e_get_ethtool_fdir_entry()
2086 vsi = i40e_find_vsi_from_id(pf, rule->dest_vsi); in i40e_get_ethtool_fdir_entry()
2108 struct i40e_pf *pf = vsi->back; in i40e_get_rxnfc() local
2117 ret = i40e_get_rss_hash_opts(pf, cmd); in i40e_get_rxnfc()
2120 cmd->rule_cnt = pf->fdir_pf_active_filters; in i40e_get_rxnfc()
2122 cmd->data = i40e_get_fd_cnt_all(pf); in i40e_get_rxnfc()
2126 ret = i40e_get_ethtool_fdir_entry(pf, cmd); in i40e_get_rxnfc()
2129 ret = i40e_get_ethtool_fdir_all(pf, cmd, rule_locs); in i40e_get_rxnfc()
2145 static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc) in i40e_set_rss_hash_opt() argument
2147 struct i40e_hw *hw = &pf->hw; in i40e_set_rss_hash_opt()
2251 pf->vsi[pf->lan_vsi]->rxnfc = *nfc; in i40e_set_rss_hash_opt()
2292 struct i40e_pf *pf = vsi->back; in i40e_update_ethtool_fdir_entry() local
2300 &pf->fdir_filter_list, fdir_node) { in i40e_update_ethtool_fdir_entry()
2315 pf->fdir_pf_active_filters--; in i40e_update_ethtool_fdir_entry()
2332 &pf->fdir_filter_list); in i40e_update_ethtool_fdir_entry()
2335 pf->fdir_pf_active_filters++; in i40e_update_ethtool_fdir_entry()
2355 struct i40e_pf *pf = vsi->back; in i40e_del_fdir_entry() local
2358 if (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state) || in i40e_del_fdir_entry()
2359 test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state)) in i40e_del_fdir_entry()
2362 if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state)) in i40e_del_fdir_entry()
2367 i40e_fdir_check_and_reenable(pf); in i40e_del_fdir_entry()
2384 struct i40e_pf *pf; in i40e_add_fdir_ethtool() local
2391 pf = vsi->back; in i40e_add_fdir_ethtool()
2393 if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED)) in i40e_add_fdir_ethtool()
2396 if (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED) in i40e_add_fdir_ethtool()
2399 if (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state) || in i40e_add_fdir_ethtool()
2400 test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state)) in i40e_add_fdir_ethtool()
2403 if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state)) in i40e_add_fdir_ethtool()
2408 if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort + in i40e_add_fdir_ethtool()
2409 pf->hw.func_caps.fd_filters_guaranteed)) { in i40e_add_fdir_ethtool()
2435 input->cnt_index = I40E_FD_SB_STAT_IDX(pf->hw.pf_id); in i40e_add_fdir_ethtool()
2448 if (ntohl(fsp->h_ext.data[1]) >= pf->num_alloc_vfs) { in i40e_add_fdir_ethtool()
2449 netif_info(pf, drv, vsi->netdev, "Invalid VF id\n"); in i40e_add_fdir_ethtool()
2454 input->dest_vsi = pf->vf[vf_id].lan_vsi_id; in i40e_add_fdir_ethtool()
2455 if (input->q_index >= pf->vf[vf_id].num_queue_pairs) { in i40e_add_fdir_ethtool()
2456 netif_info(pf, drv, vsi->netdev, "Invalid queue id\n"); in i40e_add_fdir_ethtool()
2482 struct i40e_pf *pf = vsi->back; in i40e_set_rxnfc() local
2487 ret = i40e_set_rss_hash_opt(pf, cmd); in i40e_set_rxnfc()
2527 struct i40e_pf *pf = vsi->back; in i40e_get_channels() local
2533 ch->other_count = (pf->flags & I40E_FLAG_FD_SB_ENABLED) ? 1 : 0; in i40e_get_channels()
2554 struct i40e_pf *pf = vsi->back; in i40e_set_channels() local
2566 if (ch->other_count != ((pf->flags & I40E_FLAG_FD_SB_ENABLED) ? 1 : 0)) in i40e_set_channels()
2579 new_count = i40e_reconfig_rss_queues(pf, count); in i40e_set_channels()
2614 struct i40e_pf *pf = vsi->back; in i40e_get_rxfh() local
2615 struct i40e_hw *hw = &pf->hw; in i40e_get_rxfh()
2659 struct i40e_pf *pf = vsi->back; in i40e_set_rxfh() local
2660 struct i40e_hw *hw = &pf->hw; in i40e_set_rxfh()
2704 struct i40e_pf *pf = vsi->back; in i40e_get_priv_flags() local
2707 ret_flags |= pf->hw.func_caps.npar_enable ? in i40e_get_priv_flags()
2709 ret_flags |= pf->flags & I40E_FLAG_LINK_POLLING_ENABLED ? in i40e_get_priv_flags()
2711 ret_flags |= pf->flags & I40E_FLAG_FD_ATR_ENABLED ? in i40e_get_priv_flags()
2713 ret_flags |= pf->flags & I40E_FLAG_VEB_STATS_ENABLED ? in i40e_get_priv_flags()
2728 struct i40e_pf *pf = vsi->back; in i40e_set_priv_flags() local
2731 pf->flags |= I40E_FLAG_LINK_POLLING_ENABLED; in i40e_set_priv_flags()
2733 pf->flags &= ~I40E_FLAG_LINK_POLLING_ENABLED; in i40e_set_priv_flags()
2740 pf->flags |= I40E_FLAG_FD_ATR_ENABLED; in i40e_set_priv_flags()
2742 pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; in i40e_set_priv_flags()
2743 pf->auto_disable_flags |= I40E_FLAG_FD_ATR_ENABLED; in i40e_set_priv_flags()
2747 pf->flags |= I40E_FLAG_VEB_STATS_ENABLED; in i40e_set_priv_flags()
2749 pf->flags &= ~I40E_FLAG_VEB_STATS_ENABLED; in i40e_set_priv_flags()