Lines Matching refs:cpr
886 struct bnxt_cp_ring_info *cpr,
893 &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
906 static void bnxt_reuse_rx_agg_bufs(struct bnxt_cp_ring_info *cpr, u16 idx,
909 struct bnxt_napi *bnapi = cpr->bnapi;
930 agg = bnxt_get_agg(bp, cpr, idx, start + i);
1040 struct bnxt_cp_ring_info *cpr,
1044 struct bnxt_napi *bnapi = cpr->bnapi;
1064 agg = bnxt_get_agg(bp, cpr, idx, i);
1098 bnxt_reuse_rx_agg_bufs(cpr, idx, i, agg_bufs - i, tpa);
1116 static int bnxt_agg_bufs_valid(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
1125 &cpr->cp_desc_ring[CP_RING(last)][CP_IDX(last)];
1154 static int bnxt_discard_rx(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
1177 if (!bnxt_agg_bufs_valid(bp, cpr, agg_bufs, &tmp_raw_cons))
1325 static void bnxt_abort_tpa(struct bnxt_cp_ring_info *cpr, u16 idx, u32 agg_bufs)
1328 bnxt_reuse_rx_agg_bufs(cpr, idx, 0, agg_bufs, true);
1539 struct bnxt_cp_ring_info *cpr,
1545 struct bnxt_napi *bnapi = cpr->bnapi;
1557 int rc = bnxt_discard_rx(bp, cpr, raw_cons, tpa_end);
1585 if (!bnxt_agg_bufs_valid(bp, cpr, agg_bufs, raw_cons))
1600 bnxt_abort_tpa(cpr, idx, agg_bufs);
1610 bnxt_abort_tpa(cpr, idx, agg_bufs);
1619 bnxt_abort_tpa(cpr, idx, agg_bufs);
1634 bnxt_abort_tpa(cpr, idx, agg_bufs);
1642 skb = bnxt_rx_pages(bp, cpr, skb, idx, agg_bufs, true);
1713 static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
1716 struct bnxt_napi *bnapi = cpr->bnapi;
1733 &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
1745 &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
1764 skb = bnxt_tpa_end(bp, cpr, &tmp_raw_cons,
1782 int rc1 = bnxt_discard_rx(bp, cpr, &tmp_raw_cons, rxcmp);
1802 if (!bnxt_agg_bufs_valid(bp, cpr, agg_bufs, &tmp_raw_cons))
1816 bnxt_reuse_rx_agg_bufs(cpr, cp_cons, 0, agg_bufs,
1845 bnxt_reuse_rx_agg_bufs(cpr, cp_cons, 0,
1866 skb = bnxt_rx_pages(bp, cpr, skb, cp_cons, agg_bufs, false);
1919 cpr->rx_packets += 1;
1920 cpr->rx_bytes += len;
1936 struct bnxt_cp_ring_info *cpr,
1947 &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
1952 &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
1972 return bnxt_rx_pkt(bp, cpr, raw_cons, event);
2226 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2227 u32 cons = RING_CMP(cpr->cp_raw_cons);
2229 cpr->event_ctr++;
2230 prefetch(&cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)]);
2235 static inline int bnxt_has_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
2237 u32 raw_cons = cpr->cp_raw_cons;
2241 txcmp = &cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)];
2250 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2251 u32 cons = RING_CMP(cpr->cp_raw_cons);
2254 prefetch(&cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)]);
2256 if (!bnxt_has_work(bp, cpr)) {
2259 if (!(int_status & (0x10000 << cpr->cp_ring_struct.fw_ring_id)))
2264 BNXT_CP_DB_IRQ_DIS(cpr->cp_db.doorbell);
2274 static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
2277 struct bnxt_napi *bnapi = cpr->bnapi;
2278 u32 raw_cons = cpr->cp_raw_cons;
2285 cpr->has_more_work = 0;
2286 cpr->had_work_done = 1;
2291 txcmp = &cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)];
2307 cpr->has_more_work = 1;
2312 rc = bnxt_rx_pkt(bp, cpr, &raw_cons, &event);
2314 rc = bnxt_force_rx_discard(bp, cpr, &raw_cons,
2338 cpr->has_more_work = 1;
2356 cpr->cp_raw_cons = raw_cons;
2379 static int bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
2382 struct bnxt_napi *bnapi = cpr->bnapi;
2385 rx_pkts = __bnxt_poll_work(bp, cpr, budget);
2391 bnxt_db_cq(bp, &cpr->cp_db, cpr->cp_raw_cons);
2401 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2406 u32 raw_cons = cpr->cp_raw_cons;
2415 txcmp = &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
2428 &cpr->cp_desc_ring[CP_RING(cp_cons)][CP_IDX(cp_cons)];
2437 rc = bnxt_rx_pkt(bp, cpr, &raw_cons, &event);
2457 cpr->cp_raw_cons = raw_cons;
2458 BNXT_DB_CQ(&cpr->cp_db, cpr->cp_raw_cons);
2466 if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) {
2468 BNXT_DB_CQ_ARM(&cpr->cp_db, cpr->cp_raw_cons);
2477 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2481 work_done += bnxt_poll_work(bp, cpr, budget - work_done);
2485 BNXT_DB_CQ_ARM(&cpr->cp_db, cpr->cp_raw_cons);
2489 if (!bnxt_has_work(bp, cpr)) {
2491 BNXT_DB_CQ_ARM(&cpr->cp_db, cpr->cp_raw_cons);
2498 dim_update_sample(cpr->event_ctr,
2499 cpr->rx_packets,
2500 cpr->rx_bytes,
2502 net_dim(&cpr->dim, dim_sample);
2509 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2513 struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[i];
2518 cpr->has_more_work |= cpr2->has_more_work;
2527 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2531 struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[i];
2547 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
2548 u32 raw_cons = cpr->cp_raw_cons;
2554 if (cpr->has_more_work) {
2555 cpr->has_more_work = 0;
2560 nqcmp = &cpr->nq_desc_ring[CP_RING(cons)][CP_IDX(cons)];
2563 if (cpr->has_more_work)
2567 cpr->cp_raw_cons = raw_cons;
2569 BNXT_DB_NQ_ARM_P5(&cpr->cp_db,
2570 cpr->cp_raw_cons);
2587 cpr2 = cpr->cp_ring_arr[idx];
2590 cpr->has_more_work |= cpr2->has_more_work;
2597 if (raw_cons != cpr->cp_raw_cons) {
2598 cpr->cp_raw_cons = raw_cons;
2599 BNXT_DB_NQ_P5(&cpr->cp_db, raw_cons);
3119 struct bnxt_cp_ring_info *cpr;
3126 cpr = &bnapi->cp_ring;
3127 ring = &cpr->cp_ring_struct;
3132 struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[j];
3138 cpr->cp_ring_arr[j] = NULL;
3148 struct bnxt_cp_ring_info *cpr;
3151 cpr = kzalloc(sizeof(*cpr), GFP_KERNEL);
3152 if (!cpr)
3155 ring = &cpr->cp_ring_struct;
3159 rmem->pg_arr = (void **)cpr->cp_desc_ring;
3160 rmem->dma_arr = cpr->cp_desc_mapping;
3165 kfree(cpr);
3166 cpr = NULL;
3168 return cpr;
3180 struct bnxt_cp_ring_info *cpr;
3186 cpr = &bnapi->cp_ring;
3187 cpr->bnapi = bnapi;
3188 ring = &cpr->cp_ring_struct;
3206 cpr->cp_ring_arr[BNXT_RX_HDL] = cpr2;
3216 cpr->cp_ring_arr[BNXT_TX_HDL] = cpr2;
3232 struct bnxt_cp_ring_info *cpr;
3240 cpr = &bnapi->cp_ring;
3241 ring = &cpr->cp_ring_struct;
3245 rmem->pg_arr = (void **)cpr->cp_desc_ring;
3246 rmem->dma_arr = cpr->cp_desc_mapping;
3398 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
3399 struct bnxt_ring_struct *ring = &cpr->cp_ring_struct;
3402 cpr->rx_ring_coal.coal_ticks = bp->rx_coal.coal_ticks;
3403 cpr->rx_ring_coal.coal_bufs = bp->rx_coal.coal_bufs;
3405 struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[j];
3951 struct bnxt_cp_ring_info *cpr;
3959 cpr = &bnapi->cp_ring;
3960 stats = &cpr->stats;
4038 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
4040 bnxt_free_stats_mem(bp, &cpr->stats);
4053 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
4055 cpr->stats.len = size;
4056 rc = bnxt_alloc_stats_mem(bp, &cpr->stats, !i);
4060 cpr->hw_stats_ctx_id = INVALID_STATS_CTX_ID;
4116 struct bnxt_cp_ring_info *cpr;
4123 cpr = &bnapi->cp_ring;
4124 cpr->cp_raw_cons = 0;
4244 struct bnxt_cp_ring_info *cpr =
4247 cpr->cp_ring_struct.ring_mem.flags =
4355 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
4356 struct bnxt_ring_struct *ring = &cpr->cp_ring_struct;
4359 bnxt_db_nq(bp, &cpr->cp_db, cpr->cp_raw_cons);
4366 struct bnxt_cp_ring_info *cpr;
4368 cpr = &bnapi->cp_ring;
4369 return cpr->cp_ring_struct.map_idx;
4393 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
4395 bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons);
5080 struct bnxt_cp_ring_info *cpr;
5082 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_RX_HDL];
5083 return cpr->cp_ring_struct.fw_ring_id;
5093 struct bnxt_cp_ring_info *cpr;
5095 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_TX_HDL];
5096 return cpr->cp_ring_struct.fw_ring_id;
5759 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
5760 struct bnxt_ring_struct *ring = &cpr->cp_ring_struct;
5771 bnxt_set_db(bp, &cpr->cp_db, type, map_idx, ring->fw_ring_id);
5772 bnxt_db_nq(bp, &cpr->cp_db, cpr->cp_raw_cons);
5791 struct bnxt_cp_ring_info *cpr, *cpr2;
5794 cpr = &bnapi->cp_ring;
5795 cpr2 = cpr->cp_ring_arr[BNXT_TX_HDL];
5830 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
5834 cpr2 = cpr->cp_ring_arr[BNXT_RX_HDL];
5973 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
5978 struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[j];
5990 ring = &cpr->cp_ring_struct;
6586 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
6596 req.ring_id = cpu_to_le16(cpr->cp_ring_struct.fw_ring_id);
6610 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
6618 coal.coal_ticks = cpr->rx_ring_coal.coal_ticks;
6619 coal.coal_bufs = cpr->rx_ring_coal.coal_bufs;
6709 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
6711 if (cpr->hw_stats_ctx_id != INVALID_STATS_CTX_ID) {
6712 req.stat_ctx_id = cpu_to_le32(cpr->hw_stats_ctx_id);
6721 cpr->hw_stats_ctx_id = INVALID_STATS_CTX_ID;
6744 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
6746 req.stats_dma_addr = cpu_to_le64(cpr->stats.hw_stats_map);
6753 cpr->hw_stats_ctx_id = le32_to_cpu(resp->stat_ctx_id);
6755 bp->grp_info[i].fw_stats_ctx = cpr->hw_stats_ctx_id;
7904 struct bnxt_cp_ring_info *cpr;
7907 cpr = &bnapi->cp_ring;
7908 stats = &cpr->stats;
8927 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
8931 cancel_work_sync(&cpr->dim.work);
8941 struct bnxt_cp_ring_info *cpr;
8943 cpr = &bnapi->cp_ring;
8945 cpr->sw_stats.rx.rx_resets++;
8949 INIT_WORK(&cpr->dim.work, bnxt_dim_work);
8950 cpr->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
10180 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
10181 u64 *sw = cpr->stats.sw_stats;
10691 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
10695 i, cpr->cp_ring_struct.fw_ring_id, cpr->cp_raw_cons);
10718 struct bnxt_cp_ring_info *cpr;
10721 cpr = &bnapi->cp_ring;
10722 cp_ring_id = cpr->cp_ring_struct.fw_ring_id;
10882 struct bnxt_cp_ring_info *cpr;
10905 cpr = &rxr->bnapi->cp_ring;
10906 cpr->sw_stats.rx.rx_resets++;
11065 struct bnxt_cp_ring_info *cpr;
11072 cpr = &bnapi->cp_ring;
11074 struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[j];
11089 cpr->sw_stats.cmn.missed_irqs++;