Lines Matching full:pf

45 static int	ixl_vf_alloc_vsi(struct ixl_pf *pf, struct ixl_vf *vf);
46 static int ixl_vf_setup_vsi(struct ixl_pf *pf, struct ixl_vf *vf);
47 static void ixl_vf_map_queues(struct ixl_pf *pf, struct ixl_vf *vf);
48 static void ixl_vf_vsi_release(struct ixl_pf *pf, struct ixl_vsi *vsi);
49 static void ixl_vf_release_resources(struct ixl_pf *pf, struct ixl_vf *vf);
50 static int ixl_flush_pcie(struct ixl_pf *pf, struct ixl_vf *vf);
51 static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf);
52 static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf);
53 static void ixl_send_vf_msg(struct ixl_pf *pf, struct ixl_vf *vf, uint16_t op, enum i40e_status_cod…
54 static void ixl_send_vf_ack(struct ixl_pf *pf, struct ixl_vf *vf, uint16_t op);
55 static void ixl_send_vf_nack_msg(struct ixl_pf *pf, struct ixl_vf *vf, uint16_t op, enum i40e_statu…
56 static void ixl_vf_version_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size);
57 static void ixl_vf_reset_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size);
58 static void ixl_vf_get_resources_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_…
59 static int ixl_vf_config_tx_queue(struct ixl_pf *pf, struct ixl_vf *vf, struct virtchnl_txq_info *i…
60 static int ixl_vf_config_rx_queue(struct ixl_pf *pf, struct ixl_vf *vf, struct virtchnl_rxq_info *i…
61 static void ixl_vf_config_vsi_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_siz…
62 static void ixl_vf_set_qctl(struct ixl_pf *pf, const struct virtchnl_vector_map *vector, enum i40e_…
64 static void ixl_vf_config_vector(struct ixl_pf *pf, struct ixl_vf *vf, const struct virtchnl_vector…
65 static void ixl_vf_config_irq_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_siz…
66 static void ixl_vf_enable_queues_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_…
67 static void ixl_vf_disable_queues_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg…
68 static void ixl_vf_add_mac_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size);
69 static void ixl_vf_del_mac_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size);
70 static enum i40e_status_code ixl_vf_enable_vlan_strip(struct ixl_pf *pf, struct ixl_vf *vf);
71 static void ixl_vf_add_vlan_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size);
72 static void ixl_vf_del_vlan_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size);
73 static void ixl_vf_config_promisc_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg…
74 static void ixl_vf_get_stats_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, uint16_t msg_size…
75 static int ixl_vf_reserve_queues(struct ixl_pf *pf, struct ixl_vf *vf, int num_queues);
76 static int ixl_config_pf_vsi_loopback(struct ixl_pf *pf, bool enable);
89 ixl_initialize_sriov(struct ixl_pf *pf) in ixl_initialize_sriov() argument
91 device_t dev = pf->dev; in ixl_initialize_sriov()
92 struct i40e_hw *hw = &pf->hw; in ixl_initialize_sriov()
117 pf->vc_debug_lvl = 1; in ixl_initialize_sriov()
124 ixl_vf_alloc_vsi(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_vf_alloc_vsi() argument
132 hw = &pf->hw; in ixl_vf_alloc_vsi()
133 dev = pf->dev; in ixl_vf_alloc_vsi()
136 vsi_ctx.uplink_seid = pf->veb_seid; in ixl_vf_alloc_vsi()
144 if (pf->enable_vf_loopback) in ixl_vf_alloc_vsi()
195 ixl_vf_setup_vsi(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_vf_setup_vsi() argument
200 hw = &pf->hw; in ixl_vf_setup_vsi()
203 error = ixl_vf_alloc_vsi(pf, vf); in ixl_vf_setup_vsi()
207 vf->vsi.dev = pf->dev; in ixl_vf_setup_vsi()
213 device_printf(pf->dev, "Error configuring VF VSI for broadcast promiscuous\n"); in ixl_vf_setup_vsi()
242 ixl_vf_map_queues(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_vf_map_queues() argument
248 hw = &pf->hw; in ixl_vf_map_queues()
261 /* Program index of each VF queue into PF queue space in ixl_vf_map_queues()
289 ixl_vf_vsi_release(struct ixl_pf *pf, struct ixl_vsi *vsi) in ixl_vf_vsi_release() argument
293 hw = &pf->hw; in ixl_vf_vsi_release()
319 ixl_vf_release_resources(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_vf_release_resources() argument
325 hw = &pf->hw; in ixl_vf_release_resources()
327 ixl_vf_vsi_release(pf, &vf->vsi); in ixl_vf_release_resources()
350 ixl_flush_pcie(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_flush_pcie() argument
357 hw = &pf->hw; in ixl_flush_pcie()
373 ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_reset_vf() argument
378 hw = &pf->hw; in ixl_reset_vf()
380 ixl_dbg_iov(pf, "Resetting VF-%d\n", vf->vf_num); in ixl_reset_vf()
387 ixl_reinit_vf(pf, vf); in ixl_reset_vf()
389 ixl_dbg_iov(pf, "Resetting VF-%d done.\n", vf->vf_num); in ixl_reset_vf()
393 ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_reinit_vf() argument
399 hw = &pf->hw; in ixl_reinit_vf()
401 error = ixl_flush_pcie(pf, vf); in ixl_reinit_vf()
403 device_printf(pf->dev, in ixl_reinit_vf()
416 device_printf(pf->dev, "VF %d failed to reset\n", vf->vf_num); in ixl_reinit_vf()
425 ixl_disable_rings(pf, &vf->vsi, &vf->qtag); in ixl_reinit_vf()
428 ixl_vf_release_resources(pf, vf); in ixl_reinit_vf()
429 ixl_vf_setup_vsi(pf, vf); in ixl_reinit_vf()
430 ixl_vf_map_queues(pf, vf); in ixl_reinit_vf()
448 ixl_send_vf_msg(struct ixl_pf *pf, struct ixl_vf *vf, uint16_t op, in ixl_send_vf_msg() argument
454 hw = &pf->hw; in ixl_send_vf_msg()
457 I40E_VC_DEBUG(pf, ixl_vc_opcode_level(op), in ixl_send_vf_msg()
465 ixl_send_vf_ack(struct ixl_pf *pf, struct ixl_vf *vf, uint16_t op) in ixl_send_vf_ack() argument
468 ixl_send_vf_msg(pf, vf, op, I40E_SUCCESS, NULL, 0); in ixl_send_vf_ack()
472 ixl_send_vf_nack_msg(struct ixl_pf *pf, struct ixl_vf *vf, uint16_t op, in ixl_send_vf_nack_msg() argument
476 I40E_VC_DEBUG(pf, 1, in ixl_send_vf_nack_msg()
478 ixl_vc_opcode_str(op), op, i40e_stat_str(&pf->hw, status), in ixl_send_vf_nack_msg()
480 ixl_send_vf_msg(pf, vf, op, status, NULL, 0); in ixl_send_vf_nack_msg()
484 ixl_vf_version_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_version_msg() argument
488 device_t dev = pf->dev; in ixl_vf_version_msg()
503 "%s: VF-%d requested version (%d.%d) differs from PF version (%d.%d)\n", in ixl_vf_version_msg()
509 ixl_send_vf_msg(pf, vf, VIRTCHNL_OP_VERSION, I40E_SUCCESS, in ixl_vf_version_msg()
514 ixl_vf_reset_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_reset_msg() argument
517 ixl_reset_vf(pf, vf); in ixl_vf_reset_msg()
523 ixl_vf_get_resources_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_get_resources_msg() argument
535 /* Force VF RSS setup by PF in 1.1+ VFs */ in ixl_vf_get_resources_msg()
543 reply.max_vectors = pf->hw.func_caps.num_msix_vectors_vf; in ixl_vf_get_resources_msg()
551 ixl_send_vf_msg(pf, vf, VIRTCHNL_OP_GET_VF_RESOURCES, in ixl_vf_get_resources_msg()
556 ixl_vf_config_tx_queue(struct ixl_pf *pf, struct ixl_vf *vf, in ixl_vf_config_tx_queue() argument
565 hw = &pf->hw; in ixl_vf_config_tx_queue()
570 DDPRINTF(pf->dev, "VF %d: PF TX queue %d / VF TX queue %d (Global VF %d)\n", in ixl_vf_config_tx_queue()
601 ixl_vf_config_rx_queue(struct ixl_pf *pf, struct ixl_vf *vf, in ixl_vf_config_rx_queue() argument
609 hw = &pf->hw; in ixl_vf_config_rx_queue()
613 DDPRINTF(pf->dev, "VF %d: PF RX queue %d / VF RX queue %d\n", in ixl_vf_config_rx_queue()
668 ixl_vf_config_vsi_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_config_vsi_msg() argument
677 device_printf(pf->dev, "VF %d: invalid # of qpairs (msg has %d, VSI has %d)\n", in ixl_vf_config_vsi_msg()
679 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, in ixl_vf_config_vsi_msg()
685 device_printf(pf->dev, "VF %d: VSI id in recvd message (%d) does not match expected id (%d)\n", in ixl_vf_config_vsi_msg()
687 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, in ixl_vf_config_vsi_msg()
700 i40e_send_vf_nack(pf, vf, in ixl_vf_config_vsi_msg()
705 if (ixl_vf_config_tx_queue(pf, vf, &pair->txq) != 0) { in ixl_vf_config_vsi_msg()
706 i40e_send_vf_nack(pf, vf, in ixl_vf_config_vsi_msg()
711 if (ixl_vf_config_rx_queue(pf, vf, &pair->rxq) != 0) { in ixl_vf_config_vsi_msg()
712 i40e_send_vf_nack(pf, vf, in ixl_vf_config_vsi_msg()
718 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES); in ixl_vf_config_vsi_msg()
722 ixl_vf_set_qctl(struct ixl_pf *pf, in ixl_vf_set_qctl() argument
744 wr32(&pf->hw, offset, qctl); in ixl_vf_set_qctl()
751 ixl_vf_config_vector(struct ixl_pf *pf, struct ixl_vf *vf, in ixl_vf_config_vector() argument
760 hw = &pf->hw; in ixl_vf_config_vector()
778 ixl_vf_set_qctl(pf, vector, type, cur_queue, in ixl_vf_config_vector()
787 ixl_vf_set_qctl(pf, vector, type, cur_queue, in ixl_vf_config_vector()
806 ixl_vf_config_irq_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_config_irq_msg() argument
814 hw = &pf->hw; in ixl_vf_config_irq_msg()
822 i40e_send_vf_nack(pf, vf, in ixl_vf_config_irq_msg()
830 i40e_send_vf_nack(pf, vf, in ixl_vf_config_irq_msg()
840 i40e_send_vf_nack(pf, vf, in ixl_vf_config_irq_msg()
849 i40e_send_vf_nack(pf, vf, in ixl_vf_config_irq_msg()
855 ixl_vf_config_vector(pf, vf, vector); in ixl_vf_config_irq_msg()
858 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_CONFIG_IRQ_MAP); in ixl_vf_config_irq_msg()
862 ixl_vf_enable_queues_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_enable_queues_msg() argument
872 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ENABLE_QUEUES, in ixl_vf_enable_queues_msg()
882 device_printf(pf->dev, "VF %d: TX ring %d is outside of VF VSI allocation!\n", in ixl_vf_enable_queues_msg()
891 ixl_dbg_iov(pf, "VF %d: TX ring %d is already enabled!\n", in ixl_vf_enable_queues_msg()
894 error = ixl_enable_tx_ring(pf, &vf->qtag, i); in ixl_vf_enable_queues_msg()
907 device_printf(pf->dev, "VF %d: RX ring %d is outside of VF VSI allocation!\n", in ixl_vf_enable_queues_msg()
916 ixl_dbg_iov(pf, "VF %d: RX ring %d is already enabled!\n", in ixl_vf_enable_queues_msg()
918 error = ixl_enable_rx_ring(pf, &vf->qtag, i); in ixl_vf_enable_queues_msg()
927 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ENABLE_QUEUES, in ixl_vf_enable_queues_msg()
932 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_ENABLE_QUEUES); in ixl_vf_enable_queues_msg()
936 ixl_vf_disable_queues_msg(struct ixl_pf *pf, struct ixl_vf *vf, in ixl_vf_disable_queues_msg() argument
946 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_DISABLE_QUEUES, in ixl_vf_disable_queues_msg()
956 device_printf(pf->dev, "VF %d: TX ring %d is outside of VF VSI allocation!\n", in ixl_vf_disable_queues_msg()
965 ixl_dbg_iov(pf, "VF %d: TX ring %d is already disabled!\n", in ixl_vf_disable_queues_msg()
969 error = ixl_disable_tx_ring(pf, &vf->qtag, i); in ixl_vf_disable_queues_msg()
982 device_printf(pf->dev, "VF %d: RX ring %d is outside of VF VSI allocation!\n", in ixl_vf_disable_queues_msg()
991 ixl_dbg_iov(pf, "VF %d: RX ring %d is already disabled!\n", in ixl_vf_disable_queues_msg()
995 error = ixl_disable_rx_ring(pf, &vf->qtag, i); in ixl_vf_disable_queues_msg()
1004 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_DISABLE_QUEUES, in ixl_vf_disable_queues_msg()
1009 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_DISABLE_QUEUES); in ixl_vf_disable_queues_msg()
1032 ixl_vf_add_mac_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_add_mac_msg() argument
1044 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_ETH_ADDR, in ixl_vf_add_mac_msg()
1051 i40e_send_vf_nack(pf, vf, in ixl_vf_add_mac_msg()
1062 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_ADD_ETH_ADDR); in ixl_vf_add_mac_msg()
1066 ixl_vf_del_mac_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_del_mac_msg() argument
1078 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_DEL_ETH_ADDR, in ixl_vf_del_mac_msg()
1086 i40e_send_vf_nack(pf, vf, in ixl_vf_del_mac_msg()
1097 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_DEL_ETH_ADDR); in ixl_vf_del_mac_msg()
1101 ixl_vf_enable_vlan_strip(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_vf_enable_vlan_strip() argument
1111 return (i40e_aq_update_vsi_params(&pf->hw, &vsi_ctx, NULL)); in ixl_vf_enable_vlan_strip()
1115 ixl_vf_add_vlan_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_add_vlan_msg() argument
1125 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_VLAN, in ixl_vf_add_vlan_msg()
1131 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_VLAN, in ixl_vf_add_vlan_msg()
1138 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_VLAN, in ixl_vf_add_vlan_msg()
1144 code = ixl_vf_enable_vlan_strip(pf, vf); in ixl_vf_add_vlan_msg()
1146 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_VLAN, in ixl_vf_add_vlan_msg()
1153 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_ADD_VLAN); in ixl_vf_add_vlan_msg()
1157 ixl_vf_del_vlan_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_del_vlan_msg() argument
1166 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_DEL_VLAN, in ixl_vf_del_vlan_msg()
1173 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_VLAN, in ixl_vf_del_vlan_msg()
1180 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_ADD_VLAN, in ixl_vf_del_vlan_msg()
1188 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_DEL_VLAN); in ixl_vf_del_vlan_msg()
1192 ixl_vf_config_promisc_msg(struct ixl_pf *pf, struct ixl_vf *vf, in ixl_vf_config_promisc_msg() argument
1196 struct i40e_hw *hw = &pf->hw; in ixl_vf_config_promisc_msg()
1201 * Do the same thing as the Linux PF driver -- lie to the VF in ixl_vf_config_promisc_msg()
1203 ixl_send_vf_ack(pf, vf, in ixl_vf_config_promisc_msg()
1210 i40e_send_vf_nack(pf, vf, in ixl_vf_config_promisc_msg()
1218 device_printf(pf->dev, "i40e_aq_set_vsi_unicast_promiscuous (seid %d) failed: status %s," in ixl_vf_config_promisc_msg()
1221 i40e_send_vf_nack(pf, vf, in ixl_vf_config_promisc_msg()
1229 device_printf(pf->dev, "i40e_aq_set_vsi_multicast_promiscuous (seid %d) failed: status %s," in ixl_vf_config_promisc_msg()
1232 i40e_send_vf_nack(pf, vf, in ixl_vf_config_promisc_msg()
1237 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE); in ixl_vf_config_promisc_msg()
1241 ixl_vf_get_stats_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_get_stats_msg() argument
1248 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_GET_STATS, in ixl_vf_get_stats_msg()
1255 ixl_send_vf_msg(pf, vf, VIRTCHNL_OP_GET_STATS, in ixl_vf_get_stats_msg()
1260 ixl_vf_config_rss_key_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_config_rss_key_msg() argument
1268 hw = &pf->hw; in ixl_vf_config_rss_key_msg()
1273 device_printf(pf->dev, "VF %d: Key size in msg (%d) is greater than max key size (%d)\n", in ixl_vf_config_rss_key_msg()
1275 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_KEY, in ixl_vf_config_rss_key_msg()
1281 device_printf(pf->dev, "VF %d: VSI id in recvd message (%d) does not match expected id (%d)\n", in ixl_vf_config_rss_key_msg()
1283 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_KEY, in ixl_vf_config_rss_key_msg()
1299 device_printf(pf->dev, "i40e_aq_set_rss_key status %s, error %s\n", in ixl_vf_config_rss_key_msg()
1301 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_KEY, in ixl_vf_config_rss_key_msg()
1310 DDPRINTF(pf->dev, "VF %d: Programmed key starting with 0x%x ok!", in ixl_vf_config_rss_key_msg()
1313 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_KEY); in ixl_vf_config_rss_key_msg()
1317 ixl_vf_config_rss_lut_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_config_rss_lut_msg() argument
1324 hw = &pf->hw; in ixl_vf_config_rss_lut_msg()
1329 device_printf(pf->dev, "VF %d: # of LUT entries in msg (%d) is greater than max (%d)\n", in ixl_vf_config_rss_lut_msg()
1331 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_LUT, in ixl_vf_config_rss_lut_msg()
1337 device_printf(pf->dev, "VF %d: VSI id in recvd message (%d) does not match expected id (%d)\n", in ixl_vf_config_rss_lut_msg()
1339 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_LUT, in ixl_vf_config_rss_lut_msg()
1348 device_printf(pf->dev, "i40e_aq_set_rss_lut status %s, error %s\n", in ixl_vf_config_rss_lut_msg()
1350 i40e_send_vf_nack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_LUT, in ixl_vf_config_rss_lut_msg()
1359 DDPRINTF(pf->dev, "VF %d: Programmed LUT starting with 0x%x and length %d ok!", in ixl_vf_config_rss_lut_msg()
1362 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_CONFIG_RSS_LUT); in ixl_vf_config_rss_lut_msg()
1366 ixl_vf_set_rss_hena_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, in ixl_vf_set_rss_hena_msg() argument
1372 hw = &pf->hw; in ixl_vf_set_rss_hena_msg()
1379 DDPRINTF(pf->dev, "VF %d: Programmed HENA with 0x%016lx", in ixl_vf_set_rss_hena_msg()
1382 ixl_send_vf_ack(pf, vf, VIRTCHNL_OP_SET_RSS_HENA); in ixl_vf_set_rss_hena_msg()
1386 ixl_notify_vf_link_state(struct ixl_pf *pf, struct ixl_vf *vf) in ixl_notify_vf_link_state() argument
1391 hw = &pf->hw; in ixl_notify_vf_link_state()
1394 event.event_data.link_event.link_status = pf->vsi.link_active; in ixl_notify_vf_link_state()
1398 ixl_send_vf_msg(pf, vf, VIRTCHNL_OP_EVENT, I40E_SUCCESS, &event, in ixl_notify_vf_link_state()
1403 ixl_broadcast_link_state(struct ixl_pf *pf) in ixl_broadcast_link_state() argument
1407 for (i = 0; i < pf->num_vfs; i++) in ixl_broadcast_link_state()
1408 ixl_notify_vf_link_state(pf, &pf->vfs[i]); in ixl_broadcast_link_state()
1412 ixl_handle_vf_msg(struct ixl_pf *pf, struct i40e_arq_event_info *event) in ixl_handle_vf_msg() argument
1414 device_t dev = pf->dev; in ixl_handle_vf_msg()
1421 vf_num = le16toh(event->desc.retval) - pf->hw.func_caps.vf_base_id; in ixl_handle_vf_msg()
1424 if (vf_num >= pf->num_vfs) { in ixl_handle_vf_msg()
1425 device_printf(pf->dev, "Got msg from illegal VF: %d\n", vf_num); in ixl_handle_vf_msg()
1429 vf = &pf->vfs[vf_num]; in ixl_handle_vf_msg()
1433 I40E_VC_DEBUG(pf, ixl_vc_opcode_level(opcode), in ixl_handle_vf_msg()
1444 i40e_send_vf_nack(pf, vf, opcode, I40E_ERR_PARAM); in ixl_handle_vf_msg()
1454 ixl_vf_version_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1457 ixl_vf_reset_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1460 ixl_vf_get_resources_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1464 ixl_notify_vf_link_state(pf, vf); in ixl_handle_vf_msg()
1467 ixl_vf_config_vsi_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1470 ixl_vf_config_irq_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1473 ixl_vf_enable_queues_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1477 ixl_notify_vf_link_state(pf, vf); in ixl_handle_vf_msg()
1480 ixl_vf_disable_queues_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1483 ixl_vf_add_mac_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1486 ixl_vf_del_mac_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1489 ixl_vf_add_vlan_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1492 ixl_vf_del_vlan_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1495 ixl_vf_config_promisc_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1498 ixl_vf_get_stats_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1501 ixl_vf_config_rss_key_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1504 ixl_vf_config_rss_lut_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1507 ixl_vf_set_rss_hena_msg(pf, vf, msg, msg_size); in ixl_handle_vf_msg()
1514 i40e_send_vf_nack(pf, vf, opcode, I40E_ERR_NOT_IMPLEMENTED); in ixl_handle_vf_msg()
1521 ixl_handle_vflr(struct ixl_pf *pf) in ixl_handle_vflr() argument
1529 hw = &pf->hw; in ixl_handle_vflr()
1531 ixl_dbg_iov(pf, "%s: begin\n", __func__); in ixl_handle_vflr()
1540 for (i = 0; i < pf->num_vfs; i++) { in ixl_handle_vflr()
1543 vf = &pf->vfs[i]; in ixl_handle_vflr()
1554 ixl_dbg_iov(pf, "Reinitializing VF-%d\n", i); in ixl_handle_vflr()
1555 ixl_reinit_vf(pf, vf); in ixl_handle_vflr()
1556 ixl_dbg_iov(pf, "Reinitializing VF-%d done\n", i); in ixl_handle_vflr()
1617 ixl_config_pf_vsi_loopback(struct ixl_pf *pf, bool enable) in ixl_config_pf_vsi_loopback() argument
1619 struct i40e_hw *hw = &pf->hw; in ixl_config_pf_vsi_loopback()
1620 device_t dev = pf->dev; in ixl_config_pf_vsi_loopback()
1621 struct ixl_vsi *vsi = &pf->vsi; in ixl_config_pf_vsi_loopback()
1628 if (pf->veb_seid != 0) in ixl_config_pf_vsi_loopback()
1629 ctxt.uplink_seid = pf->veb_seid; in ixl_config_pf_vsi_loopback()
1650 struct ixl_pf *pf = iflib_get_softc(ctx); in ixl_if_iov_init() local
1657 hw = &pf->hw; in ixl_if_iov_init()
1658 pf_vsi = &pf->vsi; in ixl_if_iov_init()
1660 pf->vfs = malloc(sizeof(struct ixl_vf) * num_vfs, M_IXL, M_NOWAIT | in ixl_if_iov_init()
1662 if (pf->vfs == NULL) { in ixl_if_iov_init()
1673 1, FALSE, &pf->veb_seid, FALSE, NULL); in ixl_if_iov_init()
1680 if (pf->enable_vf_loopback) in ixl_if_iov_init()
1681 ixl_config_pf_vsi_loopback(pf, true); in ixl_if_iov_init()
1690 pf->num_vfs = num_vfs; in ixl_if_iov_init()
1694 free(pf->vfs, M_IXL); in ixl_if_iov_init()
1695 pf->vfs = NULL; in ixl_if_iov_init()
1702 struct ixl_pf *pf = iflib_get_softc(ctx); in ixl_if_iov_uninit() local
1707 hw = &pf->hw; in ixl_if_iov_uninit()
1709 for (i = 0; i < pf->num_vfs; i++) { in ixl_if_iov_uninit()
1710 if (pf->vfs[i].vsi.seid != 0) in ixl_if_iov_uninit()
1711 i40e_aq_delete_element(hw, pf->vfs[i].vsi.seid, NULL); in ixl_if_iov_uninit()
1712 ixl_pf_qmgr_release(&pf->qmgr, &pf->vfs[i].qtag); in ixl_if_iov_uninit()
1713 ixl_free_filters(&pf->vfs[i].vsi.ftl); in ixl_if_iov_uninit()
1714 ixl_dbg_iov(pf, "VF %d: %d released\n", in ixl_if_iov_uninit()
1715 i, pf->vfs[i].qtag.num_allocated); in ixl_if_iov_uninit()
1716 ixl_dbg_iov(pf, "Unallocated total: %d\n", ixl_pf_qmgr_get_num_free(&pf->qmgr)); in ixl_if_iov_uninit()
1719 if (pf->veb_seid != 0) { in ixl_if_iov_uninit()
1720 i40e_aq_delete_element(hw, pf->veb_seid, NULL); in ixl_if_iov_uninit()
1721 pf->veb_seid = 0; in ixl_if_iov_uninit()
1723 /* Reset PF VSI loopback mode */ in ixl_if_iov_uninit()
1724 if (pf->enable_vf_loopback) in ixl_if_iov_uninit()
1725 ixl_config_pf_vsi_loopback(pf, false); in ixl_if_iov_uninit()
1727 vfs = pf->vfs; in ixl_if_iov_uninit()
1728 num_vfs = pf->num_vfs; in ixl_if_iov_uninit()
1730 pf->vfs = NULL; in ixl_if_iov_uninit()
1731 pf->num_vfs = 0; in ixl_if_iov_uninit()
1740 ixl_vf_reserve_queues(struct ixl_pf *pf, struct ixl_vf *vf, int num_queues) in ixl_vf_reserve_queues() argument
1742 device_t dev = pf->dev; in ixl_vf_reserve_queues()
1756 error = ixl_pf_qmgr_alloc_scattered(&pf->qmgr, num_queues, &vf->qtag); in ixl_vf_reserve_queues()
1763 ixl_dbg_iov(pf, "VF %d: %d allocated, %d active\n", in ixl_vf_reserve_queues()
1765 ixl_dbg_iov(pf, "Unallocated total: %d\n", ixl_pf_qmgr_get_num_free(&pf->qmgr)); in ixl_vf_reserve_queues()
1773 struct ixl_pf *pf = iflib_get_softc(ctx); in ixl_if_iov_vf_add() local
1781 vf = &pf->vfs[vfnum]; in ixl_if_iov_vf_add()
1783 vf->vsi.back = pf; in ixl_if_iov_vf_add()
1786 /* Reserve queue allocation from PF */ in ixl_if_iov_vf_add()
1788 error = ixl_vf_reserve_queues(pf, vf, vf_num_queues); in ixl_if_iov_vf_add()
1792 error = ixl_vf_setup_vsi(pf, vf); in ixl_if_iov_vf_add()
1818 ixl_reset_vf(pf, vf); in ixl_if_iov_vf_add()