Skip to content

Commit fe63a69

Browse files
committed
octeon: use per tx-queue aura
Type: fix JIRA: https://essjira.marvell.com/browse/IPBUSW-63283 Signed-off-by: Monendra Singh Kushwaha <[email protected]> Change-Id: If52c025a4c0666e2c602114645a0e095d24628ff Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/toolkits/vpp/+/147984 Tested-by: sa_ip-toolkits-Jenkins <[email protected]> Tested-by: sa_ip-sw-jenkins <[email protected]> Reviewed-by: Nithin Kumar Dabilpuram <[email protected]> (cherry picked from commit ab23bbf5a131a005a4a1b051950f9dd7f1313210) Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/toolkits/vpp/+/148019
1 parent ca14795 commit fe63a69

File tree

4 files changed

+23
-47
lines changed

4 files changed

+23
-47
lines changed

src/plugins/dev_octeon/init.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ oct_init_nix (vlib_main_t *vm, vnet_dev_t *dev)
300300
},
301301
};
302302

303-
if (om->use_single_rx_tx_aura && !om->rx_aura_handle)
303+
if (om->use_single_rx_aura && !om->rx_aura_handle)
304304
{
305305
if ((rrv = roc_npa_pool_create (&om->rx_aura_handle, bp->alloc_size,
306306
bp->n_buffers, &aura, &npapool, 0)))
@@ -422,7 +422,7 @@ oct_init_inl_dev (vlib_main_t *vm, vnet_dev_t *dev)
422422
if ((rv = oct_init_ipsec_backend (vm, dev)))
423423
return rv;
424424

425-
oct_main.use_single_rx_tx_aura = 1;
425+
oct_main.use_single_rx_aura = 1;
426426
oct_main.inl_dev_initialized = 1;
427427

428428
return VNET_DEV_OK;
@@ -688,7 +688,7 @@ oct_early_config (vlib_main_t *vm, unformat_input_t *input)
688688
unformat_input_t _line_input, *line_input = &_line_input;
689689
clib_error_t *error = 0;
690690

691-
oct_main.use_single_rx_tx_aura = 1;
691+
oct_main.use_single_rx_aura = 1;
692692
oct_inl_dev_main.in_min_spi = 0;
693693
oct_inl_dev_main.in_max_spi = 8192;
694694
oct_inl_dev_main.out_max_sa = 8192;
@@ -700,8 +700,8 @@ oct_early_config (vlib_main_t *vm, unformat_input_t *input)
700700
{
701701
if (unformat (line_input, "max-pools %u", &oct_npa_max_pools))
702702
;
703-
if (unformat (line_input, "disable-single-rx-tx-aura"))
704-
oct_main.use_single_rx_tx_aura = 0;
703+
if (unformat (line_input, "disable-single-rx-aura"))
704+
oct_main.use_single_rx_aura = 0;
705705
else if (unformat (line_input, "ipsec_in_min_spi %u",
706706
&oct_inl_dev_main.in_min_spi))
707707
;

src/plugins/dev_octeon/octeon.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@ typedef struct
170170
{
171171
oct_device_t **oct_dev;
172172
u8 inl_dev_initialized : 1;
173-
u8 use_single_rx_tx_aura : 1;
173+
u8 use_single_rx_aura : 1;
174174
u64 rx_aura_handle;
175-
u64 tx_aura_handle;
176175
} oct_main_t;
177176

178177
extern oct_main_t oct_main;

src/plugins/dev_octeon/queue.c

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ oct_rxq_init (vlib_main_t *vm, vnet_dev_rx_queue_t *rxq, u32 total_sz)
103103

104104
ASSERT (!(vm->buffer_main->ext_hdr_size % ROC_ALIGN));
105105

106-
if (!om->use_single_rx_tx_aura)
106+
if (!om->use_single_rx_aura)
107107
total_sz = rxq->size;
108108

109-
if (!om->use_single_rx_tx_aura || !om->rx_aura_handle)
109+
if (!om->use_single_rx_aura || !om->rx_aura_handle)
110110
{
111111
if ((rrv = roc_npa_pool_create (&crq->aura_handle, bp->alloc_size,
112112
total_sz, &aura, &npapool, 0)))
@@ -224,35 +224,22 @@ oct_rxq_deinit (vlib_main_t *vm, vnet_dev_rx_queue_t *rxq)
224224
vnet_dev_rv_t
225225
oct_txq_init (vlib_main_t *vm, vnet_dev_tx_queue_t *txq)
226226
{
227-
oct_main_t *om = &oct_main;
228227
oct_txq_t *ctq = vnet_dev_get_tx_queue_data (txq);
229228
vnet_dev_t *dev = txq->port->dev;
230229
oct_device_t *cd = vnet_dev_get_data (dev);
231230
struct roc_nix *nix = cd->nix;
232231
struct npa_aura_s aura = {};
233232
struct npa_pool_s npapool = { .nat_align = 1,
234233
.buf_offset = OCT_EXT_HDR_SIZE / ROC_ALIGN };
235-
int rrv;
236-
u32 n_buffers = 0;
237234
vlib_buffer_pool_t *bp = vlib_get_buffer_pool (vm, 0);
235+
int rrv;
238236

239-
if (om->use_single_rx_tx_aura)
240-
n_buffers = bp->n_buffers;
241-
else
242-
n_buffers = txq->size * 6;
243-
244-
if (!om->use_single_rx_tx_aura || !om->tx_aura_handle)
237+
if ((rrv = roc_npa_pool_create (&ctq->aura_handle, bp->alloc_size,
238+
bp->n_buffers, &aura, &npapool, 0)))
245239
{
246-
if ((rrv = roc_npa_pool_create (&ctq->aura_handle, bp->alloc_size,
247-
n_buffers, &aura, &npapool, 0)))
248-
{
249-
oct_txq_deinit (vm, txq);
250-
return oct_roc_err (dev, rrv, "roc_npa_pool_create() failed");
251-
}
252-
om->tx_aura_handle = ctq->aura_handle;
240+
oct_txq_deinit (vm, txq);
241+
return oct_roc_err (dev, rrv, "roc_npa_pool_create() failed");
253242
}
254-
else
255-
ctq->aura_handle = om->tx_aura_handle;
256243

257244
ctq->npa_pool_initialized = 1;
258245
log_notice (dev, "NPA pool created, aura_handle = 0x%lx", ctq->aura_handle);

src/plugins/dev_octeon/tx_node.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,11 +1263,11 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
12631263
{
12641264
oct_ipsec_main_t *im = &oct_ipsec_main;
12651265
oct_txq_t *ctq = vnet_dev_get_tx_queue_data (txq);
1266+
u64 aura_handle = ctq->aura_handle;
12661267
vnet_dev_t *dev = txq->port->dev;
12671268
oct_device_t *cd = vnet_dev_get_data (dev);
12681269
u32 current_sq0, current_sq1, current_sq2, current_sq3;
12691270
u64 sq_handle0, sq_handle1, sq_handle2, sq_handle3;
1270-
u64 aura_handle0, aura_handle1, aura_handle2, aura_handle3;
12711271
u32 sa0_index, sa1_index, sa2_index, sa3_index;
12721272
u32 current_sa0_index = ~0, current_sa1_index = ~0;
12731273
u32 current_sa2_index = ~0, current_sa3_index = ~0;
@@ -1297,11 +1297,6 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
12971297
sq_handle2 = 0;
12981298
sq_handle3 = 0;
12991299

1300-
aura_handle0 = 0;
1301-
aura_handle1 = 0;
1302-
aura_handle2 = 0;
1303-
aura_handle3 = 0;
1304-
13051300
current_sq0 = ~0;
13061301
current_sq1 = ~0;
13071302
current_sq2 = ~0;
@@ -1441,7 +1436,6 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
14411436
ctq = cd->ctqs[sq0];
14421437
sq = &ctq->sq;
14431438
sq_handle0 = sq->qid;
1444-
aura_handle0 = ctq->aura_handle;
14451439
n_left0 = oct_check_fc_nix (sq, &ctq->cached_pkts, n_packets >> 2);
14461440
current_sq0 = sq0;
14471441
}
@@ -1450,7 +1444,6 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
14501444
ctq = cd->ctqs[sq1];
14511445
sq = &ctq->sq;
14521446
sq_handle1 = sq->qid;
1453-
aura_handle1 = ctq->aura_handle;
14541447
n_left1 = oct_check_fc_nix (sq, &ctq->cached_pkts, n_packets >> 2);
14551448
current_sq1 = sq1;
14561449
}
@@ -1459,7 +1452,6 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
14591452
ctq = cd->ctqs[sq2];
14601453
sq = &ctq->sq;
14611454
sq_handle2 = sq->qid;
1462-
aura_handle2 = ctq->aura_handle;
14631455
n_left2 = oct_check_fc_nix (sq, &ctq->cached_pkts, n_packets >> 2);
14641456
current_sq2 = sq2;
14651457
}
@@ -1468,7 +1460,6 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
14681460
ctq = cd->ctqs[sq3];
14691461
sq = &ctq->sq;
14701462
sq_handle3 = sq->qid;
1471-
aura_handle3 = ctq->aura_handle;
14721463
n_left3 = oct_check_fc_nix (sq, &ctq->cached_pkts, n_packets >> 2);
14731464
current_sq3 = sq3;
14741465
}
@@ -1480,13 +1471,13 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
14801471
lmt_arg = ROC_CN10K_CPT_LMT_ARG | (uint64_t) core_lmt_id;
14811472
if (quad_bit == 0x0F)
14821473
{
1483-
oct_prepare_ipsec_inst (vm, b[0], sq_handle0, aura_handle0,
1474+
oct_prepare_ipsec_inst (vm, b[0], sq_handle0, aura_handle,
14841475
&pkt_meta[0], &inst0, &n_dwords[0], sess0);
1485-
oct_prepare_ipsec_inst (vm, b[1], sq_handle1, aura_handle1,
1476+
oct_prepare_ipsec_inst (vm, b[1], sq_handle1, aura_handle,
14861477
&pkt_meta[1], &inst1, &n_dwords[1], sess1);
1487-
oct_prepare_ipsec_inst (vm, b[2], sq_handle2, aura_handle2,
1478+
oct_prepare_ipsec_inst (vm, b[2], sq_handle2, aura_handle,
14881479
&pkt_meta[2], &inst2, &n_dwords[2], sess2);
1489-
oct_prepare_ipsec_inst (vm, b[3], sq_handle3, aura_handle3,
1480+
oct_prepare_ipsec_inst (vm, b[3], sq_handle3, aura_handle,
14901481
&pkt_meta[3], &inst3, &n_dwords[3], sess3);
14911482

14921483
oct_submit_quad_packets (lmt_arg, cd, &inst0, &inst1, &inst2, &inst3,
@@ -1502,7 +1493,7 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
15021493
{
15031494
if (n_left0)
15041495
{
1505-
oct_prepare_ipsec_inst (vm, b[0], sq_handle0, aura_handle0,
1496+
oct_prepare_ipsec_inst (vm, b[0], sq_handle0, aura_handle,
15061497
&pkt_meta[0], &inst0, &n_dwords[0],
15071498
sess0),
15081499
roc_lmt_mov_seg ((void *) lmt_line[count], &inst0, 4);
@@ -1516,7 +1507,7 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
15161507
}
15171508
if (n_left1)
15181509
{
1519-
oct_prepare_ipsec_inst (vm, b[1], sq_handle1, aura_handle1,
1510+
oct_prepare_ipsec_inst (vm, b[1], sq_handle1, aura_handle,
15201511
&pkt_meta[1], &inst1, &n_dwords[1],
15211512
sess1);
15221513
roc_lmt_mov_seg ((void *) lmt_line[count], &inst1, 4);
@@ -1532,7 +1523,7 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
15321523
}
15331524
if (n_left2)
15341525
{
1535-
oct_prepare_ipsec_inst (vm, b[2], sq_handle2, aura_handle2,
1526+
oct_prepare_ipsec_inst (vm, b[2], sq_handle2, aura_handle,
15361527
&pkt_meta[2], &inst2, &n_dwords[2],
15371528
sess2);
15381529
roc_lmt_mov_seg ((void *) lmt_line[count], &inst2, 4);
@@ -1548,7 +1539,7 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
15481539
}
15491540
if (n_left3)
15501541
{
1551-
oct_prepare_ipsec_inst (vm, b[3], sq_handle3, aura_handle3,
1542+
oct_prepare_ipsec_inst (vm, b[3], sq_handle3, aura_handle,
15521543
&pkt_meta[3], &inst3, &n_dwords[3],
15531544
sess3);
15541545
roc_lmt_mov_seg ((void *) lmt_line[count], &inst3, 4);
@@ -1618,7 +1609,6 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
16181609
ctq = cd->ctqs[sq0];
16191610
sq = &ctq->sq;
16201611
sq_handle0 = sq->qid;
1621-
aura_handle0 = ctq->aura_handle;
16221612
n_left0 = oct_check_fc_nix (sq, &ctq->cached_pkts, n_packets);
16231613
current_sq0 = sq0;
16241614
}
@@ -1629,7 +1619,7 @@ oct_pkts_send_ipsec (vlib_main_t *vm, vlib_node_runtime_t *node,
16291619
goto next;
16301620
}
16311621

1632-
oct_prepare_ipsec_inst (vm, b[0], sq_handle0, aura_handle0, &pkt_meta[0],
1622+
oct_prepare_ipsec_inst (vm, b[0], sq_handle0, aura_handle, &pkt_meta[0],
16331623
&inst0, &n_dwords[0], sess0);
16341624

16351625
roc_lmt_mov_seg ((void *) lmt_line[0], &inst0, 4);

0 commit comments

Comments
 (0)