Lines Matching +full:mac +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2013 - 2019 Intel Corporation. */
9 * fm10k_reset_hw_pf - PF hardware reset
39 hw->mac.reset_while_pending++; in fm10k_reset_hw_pf()
68 * fm10k_is_ari_hierarchy_pf - Indicate ARI hierarchy support
81 * fm10k_init_hw_pf - PF hardware initialization
107 fm10k_write_reg(hw, FM10K_ITR2(i), i - 1); in fm10k_init_hw_pf()
114 (hw->mac.default_vid << FM10K_TXQCTL_VID_SHIFT); in fm10k_init_hw_pf()
117 /* configure rings for 256 Queue / 32 Descriptor cache mode */ in fm10k_init_hw_pf()
139 switch (hw->bus.speed) { in fm10k_init_hw_pf()
142 hw->mac.itr_scale = FM10K_TDLEN_ITR_SCALE_GEN1; in fm10k_init_hw_pf()
146 hw->mac.itr_scale = FM10K_TDLEN_ITR_SCALE_GEN2; in fm10k_init_hw_pf()
150 hw->mac.itr_scale = FM10K_TDLEN_ITR_SCALE_GEN3; in fm10k_init_hw_pf()
155 hw->mac.itr_scale = FM10K_TDLEN_ITR_SCALE_GEN3; in fm10k_init_hw_pf()
175 hw->mac.max_queues = FM10K_MAX_QUEUES_PF; in fm10k_init_hw_pf()
178 hw->iov.total_vfs = fm10k_is_ari_hierarchy_pf(hw) ? 64 : 7; in fm10k_init_hw_pf()
184 * fm10k_update_vlan_pf - Update status of VLAN ID in VLAN filter table
192 * standard set/clear that supports one bit a multi-bit write is
203 /* VLAN multi-bit write: in fm10k_update_vlan_pf()
204 * The multi-bit write has several parts to it. in fm10k_update_vlan_pf()
207 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ in fm10k_update_vlan_pf()
209 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ in fm10k_update_vlan_pf()
226 len -= 32 - bit, reg++, bit = 0) { in fm10k_update_vlan_pf()
231 mask = (~(u32)0 >> ((len < 31) ? 31 - len : 0)) << bit; in fm10k_update_vlan_pf()
243 * fm10k_read_mac_addr_pf - Read device MAC address
246 * Reads the device MAC address from the SM_AREA and stores the value.
273 ether_addr_copy(hw->mac.perm_addr, perm_addr); in fm10k_read_mac_addr_pf()
274 ether_addr_copy(hw->mac.addr, perm_addr); in fm10k_read_mac_addr_pf()
280 * fm10k_glort_valid_pf - Validate that the provided glort is valid
288 glort &= hw->mac.dglort_map >> FM10K_DGLORTMAP_MASK_SHIFT; in fm10k_glort_valid_pf()
290 return glort == (hw->mac.dglort_map & FM10K_DGLORTMAP_NONE); in fm10k_glort_valid_pf()
294 * fm10k_update_xc_addr_pf - Update device addresses
297 * @mac: MAC address to add/remove from table
303 * that the given logical port add/remove the given L2 MAC/VLAN address.
306 const u8 *mac, u16 vid, bool add, u8 flags) in fm10k_update_xc_addr_pf() argument
308 struct fm10k_mbx_info *mbx = &hw->mbx; in fm10k_update_xc_addr_pf()
320 mac_update.mac_lower = cpu_to_le32(((u32)mac[2] << 24) | in fm10k_update_xc_addr_pf()
321 ((u32)mac[3] << 16) | in fm10k_update_xc_addr_pf()
322 ((u32)mac[4] << 8) | in fm10k_update_xc_addr_pf()
323 ((u32)mac[5])); in fm10k_update_xc_addr_pf()
324 mac_update.mac_upper = cpu_to_le16(((u16)mac[0] << 8) | in fm10k_update_xc_addr_pf()
325 ((u16)mac[1])); in fm10k_update_xc_addr_pf()
337 return mbx->ops.enqueue_tx(hw, mbx, msg); in fm10k_update_xc_addr_pf()
341 * fm10k_update_uc_addr_pf - Update device unicast addresses
344 * @mac: MAC address to add/remove from table
353 const u8 *mac, u16 vid, bool add, u8 flags) in fm10k_update_uc_addr_pf() argument
355 /* verify MAC address is valid */ in fm10k_update_uc_addr_pf()
356 if (!is_valid_ether_addr(mac)) in fm10k_update_uc_addr_pf()
359 return fm10k_update_xc_addr_pf(hw, glort, mac, vid, add, flags); in fm10k_update_uc_addr_pf()
363 * fm10k_update_mc_addr_pf - Update device multicast addresses
366 * @mac: MAC address to add/remove from table
370 * This function is used to add or remove multicast MAC addresses for
374 const u8 *mac, u16 vid, bool add) in fm10k_update_mc_addr_pf() argument
377 if (!is_multicast_ether_addr(mac)) in fm10k_update_mc_addr_pf()
380 return fm10k_update_xc_addr_pf(hw, glort, mac, vid, add, 0); in fm10k_update_mc_addr_pf()
384 * fm10k_update_xcast_mode_pf - Request update of multicast mode
387 * @mode: integer value indicating mode being requested
389 * This function will attempt to request a higher mode for the port
391 * promiscuous mode of operation.
393 static s32 fm10k_update_xcast_mode_pf(struct fm10k_hw *hw, u16 glort, u8 mode) in fm10k_update_xcast_mode_pf() argument
395 struct fm10k_mbx_info *mbx = &hw->mbx; in fm10k_update_xcast_mode_pf()
398 if (mode > FM10K_XCAST_MODE_NONE) in fm10k_update_xcast_mode_pf()
405 /* write xcast mode as a single u32 value, in fm10k_update_xcast_mode_pf()
407 * upper 16 bits: mode in fm10k_update_xcast_mode_pf()
409 xcast_mode = ((u32)mode << 16) | glort; in fm10k_update_xcast_mode_pf()
411 /* generate message requesting to change xcast mode */ in fm10k_update_xcast_mode_pf()
416 return mbx->ops.enqueue_tx(hw, mbx, msg); in fm10k_update_xcast_mode_pf()
420 * fm10k_update_int_moderator_pf - Update interrupt moderator linked list
423 * This function walks through the MSI-X vector table to determine the
435 for (i = FM10K_ITR_REG_COUNT_PF - 1; i; i--) { in fm10k_update_int_moderator_pf()
444 if (!hw->iov.num_vfs) in fm10k_update_int_moderator_pf()
452 * fm10k_update_lport_state_pf - Notify the switch of a change in port state
463 struct fm10k_mbx_info *mbx = &hw->mbx; in fm10k_update_lport_state_pf()
474 /* reset multicast mode if deleting lport */ in fm10k_update_lport_state_pf()
487 return mbx->ops.enqueue_tx(hw, mbx, msg); in fm10k_update_lport_state_pf()
491 * fm10k_configure_dglort_map_pf - Configures GLORT entry and queues
511 if ((dglort->idx > 7) || (dglort->rss_l > 7) || (dglort->pc_l > 3) || in fm10k_configure_dglort_map_pf()
512 (dglort->vsi_l > 6) || (dglort->vsi_b > 64) || in fm10k_configure_dglort_map_pf()
513 (dglort->queue_l > 8) || (dglort->queue_b >= 256)) in fm10k_configure_dglort_map_pf()
517 queue_count = BIT(dglort->rss_l + dglort->pc_l); in fm10k_configure_dglort_map_pf()
518 vsi_count = BIT(dglort->vsi_l + dglort->queue_l); in fm10k_configure_dglort_map_pf()
519 glort = dglort->glort; in fm10k_configure_dglort_map_pf()
520 q_idx = dglort->queue_b; in fm10k_configure_dglort_map_pf()
534 queue_count = BIT(dglort->queue_l + dglort->rss_l + dglort->vsi_l); in fm10k_configure_dglort_map_pf()
535 pc_count = BIT(dglort->pc_l); in fm10k_configure_dglort_map_pf()
539 q_idx = pc + dglort->queue_b; in fm10k_configure_dglort_map_pf()
554 dglortdec = ((u32)(dglort->rss_l) << FM10K_DGLORTDEC_RSSLENGTH_SHIFT) | in fm10k_configure_dglort_map_pf()
555 ((u32)(dglort->queue_b) << FM10K_DGLORTDEC_QBASE_SHIFT) | in fm10k_configure_dglort_map_pf()
556 ((u32)(dglort->pc_l) << FM10K_DGLORTDEC_PCLENGTH_SHIFT) | in fm10k_configure_dglort_map_pf()
557 ((u32)(dglort->vsi_b) << FM10K_DGLORTDEC_VSIBASE_SHIFT) | in fm10k_configure_dglort_map_pf()
558 ((u32)(dglort->vsi_l) << FM10K_DGLORTDEC_VSILENGTH_SHIFT) | in fm10k_configure_dglort_map_pf()
559 ((u32)(dglort->queue_l)); in fm10k_configure_dglort_map_pf()
560 if (dglort->inner_rss) in fm10k_configure_dglort_map_pf()
564 dglortmap = (dglort->idx == fm10k_dglort_default) ? in fm10k_configure_dglort_map_pf()
566 dglortmap <<= dglort->vsi_l + dglort->queue_l + dglort->shared_l; in fm10k_configure_dglort_map_pf()
567 dglortmap |= dglort->glort; in fm10k_configure_dglort_map_pf()
570 fm10k_write_reg(hw, FM10K_DGLORTDEC(dglort->idx), dglortdec); in fm10k_configure_dglort_map_pf()
571 fm10k_write_reg(hw, FM10K_DGLORTMAP(dglort->idx), dglortmap); in fm10k_configure_dglort_map_pf()
578 u16 num_pools = hw->iov.num_pools; in fm10k_queues_per_pool()
586 u16 num_vfs = hw->iov.num_vfs; in fm10k_vf_queue_index()
589 vf_q_idx -= fm10k_queues_per_pool(hw) * (num_vfs - vf_idx); in fm10k_vf_queue_index()
596 u16 num_pools = hw->iov.num_pools; in fm10k_vectors_per_pool()
612 * fm10k_iov_assign_resources_pf - Assign pool resources for virtualization
618 * the PF for SR-IOV and VMDq
624 u32 vid = hw->mac.default_vid << FM10K_TXQCTL_VID_SHIFT; in fm10k_iov_assign_resources_pf()
632 if ((num_vfs > num_pools) || (num_vfs > hw->iov.total_vfs)) in fm10k_iov_assign_resources_pf()
636 hw->iov.num_vfs = num_vfs; in fm10k_iov_assign_resources_pf()
637 hw->iov.num_pools = num_pools; in fm10k_iov_assign_resources_pf()
648 /* establish TCs with -1 credits and no quanta to prevent transmit */ in fm10k_iov_assign_resources_pf()
657 for (i = FM10K_VFMBMEM_LEN * num_vfs; i--;) in fm10k_iov_assign_resources_pf()
676 if (!(i & (vpp - 1))) in fm10k_iov_assign_resources_pf()
677 fm10k_write_reg(hw, FM10K_ITR2(i), i - vpp); in fm10k_iov_assign_resources_pf()
679 fm10k_write_reg(hw, FM10K_ITR2(i), i - 1); in fm10k_iov_assign_resources_pf()
684 fm10k_vf_vector_index(hw, num_vfs - 1)); in fm10k_iov_assign_resources_pf()
727 * fm10k_iov_configure_tc_pf - Configure the shaping group for VF
742 if (vf_idx >= hw->iov.num_vfs) in fm10k_iov_configure_tc_pf()
746 switch (hw->bus.speed) { in fm10k_iov_configure_tc_pf()
788 * fm10k_iov_assign_int_moderator_pf - Add VF interrupts to moderator list
792 * Update the interrupt moderator linked list to include any MSI-X
793 * interrupts which the VF has enabled in the MSI-X vector table.
800 if (vf_idx >= hw->iov.num_vfs) in fm10k_iov_assign_int_moderator_pf()
808 for (i = vf_v_limit - 1; i > vf_v_idx; i--) { in fm10k_iov_assign_int_moderator_pf()
814 if (vf_idx == (hw->iov.num_vfs - 1)) in fm10k_iov_assign_int_moderator_pf()
823 * fm10k_iov_assign_default_mac_vlan_pf - Assign a MAC and VLAN to VF
827 * Assign a MAC address and default VLAN to a VF and notify it of the update
838 if (!vf_info || vf_info->vf_idx >= hw->iov.num_vfs) in fm10k_iov_assign_default_mac_vlan_pf()
842 qmap_stride = (hw->iov.num_vfs > 8) ? 32 : 256; in fm10k_iov_assign_default_mac_vlan_pf()
846 vf_idx = vf_info->vf_idx; in fm10k_iov_assign_default_mac_vlan_pf()
855 if (vf_info->pf_vid) in fm10k_iov_assign_default_mac_vlan_pf()
856 vf_vid = vf_info->pf_vid | FM10K_VLAN_OVERRIDE; in fm10k_iov_assign_default_mac_vlan_pf()
858 vf_vid = vf_info->sw_vid; in fm10k_iov_assign_default_mac_vlan_pf()
863 vf_info->mac, vf_vid); in fm10k_iov_assign_default_mac_vlan_pf()
877 if (vf_info->mbx.ops.enqueue_tx) { in fm10k_iov_assign_default_mac_vlan_pf()
878 err = vf_info->mbx.ops.enqueue_tx(hw, &vf_info->mbx, msg); in fm10k_iov_assign_default_mac_vlan_pf()
885 * the VF driver is not running. It should thus be safe to re-map in fm10k_iov_assign_default_mac_vlan_pf()
886 * queues and use the registers to pass the MAC address so that the VF in fm10k_iov_assign_default_mac_vlan_pf()
907 /* Update base address registers to contain MAC address */ in fm10k_iov_assign_default_mac_vlan_pf()
908 if (is_valid_ether_addr(vf_info->mac)) { in fm10k_iov_assign_default_mac_vlan_pf()
909 tdbal = (((u32)vf_info->mac[3]) << 24) | in fm10k_iov_assign_default_mac_vlan_pf()
910 (((u32)vf_info->mac[4]) << 16) | in fm10k_iov_assign_default_mac_vlan_pf()
911 (((u32)vf_info->mac[5]) << 8); in fm10k_iov_assign_default_mac_vlan_pf()
914 (((u32)vf_info->mac[0]) << 16) | in fm10k_iov_assign_default_mac_vlan_pf()
915 (((u32)vf_info->mac[1]) << 8) | in fm10k_iov_assign_default_mac_vlan_pf()
916 ((u32)vf_info->mac[2]); in fm10k_iov_assign_default_mac_vlan_pf()
923 /* Provide the VF the ITR scale, using software-defined fields in TDLEN in fm10k_iov_assign_default_mac_vlan_pf()
927 fm10k_write_reg(hw, FM10K_TDLEN(vf_q_idx), hw->mac.itr_scale << in fm10k_iov_assign_default_mac_vlan_pf()
937 * fm10k_iov_reset_resources_pf - Reassign queues and interrupts to a VF
949 u8 vf_idx = vf_info->vf_idx; in fm10k_iov_reset_resources_pf()
953 if (vf_idx >= hw->iov.num_vfs) in fm10k_iov_reset_resources_pf()
960 vf_info->mbx.timeout = 0; in fm10k_iov_reset_resources_pf()
961 if (vf_info->mbx.ops.disconnect) in fm10k_iov_reset_resources_pf()
962 vf_info->mbx.ops.disconnect(hw, &vf_info->mbx); in fm10k_iov_reset_resources_pf()
969 qmap_stride = (hw->iov.num_vfs > 8) ? 32 : 256; in fm10k_iov_reset_resources_pf()
983 if (vf_info->pf_vid) in fm10k_iov_reset_resources_pf()
984 vf_vid = vf_info->pf_vid; in fm10k_iov_reset_resources_pf()
986 vf_vid = vf_info->sw_vid; in fm10k_iov_reset_resources_pf()
1004 /* reset TC with -1 credits and no quanta to prevent transmit */ in fm10k_iov_reset_resources_pf()
1012 hw->mac.ops.update_int_moderator(hw); in fm10k_iov_reset_resources_pf()
1014 hw->iov.ops.assign_int_moderator(hw, vf_idx - 1); in fm10k_iov_reset_resources_pf()
1017 if (vf_idx == (hw->iov.num_vfs - 1)) in fm10k_iov_reset_resources_pf()
1024 fm10k_write_reg(hw, FM10K_ITR2(vf_v_idx), vf_v_idx - 1); in fm10k_iov_reset_resources_pf()
1027 for (i = FM10K_VFMBMEM_LEN; i--;) in fm10k_iov_reset_resources_pf()
1029 for (i = FM10K_VLAN_TABLE_SIZE; i--;) in fm10k_iov_reset_resources_pf()
1030 fm10k_write_reg(hw, FM10K_VLAN_TABLE(vf_info->vsi, i), 0); in fm10k_iov_reset_resources_pf()
1031 for (i = FM10K_RETA_SIZE; i--;) in fm10k_iov_reset_resources_pf()
1032 fm10k_write_reg(hw, FM10K_RETA(vf_info->vsi, i), 0); in fm10k_iov_reset_resources_pf()
1033 for (i = FM10K_RSSRK_SIZE; i--;) in fm10k_iov_reset_resources_pf()
1034 fm10k_write_reg(hw, FM10K_RSSRK(vf_info->vsi, i), 0); in fm10k_iov_reset_resources_pf()
1035 fm10k_write_reg(hw, FM10K_MRQC(vf_info->vsi), 0); in fm10k_iov_reset_resources_pf()
1037 /* Update base address registers to contain MAC address */ in fm10k_iov_reset_resources_pf()
1038 if (is_valid_ether_addr(vf_info->mac)) { in fm10k_iov_reset_resources_pf()
1039 tdbal = (((u32)vf_info->mac[3]) << 24) | in fm10k_iov_reset_resources_pf()
1040 (((u32)vf_info->mac[4]) << 16) | in fm10k_iov_reset_resources_pf()
1041 (((u32)vf_info->mac[5]) << 8); in fm10k_iov_reset_resources_pf()
1043 (((u32)vf_info->mac[0]) << 16) | in fm10k_iov_reset_resources_pf()
1044 (((u32)vf_info->mac[1]) << 8) | in fm10k_iov_reset_resources_pf()
1045 ((u32)vf_info->mac[2]); in fm10k_iov_reset_resources_pf()
1049 for (i = queues_per_pool; i--;) { in fm10k_iov_reset_resources_pf()
1056 hw->mac.itr_scale << in fm10k_iov_reset_resources_pf()
1072 * fm10k_iov_set_lport_pf - Assign and enable a logical port for a given VF
1079 * setting the flags so that it can enable an Rx mode.
1085 u16 glort = (hw->mac.dglort_map + lport_idx) & FM10K_DGLORTMAP_NONE; in fm10k_iov_set_lport_pf()
1091 vf_info->vf_flags = flags | FM10K_VF_FLAG_NONE_CAPABLE; in fm10k_iov_set_lport_pf()
1092 vf_info->glort = glort; in fm10k_iov_set_lport_pf()
1098 * fm10k_iov_reset_lport_pf - Disable a logical port for a given VF
1103 * setting the flags so that it cannot enable any Rx mode.
1113 fm10k_update_lport_state_pf(hw, vf_info->glort, 1, false); in fm10k_iov_reset_lport_pf()
1117 vf_info->mbx.ops.enqueue_tx(hw, &vf_info->mbx, msg); in fm10k_iov_reset_lport_pf()
1121 vf_info->vf_flags = 0; in fm10k_iov_reset_lport_pf()
1122 vf_info->glort = 0; in fm10k_iov_reset_lport_pf()
1126 * fm10k_iov_update_stats_pf - Updates hardware related statistics for VFs
1146 * fm10k_iov_msg_msix_pf - Message handler for MSI-X request from VF
1151 * This function is a default handler for MSI-X requests from the VF. The
1159 u8 vf_idx = vf_info->vf_idx; in fm10k_iov_msg_msix_pf()
1161 return hw->iov.ops.assign_int_moderator(hw, vf_idx); in fm10k_iov_msg_msix_pf()
1165 * fm10k_iov_select_vid - Select correct default VLAN ID
1175 return vf_info->pf_vid ? vf_info->pf_vid : vf_info->sw_vid; in fm10k_iov_select_vid()
1176 else if (vf_info->pf_vid && vid != vf_info->pf_vid) in fm10k_iov_select_vid()
1183 * fm10k_iov_msg_mac_vlan_pf - Message handler for MAC/VLAN request from VF
1188 * This function is a default handler for MAC/VLAN requests from the VF.
1196 u8 mac[ETH_ALEN]; in fm10k_iov_msg_mac_vlan_pf() local
1218 /* if the length field has been set, this is a multi-bit in fm10k_iov_msg_mac_vlan_pf()
1219 * update request. For multi-bit requests, simply disallow in fm10k_iov_msg_mac_vlan_pf()
1223 * on a VLAN it was not assigned. In the single-bit case, we in fm10k_iov_msg_mac_vlan_pf()
1229 /* prevent multi-bit requests when PF has in fm10k_iov_msg_mac_vlan_pf()
1232 if (vf_info->pf_vid) in fm10k_iov_msg_mac_vlan_pf()
1243 err = hw->mac.ops.update_vlan(hw, vid, vf_info->vsi, set); in fm10k_iov_msg_mac_vlan_pf()
1249 /* record unicast MAC address requested */ in fm10k_iov_msg_mac_vlan_pf()
1250 err = fm10k_tlv_attr_get_mac_vlan(result, mac, &vlan); in fm10k_iov_msg_mac_vlan_pf()
1254 /* block attempts to set MAC for a locked device */ in fm10k_iov_msg_mac_vlan_pf()
1255 if (is_valid_ether_addr(vf_info->mac) && in fm10k_iov_msg_mac_vlan_pf()
1256 !ether_addr_equal(mac, vf_info->mac)) in fm10k_iov_msg_mac_vlan_pf()
1269 err = hw->mac.ops.update_uc_addr(hw, vf_info->glort, in fm10k_iov_msg_mac_vlan_pf()
1270 mac, vlan, set, 0); in fm10k_iov_msg_mac_vlan_pf()
1276 /* record multicast MAC address requested */ in fm10k_iov_msg_mac_vlan_pf()
1277 err = fm10k_tlv_attr_get_mac_vlan(result, mac, &vlan); in fm10k_iov_msg_mac_vlan_pf()
1282 if (!(vf_info->vf_flags & FM10K_VF_FLAG_MULTI_ENABLED)) in fm10k_iov_msg_mac_vlan_pf()
1295 err = hw->mac.ops.update_mc_addr(hw, vf_info->glort, in fm10k_iov_msg_mac_vlan_pf()
1296 mac, vlan, set); in fm10k_iov_msg_mac_vlan_pf()
1303 * fm10k_iov_supported_xcast_mode_pf - Determine best match for xcast mode
1305 * @mode: Requested xcast mode
1307 * This function outputs the mode that most closely matches the requested
1308 * mode. If not modes match it will request we disable the port
1311 u8 mode) in fm10k_iov_supported_xcast_mode_pf() argument
1313 u8 vf_flags = vf_info->vf_flags; in fm10k_iov_supported_xcast_mode_pf()
1315 /* match up mode to capabilities as best as possible */ in fm10k_iov_supported_xcast_mode_pf()
1316 switch (mode) { in fm10k_iov_supported_xcast_mode_pf()
1342 * fm10k_iov_msg_lport_state_pf - Message handler for port state requests
1357 u8 mode = 0; in fm10k_iov_msg_lport_state_pf() local
1359 /* verify VF is allowed to enable even minimal mode */ in fm10k_iov_msg_lport_state_pf()
1360 if (!(vf_info->vf_flags & FM10K_VF_FLAG_NONE_CAPABLE)) in fm10k_iov_msg_lport_state_pf()
1366 /* XCAST mode update requested */ in fm10k_iov_msg_lport_state_pf()
1367 err = fm10k_tlv_attr_get_u8(result, &mode); in fm10k_iov_msg_lport_state_pf()
1372 mode = fm10k_iov_supported_xcast_mode_pf(vf_info, mode); in fm10k_iov_msg_lport_state_pf()
1374 /* if mode is not currently enabled, enable it */ in fm10k_iov_msg_lport_state_pf()
1375 if (!(FM10K_VF_FLAG_ENABLED(vf_info) & BIT(mode))) in fm10k_iov_msg_lport_state_pf()
1376 fm10k_update_xcast_mode_pf(hw, vf_info->glort, mode); in fm10k_iov_msg_lport_state_pf()
1378 /* swap mode back to a bit flag */ in fm10k_iov_msg_lport_state_pf()
1379 mode = FM10K_VF_FLAG_SET_MODE(mode); in fm10k_iov_msg_lport_state_pf()
1383 err = fm10k_update_lport_state_pf(hw, vf_info->glort, in fm10k_iov_msg_lport_state_pf()
1387 * that we actually re-enable the LPORT state below. Note that in fm10k_iov_msg_lport_state_pf()
1392 vf_info->vf_flags = FM10K_VF_FLAG_CAPABLE(vf_info); in fm10k_iov_msg_lport_state_pf()
1395 hw->iov.ops.configure_tc(hw, vf_info->vf_idx, vf_info->rate); in fm10k_iov_msg_lport_state_pf()
1397 /* set mode for minimal functionality */ in fm10k_iov_msg_lport_state_pf()
1398 mode = FM10K_VF_FLAG_SET_MODE_NONE; in fm10k_iov_msg_lport_state_pf()
1403 mbx->ops.enqueue_tx(hw, mbx, msg); in fm10k_iov_msg_lport_state_pf()
1407 if (!err && (!FM10K_VF_FLAG_ENABLED(vf_info) != !mode)) in fm10k_iov_msg_lport_state_pf()
1408 err = fm10k_update_lport_state_pf(hw, vf_info->glort, 1, in fm10k_iov_msg_lport_state_pf()
1409 !!mode); in fm10k_iov_msg_lport_state_pf()
1412 mode |= FM10K_VF_FLAG_CAPABLE(vf_info); in fm10k_iov_msg_lport_state_pf()
1414 vf_info->vf_flags = mode; in fm10k_iov_msg_lport_state_pf()
1420 * fm10k_update_hw_stats_pf - Updates hardware related statistics of PF
1439 &stats->timeout); in fm10k_update_hw_stats_pf()
1440 ur = fm10k_read_hw_stats_32b(hw, FM10K_STATS_UR, &stats->ur); in fm10k_update_hw_stats_pf()
1441 ca = fm10k_read_hw_stats_32b(hw, FM10K_STATS_CA, &stats->ca); in fm10k_update_hw_stats_pf()
1442 um = fm10k_read_hw_stats_32b(hw, FM10K_STATS_UM, &stats->um); in fm10k_update_hw_stats_pf()
1443 xec = fm10k_read_hw_stats_32b(hw, FM10K_STATS_XEC, &stats->xec); in fm10k_update_hw_stats_pf()
1445 &stats->vlan_drop); in fm10k_update_hw_stats_pf()
1449 &stats->loopback_drop); in fm10k_update_hw_stats_pf()
1452 &stats->nodesc_drop); in fm10k_update_hw_stats_pf()
1459 /* drop non-ID bits and set VALID ID bit */ in fm10k_update_hw_stats_pf()
1464 if (stats->stats_idx == id) { in fm10k_update_hw_stats_pf()
1465 stats->timeout.count += timeout; in fm10k_update_hw_stats_pf()
1466 stats->ur.count += ur; in fm10k_update_hw_stats_pf()
1467 stats->ca.count += ca; in fm10k_update_hw_stats_pf()
1468 stats->um.count += um; in fm10k_update_hw_stats_pf()
1469 stats->xec.count += xec; in fm10k_update_hw_stats_pf()
1470 stats->vlan_drop.count += vlan_drop; in fm10k_update_hw_stats_pf()
1471 stats->loopback_drop.count += loopback_drop; in fm10k_update_hw_stats_pf()
1472 stats->nodesc_drop.count += nodesc_drop; in fm10k_update_hw_stats_pf()
1476 fm10k_update_hw_base_32b(&stats->timeout, timeout); in fm10k_update_hw_stats_pf()
1477 fm10k_update_hw_base_32b(&stats->ur, ur); in fm10k_update_hw_stats_pf()
1478 fm10k_update_hw_base_32b(&stats->ca, ca); in fm10k_update_hw_stats_pf()
1479 fm10k_update_hw_base_32b(&stats->um, um); in fm10k_update_hw_stats_pf()
1480 fm10k_update_hw_base_32b(&stats->xec, xec); in fm10k_update_hw_stats_pf()
1481 fm10k_update_hw_base_32b(&stats->vlan_drop, vlan_drop); in fm10k_update_hw_stats_pf()
1482 fm10k_update_hw_base_32b(&stats->loopback_drop, loopback_drop); in fm10k_update_hw_stats_pf()
1483 fm10k_update_hw_base_32b(&stats->nodesc_drop, nodesc_drop); in fm10k_update_hw_stats_pf()
1484 stats->stats_idx = id; in fm10k_update_hw_stats_pf()
1487 fm10k_update_hw_stats_q(hw, stats->q, 0, hw->mac.max_queues); in fm10k_update_hw_stats_pf()
1491 * fm10k_rebind_hw_stats_pf - Resets base for hardware statistics of PF
1502 fm10k_unbind_hw_stats_32b(&stats->timeout); in fm10k_rebind_hw_stats_pf()
1503 fm10k_unbind_hw_stats_32b(&stats->ur); in fm10k_rebind_hw_stats_pf()
1504 fm10k_unbind_hw_stats_32b(&stats->ca); in fm10k_rebind_hw_stats_pf()
1505 fm10k_unbind_hw_stats_32b(&stats->um); in fm10k_rebind_hw_stats_pf()
1506 fm10k_unbind_hw_stats_32b(&stats->xec); in fm10k_rebind_hw_stats_pf()
1507 fm10k_unbind_hw_stats_32b(&stats->vlan_drop); in fm10k_rebind_hw_stats_pf()
1508 fm10k_unbind_hw_stats_32b(&stats->loopback_drop); in fm10k_rebind_hw_stats_pf()
1509 fm10k_unbind_hw_stats_32b(&stats->nodesc_drop); in fm10k_rebind_hw_stats_pf()
1512 fm10k_unbind_hw_stats_q(stats->q, 0, hw->mac.max_queues); in fm10k_rebind_hw_stats_pf()
1519 * fm10k_set_dma_mask_pf - Configures PhyAddrSpace to limit DMA to system
1535 * fm10k_get_fault_pf - Record a fault in one of the interface units
1566 fault->address = fm10k_read_reg(hw, type + FM10K_FAULT_ADDR_HI); in fm10k_get_fault_pf()
1567 fault->address <<= 32; in fm10k_get_fault_pf()
1568 fault->address |= fm10k_read_reg(hw, type + FM10K_FAULT_ADDR_LO); in fm10k_get_fault_pf()
1569 fault->specinfo = fm10k_read_reg(hw, type + FM10K_FAULT_SPECINFO); in fm10k_get_fault_pf()
1576 fault->func = 0; in fm10k_get_fault_pf()
1578 fault->func = 1 + FIELD_GET(FM10K_FAULT_FUNC_VF_MASK, func); in fm10k_get_fault_pf()
1581 fault->type = func & FM10K_FAULT_FUNC_TYPE_MASK; in fm10k_get_fault_pf()
1587 * fm10k_request_lport_map_pf - Request LPORT map from the switch API
1593 struct fm10k_mbx_info *mbx = &hw->mbx; in fm10k_request_lport_map_pf()
1600 return mbx->ops.enqueue_tx(hw, mbx, msg); in fm10k_request_lport_map_pf()
1604 * fm10k_get_host_state_pf - Returns the state of the switch and mailbox
1634 * fm10k_msg_lport_map_pf - Message handler for lport_map message from SM
1663 if (((~(mask - 1) & mask) + mask) & FM10K_DGLORTMAP_NONE) in fm10k_msg_lport_map_pf()
1667 hw->mac.dglort_map = dglort_map; in fm10k_msg_lport_map_pf()
1678 * fm10k_msg_update_pvid_pf - Message handler for port VLAN message from SM
1710 hw->mac.default_vid = pvid; in fm10k_msg_update_pvid_pf()
1716 * fm10k_record_global_table_data - Move global table data to swapi table info
1727 to->used = le32_to_cpu(from->used); in fm10k_record_global_table_data()
1728 to->avail = le32_to_cpu(from->avail); in fm10k_record_global_table_data()
1738 * fm10k_msg_err_pf - Message handler for error reply
1759 fm10k_record_global_table_data(&err_msg.mac, &hw->swapi.mac); in fm10k_msg_err_pf()
1760 fm10k_record_global_table_data(&err_msg.nexthop, &hw->swapi.nexthop); in fm10k_msg_err_pf()
1761 fm10k_record_global_table_data(&err_msg.ffu, &hw->swapi.ffu); in fm10k_msg_err_pf()
1764 hw->swapi.status = le32_to_cpu(err_msg.status); in fm10k_msg_err_pf()
1816 return fm10k_sm_mbx_init(hw, &hw->mbx, fm10k_msg_data_pf); in fm10k_get_invariants_pf()
1820 .mac = fm10k_mac_pf,