/openbmc/linux/drivers/net/ethernet/marvell/octeontx2/nic/ |
H A D | otx2_dcbnl.c | 13 u8 pfc_en = pfvf->pfc_en; in otx2_check_pfc_config() 18 dev_warn(pfvf->dev, in otx2_check_pfc_config() 33 pfc_en = pfvf->pfc_en; in otx2_pfc_txschq_config() 47 dev_err(pfvf->dev, in otx2_pfc_txschq_config() 98 pfvf->pfc_schq_list[lvl][prio] = pfvf->hw.txschq_list[lvl][0]; in otx2_pfc_txschq_alloc_one() 216 otx2_smq_flush(pfvf, pfvf->pfc_schq_list[NIX_TXSCH_LVL_SMQ][prio]); in otx2_pfc_txschq_update() 243 dev_err(pfvf->dev, in otx2_pfc_txschq_update() 306 if (pfvf->pfc_en) { in otx2_config_priority_flow_ctrl() 339 dev_warn(pfvf->dev, in otx2_update_bpid_in_rqctx() 389 dev_warn(pfvf->dev, in otx2_update_bpid_in_rqctx() [all …]
|
H A D | otx2_common.c | 613 dwrr_val = mtu_to_dwrr_weight(pfvf, pfvf->tx_max_pktlen); in otx2_txschq_config() 951 if (pfvf->ptp && qidx < pfvf->hw.tx_queues) { in otx2_sq_init() 974 err = pfvf->hw_ops->sq_aq_init(pfvf, qidx, sqb_aura); in otx2_sq_init() 1123 pfvf->cq_op_addr = (__force u64 *)otx2_get_regaddr(pfvf, in otx2_config_nix_queues() 1127 pfvf->refill_wrk = devm_kcalloc(pfvf->dev, pfvf->qset.cq_cnt, in otx2_config_nix_queues() 1133 pfvf->refill_wrk[qidx].pf = pfvf; in otx2_config_nix_queues() 1146 pfvf->qset.xqe_size = pfvf->hw.xqe_size; in otx2_config_nix() 1278 devm_kfree(pfvf->dev, pfvf->qset.pool); in otx2_aura_pool_free() 1484 pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr); in otx2_sq_aura_pool_init() 1537 pfvf->hw_ops->aura_freeptr(pfvf, pool_id, in otx2_rq_aura_pool_init() [all …]
|
H A D | qos_sq.c | 23 if (!pfvf->qset.pool) in otx2_qos_aura_pool_free() 26 pool = &pfvf->qset.pool[pool_id]; in otx2_qos_aura_pool_free() 27 qmem_free(pfvf->dev, pool->stack); in otx2_qos_aura_pool_free() 37 struct otx2_hw *hw = &pfvf->hw; in otx2_qos_sq_aura_pool_init() 88 pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr); in otx2_qos_sq_aura_pool_init() 141 qmem_free(pfvf->dev, sq->sqe); in otx2_qos_sq_free_sqbs() 225 pfvf->hw.tc_tx_queues); in otx2_qos_get_qid() 245 mutex_lock(&pfvf->mbox.lock); in otx2_qos_enable_sq() 273 sq = &pfvf->qset.sq[sq_idx]; in otx2_qos_disable_sq() 287 otx2_smq_flush(pfvf, otx2_get_smq_idx(pfvf, sq_idx)); in otx2_qos_disable_sq() [all …]
|
H A D | qos.c | 28 struct otx2_hw *hw = &pfvf->hw; in otx2_qos_update_tx_netdev_queues() 38 netdev_err(pfvf->netdev, in otx2_qos_update_tx_netdev_queues() 100 mtu_to_dwrr_weight(pfvf, pfvf->tx_max_pktlen); in otx2_config_sched_shaping() 1017 netdev_dbg(pfvf->netdev, in otx2_qos_root_add() 1045 netdev_dbg(pfvf->netdev, in otx2_qos_root_add() 1212 netdev_dbg(pfvf->netdev, in otx2_qos_leaf_alloc_queue() 1305 netdev_err(pfvf->netdev, in otx2_qos_leaf_alloc_queue() 1351 netdev_dbg(pfvf->netdev, in otx2_qos_leaf_to_inner() 1443 netdev_err(pfvf->netdev, in otx2_qos_leaf_to_inner() 1449 netdev_err(pfvf->netdev, in otx2_qos_leaf_to_inner() [all …]
|
H A D | cn10k.c | 34 pfvf->hw_ops = &otx2_hw_ops; in cn10k_lmtst_init() 38 pfvf->hw_ops = &cn10k_hw_ops; in cn10k_lmtst_init() 43 mutex_lock(&pfvf->mbox.lock); in cn10k_lmtst_init() 52 err = qmem_alloc(pfvf->dev, &pfvf->dync_lmt, pfvf->tot_lmt_lines, in cn10k_lmtst_init() 58 pfvf->hw.lmt_base = (u64 *)pfvf->dync_lmt->base; in cn10k_lmtst_init() 78 struct otx2_nic *pfvf = dev; in cn10k_sq_aq_init() local 90 aq->sq.smq_rr_weight = mtu_to_dwrr_weight(pfvf, pfvf->tx_max_pktlen); in cn10k_sq_aq_init() 112 struct otx2_nic *pfvf = dev; in cn10k_refill_pool_ptrs() local 141 struct otx2_nic *pfvf = dev; in cn10k_sqe_flush() local 168 if (is_dev_otx2(pfvf->pdev)) in cn10k_free_all_ipolicers() [all …]
|
H A D | otx2_ethtool.c | 155 if (!pfvf) in otx2_get_qset_stats() 206 otx2_get_dev_stats(pfvf); in otx2_get_ethtool_stats() 263 (pfvf->hw.rx_queues + otx2_get_total_tx_queues(pfvf)); in otx2_get_sset_count() 296 if (bitmap_weight(&pfvf->rq_bmap, pfvf->hw.rx_queues) > 1) { in otx2_set_channels() 315 if (pfvf->xdp_prog) in otx2_set_channels() 322 pfvf->hw.tx_queues, pfvf->hw.rx_queues); in otx2_set_channels() 630 netdev_err(pfvf->netdev, in otx2_set_rss_hash_opts() 863 otx2_set_rss_key(pfvf); in otx2_set_rxfh_context() 944 return pfvf->msg_enable; in otx2_get_msglevel() 951 pfvf->msg_enable = val; in otx2_set_msglevel() [all …]
|
H A D | otx2_common.h | 181 struct otx2_nic *pfvf; member 581 struct otx2_hw *hw = &pfvf->hw; in otx2_setup_dev_hw_settings() 589 if (is_96xx_A0(pfvf->pdev)) { in otx2_setup_dev_hw_settings() 598 pfvf->hw.rq_skid = 600; in otx2_setup_dev_hw_settings() 601 if (is_96xx_B0(pfvf->pdev)) in otx2_setup_dev_hw_settings() 612 if (is_dev_cn10kb(pfvf->pdev)) in otx2_setup_dev_hw_settings() 760 struct otx2_nic *pfvf = dev; in cn10k_aura_freeptr() local 782 struct otx2_nic *pfvf = dev; in otx2_aura_freeptr() local 922 smq = pfvf->qos.qid_to_sqmap[qidx - pfvf->hw.non_qos_queues]; in otx2_get_smq_idx() 931 return pfvf->hw.non_qos_queues + pfvf->hw.tc_tx_queues; in otx2_get_total_tx_queues() [all …]
|
H A D | otx2_txrx.c | 227 pfvf->hw_ops->aura_freeptr(pfvf, qidx, iova & ~0x07ULL); in otx2_skb_add_frag() 268 pfvf->hw_ops->aura_freeptr(pfvf, qidx, in otx2_free_rcv_seg() 356 if (pfvf->xdp_prog) in otx2_rcv_pkt_handler() 478 otx2_snd_pkt_handler(pfvf, cq, &pfvf->qset.sq[qidx], in otx2_tx_napi_handler() 559 filled_cnt = pfvf->hw_ops->refill_pool_ptrs(pfvf, rx_cq); in otx2_napi_handler() 961 pfvf->hw_ops->sqe_flush(pfvf, sq, offset, qidx); in otx2_sq_append_tso() 1207 pfvf->hw_ops->sqe_flush(pfvf, sq, offset, qidx); in otx2_sq_append_skb() 1243 otx2_free_bufs(pfvf, pool, iova, pfvf->rbsize); in otx2_cleanup_rx_cqes() 1398 pfvf->hw_ops->sqe_flush(pfvf, sq, offset, qidx); in otx2_xdp_sq_append_pkt() 1441 otx2_dma_unmap_page(pfvf, iova, pfvf->rbsize, in otx2_xdp_rcv_pkt_handler() [all …]
|
H A D | otx2_devlink.c | 15 struct otx2_nic *pfvf = otx2_dl->pfvf; in otx2_dl_mcam_count_validate() local 18 if (!pfvf->flow_cfg) { in otx2_dl_mcam_count_validate() 24 flow_cfg = pfvf->flow_cfg; in otx2_dl_mcam_count_validate() 38 struct otx2_nic *pfvf = otx2_dl->pfvf; in otx2_dl_mcam_count_set() local 40 if (!pfvf->flow_cfg) in otx2_dl_mcam_count_set() 52 struct otx2_nic *pfvf = otx2_dl->pfvf; in otx2_dl_mcam_count_get() local 55 if (!pfvf->flow_cfg) { in otx2_dl_mcam_count_get() 60 flow_cfg = pfvf->flow_cfg; in otx2_dl_mcam_count_get() 97 otx2_dl->pfvf = pfvf; in otx2_register_dl() 98 pfvf->dl = otx2_dl; in otx2_register_dl() [all …]
|
H A D | otx2_flows.c | 51 mutex_lock(&pfvf->mbox.lock); in otx2_free_ntuple_mcam_entries() 64 mutex_unlock(&pfvf->mbox.lock); in otx2_free_ntuple_mcam_entries() 90 netdev_err(pfvf->netdev, in otx2_alloc_mcam_entries() 96 mutex_lock(&pfvf->mbox.lock); in otx2_alloc_mcam_entries() 157 netdev_info(pfvf->netdev, in otx2_alloc_mcam_entries() 204 netdev_info(pfvf->netdev, in otx2_mcam_entry_init() 265 pfvf->flow_cfg = devm_kzalloc(pfvf->dev, in otx2vf_mcam_flow_init() 268 if (!pfvf->flow_cfg) in otx2vf_mcam_flow_init() 271 pfvf->flow_cfg->dmacflt_bmap = devm_kcalloc(pfvf->dev, in otx2vf_mcam_flow_init() 277 flow_cfg = pfvf->flow_cfg; in otx2vf_mcam_flow_init() [all …]
|
H A D | cn10k_macsec.c | 144 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_alloc_rsrc() 204 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_free_rsrc() 263 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_write_rx_secy() 317 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_write_rx_flowid() 362 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_write_sc_cam() 430 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_write_rx_sa_plcy() 475 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_write_rx_sa_pn() 502 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_write_tx_secy() 1782 pfvf->macsec_cfg = cfg; in cn10k_mcs_init() 1814 kfree(pfvf->macsec_cfg); in cn10k_mcs_free() [all …]
|
H A D | cn10k.h | 13 static inline int mtu_to_dwrr_weight(struct otx2_nic *pfvf, int mtu) in mtu_to_dwrr_weight() argument 20 weight = mtu / pfvf->hw.dwrr_mtu; in mtu_to_dwrr_weight() 21 if (mtu % pfvf->hw.dwrr_mtu) in mtu_to_dwrr_weight() 30 int cn10k_lmtst_init(struct otx2_nic *pfvf); 31 int cn10k_free_all_ipolicers(struct otx2_nic *pfvf); 32 int cn10k_alloc_matchall_ipolicer(struct otx2_nic *pfvf); 33 int cn10k_free_matchall_ipolicer(struct otx2_nic *pfvf); 34 int cn10k_set_matchall_ipolicer_rate(struct otx2_nic *pfvf, 38 int cn10k_alloc_leaf_profile(struct otx2_nic *pfvf, u16 *leaf); 39 int cn10k_set_ipolicer_rate(struct otx2_nic *pfvf, u16 profile, [all …]
|
H A D | otx2_ptp.c | 58 mutex_lock(&pfvf->mbox.lock); in otx2_ptp_hw_adjtime() 67 mutex_unlock(&pfvf->mbox.lock); in otx2_ptp_hw_adjtime() 127 mutex_lock(&pfvf->mbox.lock); in otx2_ptp_hw_settime() 235 mutex_lock(&pfvf->mbox.lock); in otx2_ptp_tc_adjtime() 376 pfvf->ptp = NULL; in otx2_ptp_init() 403 ptp_ptr->nic = pfvf; in otx2_ptp_init() 465 pfvf->ptp = ptp_ptr; in otx2_ptp_init() 483 pfvf->ptp = NULL; in otx2_ptp_destroy() 489 if (!pfvf->ptp) in otx2_ptp_clock_index() 498 if (!pfvf->ptp) in otx2_ptp_tstamp2time() [all …]
|
H A D | otx2_ptp.h | 26 int otx2_ptp_init(struct otx2_nic *pfvf); 27 void otx2_ptp_destroy(struct otx2_nic *pfvf); 29 int otx2_ptp_clock_index(struct otx2_nic *pfvf); 30 int otx2_ptp_tstamp2time(struct otx2_nic *pfvf, u64 tstamp, u64 *tsns);
|
H A D | otx2_devlink.h | 13 struct otx2_nic *pfvf; member 17 int otx2_register_dl(struct otx2_nic *pfvf); 18 void otx2_unregister_dl(struct otx2_nic *pfvf);
|
H A D | qos.h | 26 int otx2_qos_get_qid(struct otx2_nic *pfvf); 27 void otx2_qos_free_qid(struct otx2_nic *pfvf, int qidx); 28 int otx2_qos_enable_sq(struct otx2_nic *pfvf, int qidx); 29 void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx);
|
H A D | otx2_dmac_flt.c | 89 static int otx2_dmacflt_do_remove(struct otx2_nic *pfvf, const u8 *mac, in otx2_dmacflt_do_remove() argument 95 mutex_lock(&pfvf->mbox.lock); in otx2_dmacflt_do_remove() 96 req = otx2_mbox_alloc_msg_cgx_mac_addr_del(&pfvf->mbox); in otx2_dmacflt_do_remove() 98 mutex_unlock(&pfvf->mbox.lock); in otx2_dmacflt_do_remove() 104 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_dmacflt_do_remove() 105 mutex_unlock(&pfvf->mbox.lock); in otx2_dmacflt_do_remove()
|
H A D | otx2_pf.c | 459 pf = vf_mbox->pfvf; in otx2_pfvf_mbox_handler() 621 mbox->pfvf = pf; in otx2_pfvf_mbox_init() 821 pf = af_mbox->pfvf; in otx2_pfaf_mbox_handler() 1090 mbox->pfvf = pf; in otx2_pfaf_mbox_init() 1684 if (is_otx2_vf(pfvf->pcifunc)) in otx2_promisc_use_mce_list() 1745 struct otx2_nic *pfvf; in otx2_dim_work() local 1756 otx2_set_irq_coalesce(pfvf); in otx2_dim_work() 2206 mutex_lock(&pfvf->mbox.lock); in otx2_config_hw_rx_tstamp() 2222 mutex_unlock(&pfvf->mbox.lock); in otx2_config_hw_rx_tstamp() 2238 mutex_lock(&pfvf->mbox.lock); in otx2_config_hw_tx_tstamp() [all …]
|
/openbmc/linux/drivers/net/ethernet/marvell/octeontx2/af/ |
H A D | rvu_npa.c | 70 struct rvu_pfvf *pfvf; in rvu_npa_aq_enq_inst() local 75 if (!pfvf->aura_ctx || req->aura_id >= pfvf->aura_ctx->qsize) in rvu_npa_aq_enq_inst() 218 if (!pfvf->pool_ctx || !pfvf->aura_ctx) in npa_lf_hwctx_disable() 311 kfree(pfvf->aura_bmap); in npa_ctx_free() 312 pfvf->aura_bmap = NULL; in npa_ctx_free() 315 pfvf->aura_ctx = NULL; in npa_ctx_free() 321 pfvf->pool_ctx = NULL; in npa_ctx_free() 335 struct rvu_pfvf *pfvf; in rvu_mbox_handler_npa_lf_alloc() local 374 if (!pfvf->aura_bmap) in rvu_mbox_handler_npa_lf_alloc() 385 if (!pfvf->pool_bmap) in rvu_mbox_handler_npa_lf_alloc() [all …]
|
H A D | rvu.c | 378 attach ? pfvf->sso++ : pfvf->sso--; in rvu_update_rsrc_map() 382 attach ? pfvf->ssow++ : pfvf->ssow--; in rvu_update_rsrc_map() 386 attach ? pfvf->timlfs++ : pfvf->timlfs--; in rvu_update_rsrc_map() 390 attach ? pfvf->cptlfs++ : pfvf->cptlfs--; in rvu_update_rsrc_map() 394 attach ? pfvf->cpt1_lfs++ : pfvf->cpt1_lfs--; in rvu_update_rsrc_map() 634 pfvf->msix_lfmap = devm_kcalloc(rvu->dev, pfvf->msix.max, in rvu_setup_msix_resources() 790 ether_addr_copy(pfvf->default_mac, pfvf->mac_addr); in rvu_setup_pfvf_macaddress() 806 ether_addr_copy(pfvf->default_mac, pfvf->mac_addr); in rvu_setup_pfvf_macaddress() 1253 return pfvf->sso; in rvu_get_rsrc_mapcount() 1255 return pfvf->ssow; in rvu_get_rsrc_mapcount() [all …]
|
H A D | rvu_switch.c | 13 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_switch_enable_lbk_link() local 16 nix_hw = get_nix_hw(rvu->hw, pfvf->nix_blkaddr); in rvu_switch_enable_lbk_link() 18 rvu_nix_tx_tl2_cfg(rvu, pfvf->nix_blkaddr, pcifunc, in rvu_switch_enable_lbk_link() 27 struct rvu_pfvf *pfvf; in rvu_switch_install_rx_rule() local 29 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_switch_install_rx_rule() 34 if (!test_bit(NIXLF_INITIALIZED, &pfvf->flags)) in rvu_switch_install_rx_rule() 42 req.channel = pfvf->rx_chan_base; in rvu_switch_install_rx_rule() 44 req.intf = pfvf->nix_rx_intf; in rvu_switch_install_rx_rule() 55 struct rvu_pfvf *pfvf; in rvu_switch_install_tx_rule() local 58 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_switch_install_tx_rule() [all …]
|
H A D | rvu_nix.c | 334 pfvf->tx_chan_base = pfvf->rx_chan_base; in nix_interface_init() 423 pfvf->tx_chan_base = pfvf->rx_chan_base; in nix_interface_init() 424 pfvf->tx_chan_cnt = pfvf->rx_chan_cnt; in nix_interface_init() 437 pfvf->rx_chan_base, pfvf->mac_addr); in nix_interface_init() 904 if (!pfvf->rq_ctx || req->qidx >= pfvf->rq_ctx->qsize) in rvu_nix_blk_aq_enq_inst() 908 if (!pfvf->sq_ctx || req->qidx >= pfvf->sq_ctx->qsize) in rvu_nix_blk_aq_enq_inst() 912 if (!pfvf->cq_ctx || req->qidx >= pfvf->cq_ctx->qsize) in rvu_nix_blk_aq_enq_inst() 1217 if (!pfvf->cq_ctx || !pfvf->sq_ctx || !pfvf->rq_ctx) in nix_lf_hwctx_disable() 4167 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs() 4176 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs() [all …]
|
H A D | rvu_sdp.c | 52 struct rvu_pfvf *pfvf; in rvu_sdp_init() local 60 pfvf = &rvu->pf[sdp_pf_num[i]]; in rvu_sdp_init() 62 pfvf->sdp_info = devm_kzalloc(rvu->dev, in rvu_sdp_init() 65 if (!pfvf->sdp_info) { in rvu_sdp_init() 85 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_mbox_handler_set_sdp_chan_info() local 87 memcpy(pfvf->sdp_info, &req->info, sizeof(struct sdp_node_info)); in rvu_mbox_handler_set_sdp_chan_info()
|
H A D | rvu_cn10k.c | 120 if (!pfvf->lmt_base_addr) in rvu_update_lmtaddr() 121 pfvf->lmt_base_addr = val; in rvu_update_lmtaddr() 209 if (!pfvf->lmt_map_ent_w1) in rvu_mbox_handler_lmtst_tbl_setup() 210 pfvf->lmt_map_ent_w1 = val; in rvu_mbox_handler_lmtst_tbl_setup() 249 if (pfvf->lmt_base_addr || pfvf->lmt_map_ent_w1) { in rvu_reset_lmt_map_tbl() 255 if (pfvf->lmt_base_addr) { in rvu_reset_lmt_map_tbl() 257 &pfvf->lmt_base_addr, in rvu_reset_lmt_map_tbl() 263 pfvf->lmt_base_addr = 0; in rvu_reset_lmt_map_tbl() 268 if (pfvf->lmt_map_ent_w1) { in rvu_reset_lmt_map_tbl() 271 &pfvf->lmt_map_ent_w1, in rvu_reset_lmt_map_tbl() [all …]
|
H A D | rvu_npc_fs.c | 1069 if (pfvf->def_ucast_rule) { in npc_update_rx_entry() 1244 rule->intf = pfvf->nix_tx_intf; in npc_install_flow() 1246 rule->intf = pfvf->nix_rx_intf; in npc_install_flow() 1251 pfvf->def_ucast_rule = rule; in npc_install_flow() 1269 set_bit(PF_SET_VF_MAC, &pfvf->flags); in npc_install_flow() 1291 struct rvu_pfvf *pfvf; in rvu_mbox_handler_npc_install_flow() local 1363 pfvf = rvu_get_pfvf(rvu, target); in rvu_mbox_handler_npc_install_flow() 1367 set_bit(PF_SET_VF_CFG, &pfvf->flags); in rvu_mbox_handler_npc_install_flow() 1401 set_bit(PF_SET_VF_MAC, &pfvf->flags); in rvu_mbox_handler_npc_install_flow() 1484 struct rvu_pfvf *pfvf) in npc_update_dmac_value() argument [all …]
|