Lines Matching defs:pfvf

72 static struct cgx_fw_data *otx2_get_fwdata(struct otx2_nic *pfvf);
77 struct otx2_nic *pfvf = netdev_priv(netdev);
80 strscpy(info->bus_info, pci_name(pfvf->pdev), sizeof(info->bus_info));
83 static void otx2_get_qset_strings(struct otx2_nic *pfvf, u8 **data, int qset)
85 int start_qidx = qset * pfvf->hw.rx_queues;
88 for (qidx = 0; qidx < pfvf->hw.rx_queues; qidx++) {
96 for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf); qidx++) {
98 if (qidx >= pfvf->hw.non_qos_queues)
100 qidx + start_qidx - pfvf->hw.non_qos_queues,
112 struct otx2_nic *pfvf = netdev_priv(netdev);
128 otx2_get_qset_strings(pfvf, &data, 0);
130 if (!test_bit(CN10K_RPM, &pfvf->hw.cap_flag)) {
150 static void otx2_get_qset_stats(struct otx2_nic *pfvf,
155 if (!pfvf)
157 for (qidx = 0; qidx < pfvf->hw.rx_queues; qidx++) {
158 if (!otx2_update_rq_stats(pfvf, qidx)) {
164 *((*data)++) = ((u64 *)&pfvf->qset.rq[qidx].stats)
168 for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf); qidx++) {
169 if (!otx2_update_sq_stats(pfvf, qidx)) {
175 *((*data)++) = ((u64 *)&pfvf->qset.sq[qidx].stats)
180 static int otx2_get_phy_fec_stats(struct otx2_nic *pfvf)
185 mutex_lock(&pfvf->mbox.lock);
186 req = otx2_mbox_alloc_msg_cgx_get_phy_fec_stats(&pfvf->mbox);
190 if (!otx2_sync_mbox_msg(&pfvf->mbox))
193 mutex_unlock(&pfvf->mbox.lock);
201 struct otx2_nic *pfvf = netdev_priv(netdev);
206 otx2_get_dev_stats(pfvf);
208 *(data++) = ((u64 *)&pfvf->hw.dev_stats)
212 *(data++) = atomic_read(&((atomic_t *)&pfvf->hw.drv_stats)
215 otx2_get_qset_stats(pfvf, stats, &data);
217 if (!test_bit(CN10K_RPM, &pfvf->hw.cap_flag)) {
218 otx2_update_lmac_stats(pfvf);
220 *(data++) = pfvf->hw.cgx_rx_stats[stat];
222 *(data++) = pfvf->hw.cgx_tx_stats[stat];
225 *(data++) = pfvf->reset_count;
227 fec_corr_blks = pfvf->hw.cgx_fec_corr_blks;
228 fec_uncorr_blks = pfvf->hw.cgx_fec_uncorr_blks;
230 rsp = otx2_get_fwdata(pfvf);
232 !otx2_get_phy_fec_stats(pfvf)) {
236 rsp = otx2_get_fwdata(pfvf);
240 if (pfvf->linfo.fec == OTX2_FEC_BASER) {
256 struct otx2_nic *pfvf = netdev_priv(netdev);
263 (pfvf->hw.rx_queues + otx2_get_total_tx_queues(pfvf));
264 if (!test_bit(CN10K_RPM, &pfvf->hw.cap_flag))
266 otx2_update_lmac_fec_stats(pfvf);
276 struct otx2_nic *pfvf = netdev_priv(dev);
278 channel->max_rx = pfvf->hw.max_queues;
279 channel->max_tx = pfvf->hw.max_queues;
281 channel->rx_count = pfvf->hw.rx_queues;
282 channel->tx_count = pfvf->hw.tx_queues;
289 struct otx2_nic *pfvf = netdev_priv(dev);
296 if (bitmap_weight(&pfvf->rq_bmap, pfvf->hw.rx_queues) > 1) {
305 qos_txqs = bitmap_weight(pfvf->qos.qos_sq_bmap,
313 pfvf->hw.rx_queues = channel->rx_count;
314 pfvf->hw.tx_queues = channel->tx_count;
315 if (pfvf->xdp_prog)
316 pfvf->hw.xdp_queues = channel->rx_count;
322 pfvf->hw.tx_queues, pfvf->hw.rx_queues);
330 struct otx2_nic *pfvf = netdev_priv(netdev);
333 if (is_otx2_lbkvf(pfvf->pdev))
336 mutex_lock(&pfvf->mbox.lock);
337 req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
339 mutex_unlock(&pfvf->mbox.lock);
343 if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
345 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
349 mutex_unlock(&pfvf->mbox.lock);
355 struct otx2_nic *pfvf = netdev_priv(netdev);
360 if (is_otx2_lbkvf(pfvf->pdev))
364 pfvf->flags |= OTX2_FLAG_RX_PAUSE_ENABLED;
366 pfvf->flags &= ~OTX2_FLAG_RX_PAUSE_ENABLED;
369 pfvf->flags |= OTX2_FLAG_TX_PAUSE_ENABLED;
371 pfvf->flags &= ~OTX2_FLAG_TX_PAUSE_ENABLED;
373 return otx2_config_pause_frm(pfvf);
381 struct otx2_nic *pfvf = netdev_priv(netdev);
382 struct otx2_qset *qs = &pfvf->qset;
388 kernel_ring->rx_buf_len = pfvf->hw.rbuf_len;
389 kernel_ring->cqe_size = pfvf->hw.xqe_size;
397 struct otx2_nic *pfvf = netdev_priv(netdev);
399 u32 old_rx_buf_len = pfvf->hw.rbuf_len;
402 struct otx2_qset *qs = &pfvf->qset;
428 if (rx_count < pfvf->hw.rq_skid)
429 rx_count = pfvf->hw.rq_skid;
441 rx_buf_len == old_rx_buf_len && xqe_size == pfvf->hw.xqe_size)
451 pfvf->hw.rbuf_len = rx_buf_len;
452 pfvf->hw.xqe_size = xqe_size;
465 struct otx2_nic *pfvf = netdev_priv(netdev);
466 struct otx2_hw *hw = &pfvf->hw;
472 if ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) ==
489 struct otx2_nic *pfvf = netdev_priv(netdev);
490 struct otx2_hw *hw = &pfvf->hw;
504 if ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) ==
508 pfvf->flags &= ~OTX2_FLAG_ADPTV_INT_COAL_ENABLED;
512 pfvf->flags |= OTX2_FLAG_ADPTV_INT_COAL_ENABLED;
558 ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) !=
565 for (qidx = 0; qidx < pfvf->hw.cint_cnt; qidx++)
566 otx2_config_irq_coalescing(pfvf, qidx);
572 static int otx2_get_rss_hash_opts(struct otx2_nic *pfvf,
575 struct otx2_rss_info *rss = &pfvf->hw.rss_info;
622 static int otx2_set_rss_hash_opts(struct otx2_nic *pfvf,
625 struct otx2_rss_info *rss = &pfvf->hw.rss_info;
630 netdev_err(pfvf->netdev,
701 netdev_err(pfvf->netdev,
726 otx2_set_flowkey_cfg(pfvf);
734 struct otx2_nic *pfvf = netdev_priv(dev);
739 nfc->data = pfvf->hw.rx_queues;
744 nfc->rule_cnt = pfvf->flow_cfg->nr_flows;
750 ret = otx2_get_flow(pfvf, nfc, nfc->fs.location);
754 ret = otx2_get_all_flows(pfvf, nfc, rules);
757 return otx2_get_rss_hash_opts(pfvf, nfc);
767 struct otx2_nic *pfvf = netdev_priv(dev);
770 pfvf->flow_cfg->ntuple = ntuple;
773 ret = otx2_set_rss_hash_opts(pfvf, nfc);
777 ret = otx2_add_flow(pfvf, nfc);
781 ret = otx2_remove_flow(pfvf, nfc->fs.location);
792 struct otx2_nic *pfvf = netdev_priv(netdev);
795 rss = &pfvf->hw.rss_info;
805 static int otx2_rss_ctx_delete(struct otx2_nic *pfvf, int ctx_id)
807 struct otx2_rss_info *rss = &pfvf->hw.rss_info;
809 otx2_rss_ctx_flow_del(pfvf, ctx_id);
816 static int otx2_rss_ctx_create(struct otx2_nic *pfvf,
819 struct otx2_rss_info *rss = &pfvf->hw.rss_info;
843 struct otx2_nic *pfvf = netdev_priv(dev);
859 rss = &pfvf->hw.rss_info;
868 otx2_set_rss_key(pfvf);
871 return otx2_rss_ctx_delete(pfvf, rss_context);
874 ret = otx2_rss_ctx_create(pfvf, &rss_context);
884 otx2_set_rss_table(pfvf, rss_context);
894 struct otx2_nic *pfvf = netdev_priv(dev);
900 rss = &pfvf->hw.rss_info;
910 rx_queues = pfvf->hw.rx_queues;
934 struct otx2_nic *pfvf = netdev_priv(netdev);
936 return pfvf->msg_enable;
941 struct otx2_nic *pfvf = netdev_priv(netdev);
943 pfvf->msg_enable = val;
948 struct otx2_nic *pfvf = netdev_priv(netdev);
951 if (is_otx2_lbkvf(pfvf->pdev))
953 return pfvf->linfo.link_up;
959 struct otx2_nic *pfvf = netdev_priv(netdev);
961 if (!pfvf->ptp)
971 info->phc_index = otx2_ptp_clock_index(pfvf);
974 if (test_bit(CN10K_PTP_ONESTEP, &pfvf->hw.cap_flag))
983 static struct cgx_fw_data *otx2_get_fwdata(struct otx2_nic *pfvf)
989 mutex_lock(&pfvf->mbox.lock);
990 req = otx2_mbox_alloc_msg_cgx_get_aux_link_info(&pfvf->mbox);
992 mutex_unlock(&pfvf->mbox.lock);
996 err = otx2_sync_mbox_msg(&pfvf->mbox);
999 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
1004 mutex_unlock(&pfvf->mbox.lock);
1011 struct otx2_nic *pfvf = netdev_priv(netdev);
1019 if (pfvf->linfo.fec < FEC_MAX_INDEX)
1020 fecparam->active_fec = fec[pfvf->linfo.fec];
1022 rsp = otx2_get_fwdata(pfvf);
1038 struct otx2_nic *pfvf = netdev_priv(netdev);
1039 struct mbox *mbox = &pfvf->mbox;
1056 netdev_warn(pfvf->netdev, "Unsupported FEC mode: %d",
1061 if (fec == pfvf->linfo.fec)
1065 req = otx2_mbox_alloc_msg_cgx_set_fec_param(&pfvf->mbox);
1071 err = otx2_sync_mbox_msg(&pfvf->mbox);
1075 rsp = (struct fec_mode *)otx2_mbox_get_rsp(&pfvf->mbox.mbox,
1078 pfvf->linfo.fec = rsp->fec;
1190 struct otx2_nic *pfvf = netdev_priv(netdev);
1193 cmd->base.duplex = pfvf->linfo.full_duplex;
1194 cmd->base.speed = pfvf->linfo.speed;
1195 cmd->base.autoneg = pfvf->linfo.an;
1197 rsp = otx2_get_fwdata(pfvf);
1281 struct otx2_nic *pfvf = netdev_priv(netdev);
1284 otx2_update_lmac_fec_stats(pfvf);
1287 fec_stats->corrected_blocks.total = pfvf->hw.cgx_fec_corr_blks;
1288 fec_stats->uncorrectable_blocks.total = pfvf->hw.cgx_fec_uncorr_blks;
1290 rsp = otx2_get_fwdata(pfvf);
1292 !otx2_get_phy_fec_stats(pfvf)) {
1296 rsp = otx2_get_fwdata(pfvf);
1300 if (pfvf->linfo.fec == OTX2_FEC_BASER) {
1422 struct otx2_nic *pfvf = netdev_priv(netdev);
1424 if (is_otx2_lbkvf(pfvf->pdev)) {