| /linux/drivers/net/ethernet/marvell/octeontx2/nic/ |
| H A D | otx2_common.c | 22 static bool otx2_is_pfc_enabled(struct otx2_nic *pfvf) in otx2_is_pfc_enabled() argument 24 return IS_ENABLED(CONFIG_DCB) && !!pfvf->pfc_en; in otx2_is_pfc_enabled() 28 struct otx2_nic *pfvf, int qidx) in otx2_nix_rq_op_stats() argument 33 ptr = otx2_get_regaddr(pfvf, NIX_LF_RQ_OP_OCTS); in otx2_nix_rq_op_stats() 36 ptr = otx2_get_regaddr(pfvf, NIX_LF_RQ_OP_PKTS); in otx2_nix_rq_op_stats() 41 struct otx2_nic *pfvf, int qidx) in otx2_nix_sq_op_stats() argument 46 ptr = otx2_get_regaddr(pfvf, NIX_LF_SQ_OP_OCTS); in otx2_nix_sq_op_stats() 49 ptr = otx2_get_regaddr(pfvf, NIX_LF_SQ_OP_PKTS); in otx2_nix_sq_op_stats() 53 void otx2_update_lmac_stats(struct otx2_nic *pfvf) in otx2_update_lmac_stats() argument 57 if (!netif_running(pfvf->netdev)) in otx2_update_lmac_stats() [all …]
|
| H A D | qos_sq.c | 19 static void otx2_qos_aura_pool_free(struct otx2_nic *pfvf, int pool_id) in otx2_qos_aura_pool_free() argument 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() 28 qmem_free(pfvf->dev, pool->fc_addr); in otx2_qos_aura_pool_free() 33 static int otx2_qos_sq_aura_pool_init(struct otx2_nic *pfvf, int qidx) in otx2_qos_sq_aura_pool_init() argument 35 struct otx2_qset *qset = &pfvf->qset; in otx2_qos_sq_aura_pool_init() 37 struct otx2_hw *hw = &pfvf->hw; in otx2_qos_sq_aura_pool_init() 56 pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx); in otx2_qos_sq_aura_pool_init() 57 pool = &pfvf->qset.pool[pool_id]; in otx2_qos_sq_aura_pool_init() [all …]
|
| H A D | qos.c | 26 static void otx2_qos_update_tx_netdev_queues(struct otx2_nic *pfvf) in otx2_qos_update_tx_netdev_queues() argument 28 struct otx2_hw *hw = &pfvf->hw; in otx2_qos_update_tx_netdev_queues() 31 qos_txqs = bitmap_weight(pfvf->qos.qos_sq_bmap, in otx2_qos_update_tx_netdev_queues() 36 err = netif_set_real_num_tx_queues(pfvf->netdev, tx_queues); in otx2_qos_update_tx_netdev_queues() 38 netdev_err(pfvf->netdev, in otx2_qos_update_tx_netdev_queues() 71 static int otx2_qos_quantum_to_dwrr_weight(struct otx2_nic *pfvf, u32 quantum) in otx2_qos_quantum_to_dwrr_weight() argument 75 weight = quantum / pfvf->hw.dwrr_mtu; in otx2_qos_quantum_to_dwrr_weight() 76 if (quantum % pfvf->hw.dwrr_mtu) in otx2_qos_quantum_to_dwrr_weight() 82 static void otx2_config_sched_shaping(struct otx2_nic *pfvf, in otx2_config_sched_shaping() argument 100 mtu_to_dwrr_weight(pfvf, pfvf->tx_max_pktlen); in otx2_config_sched_shaping() [all …]
|
| H A D | otx2_ethtool.c | 73 static struct cgx_fw_data *otx2_get_fwdata(struct otx2_nic *pfvf); 78 struct otx2_nic *pfvf = netdev_priv(netdev); in otx2_get_drvinfo() local 81 strscpy(info->bus_info, pci_name(pfvf->pdev), sizeof(info->bus_info)); in otx2_get_drvinfo() 84 static void otx2_get_qset_strings(struct otx2_nic *pfvf, u8 **data, int qset) in otx2_get_qset_strings() argument 86 int start_qidx = qset * pfvf->hw.rx_queues; in otx2_get_qset_strings() 89 for (qidx = 0; qidx < pfvf->hw.rx_queues; qidx++) in otx2_get_qset_strings() 94 for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf); qidx++) in otx2_get_qset_strings() 96 if (qidx >= pfvf->hw.non_qos_queues) in otx2_get_qset_strings() 99 pfvf->hw.non_qos_queues, in otx2_get_qset_strings() 109 struct otx2_nic *pfvf = netdev_priv(netdev); in otx2_get_strings() local [all …]
|
| H A D | otx2_txrx.c | 40 static bool otx2_xdp_rcv_pkt_handler(struct otx2_nic *pfvf, 57 static int otx2_nix_cq_op_status(struct otx2_nic *pfvf, in otx2_nix_cq_op_status() argument 63 status = otx2_atomic64_fetch_add(incr, pfvf->cq_op_addr); in otx2_nix_cq_op_status() 67 dev_err(pfvf->dev, "CQ stopped due to error"); in otx2_nix_cq_op_status() 105 static void otx2_xdp_snd_pkt_handler(struct otx2_nic *pfvf, in otx2_xdp_snd_pkt_handler() argument 120 otx2_dma_unmap_page(pfvf, sg->dma_addr[0], sg->size[0], DMA_TO_DEVICE); in otx2_xdp_snd_pkt_handler() 125 static void otx2_snd_pkt_handler(struct otx2_nic *pfvf, in otx2_snd_pkt_handler() argument 138 if (unlikely(snd_comp->status) && netif_msg_tx_err(pfvf)) in otx2_snd_pkt_handler() 140 pfvf->netdev->name, cq->cint_idx, in otx2_snd_pkt_handler() 151 timestamp = pfvf->ptp->convert_tx_ptp_tstmp(timestamp); in otx2_snd_pkt_handler() [all …]
|
| H A D | otx2_flows.c | 33 static void otx2_clear_ntuple_flow_info(struct otx2_nic *pfvf, struct otx2_flow_config *flow_cfg) in otx2_clear_ntuple_flow_info() argument 35 devm_kfree(pfvf->dev, flow_cfg->flow_ent); in otx2_clear_ntuple_flow_info() 40 static int otx2_free_ntuple_mcam_entries(struct otx2_nic *pfvf) in otx2_free_ntuple_mcam_entries() argument 42 struct otx2_flow_config *flow_cfg = pfvf->flow_cfg; in otx2_free_ntuple_mcam_entries() 49 mutex_lock(&pfvf->mbox.lock); in otx2_free_ntuple_mcam_entries() 51 req = otx2_mbox_alloc_msg_npc_mcam_free_entry(&pfvf->mbox); in otx2_free_ntuple_mcam_entries() 58 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_free_ntuple_mcam_entries() 62 mutex_unlock(&pfvf->mbox.lock); in otx2_free_ntuple_mcam_entries() 63 otx2_clear_ntuple_flow_info(pfvf, flow_cfg); in otx2_free_ntuple_mcam_entries() 67 int otx2_alloc_mcam_entries(struct otx2_nic *pfvf, u16 count) in otx2_alloc_mcam_entries() argument [all …]
|
| H A D | cn10k_macsec.c | 49 static int cn10k_ecb_aes_encrypt(struct otx2_nic *pfvf, u8 *sak, in cn10k_ecb_aes_encrypt() argument 61 dev_err(pfvf->dev, "failed to allocate transform for ecb-aes\n"); in cn10k_ecb_aes_encrypt() 67 dev_err(pfvf->dev, "failed to allocate request for skcipher\n"); in cn10k_ecb_aes_encrypt() 74 dev_err(pfvf->dev, "failed to set key for skcipher\n"); in cn10k_ecb_aes_encrypt() 139 static int cn10k_mcs_alloc_rsrc(struct otx2_nic *pfvf, enum mcs_direction dir, in cn10k_mcs_alloc_rsrc() argument 142 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_alloc_rsrc() 161 rsp = (struct mcs_alloc_rsrc_rsp *)otx2_mbox_get_rsp(&pfvf->mbox.mbox, in cn10k_mcs_alloc_rsrc() 191 dev_err(pfvf->dev, "Failed to allocate %s %s resource\n", in cn10k_mcs_alloc_rsrc() 197 static void cn10k_mcs_free_rsrc(struct otx2_nic *pfvf, enum mcs_direction dir, in cn10k_mcs_free_rsrc() argument 202 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_free_rsrc() [all …]
|
| H A D | otx2_xsk.c | 17 int otx2_xsk_pool_alloc_buf(struct otx2_nic *pfvf, struct otx2_pool *pool, in otx2_xsk_pool_alloc_buf() argument 36 static int otx2_xsk_ctx_disable(struct otx2_nic *pfvf, u16 qidx, int aura_id) in otx2_xsk_ctx_disable() argument 43 if (test_bit(CN10K_LMTST, &pfvf->hw.cap_flag)) { in otx2_xsk_ctx_disable() 44 cn10k_rq_aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq(&pfvf->mbox); in otx2_xsk_ctx_disable() 53 rq_aq = otx2_mbox_alloc_msg_nix_aq_enq(&pfvf->mbox); in otx2_xsk_ctx_disable() 63 aura_aq = otx2_mbox_alloc_msg_npa_aq_enq(&pfvf->mbox); in otx2_xsk_ctx_disable() 73 pool_aq = otx2_mbox_alloc_msg_npa_aq_enq(&pfvf->mbox); in otx2_xsk_ctx_disable() 84 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_xsk_ctx_disable() 87 otx2_mbox_reset(&pfvf->mbox.mbox, 0); in otx2_xsk_ctx_disable() 91 static void otx2_clean_up_rq(struct otx2_nic *pfvf, int qidx) in otx2_clean_up_rq() argument [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, 36 int cn10k_map_unmap_rq_policer(struct otx2_nic *pfvf, int rq_idx, 38 int cn10k_alloc_leaf_profile(struct otx2_nic *pfvf, u16 *leaf); [all …]
|
| H A D | otx2_ptp.c | 51 struct otx2_nic *pfvf = ptp->nic; in otx2_ptp_hw_adjtime() local 58 mutex_lock(&pfvf->mbox.lock); in otx2_ptp_hw_adjtime() 61 mutex_unlock(&pfvf->mbox.lock); in otx2_ptp_hw_adjtime() 67 mutex_unlock(&pfvf->mbox.lock); in otx2_ptp_hw_adjtime() 117 struct otx2_nic *pfvf = ptp->nic; in otx2_ptp_hw_settime() local 127 mutex_lock(&pfvf->mbox.lock); in otx2_ptp_hw_settime() 130 mutex_unlock(&pfvf->mbox.lock); in otx2_ptp_hw_settime() 137 mutex_unlock(&pfvf->mbox.lock); in otx2_ptp_hw_settime() 234 struct otx2_nic *pfvf = ptp->nic; in otx2_ptp_tc_adjtime() local 236 mutex_lock(&pfvf->mbox.lock); in otx2_ptp_tc_adjtime() [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_xsk.h | 17 int otx2_xsk_pool_alloc_buf(struct otx2_nic *pfvf, struct otx2_pool *pool, 20 void otx2_zc_napi_handler(struct otx2_nic *pfvf, struct xsk_buff_pool *pool, 22 void otx2_attach_xsk_buff(struct otx2_nic *pfvf, struct otx2_snd_queue *sq, int qidx);
|
| H A D | cn20k.h | 13 void cn20k_init(struct otx2_nic *pfvf);
|
| H A D | cn10k_ipsec.h | 229 bool otx2_sqe_add_sg_ipsec(struct otx2_nic *pfvf, struct otx2_snd_queue *sq, 251 otx2_sqe_add_sg_ipsec(struct otx2_nic *pfvf, struct otx2_snd_queue *sq, in otx2_sqe_add_sg_ipsec() argument
|
| /linux/drivers/net/ethernet/marvell/octeontx2/af/ |
| 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() 37 ether_addr_copy(req.packet.dmac, pfvf->mac_addr); 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 [all …]
|
| H A D | rvu_sdp.c | 56 struct rvu_pfvf *pfvf; in rvu_sdp_init() local 61 pfvf = &rvu->pf[sdp_pf_num[0]]; in rvu_sdp_init() 62 pfvf->sdp_info = &rvu->fwdata->channel_data.info; in rvu_sdp_init() 72 pfvf = &rvu->pf[sdp_pf_num[i]]; in rvu_sdp_init() 74 pfvf->sdp_info = devm_kzalloc(rvu->dev, in rvu_sdp_init() 77 if (!pfvf->sdp_info) { in rvu_sdp_init() 97 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_mbox_handler_set_sdp_chan_info() local 99 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 | 115 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_update_lmtaddr() local 134 if (!pfvf->lmt_base_addr) in rvu_update_lmtaddr() 135 pfvf->lmt_base_addr = val; in rvu_update_lmtaddr() 152 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_mbox_handler_lmtst_tbl_setup() local 223 if (!pfvf->lmt_map_ent_w1) in rvu_mbox_handler_lmtst_tbl_setup() 224 pfvf->lmt_map_ent_w1 = val; in rvu_mbox_handler_lmtst_tbl_setup() 256 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_reset_lmt_map_tbl() local 263 if (pfvf->lmt_base_addr || pfvf->lmt_map_ent_w1) { in rvu_reset_lmt_map_tbl() 269 if (pfvf->lmt_base_addr) { in rvu_reset_lmt_map_tbl() 271 &pfvf->lmt_base_addr, in rvu_reset_lmt_map_tbl() [all …]
|
| H A D | rvu_npc_fs.c | 1132 static int npc_update_rx_entry(struct rvu *rvu, struct rvu_pfvf *pfvf, in npc_update_rx_entry() argument 1160 if (pfvf->def_ucast_rule) { in npc_update_rx_entry() 1161 action = pfvf->def_ucast_rule->rx_action; in npc_update_rx_entry() 1193 static int npc_update_tx_entry(struct rvu *rvu, struct rvu_pfvf *pfvf, in npc_update_tx_entry() argument 1238 int nixlf, struct rvu_pfvf *pfvf, in npc_install_flow() argument 1243 struct rvu_npc_mcam_rule *def_ucast_rule = pfvf->def_ucast_rule; in npc_install_flow() 1265 err = npc_update_rx_entry(rvu, pfvf, entry, req, target, pf_set_vfs_mac); in npc_install_flow() 1269 err = npc_update_tx_entry(rvu, pfvf, entry, req, target); in npc_install_flow() 1352 rule->intf = pfvf->nix_tx_intf; in npc_install_flow() 1354 rule->intf = pfvf->nix_rx_intf; in npc_install_flow() [all …]
|
| H A D | rvu_npc.c | 64 void rvu_npc_set_pkind(struct rvu *rvu, int pkind, struct rvu_pfvf *pfvf) in rvu_npc_set_pkind() argument 129 struct rvu_pfvf *pfvf; in npc_get_ucast_mcam_index() local 131 pfvf = rvu_get_pfvf(rvu, pcifunc); in npc_get_ucast_mcam_index() 137 if (pfvf->nix_blkaddr == blkaddr) in npc_get_ucast_mcam_index() 394 struct rvu_pfvf *pfvf; in npc_fixup_vf_rule() local 406 pfvf = rvu_get_pfvf(rvu, target_func); in npc_fixup_vf_rule() 411 test_bit(NIXLF_INITIALIZED, &pfvf->flags))) in npc_fixup_vf_rule() 605 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_npc_install_ucast_entry() local 623 if (!npc_is_feature_supported(rvu, BIT_ULL(NPC_DMAC), pfvf->nix_rx_intf)) in rvu_npc_install_ucast_entry() 646 req.intf = pfvf->nix_rx_intf; in rvu_npc_install_ucast_entry() [all …]
|
| H A D | rvu_npc_hash.c | 1565 struct rvu_pfvf *pfvf; in rvu_npc_exact_mac_addr_reset() local 1571 pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_npc_exact_mac_addr_reset() 1576 dev_err(rvu->dev, "%s MAC (%pM) del PF=%d failed\n", __func__, pfvf->mac_addr, pf); in rvu_npc_exact_mac_addr_reset() 1581 __func__, pfvf->mac_addr, pf, seq_id); in rvu_npc_exact_mac_addr_reset() 1599 struct rvu_pfvf *pfvf; in rvu_npc_exact_mac_addr_update() local 1613 pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_npc_exact_mac_addr_update() 1636 __func__, req->mac_addr, pfvf->mac_addr, pfvf->default_mac, pf); in rvu_npc_exact_mac_addr_update() 1637 ether_addr_copy(pfvf->mac_addr, req->mac_addr); in rvu_npc_exact_mac_addr_update() 1646 pfvf->mac_addr, pf); in rvu_npc_exact_mac_addr_update() 1650 pfvf->rx_chan_base, 0, &seq_id, true, in rvu_npc_exact_mac_addr_update() [all …]
|
| /linux/drivers/net/ethernet/marvell/octeontx2/af/cn20k/ |
| H A D | mbox_init.c | 391 int rvu_alloc_cint_qint_mem(struct rvu *rvu, struct rvu_pfvf *pfvf, in rvu_alloc_cint_qint_mem() argument 405 err = qmem_alloc(rvu->dev, &pfvf->cq_ints_ctx, qints, hwctx_size); in rvu_alloc_cint_qint_mem() 410 (u64)pfvf->cq_ints_ctx->iova); in rvu_alloc_cint_qint_mem() 416 err = qmem_alloc(rvu->dev, &pfvf->nix_qints_ctx, qints, hwctx_size); in rvu_alloc_cint_qint_mem() 421 (u64)pfvf->nix_qints_ctx->iova); in rvu_alloc_cint_qint_mem()
|
| /linux/drivers/net/ethernet/chelsio/cxgb4/ |
| H A D | smt.c | 209 static struct smt_entry *t4_smt_alloc_switching(struct adapter *adap, u16 pfvf, in t4_smt_alloc_switching() argument 222 e->pfvf = pfvf; in t4_smt_alloc_switching()
|
| H A D | smt.h | 60 u16 pfvf; member
|