• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/qlnx/qlnxe/

Lines Matching defs:p_hwfn

72 enum _ecore_status_t ecore_l2_alloc(struct ecore_hwfn *p_hwfn)
78 if (!ECORE_IS_L2_PERSONALITY(p_hwfn))
81 p_l2_info = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_l2_info));
84 p_hwfn->p_l2_info = p_l2_info;
86 if (IS_PF(p_hwfn->p_dev)) {
87 p_l2_info->queues = RESC_NUM(p_hwfn, ECORE_L2_QUEUE);
91 ecore_vf_get_num_rxqs(p_hwfn, &rx);
92 ecore_vf_get_num_txqs(p_hwfn, &tx);
97 pp_qids = OSAL_VZALLOC(p_hwfn->p_dev,
105 pp_qids[i] = OSAL_VZALLOC(p_hwfn->p_dev,
112 if (OSAL_MUTEX_ALLOC(p_hwfn, &p_l2_info->lock))
119 void ecore_l2_setup(struct ecore_hwfn *p_hwfn)
121 if (!ECORE_IS_L2_PERSONALITY(p_hwfn))
124 OSAL_MUTEX_INIT(&p_hwfn->p_l2_info->lock);
127 void ecore_l2_free(struct ecore_hwfn *p_hwfn)
131 if (!ECORE_IS_L2_PERSONALITY(p_hwfn))
134 if (p_hwfn->p_l2_info == OSAL_NULL)
137 if (p_hwfn->p_l2_info->pp_qid_usage == OSAL_NULL)
141 for (i = 0; i < p_hwfn->p_l2_info->queues; i++) {
142 if (p_hwfn->p_l2_info->pp_qid_usage[i] == OSAL_NULL)
144 OSAL_VFREE(p_hwfn->p_dev,
145 p_hwfn->p_l2_info->pp_qid_usage[i]);
146 p_hwfn->p_l2_info->pp_qid_usage[i] = OSAL_NULL;
151 if (i == p_hwfn->p_l2_info->queues)
152 OSAL_MUTEX_DEALLOC(&p_hwfn->p_l2_info->lock);
155 OSAL_VFREE(p_hwfn->p_dev, p_hwfn->p_l2_info->pp_qid_usage);
156 p_hwfn->p_l2_info->pp_qid_usage = OSAL_NULL;
159 OSAL_VFREE(p_hwfn->p_dev, p_hwfn->p_l2_info);
160 p_hwfn->p_l2_info = OSAL_NULL;
164 static bool ecore_eth_queue_qid_usage_add(struct ecore_hwfn *p_hwfn,
167 struct ecore_l2_info *p_l2_info = p_hwfn->p_l2_info;
175 DP_NOTICE(p_hwfn, true,
197 static void ecore_eth_queue_qid_usage_del(struct ecore_hwfn *p_hwfn,
200 OSAL_MUTEX_ACQUIRE(&p_hwfn->p_l2_info->lock);
203 p_hwfn->p_l2_info->pp_qid_usage[p_cid->rel.queue_id]);
205 OSAL_MUTEX_RELEASE(&p_hwfn->p_l2_info->lock);
208 void ecore_eth_queue_cid_release(struct ecore_hwfn *p_hwfn,
217 if (IS_PF(p_hwfn->p_dev) && !b_legacy_vf)
218 _ecore_cxt_release_cid(p_hwfn, p_cid->cid, p_cid->vfid);
222 ecore_eth_queue_qid_usage_del(p_hwfn, p_cid);
224 OSAL_VFREE(p_hwfn->p_dev, p_cid);
231 _ecore_eth_queue_to_cid(struct ecore_hwfn *p_hwfn,
240 p_cid = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_cid));
246 p_cid->p_owner = p_hwfn;
266 if (IS_VF(p_hwfn->p_dev)) {
276 rc = ecore_fw_vport(p_hwfn, p_cid->rel.vport_id, &p_cid->abs.vport_id);
280 rc = ecore_fw_l2_queue(p_hwfn, p_cid->rel.queue_id,
289 rc = ecore_fw_vport(p_hwfn, p_cid->rel.stats_id,
302 if (!ecore_eth_queue_qid_usage_add(p_hwfn, p_cid))
308 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
320 OSAL_VFREE(p_hwfn->p_dev, p_cid);
325 ecore_eth_queue_to_cid(struct ecore_hwfn *p_hwfn, u16 opaque_fid,
353 if (IS_PF(p_hwfn->p_dev) && !b_legacy_vf) {
354 if (_ecore_cxt_acquire_cid(p_hwfn, PROTOCOLID_ETH,
356 DP_NOTICE(p_hwfn, true, "Failed to acquire cid\n");
361 p_cid = _ecore_eth_queue_to_cid(p_hwfn, opaque_fid, cid,
363 if ((p_cid == OSAL_NULL) && IS_PF(p_hwfn->p_dev) && !b_legacy_vf)
364 _ecore_cxt_release_cid(p_hwfn, cid, vfid);
370 ecore_eth_queue_to_cid_pf(struct ecore_hwfn *p_hwfn, u16 opaque_fid,
374 return ecore_eth_queue_to_cid(p_hwfn, opaque_fid, p_params, b_is_rx,
378 enum _ecore_status_t ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
389 rc = ecore_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
395 init_data.cid = ecore_spq_get_cid(p_hwfn);
399 rc = ecore_sp_init_request(p_hwfn, &p_ent,
468 if (CHIP_REV_IS_SLOW(p_hwfn->p_dev))
478 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
481 enum _ecore_status_t ecore_sp_vport_start(struct ecore_hwfn *p_hwfn,
484 if (IS_VF(p_hwfn->p_dev))
485 return ecore_vf_pf_vport_start(p_hwfn, p_params->vport_id,
493 return ecore_sp_eth_vport_start(p_hwfn, p_params);
497 ecore_sp_vport_update_rss(struct ecore_hwfn *p_hwfn,
515 rc = ecore_fw_rss_eng(p_hwfn, p_rss->rss_eng_id,
552 DP_VERBOSE(p_hwfn, ECORE_MSG_IFUP,
573 DP_VERBOSE(p_hwfn, ECORE_MSG_IFUP,
577 DP_VERBOSE(p_hwfn, ECORE_MSG_IFUP,
604 ecore_sp_update_accept_mode(struct ecore_hwfn *p_hwfn,
617 if (CHIP_REV_IS_SLOW(p_hwfn->p_dev)) {
618 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
648 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
672 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
733 enum _ecore_status_t ecore_sp_vport_update(struct ecore_hwfn *p_hwfn,
746 if (IS_VF(p_hwfn->p_dev)) {
747 rc = ecore_vf_pf_vport_update(p_hwfn, p_params);
751 rc = ecore_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
757 init_data.cid = ecore_spq_get_cid(p_hwfn);
762 rc = ecore_sp_init_request(p_hwfn, &p_ent,
798 if (CHIP_REV_IS_FPGA(p_hwfn->p_dev))
801 DP_NOTICE(p_hwfn, false, "FPGA - why are we seeing tx-switching? Overriding it\n");
812 rc = ecore_sp_vport_update_rss(p_hwfn, p_ramrod, p_rss_params);
815 ecore_spq_return_entry(p_hwfn, p_ent);
822 ecore_sp_update_accept_mode(p_hwfn, p_ramrod, p_params->accept_flags);
824 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
827 enum _ecore_status_t ecore_sp_vport_stop(struct ecore_hwfn *p_hwfn,
837 if (IS_VF(p_hwfn->p_dev))
838 return ecore_vf_pf_vport_stop(p_hwfn);
840 rc = ecore_fw_vport(p_hwfn, vport_id, &abs_vport_id);
846 init_data.cid = ecore_spq_get_cid(p_hwfn);
850 rc = ecore_sp_init_request(p_hwfn, &p_ent,
859 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
863 ecore_vf_pf_accept_flags(struct ecore_hwfn *p_hwfn,
872 return ecore_vf_pf_vport_update(p_hwfn, &s_params);
894 struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
896 vport_update_params.opaque_fid = p_hwfn->hw_info.opaque_fid;
899 rc = ecore_vf_pf_accept_flags(p_hwfn, &accept_flags);
905 rc = ecore_sp_vport_update(p_hwfn, &vport_update_params,
912 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
918 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
927 ecore_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
939 DP_VERBOSE(p_hwfn, ECORE_MSG_SP, "opaque_fid=0x%x, cid=0x%x, rx_qzone=0x%x, vport_id=0x%x, sb_id=0x%x\n",
949 rc = ecore_sp_init_request(p_hwfn, &p_ent,
976 DP_VERBOSE(p_hwfn, ECORE_MSG_SP, "Queue%s is meant for VF rxq[%02x]\n",
982 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
986 ecore_eth_pf_rx_queue_start(struct ecore_hwfn *p_hwfn,
997 p_hwfn->regview +
1002 __internal_ram_wr(p_hwfn, *pp_prod, sizeof(u32),
1005 return ecore_eth_rxq_start_ramrod(p_hwfn, p_cid,
1012 ecore_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
1025 p_cid = ecore_eth_queue_to_cid_pf(p_hwfn, opaque_fid, true, p_params);
1029 if (IS_PF(p_hwfn->p_dev))
1030 rc = ecore_eth_pf_rx_queue_start(p_hwfn, p_cid,
1036 rc = ecore_vf_pf_rxq_start(p_hwfn, p_cid,
1045 ecore_eth_queue_cid_release(p_hwfn, p_cid);
1052 enum _ecore_status_t ecore_sp_eth_rx_queues_update(struct ecore_hwfn *p_hwfn,
1068 if (IS_VF(p_hwfn->p_dev))
1069 return ecore_vf_pf_rxqs_update(p_hwfn,
1088 rc = ecore_sp_init_request(p_hwfn, &p_ent,
1101 rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1110 ecore_sp_eth_rx_queues_set_default(struct ecore_hwfn *p_hwfn,
1121 if (IS_VF(p_hwfn->p_dev))
1134 rc = ecore_sp_init_request(p_hwfn, &p_ent,
1148 rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1154 ecore_eth_pf_rx_queue_stop(struct ecore_hwfn *p_hwfn,
1169 rc = ecore_sp_init_request(p_hwfn, &p_ent,
1188 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1191 enum _ecore_status_t ecore_eth_rx_queue_stop(struct ecore_hwfn *p_hwfn,
1199 if (IS_PF(p_hwfn->p_dev))
1200 rc = ecore_eth_pf_rx_queue_stop(p_hwfn, p_cid,
1204 rc = ecore_vf_pf_rxq_stop(p_hwfn, p_cid, cqe_completion);
1207 ecore_eth_queue_cid_release(p_hwfn, p_cid);
1212 ecore_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
1228 rc = ecore_sp_init_request(p_hwfn, &p_ent,
1249 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1253 ecore_eth_pf_tx_queue_start(struct ecore_hwfn *p_hwfn,
1262 rc = ecore_eth_txq_start_ramrod(p_hwfn, p_cid,
1264 ecore_get_cm_pq_idx_mcos(p_hwfn, tc));
1270 p_hwfn->doorbells +
1277 ecore_eth_tx_queue_start(struct ecore_hwfn *p_hwfn, u16 opaque_fid,
1286 p_cid = ecore_eth_queue_to_cid_pf(p_hwfn, opaque_fid, false, p_params);
1290 if (IS_PF(p_hwfn->p_dev))
1291 rc = ecore_eth_pf_tx_queue_start(p_hwfn, p_cid, tc,
1295 rc = ecore_vf_pf_txq_start(p_hwfn, p_cid,
1300 ecore_eth_queue_cid_release(p_hwfn, p_cid);
1308 ecore_eth_pf_tx_queue_stop(struct ecore_hwfn *p_hwfn,
1320 rc = ecore_sp_init_request(p_hwfn, &p_ent,
1326 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1329 enum _ecore_status_t ecore_eth_tx_queue_stop(struct ecore_hwfn *p_hwfn,
1335 if (IS_PF(p_hwfn->p_dev))
1336 rc = ecore_eth_pf_tx_queue_stop(p_hwfn, p_cid);
1338 rc = ecore_vf_pf_txq_stop(p_hwfn, p_cid);
1341 ecore_eth_queue_cid_release(p_hwfn, p_cid);
1367 ecore_filter_ucast_common(struct ecore_hwfn *p_hwfn,
1383 rc = ecore_fw_vport(p_hwfn, p_filter_cmd->vport_to_remove_from,
1388 rc = ecore_fw_vport(p_hwfn, p_filter_cmd->vport_to_add_to,
1395 init_data.cid = ecore_spq_get_cid(p_hwfn);
1400 rc = ecore_sp_init_request(p_hwfn, pp_ent,
1412 if (CHIP_REV_IS_SLOW(p_hwfn->p_dev)) {
1413 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
1499 DP_NOTICE(p_hwfn, true,
1514 enum _ecore_status_t ecore_sp_eth_filter_ucast(struct ecore_hwfn *p_hwfn,
1525 rc = ecore_filter_ucast_common(p_hwfn, opaque_fid, p_filter_cmd,
1529 DP_ERR(p_hwfn, "Uni. filter command failed %d\n", rc);
1535 rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1537 DP_ERR(p_hwfn,
1543 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
1556 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
1616 ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
1630 rc = ecore_fw_vport(p_hwfn, p_filter_cmd->vport_to_add_to,
1633 rc = ecore_fw_vport(p_hwfn, p_filter_cmd->vport_to_remove_from,
1640 init_data.cid = ecore_spq_get_cid(p_hwfn);
1641 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
1645 rc = ecore_sp_init_request(p_hwfn, &p_ent,
1649 DP_ERR(p_hwfn, "Multi-cast command failed %d\n", rc);
1682 rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
1684 DP_ERR(p_hwfn, "Multicast filter command failed %d\n", rc);
1705 struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
1708 ecore_vf_pf_filter_mcast(p_hwfn, p_filter_cmd);
1712 rc = ecore_sp_eth_filter_mcast(p_hwfn,
1732 struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
1736 rc = ecore_vf_pf_filter_ucast(p_hwfn, p_filter_cmd);
1740 opaque_fid = p_hwfn->hw_info.opaque_fid;
1741 rc = ecore_sp_eth_filter_ucast(p_hwfn,
1754 static void __ecore_get_vport_pstats_addrlen(struct ecore_hwfn *p_hwfn,
1758 if (IS_PF(p_hwfn->p_dev)) {
1763 struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
1771 static void __ecore_get_vport_pstats(struct ecore_hwfn *p_hwfn,
1779 __ecore_get_vport_pstats_addrlen(p_hwfn, &pstats_addr, &pstats_len,
1783 ecore_memcpy_from(p_hwfn, p_ptt, &pstats,
1802 static void __ecore_get_vport_tstats(struct ecore_hwfn *p_hwfn,
1809 if (IS_PF(p_hwfn->p_dev)) {
1811 TSTORM_PORT_STAT_OFFSET(MFW_PORT(p_hwfn));
1814 struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
1822 ecore_memcpy_from(p_hwfn, p_ptt, &tstats,
1831 static void __ecore_get_vport_ustats_addrlen(struct ecore_hwfn *p_hwfn,
1835 if (IS_PF(p_hwfn->p_dev)) {
1840 struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
1848 static void __ecore_get_vport_ustats(struct ecore_hwfn *p_hwfn,
1856 __ecore_get_vport_ustats_addrlen(p_hwfn, &ustats_addr, &ustats_len,
1860 ecore_memcpy_from(p_hwfn, p_ptt, &ustats,
1877 static void __ecore_get_vport_mstats_addrlen(struct ecore_hwfn *p_hwfn,
1881 if (IS_PF(p_hwfn->p_dev)) {
1886 struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
1894 static void __ecore_get_vport_mstats(struct ecore_hwfn *p_hwfn,
1902 __ecore_get_vport_mstats_addrlen(p_hwfn, &mstats_addr, &mstats_len,
1906 ecore_memcpy_from(p_hwfn, p_ptt, &mstats,
1925 static void __ecore_get_vport_port_stats(struct ecore_hwfn *p_hwfn,
1935 ecore_memcpy_from(p_hwfn, p_ptt, &port_stats,
1936 p_hwfn->mcp_info->port_addr +
1979 if (ECORE_IS_BB(p_hwfn->p_dev)) {
2011 p_common->link_change_count = ecore_rd(p_hwfn, p_ptt,
2012 p_hwfn->mcp_info->port_addr +
2017 void __ecore_get_vport_stats(struct ecore_hwfn *p_hwfn,
2022 __ecore_get_vport_mstats(p_hwfn, p_ptt, stats, statistics_bin);
2023 __ecore_get_vport_ustats(p_hwfn, p_ptt, stats, statistics_bin);
2024 __ecore_get_vport_tstats(p_hwfn, p_ptt, stats);
2025 __ecore_get_vport_pstats(p_hwfn, p_ptt, stats, statistics_bin);
2029 if (CHIP_REV_IS_EMUL(p_hwfn->p_dev))
2033 if (b_get_port_stats && p_hwfn->mcp_info)
2034 __ecore_get_vport_port_stats(p_hwfn, p_ptt, stats);
2046 struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
2048 ecore_ptt_acquire(p_hwfn) : OSAL_NULL;
2053 if (ecore_fw_vport(p_hwfn, 0, &fw_vport)) {
2054 DP_ERR(p_hwfn, "No vport available!\n");
2060 DP_ERR(p_hwfn, "Failed to acquire ptt\n");
2064 b_get_port_stats = IS_PF(p_dev) && IS_LEAD_HWFN(p_hwfn);
2065 __ecore_get_vport_stats(p_hwfn, p_ptt, stats, fw_vport,
2070 ecore_ptt_release(p_hwfn, p_ptt);
2100 struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
2105 ecore_ptt_acquire(p_hwfn) : OSAL_NULL;
2109 DP_ERR(p_hwfn, "Failed to acquire ptt\n");
2114 __ecore_get_vport_mstats_addrlen(p_hwfn, &addr, &len, 0);
2115 ecore_memcpy_to(p_hwfn, p_ptt, addr, &mstats, len);
2118 __ecore_get_vport_ustats_addrlen(p_hwfn, &addr, &len, 0);
2119 ecore_memcpy_to(p_hwfn, p_ptt, addr, &ustats, len);
2122 __ecore_get_vport_pstats_addrlen(p_hwfn, &addr, &len, 0);
2123 ecore_memcpy_to(p_hwfn, p_ptt, addr, &pstats, len);
2126 ecore_ptt_release(p_hwfn, p_ptt);
2151 void ecore_arfs_mode_configure(struct ecore_hwfn *p_hwfn,
2155 if (OSAL_TEST_BIT(ECORE_MF_DISABLE_ARFS, &p_hwfn->p_dev->mf_bits))
2159 ecore_gft_config(p_hwfn, p_ptt, p_hwfn->rel_pf_id,
2165 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
2173 DP_VERBOSE(p_hwfn, ECORE_MSG_SP, "Disabled Filtering\n");
2174 ecore_gft_disable(p_hwfn, p_ptt, p_hwfn->rel_pf_id);
2179 ecore_configure_rfs_ntuple_filter(struct ecore_hwfn *p_hwfn,
2190 rc = ecore_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
2195 rc = ecore_fw_l2_queue(p_hwfn, p_params->qid, &abs_rx_q_id);
2202 init_data.cid = ecore_spq_get_cid(p_hwfn);
2204 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
2213 rc = ecore_sp_init_request(p_hwfn, &p_ent,
2236 DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
2242 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
2245 int ecore_get_rxq_coalesce(struct ecore_hwfn *p_hwfn,
2255 rc = ecore_dmae_grc2host(p_hwfn, p_ptt, CAU_REG_SB_VAR_MEMORY +
2260 DP_ERR(p_hwfn, "dmae_grc2host failed %d\n", rc);
2268 coalesce = ecore_rd(p_hwfn, p_ptt, address);
2280 int ecore_get_txq_coalesce(struct ecore_hwfn *p_hwfn,
2290 rc = ecore_dmae_grc2host(p_hwfn, p_ptt, CAU_REG_SB_VAR_MEMORY +
2295 DP_ERR(p_hwfn, "dmae_grc2host failed %d\n", rc);
2303 coalesce = ecore_rd(p_hwfn, p_ptt, address);
2316 ecore_get_queue_coalesce(struct ecore_hwfn *p_hwfn, u16 *p_coal,
2324 if (IS_VF(p_hwfn->p_dev)) {
2325 rc = ecore_vf_pf_get_coalesce(p_hwfn, p_coal, p_cid);
2327 DP_NOTICE(p_hwfn, false,
2334 p_ptt = ecore_ptt_acquire(p_hwfn);
2339 rc = ecore_get_rxq_coalesce(p_hwfn, p_ptt, p_cid, p_coal);
2343 rc = ecore_get_txq_coalesce(p_hwfn, p_ptt, p_cid, p_coal);
2349 ecore_ptt_release(p_hwfn, p_ptt);