Skip to content

Commit 508c58f

Browse files
Hariprasad Kelamdavem330
authored andcommitted
octeontx2-pf: Rename tot_tx_queues to non_qos_queues
current implementation is such that tot_tx_queues contains both xdp queues and normal tx queues. which will be allocated in interface open calls and deallocated on interface down calls respectively. With addition of QOS, where send quees are allocated/deallacated upon user request Qos send queues won't be part of tot_tx_queues. So this patch renames tot_tx_queues to non_qos_queues. Signed-off-by: Hariprasad Kelam <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 12e7789 commit 508c58f

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ void otx2_sqb_flush(struct otx2_nic *pfvf)
762762
int timeout = 1000;
763763

764764
ptr = (u64 *)otx2_get_regaddr(pfvf, NIX_LF_SQ_OP_STATUS);
765-
for (qidx = 0; qidx < pfvf->hw.tot_tx_queues; qidx++) {
765+
for (qidx = 0; qidx < pfvf->hw.non_qos_queues; qidx++) {
766766
incr = (u64)qidx << 32;
767767
while (timeout) {
768768
val = otx2_atomic64_add(incr, ptr);
@@ -1048,7 +1048,7 @@ int otx2_config_nix_queues(struct otx2_nic *pfvf)
10481048
}
10491049

10501050
/* Initialize TX queues */
1051-
for (qidx = 0; qidx < pfvf->hw.tot_tx_queues; qidx++) {
1051+
for (qidx = 0; qidx < pfvf->hw.non_qos_queues; qidx++) {
10521052
u16 sqb_aura = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx);
10531053

10541054
err = otx2_sq_init(pfvf, qidx, sqb_aura);
@@ -1095,7 +1095,7 @@ int otx2_config_nix(struct otx2_nic *pfvf)
10951095

10961096
/* Set RQ/SQ/CQ counts */
10971097
nixlf->rq_cnt = pfvf->hw.rx_queues;
1098-
nixlf->sq_cnt = pfvf->hw.tot_tx_queues;
1098+
nixlf->sq_cnt = pfvf->hw.non_qos_queues;
10991099
nixlf->cq_cnt = pfvf->qset.cq_cnt;
11001100
nixlf->rss_sz = MAX_RSS_INDIR_TBL_SIZE;
11011101
nixlf->rss_grps = MAX_RSS_GROUPS;
@@ -1133,7 +1133,7 @@ void otx2_sq_free_sqbs(struct otx2_nic *pfvf)
11331133
int sqb, qidx;
11341134
u64 iova, pa;
11351135

1136-
for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
1136+
for (qidx = 0; qidx < hw->non_qos_queues; qidx++) {
11371137
sq = &qset->sq[qidx];
11381138
if (!sq->sqb_ptrs)
11391139
continue;
@@ -1349,7 +1349,7 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf)
13491349
stack_pages =
13501350
(num_sqbs + hw->stack_pg_ptrs - 1) / hw->stack_pg_ptrs;
13511351

1352-
for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
1352+
for (qidx = 0; qidx < hw->non_qos_queues; qidx++) {
13531353
pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx);
13541354
/* Initialize aura context */
13551355
err = otx2_aura_init(pfvf, pool_id, pool_id, num_sqbs);
@@ -1369,7 +1369,7 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf)
13691369
goto fail;
13701370

13711371
/* Allocate pointers and free them to aura/pool */
1372-
for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
1372+
for (qidx = 0; qidx < hw->non_qos_queues; qidx++) {
13731373
pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx);
13741374
pool = &pfvf->qset.pool[pool_id];
13751375

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ struct otx2_hw {
190190
u16 rx_queues;
191191
u16 tx_queues;
192192
u16 xdp_queues;
193-
u16 tot_tx_queues;
193+
u16 non_qos_queues; /* tx queues plus xdp queues */
194194
u16 max_queues;
195195
u16 pool_cnt;
196196
u16 rqpool_cnt;

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ static irqreturn_t otx2_q_intr_handler(int irq, void *data)
12571257
}
12581258

12591259
/* SQ */
1260-
for (qidx = 0; qidx < pf->hw.tot_tx_queues; qidx++) {
1260+
for (qidx = 0; qidx < pf->hw.non_qos_queues; qidx++) {
12611261
u64 sq_op_err_dbg, mnq_err_dbg, snd_err_dbg;
12621262
u8 sq_op_err_code, mnq_err_code, snd_err_code;
12631263

@@ -1383,7 +1383,7 @@ static void otx2_free_sq_res(struct otx2_nic *pf)
13831383
otx2_ctx_disable(&pf->mbox, NIX_AQ_CTYPE_SQ, false);
13841384
/* Free SQB pointers */
13851385
otx2_sq_free_sqbs(pf);
1386-
for (qidx = 0; qidx < pf->hw.tot_tx_queues; qidx++) {
1386+
for (qidx = 0; qidx < pf->hw.non_qos_queues; qidx++) {
13871387
sq = &qset->sq[qidx];
13881388
qmem_free(pf->dev, sq->sqe);
13891389
qmem_free(pf->dev, sq->tso_hdrs);
@@ -1433,7 +1433,7 @@ static int otx2_init_hw_resources(struct otx2_nic *pf)
14331433
* so, aura count = pool count.
14341434
*/
14351435
hw->rqpool_cnt = hw->rx_queues;
1436-
hw->sqpool_cnt = hw->tot_tx_queues;
1436+
hw->sqpool_cnt = hw->non_qos_queues;
14371437
hw->pool_cnt = hw->rqpool_cnt + hw->sqpool_cnt;
14381438

14391439
/* Maximum hardware supported transmit length */
@@ -1688,7 +1688,7 @@ int otx2_open(struct net_device *netdev)
16881688

16891689
netif_carrier_off(netdev);
16901690

1691-
pf->qset.cq_cnt = pf->hw.rx_queues + pf->hw.tot_tx_queues;
1691+
pf->qset.cq_cnt = pf->hw.rx_queues + pf->hw.non_qos_queues;
16921692
/* RQ and SQs are mapped to different CQs,
16931693
* so find out max CQ IRQs (i.e CINTs) needed.
16941694
*/
@@ -1708,7 +1708,7 @@ int otx2_open(struct net_device *netdev)
17081708
if (!qset->cq)
17091709
goto err_free_mem;
17101710

1711-
qset->sq = kcalloc(pf->hw.tot_tx_queues,
1711+
qset->sq = kcalloc(pf->hw.non_qos_queues,
17121712
sizeof(struct otx2_snd_queue), GFP_KERNEL);
17131713
if (!qset->sq)
17141714
goto err_free_mem;
@@ -2529,7 +2529,7 @@ static int otx2_xdp_setup(struct otx2_nic *pf, struct bpf_prog *prog)
25292529
xdp_features_clear_redirect_target(dev);
25302530
}
25312531

2532-
pf->hw.tot_tx_queues += pf->hw.xdp_queues;
2532+
pf->hw.non_qos_queues += pf->hw.xdp_queues;
25332533

25342534
if (if_up)
25352535
otx2_open(pf->netdev);
@@ -2760,7 +2760,7 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
27602760
hw->pdev = pdev;
27612761
hw->rx_queues = qcount;
27622762
hw->tx_queues = qcount;
2763-
hw->tot_tx_queues = qcount;
2763+
hw->non_qos_queues = qcount;
27642764
hw->max_queues = qcount;
27652765
hw->rbuf_len = OTX2_DEFAULT_RBUF_LEN;
27662766
/* Use CQE of 128 byte descriptor size by default */

drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
570570
hw->rx_queues = qcount;
571571
hw->tx_queues = qcount;
572572
hw->max_queues = qcount;
573-
hw->tot_tx_queues = qcount;
573+
hw->non_qos_queues = qcount;
574574
hw->rbuf_len = OTX2_DEFAULT_RBUF_LEN;
575575
/* Use CQE of 128 byte descriptor size by default */
576576
hw->xqe_size = 128;

0 commit comments

Comments
 (0)