net/cnxk: resolve sefgault caused during transmit completion
PATCH 1/15 net/cnxk: resolve sefgault caused during transmit completion
From: Rakesh Kudurumalla <[email protected]>
while sending external buffers from application if tx_compl_ena is not provided as devargs, cq for transmit completion is not initialized but the same is accessed in driver resulting in segfault. This patch fixes the same by calling callback handler before the actual packet is transmitted
---
Depends-on: series-27133 ("common/cnxk: add cnf10ka A1 platform")
drivers/net/cnxk/cn10k_tx.h | 4 ++++ drivers/net/cnxk/cn9k_tx.h | 4 ++++ 2 files changed, 8 insertions(+)
drivers/net/cnxk/cn10k_tx.h +4 -0
@@ -650,6 +650,10 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,uint32_t sqe_id;if (RTE_MBUF_HAS_EXTBUF (m)) { +if (unlikely (txq->tx_compl.ena ==0 )) { +rte_pktmbuf_free_seg (m); +return 1 ; + }if (send_hdr->w0.pnc) { txq->tx_compl.ptr[send_hdr->w1.sqe_id]->next = m; }else {
drivers/net/cnxk/cn9k_tx.h +4 -0
@@ -88,6 +88,10 @@ cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq,uint32_t sqe_id;if (RTE_MBUF_HAS_EXTBUF (m)) { +if (unlikely (txq->tx_compl.ena ==0 )) { +rte_pktmbuf_free_seg (m); +return 1 ; + }if (send_hdr->w0.pnc) { txq->tx_compl.ptr[send_hdr->w1.sqe_id]->next = m; }else {
Signature · 1 line
2.25.1
PATCH 2/15 net/cnxk: fix data len for first seg with multi seg pkt
When coming from vector routine, the first seg length is set to same as pkt len assuming it is a single segment pkt. Read just the same in cn10k_nix_prepare_mseg() that is called in case of mbuf-fast-free offload disabled.
In CN9K, clear other data len fields to avoid using stale data.
--- drivers/net/cnxk/cn10k_tx.h | 24 +++++++++++++++++++----- drivers/net/cnxk/cn9k_tx.h | 1 + 2 files changed, 20 insertions(+), 5 deletions(-)
drivers/net/cnxk/cn10k_tx.h +19 -5
@@ -1012,9 +1012,13 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq, ol_flags = m->ol_flags;/* Start from second segment, first segment is already there */ + dlen = m->data_len; is_sg2 =0 ; l_sg.u = sg->u; - len -= l_sg.u &0xFFFF ; +/* Clear l_sg.u first seg length that might be stale from vector path */ + l_sg.u &= ~0xFFFFUL ; + l_sg.u |= dlen; + len -= dlen; nb_segs = m->nb_segs -1 ; m_next = m->next; slist = &cmd[3 + off +1 ];
@@ -1940,7 +1944,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,uint64x2_t xtmp128, ytmp128;uint64x2_t xmask01, xmask23;uintptr_t c_laddr = laddr; -uint8_t lnum, shift, loff; +uint8_t lnum, shift, loff =0 ;rte_iova_t c_io_addr;uint64_t sa_base;union wdata {
@@ -2059,10 +2063,20 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, !!(flags &NIX_TX_OFFLOAD_TSTAMP_F ); } -/* Check if there are enough LMTLINES for this loop */ -if (lnum +4 >32 ) { +/* Check if there are enough LMTLINES for this loop. +* Consider previous line to be partial. +*/ +if (lnum +4 >=32 ) {uint8_t ldwords_con =0 , lneeded =0 ; -for (j =0 ; j <NIX_DESCS_PER_LOOP ; j++) { + +if ((loff >>4 ) + segdw[0 ] >8 ) { + lneeded +=1 ; + ldwords_con = segdw[0 ]; + }else { + ldwords_con = (loff >>4 ) + segdw[0 ]; + } + +for (j =1 ; j <NIX_DESCS_PER_LOOP ; j++) { ldwords_con += segdw[j];if (ldwords_con >8 ) { lneeded +=1 ;
drivers/net/cnxk/cn9k_tx.h +1 -0
@@ -461,6 +461,7 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,/* Start from second segment, first segment is already there */ i =1 ; sg_u = sg->u; + sg_u &=0xFC0000000000FFFF ; nb_segs = m->nb_segs -1 ; m_next = m->next; slist = &cmd[3 + off +1 ];
Signature · 1 line
2.25.1
PATCH 3/15 net/cnxk: release LBK bpid for after freeing resources
In reply to Nithin DabilpuramFrom: Rakesh Kudurumalla <[email protected]>
bpids are not disabled while freeing resources for NIX device as a result a new bpid is assigned which leads to exhaustion of bpid's after soft exit of application. This patch fixes the same
--- drivers/net/cnxk/cnxk_ethdev.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/net/cnxk/cnxk_ethdev.c +28 -0
@@ -900,6 +900,27 @@ cnxk_rss_ethdev_to_nix(struct cnxk_eth_dev *dev, uint64_t ethdev_rss,return flowkey_cfg; } +static int +nix_rxchan_cfg_disable (struct cnxk_eth_dev *dev) +{ +struct roc_nix *nix = &dev->nix; +struct roc_nix_fc_cfg fc_cfg; +int rc; + +if (!roc_nix_is_lbk (nix)) +return 0 ; + +memset (&fc_cfg,0 ,sizeof (struct roc_nix_fc_cfg )); + fc_cfg.type =ROC_NIX_FC_RXCHAN_CFG ; + fc_cfg.rxchan_cfg.enable = false; + rc =roc_nix_fc_config_set (nix, &fc_cfg); +if (rc) { +plt_err ("Failed to setup flow control, rc=%d(%s)" , rc,roc_error_msg_get (rc)); +return rc; + } +return 0 ; +} +static void nix_free_queue_mem (struct cnxk_eth_dev *dev) {
@@ -1218,6 +1239,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) goto fail_configure;roc_nix_tm_fini (nix); +nix_rxchan_cfg_disable (dev);roc_nix_lf_free (nix); }
@@ -1456,6 +1478,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)roc_nix_tm_fini (nix); free_nix_lf:nix_free_queue_mem (dev); + rc |=nix_rxchan_cfg_disable (dev); rc |=roc_nix_lf_free (nix); fail_configure: dev->configured =0 ;
@@ -2026,6 +2049,11 @@ cnxk_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool reset)/* Free ROC RQ's, SQ's and CQ's memory */ nix_free_queue_mem (dev); +/* free nix bpid */ + rc =nix_rxchan_cfg_disable (dev); +if (rc) +plt_err ("Failed to free nix bpid, rc=%d" , rc); +/* Free nix lf resources */ rc =roc_nix_lf_free (nix);if (rc)
Signature · 1 line
2.25.1
PATCH 4/15 common/cnxk: add separate inline dev stats API
In reply to Nithin DabilpuramFrom: Kommula Shiva Shankar <[email protected]>
This patch adds separate inline dev stats api,
thus avoiding expensive nix xstats call
--- drivers/common/cnxk/roc_nix_inl.h | 1 + drivers/common/cnxk/roc_nix_inl_dev.c | 33 +++++++++++++++++++++++++++ drivers/common/cnxk/version.map | 1 + 3 files changed, 35 insertions(+)
drivers/common/cnxk/roc_nix_inl.h +1 -0
@@ -152,6 +152,7 @@ bool __roc_api roc_nix_inl_dev_is_probed(void); void __roc_api roc_nix_inl_dev_lock(void); void __roc_api roc_nix_inl_dev_unlock(void); int __roc_api roc_nix_inl_dev_xaq_realloc(uint64_t aura_handle); +int __roc_api roc_nix_inl_dev_stats_get(struct roc_nix_stats *stats); uint16_t __roc_api roc_nix_inl_dev_pffunc_get(void);/* NIX Inline Inbound API */
drivers/common/cnxk/roc_nix_inl_dev.c +33 -0
@@ -15,6 +15,8 @@ ROC_NIX_LF_RX_CFG_IP6_UDP_OPT | ROC_NIX_LF_RX_CFG_DIS_APAD | \ ROC_NIX_LF_RX_CFG_LEN_IL3 | ROC_NIX_LF_RX_CFG_LEN_OL3) +#define INL_NIX_RX_STATS (val) plt_read64(inl_dev->nix_base + NIX_LF_RX_STATX(val)) +extern uint32_t soft_exp_consumer_cnt;static bool soft_exp_poll_thread_exit = true;
@@ -832,6 +834,37 @@ nix_inl_outb_poll_thread_setup(struct nix_inl_dev *inl_dev)return rc; } +int +roc_nix_inl_dev_stats_get (struct roc_nix_stats *stats) +{ +struct idev_cfg *idev =idev_get_cfg (); +struct nix_inl_dev *inl_dev =NULL ; + +if (stats ==NULL ) +return NIX_ERR_PARAM ; + +if (!idev && idev->nix_inl_dev) + inl_dev = idev->nix_inl_dev; + +if (!inl_dev) +return -EINVAL ; + + stats->rx_octs =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_OCTS ); + stats->rx_ucast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_UCAST ); + stats->rx_bcast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_BCAST ); + stats->rx_mcast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_MCAST ); + stats->rx_drop =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_DROP ); + stats->rx_drop_octs =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_DROP_OCTS ); + stats->rx_fcs =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_FCS ); + stats->rx_err =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_ERR ); + stats->rx_drop_bcast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_DRP_BCAST ); + stats->rx_drop_mcast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_DRP_MCAST ); + stats->rx_drop_l3_bcast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_DRP_L3BCAST ); + stats->rx_drop_l3_mcast =INL_NIX_RX_STATS (NIX_STAT_LF_RX_RX_DRP_L3MCAST ); + +return 0 ; +} +int roc_nix_inl_dev_init (struct roc_nix_inl_dev *roc_inl_dev) {
drivers/common/cnxk/version.map +1 -0
@@ -146,6 +146,7 @@ INTERNAL { roc_nix_inl_dev_fini; roc_nix_inl_dev_init; roc_nix_inl_dev_is_probed; + roc_nix_inl_dev_stats_get; roc_nix_inl_dev_lock; roc_nix_inl_dev_pffunc_get; roc_nix_inl_dev_rq;
Signature · 1 line
2.25.1
PATCH 5/15 common/cnxk: distribute SQ's to sdp channels
In reply to Nithin DabilpuramFrom: Veerasenareddy Burru <[email protected]>
map SQ's to SDP channels using round-robin policy.
--- drivers/common/cnxk/roc_nix_queue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/common/cnxk/roc_nix_queue.c +6 -3
@@ -1202,9 +1202,9 @@ sq_cn9k_fini(struct nix *nix, struct roc_nix_sq *sq) }static int -sq_init (struct nix *nix,struct roc_nix_sq *sq,uint32_t rr_quantum, -uint16_t smq) +sq_init (struct nix *nix,struct roc_nix_sq *sq,uint32_t rr_quantum,uint16_t smq) { +struct roc_nix *roc_nix =nix_priv_to_roc_nix (nix);struct mbox *mbox = (&nix->dev)->mbox;struct nix_cn10k_aq_enq_req *aq;
@@ -1220,7 +1220,10 @@ sq_init(struct nix *nix, struct roc_nix_sq *sq, uint32_t rr_quantum, aq->sq.max_sqe_size = sq->max_sqe_sz; aq->sq.smq = smq; aq->sq.smq_rr_weight = rr_quantum; - aq->sq.default_chan = nix->tx_chan_base; +if (roc_nix_is_sdp (roc_nix)) + aq->sq.default_chan = nix->tx_chan_base + (sq->qid % nix->tx_chan_cnt); +else + aq->sq.default_chan = nix->tx_chan_base; aq->sq.sqe_stype =NIX_STYPE_STF ; aq->sq.ena =1 ; aq->sq.sso_ena = !!sq->sso_ena;
Signature · 1 line
2.25.1
PATCH 6/15 common/cnxk: remove flow control config at queue setup
In reply to Nithin DabilpuramRemove flow control default enable/disable from queue setup time and move it to explicit per queue setup after device is configured and as part of device start.
Also remove TM node ref count for flow control to avoid ref count mismatch. For user tree, on user disabling flow control or PFC on one SQ would clear the config from corresponding TM node immediately irrespective of other SQ connections.
--- drivers/common/cnxk/roc_nix.c | 18 +++--- drivers/common/cnxk/roc_nix.h | 1 + drivers/common/cnxk/roc_nix_debug.c | 2 + drivers/common/cnxk/roc_nix_fc.c | 67 +++++++-------------- drivers/common/cnxk/roc_nix_priv.h | 7 ++- drivers/common/cnxk/roc_nix_queue.c | 14 ++--- drivers/common/cnxk/roc_nix_tm.c | 81 +++++++++++--------------- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_nix_tm_utils.c | 14 +---- 9 files changed, 82 insertions(+), 124 deletions(-)
drivers/common/cnxk/roc_nix.c +9 -9
@@ -214,6 +214,13 @@ roc_nix_lf_alloc(struct roc_nix *roc_nix, uint32_t nb_rxq, uint32_t nb_txq, nix->tx_link = rsp->tx_link; nix->nb_rx_queues = nb_rxq; nix->nb_tx_queues = nb_txq; + + nix->rqs =plt_zmalloc (sizeof (struct roc_nix_rq *) * nb_rxq,0 ); +if (!nix->rqs) { + rc = -ENOMEM ; + goto fail; + } + nix->sqs =plt_zmalloc (sizeof (struct roc_nix_sq *) * nb_txq,0 );if (!nix->sqs) { rc = -ENOMEM ;
@@ -235,7 +242,9 @@ roc_nix_lf_free(struct roc_nix *roc_nix)struct ndc_sync_op *ndc_req;int rc = -ENOSPC ; +plt_free (nix->rqs);plt_free (nix->sqs); + nix->rqs =NULL ; nix->sqs =NULL ;/* Sync NDC-NIX for LF */
@@ -456,15 +465,6 @@ roc_nix_dev_init(struct roc_nix *roc_nix) nix->reta_sz = reta_sz; nix->mtu =ROC_NIX_DEFAULT_HW_FRS ; -/* Always start with full FC for LBK */ -if (nix->lbk_link) { - nix->rx_pause =1 ; - nix->tx_pause =1 ; - }else if (!roc_nix_is_vf_or_sdp (roc_nix)) { -/* Get the current state of flow control */ -roc_nix_fc_mode_get (roc_nix); - } -/* Register error and ras interrupts */ rc =nix_register_irqs (nix);if (rc)
drivers/common/cnxk/roc_nix.h +1 -0
@@ -328,6 +328,7 @@ struct roc_nix_rq {struct roc_nix *roc_nix;uint64_t meta_aura_handle;uint16_t inl_dev_refs; +uint8_t tc; };struct roc_nix_cq {
drivers/common/cnxk/roc_nix_debug.c +2 -0
@@ -879,6 +879,7 @@ roc_nix_rq_dump(struct roc_nix_rq *rq, FILE *file)nix_dump (file," vwqe_aura_handle = %ld" , rq->vwqe_aura_handle);nix_dump (file," roc_nix = %p" , rq->roc_nix);nix_dump (file," inl_dev_refs = %d" , rq->inl_dev_refs); +nix_dump (file," tc = %d" , rq->tc); }void
@@ -911,6 +912,7 @@ roc_nix_sq_dump(struct roc_nix_sq *sq, FILE *file)nix_dump (file," lmt_addr = %p" , sq->lmt_addr);nix_dump (file," sqe_mem = %p" , sq->sqe_mem);nix_dump (file," fc = %p" , sq->fc); +nix_dump (file," tc = %d" , sq->tc); }; static uint8_t
drivers/common/cnxk/roc_nix_fc.c +22 -45
114 lines not on this page · raw message
drivers/common/cnxk/roc_nix_priv.h +5 -2
@@ -102,7 +102,6 @@ struct nix_tm_node {/* Last stats */ uint64_t last_pkts;uint64_t last_bytes; -uint32_t tc_refcnt; };struct nix_tm_shaper_profile {
@@ -131,6 +130,7 @@ struct nix {struct nix_qint *cints_mem;uint8_t configured_qints;uint8_t configured_cints; +struct roc_nix_rq **rqs;struct roc_nix_sq **sqs;uint16_t vwqe_interval;uint16_t tx_chan_base;
@@ -158,6 +158,8 @@ struct nix {uint16_t msixoff;uint8_t rx_pause;uint8_t tx_pause; +uint8_t pfc_rx_pause; +uint8_t pfc_tx_pause;uint16_t cev;uint64_t rx_cfg;struct dev dev;
@@ -407,7 +409,7 @@ int nix_rq_cfg(struct dev *dev, struct roc_nix_rq *rq, uint16_t qints, bool cfg,int nix_rq_ena_dis (struct dev *dev,struct roc_nix_rq *rq,bool enable);int nix_tm_bp_config_get (struct roc_nix *roc_nix,bool *is_enabled);int nix_tm_bp_config_set (struct roc_nix *roc_nix,uint16_t sq,uint16_t tc, -bool enable,bool force_flush); +bool enable);void nix_rq_vwqe_flush (struct roc_nix_rq *rq,uint16_t vwqe_interval);int nix_tm_mark_init (struct nix *nix);void nix_tm_sq_free_sqe_buffer (uint64_t *sqe,int head_off,int end_off,int instr_sz);
@@ -469,6 +471,7 @@ int nix_lf_int_reg_dump(uintptr_t nix_lf_base, uint64_t *data, uint16_t qints, uint16_t cints);int nix_q_ctx_get (struct dev *dev,uint8_t ctype,uint16_t qid, __io void **ctx_p); +uint8_t nix_tm_lbk_relchan_get (struct nix *nix);/* * Telemetry
drivers/common/cnxk/roc_nix_queue.c +6 -8
@@ -667,6 +667,7 @@ roc_nix_rq_init(struct roc_nix *roc_nix, struct roc_nix_rq *rq, bool ena) } rq->roc_nix = roc_nix; + rq->tc =ROC_NIX_PFC_CLASS_INVALID ;if (is_cn9k) rc =nix_rq_cn9k_cfg (dev, rq, nix->qints, false, ena);
@@ -695,6 +696,7 @@ roc_nix_rq_init(struct roc_nix *roc_nix, struct roc_nix_rq *rq, bool ena)return rc; } + nix->rqs[rq->qid] = rq;return nix_tel_node_add_rq (rq); }
@@ -718,6 +720,7 @@ roc_nix_rq_modify(struct roc_nix *roc_nix, struct roc_nix_rq *rq, bool ena)nix_rq_aura_buf_type_update (rq, false); rq->roc_nix = roc_nix; + rq->tc =ROC_NIX_PFC_CLASS_INVALID ; mbox =mbox_get (m_box);if (is_cn9k)
@@ -779,6 +782,7 @@ roc_nix_rq_cman_config(struct roc_nix *roc_nix, struct roc_nix_rq *rq)int roc_nix_rq_fini (struct roc_nix_rq *rq) { +struct nix *nix =roc_nix_to_nix_priv (rq->roc_nix);int rc;/* Disabling RQ is sufficient */
@@ -788,6 +792,8 @@ roc_nix_rq_fini(struct roc_nix_rq *rq)/* Update aura attribute to indicate its use for */ nix_rq_aura_buf_type_update (rq, false); + + nix->rqs[rq->qid] =NULL ;return 0 ; }
@@ -895,14 +901,6 @@ roc_nix_cq_init(struct roc_nix *roc_nix, struct roc_nix_cq *cq) } } -/* TX pause frames enable flow ctrl on RX side */ -if (nix->tx_pause) { -/* Single BPID is allocated for all rx channels for now */ - cq_ctx->bpid = nix->bpid[0 ]; - cq_ctx->bp = cq->drop_thresh; - cq_ctx->bp_ena =1 ; - } - rc =mbox_process (mbox);mbox_put (mbox);if (rc)
drivers/common/cnxk/roc_nix_tm.c +33 -48
147 lines not on this page · raw message
drivers/common/cnxk/roc_nix_tm_ops.c +1 -1
@@ -481,7 +481,7 @@ roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix)if (!sq)continue ; - rc =nix_tm_bp_config_set (roc_nix, sq->qid,0 , false, false); + rc =nix_tm_bp_config_set (roc_nix, sq->qid,0 , false);if (rc && rc != -ENOENT ) {plt_err ("Failed to disable backpressure, rc=%d" , rc); goto cleanup;
drivers/common/cnxk/roc_nix_tm_utils.c +3 -11
@@ -72,8 +72,8 @@ nix_tm_lvl2nix(struct nix *nix, uint32_t lvl)return nix_tm_lvl2nix_tl2_root (lvl); } -static uint8_t -nix_tm_relchan_get (struct nix *nix) +uint8_t +nix_tm_lbk_relchan_get (struct nix *nix) {return nix->tx_chan_base &0xff ; }
@@ -531,7 +531,7 @@ nix_tm_topology_reg_prep(struct nix *nix, struct nix_tm_node *node, parent = node->parent->hw_id; link = nix->tx_link; - relchan =nix_tm_relchan_get (nix); + relchan =roc_nix_is_lbk (roc_nix) ?nix_tm_lbk_relchan_get (nix) :0 ;if (hw_lvl !=NIX_TXSCH_LVL_SMQ ) child =nix_tm_find_prio_anchor (nix, node->id, tree);
@@ -602,10 +602,6 @@ nix_tm_topology_reg_prep(struct nix *nix, struct nix_tm_node *node, nix->tm_link_cfg_lvl == NIX_TXSCH_LVL_TL3) { reg[k] =NIX_AF_TL3_TL2X_LINKX_CFG (schq, link); regval[k] =BIT_ULL (12 ) | relchan; -/* Enable BP if node is BP capable and rx_pause is set -*/ -if (nix->rx_pause && node->bp_capa) - regval[k] |=BIT_ULL (13 ); k++; }
@@ -625,10 +621,6 @@ nix_tm_topology_reg_prep(struct nix *nix, struct nix_tm_node *node, nix->tm_link_cfg_lvl == NIX_TXSCH_LVL_TL2) { reg[k] =NIX_AF_TL3_TL2X_LINKX_CFG (schq, link); regval[k] =BIT_ULL (12 ) | relchan; -/* Enable BP if node is BP capable and rx_pause is set -*/ -if (nix->rx_pause && node->bp_capa) - regval[k] |=BIT_ULL (13 ); k++; }
Signature · 1 line
2.25.1
PATCH 7/15 common/cnxk: enable 10K B0 support for inline IPsec
In reply to Nithin DabilpuramEnable support similar to CN10KB as CN10KA_B0 is similar to CN10KB.
--- drivers/common/cnxk/roc_api.h | 3 +++ drivers/common/cnxk/roc_cpt.h | 2 -- drivers/common/cnxk/roc_features.h | 31 +++++++++++++++++++++++++++++ drivers/common/cnxk/roc_nix_debug.c | 16 ++++++++------- drivers/common/cnxk/roc_nix_fc.c | 10 ++++++++-- drivers/common/cnxk/roc_nix_inl.c | 11 ++-------- drivers/common/cnxk/roc_nix_inl.h | 1 - drivers/common/cnxk/roc_nix_queue.c | 5 +++-- drivers/common/cnxk/version.map | 1 - drivers/net/cnxk/cn10k_ethdev.c | 4 ++-- drivers/net/cnxk/cn10k_ethdev_sec.c | 2 +- 11 files changed, 59 insertions(+), 27 deletions(-) create mode 100644 drivers/common/cnxk/roc_features.h
drivers/common/cnxk/roc_api.h +3 -0
@@ -47,6 +47,9 @@/* HW Errata */ #include "roc_errata.h" +/* HW Features */ +#include "roc_features.h" +/* Mbox */ #include "roc_mbox.h"
drivers/common/cnxk/roc_cpt.h +0 -2
@@ -9,8 +9,6 @@#include "roc_platform.h" -struct nix_inline_ipsec_cfg ; -#define ROC_AE_CPT_BLOCK_TYPE1 0#define ROC_AE_CPT_BLOCK_TYPE2 1
drivers/common/cnxk/roc_features.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2022 Marvell. +*/ +#ifndef _ROC_FEATURES_H_ +#define _ROC_FEATURES_H_ + +static inline bool +roc_feature_nix_has_inl_ipsec_mseg (void ) +{ +return (roc_model_is_cn10kb () ||roc_model_is_cn10ka_b0 ()); +} + +static inline bool +roc_feature_nix_has_inl_rq_mask (void ) +{ +return (roc_model_is_cn10kb () ||roc_model_is_cn10ka_b0 ()); +} + +static inline bool +roc_feature_nix_has_late_bp (void ) +{ +return (roc_model_is_cn10kb () ||roc_model_is_cn10ka_b0 ()); +} + +static inline bool +roc_feature_nix_has_reass (void ) +{ +return roc_model_is_cn10ka (); +} + +#endif
drivers/common/cnxk/roc_nix_debug.c +9 -7
@@ -661,6 +661,12 @@ nix_lf_cq_dump(__io struct nix_cq_ctx_s *ctx, FILE *file) ctx->qint_idx);nix_dump (file,"W1: bpid \t\t\t%d\nW1: bp_ena \t\t\t%d\n" , ctx->bpid, ctx->bp_ena); +nix_dump (file, +"W1: lbpid_high \t\t\t0x%03x\nW1: lbpid_med \t\t\t0x%03x\n" +"W1: lbpid_low \t\t\t0x%03x\n(W1: lbpid) \t\t\t0x%03x\n" , + ctx->lbpid_high, ctx->lbpid_med, ctx->lbpid_low, + ctx->lbpid_high <<6 | ctx->lbpid_med <<3 | ctx->lbpid_low); +nix_dump (file,"W1: lbp_ena \t\t\t\t%d\n" , ctx->lbp_ena);nix_dump (file,"W2: update_time \t\t%d\nW2: avg_level \t\t\t%d" , ctx->update_time, ctx->avg_level);
@@ -671,14 +677,10 @@ nix_lf_cq_dump(__io struct nix_cq_ctx_s *ctx, FILE *file) ctx->cq_err_int_ena, ctx->cq_err_int);nix_dump (file,"W3: qsize \t\t\t%d\nW3: caching \t\t\t%d" , ctx->qsize, ctx->caching); -nix_dump (file,"W3: substream \t\t\t0x%03x\nW3: ena \t\t\t%d\nW3: lbp_ena \t\t\t%d" , - ctx->substream, ctx->ena, ctx->lbp_ena); -nix_dump (file, -"W3: lbpid_high \t\t\t0x%03x\nW3: lbpid_med \t\t\t0x%03x\n" -"W3: lbpid_low \t\t\t0x%03x\n(W3: lbpid) \t\t\t0x%03x" , - ctx->lbpid_high, ctx->lbpid_med, ctx->lbpid_low, - ctx->lbpid_high <<6 | ctx->lbpid_med <<3 | ctx->lbpid_low);nix_dump (file,"W3: lbp_frac \t\t\t%d\n" , ctx->lbp_frac); +nix_dump (file,"W3: substream \t\t\t0x%03x\nW3: cpt_drop_err_en \t\t\t%d\n" , + ctx->substream, ctx->cpt_drop_err_en); +nix_dump (file,"W3: ena \t\t\t%d\n" , ctx->ena);nix_dump (file,"W3: drop_ena \t\t\t%d\nW3: drop \t\t\t%d" , ctx->drop_ena, ctx->drop);nix_dump (file,"W3: bp \t\t\t\t%d\n" , ctx->bp);
drivers/common/cnxk/roc_nix_fc.c +8 -2
@@ -77,7 +77,10 @@ nix_fc_rxchan_bpid_set(struct roc_nix *roc_nix, bool enable)if (req ==NULL ) goto exit; req->chan_base =0 ; - req->chan_cnt =1 ; +if (roc_nix_is_lbk (roc_nix) ||roc_nix_is_sdp (roc_nix)) + req->chan_cnt =NIX_LBK_MAX_CHAN ; +else + req->chan_cnt =NIX_CGX_MAX_CHAN ; req->bpid_per_chan =0 ; rc =mbox_process_msg (mbox, (void *)&rsp);
@@ -89,7 +92,10 @@ nix_fc_rxchan_bpid_set(struct roc_nix *roc_nix, bool enable)if (req ==NULL ) goto exit; req->chan_base =0 ; - req->chan_cnt =1 ; +if (roc_nix_is_lbk (roc_nix) ||roc_nix_is_sdp (roc_nix)) + req->chan_cnt =NIX_LBK_MAX_CHAN ; +else + req->chan_cnt =NIX_CGX_MAX_CHAN ; req->bpid_per_chan =0 ; rc =mbox_process_msg (mbox, (void *)&rsp);
drivers/common/cnxk/roc_nix_inl.c +2 -9
@@ -485,13 +485,6 @@ nix_inl_rq_mask_cfg(struct roc_nix *roc_nix, bool enable)return rc; } -bool -roc_nix_has_reass_support (struct roc_nix *nix) -{ -PLT_SET_USED (nix); -return !!roc_model_is_cn10ka (); -} -int roc_nix_inl_inb_init (struct roc_nix *roc_nix) {
@@ -574,7 +567,7 @@ roc_nix_inl_inb_fini(struct roc_nix *roc_nix)nix_inl_meta_aura_destroy (); } -if (roc_model_is_cn10kb_a0 ()) { +if (roc_feature_nix_has_inl_rq_mask ()) { rc =nix_inl_rq_mask_cfg (roc_nix, false);if (rc) {plt_err ("Failed to get rq mask rc=%d" , rc);
@@ -1046,7 +1039,7 @@ roc_nix_inl_rq_ena_dis(struct roc_nix *roc_nix, bool enable)if (!idev)return -EFAULT ; -if (roc_model_is_cn10kb_a0 ()) { +if (roc_feature_nix_has_inl_rq_mask ()) { rc =nix_inl_rq_mask_cfg (roc_nix, true);if (rc) {plt_err ("Failed to get rq mask rc=%d" , rc);
drivers/common/cnxk/roc_nix_inl.h +0 -1
@@ -182,7 +182,6 @@ int __roc_api roc_nix_inl_ts_pkind_set(struct roc_nix *roc_nix, bool ts_ena, bool inb_inl_dev); int __roc_api roc_nix_inl_rq_ena_dis(struct roc_nix *roc_nix, bool ena); int __roc_api roc_nix_inl_meta_aura_check(struct roc_nix_rq *rq); -bool __roc_api roc_nix_has_reass_support(struct roc_nix *nix);/* NIX Inline Outbound API */ int __roc_api roc_nix_inl_outb_init(struct roc_nix *roc_nix);
drivers/common/cnxk/roc_nix_queue.c +3 -2
@@ -863,7 +863,7 @@ roc_nix_cq_init(struct roc_nix *roc_nix, struct roc_nix_cq *cq) cq_ctx->avg_level =0xff ; cq_ctx->cq_err_int_ena =BIT (NIX_CQERRINT_CQE_FAULT ); cq_ctx->cq_err_int_ena |=BIT (NIX_CQERRINT_DOOR_ERR ); -if (roc_model_is_cn10kb () &&roc_nix_inl_inb_is_enabled (roc_nix)) { +if (roc_feature_nix_has_late_bp () &&roc_nix_inl_inb_is_enabled (roc_nix)) { cq_ctx->cq_err_int_ena |=BIT (NIX_CQERRINT_CPT_DROP ); cq_ctx->cpt_drop_err_en =1 ;/* Enable Late BP only when non zero CPT BPID */
@@ -900,6 +900,7 @@ roc_nix_cq_init(struct roc_nix *roc_nix, struct roc_nix_cq *cq) cq_ctx->drop_ena =1 ; } } + cq_ctx->bp = cq->drop_thresh; rc =mbox_process (mbox);mbox_put (mbox);
@@ -960,7 +961,7 @@ roc_nix_cq_fini(struct roc_nix_cq *cq) aq->cq.bp_ena =0 ; aq->cq_mask.ena = ~aq->cq_mask.ena; aq->cq_mask.bp_ena = ~aq->cq_mask.bp_ena; -if (roc_model_is_cn10kb () &&roc_nix_inl_inb_is_enabled (cq->roc_nix)) { +if (roc_feature_nix_has_late_bp () &&roc_nix_inl_inb_is_enabled (cq->roc_nix)) { aq->cq.lbp_ena =0 ; aq->cq_mask.lbp_ena = ~aq->cq_mask.lbp_ena; }
drivers/common/cnxk/version.map +0 -1
@@ -138,7 +138,6 @@ INTERNAL { roc_nix_get_pf_func; roc_nix_get_vf; roc_nix_get_vwqe_interval; - roc_nix_has_reass_support; roc_nix_inl_cb_register; roc_nix_inl_cb_unregister; roc_nix_inl_ctx_write;
drivers/net/cnxk/cn10k_ethdev.c +2 -2
@@ -591,7 +591,7 @@ cn10k_nix_reassembly_capability_get(struct rte_eth_dev *eth_dev,int rc = -ENOTSUP ;RTE_SET_USED (eth_dev); -if (!roc_nix_has_reass_support (&dev->nix)) +if (!roc_feature_nix_has_reass ())return -ENOTSUP ;if (dev->rx_offloads &RTE_ETH_RX_OFFLOAD_SECURITY ) {
@@ -621,7 +621,7 @@ cn10k_nix_reassembly_conf_set(struct rte_eth_dev *eth_dev,struct cnxk_eth_dev *dev =cnxk_eth_pmd_priv (eth_dev);int rc =0 ; -if (!roc_nix_has_reass_support (&dev->nix)) +if (!roc_feature_nix_has_reass ())return -ENOTSUP ;if (!conf->flags) {
drivers/net/cnxk/cn10k_ethdev_sec.c +1 -1
@@ -809,7 +809,7 @@ cn10k_eth_sec_session_create(void *device, sess_priv.chksum = (!ipsec->options.ip_csum_enable <<1 | !ipsec->options.l4_csum_enable); sess_priv.dec_ttl = ipsec->options.dec_ttl; -if (roc_model_is_cn10kb_a0 ()) +if (roc_feature_nix_has_inl_ipsec_mseg ()) sess_priv.nixtx_off =1 ;/* Pointer from eth_sec -> outb_sa */
Signature · 1 line
2.25.1
PATCH 8/15 net/cnxk: check flow control config per queue on dev start
In reply to Nithin DabilpuramCheck and enable/disable flow control config per queue on device start to handle cases like SSO enablement, TM changes etc. Modify flow control config get to get status per RQ/SQ.
Also disallow changes to flow control config when device is in started state.
--- drivers/net/cnxk/cnxk_ethdev.c | 9 +- drivers/net/cnxk/cnxk_ethdev_ops.c | 198 ++++++++++++++++------------- 2 files changed, 113 insertions(+), 94 deletions(-)
drivers/net/cnxk/cnxk_ethdev.c +6 -3
@@ -363,7 +363,7 @@ nix_init_flow_ctrl_config(struct rte_eth_dev *eth_dev)struct cnxk_fc_cfg *fc = &dev->fc_cfg;int rc; -if (roc_nix_is_vf_or_sdp (&dev->nix)) +if (roc_nix_is_vf_or_sdp (&dev->nix) && !roc_nix_is_lbk (&dev->nix))return 0 ;/* To avoid Link credit deadlock on Ax, disable Tx FC if it's enabled */
@@ -388,7 +388,11 @@ nix_update_flow_ctrl_config(struct rte_eth_dev *eth_dev)struct cnxk_fc_cfg *fc = &dev->fc_cfg;struct rte_eth_fc_conf fc_cfg = {0 }; -if (roc_nix_is_vf_or_sdp (&dev->nix) && !roc_nix_is_lbk (&dev->nix)) +if (roc_nix_is_sdp (&dev->nix)) +return 0 ; + +/* Don't do anything if PFC is enabled */ +if (dev->pfc_cfg.rx_pause_en || dev->pfc_cfg.tx_pause_en)return 0 ; fc_cfg.mode = fc->mode;
@@ -481,7 +485,6 @@ cnxk_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid, sq->qid = qid; sq->nb_desc = nb_desc; sq->max_sqe_sz =nix_sq_max_sqe_sz (dev); - sq->tc =ROC_NIX_PFC_CLASS_INVALID ;if (nix->tx_compl_ena) { sq->cqid = sq->qid + dev->nb_rxq;
drivers/net/cnxk/cnxk_ethdev_ops.c +107 -91
278 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 9/15 net/cnxk: don't allow PFC configuration on started port
In reply to Nithin DabilpuramFrom: Rahul Bhansali <[email protected]>
Avoid priority flow control configuration when port is started.
--- drivers/net/cnxk/cnxk_ethdev_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/cnxk/cnxk_ethdev_ops.c +2 -2
@@ -1121,8 +1121,8 @@ nix_priority_flow_ctrl_rq_conf(struct rte_eth_dev *eth_dev, uint16_t qid,struct roc_nix_cq *cq;int rc, i; -if (roc_model_is_cn96_ax () && data->dev_started) { -/* On Ax, CQ should be in disabled state +if (data->dev_started) { +/* RQ should be in disabled state * while setting flow control configuration. */ plt_info("Stop the port=%d for setting flow control",
Signature · 1 line
2.25.1
PATCH 10/15 net/cnxk: aura handle for fastpath Rx queues
In reply to Nithin DabilpuramFrom: Rahul Bhansali <[email protected]>
Meta aura for RQs is created during queue enable process, so aura handle for fastpath Rx queues should be updated after this.
--- drivers/net/cnxk/cn10k_ethdev.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-)
drivers/net/cnxk/cn10k_ethdev.c +26 -7
@@ -283,7 +283,6 @@ cn10k_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid, struct rte_mempool *mp) {struct cnxk_eth_dev *dev =cnxk_eth_pmd_priv (eth_dev); -struct cnxk_eth_rxq_sp *rxq_sp;struct cn10k_eth_rxq *rxq;struct roc_nix_rq *rq;struct roc_nix_cq *cq;
@@ -335,17 +334,34 @@ cn10k_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid, rxq->lmt_base = dev->nix.lmt_base; rxq->sa_base =roc_nix_inl_inb_sa_base_get (&dev->nix, dev->inb.inl_dev); + } + +/* Lookup mem */ + rxq->lookup_mem =cnxk_nix_fastpath_lookup_mem_get (); +return 0 ; +} + +static void +cn10k_nix_rx_queue_meta_aura_update (struct rte_eth_dev *eth_dev) +{ +struct cnxk_eth_dev *dev =cnxk_eth_pmd_priv (eth_dev); +struct cnxk_eth_rxq_sp *rxq_sp; +struct cn10k_eth_rxq *rxq; +struct roc_nix_rq *rq; +int i; + +/* Update Aura handle for fastpath rx queues */ +for (i =0 ; i < eth_dev->data->nb_rx_queues; i++) { + rq = &dev->rqs[i]; + rxq = eth_dev->data->rx_queues[i]; rxq->meta_aura = rq->meta_aura_handle; - rxq_sp =cnxk_eth_rxq_to_sp (rxq);/* Assume meta packet from normal aura if meta aura is not setup */ -if (!rxq->meta_aura) +if (!rxq->meta_aura) { + rxq_sp =cnxk_eth_rxq_to_sp (rxq); rxq->meta_aura = rxq_sp->qconf.mp->pool_id; + } } - -/* Lookup mem */ - rxq->lookup_mem =cnxk_nix_fastpath_lookup_mem_get (); -return 0 ; } static int
@@ -557,6 +573,9 @@ cn10k_nix_dev_start(struct rte_eth_dev *eth_dev) dev->rx_offload_flags |=nix_rx_offload_flags (eth_dev); dev->tx_offload_flags |=nix_tx_offload_flags (eth_dev); +if (dev->rx_offload_flags &NIX_RX_OFFLOAD_SECURITY_F ) +cn10k_nix_rx_queue_meta_aura_update (eth_dev); +cn10k_eth_set_tx_function (eth_dev);cn10k_eth_set_rx_function (eth_dev);return 0 ;
Signature · 1 line
2.25.1
PATCH 11/15 common/cnxk: support of per NIX LF meta aura
In reply to Nithin DabilpuramFrom: Rahul Bhansali <[email protected]>
Supports creation of individual meta aura per NIX port for CN106-B0/CN103xx SoC.
Individual pool buffer size can be passed using meta_buf_sz devargs parameter per NIX for local meta aura creation.
--- doc/guides/nics/cnxk.rst | 14 ++ drivers/common/cnxk/roc_features.h | 6 + drivers/common/cnxk/roc_nix.h | 5 + drivers/common/cnxk/roc_nix_fc.c | 7 +- drivers/common/cnxk/roc_nix_inl.c | 232 +++++++++++++++++++------ drivers/common/cnxk/roc_nix_inl.h | 7 +- drivers/common/cnxk/roc_nix_queue.c | 6 +- drivers/event/cnxk/cn10k_eventdev.c | 10 +- drivers/event/cnxk/cn10k_worker.h | 11 +- drivers/event/cnxk/cn9k_eventdev.c | 7 +- drivers/event/cnxk/cnxk_tim_evdev.c | 2 +- drivers/event/cnxk/cnxk_tim_evdev.h | 2 +- drivers/net/cnxk/cn10k_ethdev.c | 2 + drivers/net/cnxk/cnxk_ethdev.c | 4 + drivers/net/cnxk/cnxk_ethdev.h | 6 +- drivers/net/cnxk/cnxk_ethdev_devargs.c | 23 +++ drivers/net/cnxk/cnxk_ethdev_dp.h | 13 ++ drivers/net/cnxk/cnxk_ethdev_sec.c | 21 ++- drivers/net/cnxk/cnxk_lookup.c | 37 +++- 19 files changed, 330 insertions(+), 85 deletions(-)
doc/guides/nics/cnxk.rst +14 -0
@@ -402,6 +402,20 @@ Runtime Config Options -a 0002:01:00.1,tx_compl_ena=1 +- ``Meta buffer size per ethdev port for inline inbound IPsec second pass`` + + Size of meta buffer allocated for inline inbound IPsec second pass per + ethdev port can be specified by ``meta_buf_sz`` ``devargs`` parameter. + Default value is computed runtime based on pkt mbuf pools created and in use. + This option is for OCTEON CN106-B0/CN103XX SoC family. + + For example:: + + -a 0002:02:00.0,meta_buf_sz=512 + + With the above configuration, PMD would allocate meta buffers of size 512 for + inline inbound IPsec processing second pass. + .. note:: Above devarg parameters are configurable per device, user needs to pass the
drivers/common/cnxk/roc_features.h +6 -0
@@ -16,6 +16,12 @@ roc_feature_nix_has_inl_rq_mask(void)return (roc_model_is_cn10kb () ||roc_model_is_cn10ka_b0 ()); } +static inline bool +roc_feature_nix_has_own_meta_aura (void ) +{ +return (roc_model_is_cn10kb () ||roc_model_is_cn10ka_b0 ()); +} +static inline bool roc_feature_nix_has_late_bp (void ) {
drivers/common/cnxk/roc_nix.h +5 -0
@@ -434,12 +434,17 @@ struct roc_nix {uint32_t dwrr_mtu;bool ipsec_out_sso_pffunc;bool custom_sa_action; +bool local_meta_aura_ena; +uint32_t meta_buf_sz;/* End of input parameters */ /* LMT line base for "Per Core Tx LMT line" mode*/ uintptr_t lmt_base;bool io_enabled;bool rx_ptp_ena;uint16_t cints; +uint32_t buf_sz; +uint64_t meta_aura_handle; +uintptr_t meta_mempool;#define ROC_NIX_MEM_SZ (6 * 1056) uint8_t reserved[ROC_NIX_MEM_SZ] __plt_cache_aligned;
drivers/common/cnxk/roc_nix_fc.c +6 -1
@@ -295,11 +295,16 @@ nix_fc_rq_config_set(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)if (sso_ena <0 )return -EINVAL ; -if (sso_ena) +if (sso_ena) {roc_nix_fc_npa_bp_cfg (roc_nix, fc_cfg->rq_cfg.pool, fc_cfg->rq_cfg.enable, true, fc_cfg->rq_cfg.tc); +if (roc_nix->local_meta_aura_ena) +roc_nix_fc_npa_bp_cfg (roc_nix, roc_nix->meta_aura_handle, + fc_cfg->rq_cfg.enable, true, fc_cfg->rq_cfg.tc); + } +/* Copy RQ config to CQ config as they are occupying same area */ memset (&tmp,0 ,sizeof (tmp)); tmp.type =ROC_NIX_FC_CQ_CFG ;
drivers/common/cnxk/roc_nix_inl.c +179 -53
350 lines not on this page · raw message
drivers/common/cnxk/roc_nix_inl.h +4 -3
@@ -118,8 +118,9 @@ roc_nix_inl_onf_ipsec_outb_sa_sw_rsvd(void *sa)typedef void (*roc_nix_inl_sso_work_cb_t )(uint64_t *gw,void *args,uint32_t soft_exp_event); -typedef int (*roc_nix_inl_meta_pool_cb_t )(uint64_t *aura_handle,uint32_t blk_sz,uint32_t nb_bufs, -bool destroy); +typedef int (*roc_nix_inl_meta_pool_cb_t )(uint64_t *aura_handle,uintptr_t *mpool, +uint32_t blk_sz,uint32_t nb_bufs,bool destroy, +const char *mempool_name);struct roc_nix_inl_dev {/* Input parameters */
@@ -181,7 +182,7 @@ int __roc_api roc_nix_reassembly_configure(uint32_t max_wait_time, int __roc_api roc_nix_inl_ts_pkind_set(struct roc_nix *roc_nix, bool ts_ena,bool inb_inl_dev); int __roc_api roc_nix_inl_rq_ena_dis(struct roc_nix *roc_nix, bool ena); -int __roc_api roc_nix_inl_meta_aura_check(struct roc_nix_rq *rq); +int __roc_api roc_nix_inl_meta_aura_check(struct roc_nix *roc_nix, struct roc_nix_rq *rq);/* NIX Inline Outbound API */ int __roc_api roc_nix_inl_outb_init(struct roc_nix *roc_nix);
drivers/common/cnxk/roc_nix_queue.c +3 -3
@@ -102,7 +102,7 @@ roc_nix_rq_ena_dis(struct roc_nix_rq *rq, bool enable)/* Check for meta aura if RQ is enabled */ if (enable && nix->need_meta_aura) - rc =roc_nix_inl_meta_aura_check (rq); + rc =roc_nix_inl_meta_aura_check (rq->roc_nix, rq);return rc; }
@@ -691,7 +691,7 @@ roc_nix_rq_init(struct roc_nix *roc_nix, struct roc_nix_rq *rq, bool ena)/* Check for meta aura if RQ is enabled */ if (ena && nix->need_meta_aura) { - rc =roc_nix_inl_meta_aura_check (rq); + rc =roc_nix_inl_meta_aura_check (roc_nix, rq);if (rc)return rc; }
@@ -745,7 +745,7 @@ roc_nix_rq_modify(struct roc_nix *roc_nix, struct roc_nix_rq *rq, bool ena)/* Check for meta aura if RQ is enabled */ if (ena && nix->need_meta_aura) { - rc =roc_nix_inl_meta_aura_check (rq); + rc =roc_nix_inl_meta_aura_check (roc_nix, rq);if (rc)return rc; }
drivers/event/cnxk/cn10k_eventdev.c +3 -7
@@ -843,7 +843,7 @@ cn10k_sso_rx_adapter_caps_get(const struct rte_eventdev *event_dev, }static void -cn10k_sso_set_priv_mem (const struct rte_eventdev *event_dev,void *lookup_mem,uint64_t meta_aura) +cn10k_sso_set_priv_mem (const struct rte_eventdev *event_dev,void *lookup_mem) {struct cnxk_sso_evdev *dev =cnxk_sso_pmd_priv (event_dev);int i;
@@ -855,8 +855,6 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem, u ws->tstamp = dev->tstamp;if (lookup_mem) ws->lookup_mem = lookup_mem; -if (meta_aura) - ws->meta_aura = meta_aura; } }
@@ -867,7 +865,6 @@ cn10k_sso_rx_adapter_queue_add( const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) {struct cn10k_eth_rxq *rxq; -uint64_t meta_aura;void *lookup_mem;int rc;
@@ -881,8 +878,7 @@ cn10k_sso_rx_adapter_queue_add(return -EINVAL ; rxq = eth_dev->data->rx_queues[0 ]; lookup_mem = rxq->lookup_mem; - meta_aura = rxq->meta_aura; -cn10k_sso_set_priv_mem (event_dev, lookup_mem, meta_aura); +cn10k_sso_set_priv_mem (event_dev, lookup_mem);cn10k_sso_fp_fns_set ((struct rte_eventdev *)(uintptr_t )event_dev);return 0 ;
@@ -1056,7 +1052,7 @@ cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,cn10k_sso_fp_fns_set ((struct rte_eventdev *)(uintptr_t )event_dev); ret =cnxk_crypto_adapter_qp_add (event_dev, cdev, queue_pair_id, conf); -cn10k_sso_set_priv_mem (event_dev,NULL ,0 ); +cn10k_sso_set_priv_mem (event_dev,NULL );return ret; }
drivers/event/cnxk/cn10k_worker.h +8 -3
@@ -55,9 +55,10 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, strucstruct cnxk_timesync_info *tstamp = ws->tstamp[port_id];void *lookup_mem = ws->lookup_mem;uintptr_t lbase = ws->lmt_base; +uint64_t meta_aura =0 , laddr;struct rte_event_vector *vec; -uint64_t meta_aura, laddr;uint16_t nb_mbufs, non_vec; +struct rte_mempool *mp;uint16_t lmt_id, d_off;struct rte_mbuf **wqe;struct rte_mbuf *mbuf;
@@ -77,7 +78,12 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, strucif (flags &NIX_RX_OFFLOAD_TSTAMP_F && tstamp) mbuf_init |=8 ; - meta_aura = ws->meta_aura; +if (flags &NIX_RX_OFFLOAD_SECURITY_F ) { + mp = (struct rte_mempool *)cnxk_nix_inl_metapool_get (port_id, lookup_mem); +if (mp) + meta_aura = mp->pool_id; + } + nb_mbufs =RTE_ALIGN_FLOOR (vec->nb_elem,NIX_DESCS_PER_LOOP ); nb_mbufs = cn10k_nix_recv_pkts_vector(&mbuf_init, wqe, nb_mbufs, flags | NIX_RX_VWQE_F,
@@ -94,7 +100,6 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, struc/* Pick first mbuf's aura handle assuming all * mbufs are from a vec and are from same RQ. */ - meta_aura = ws->meta_aura;if (!meta_aura) meta_aura = mbuf->pool->pool_id;ROC_LMT_BASE_ID_GET (lbase, lmt_id);
drivers/event/cnxk/cn9k_eventdev.c +3 -4
@@ -945,8 +945,7 @@ cn9k_sso_rx_adapter_caps_get(const struct rte_eventdev *event_dev, }static void -cn9k_sso_set_priv_mem (const struct rte_eventdev *event_dev,void *lookup_mem, - uint64_t aura __rte_unused) +cn9k_sso_set_priv_mem (const struct rte_eventdev *event_dev,void *lookup_mem) {struct cnxk_sso_evdev *dev =cnxk_sso_pmd_priv (event_dev);int i;
@@ -992,7 +991,7 @@ cn9k_sso_rx_adapter_queue_add( rxq = eth_dev->data->rx_queues[0 ]; lookup_mem = rxq->lookup_mem; -cn9k_sso_set_priv_mem (event_dev, lookup_mem,0 ); +cn9k_sso_set_priv_mem (event_dev, lookup_mem);cn9k_sso_fp_fns_set ((struct rte_eventdev *)(uintptr_t )event_dev);return 0 ;
@@ -1141,7 +1140,7 @@ cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,cn9k_sso_fp_fns_set ((struct rte_eventdev *)(uintptr_t )event_dev); ret =cnxk_crypto_adapter_qp_add (event_dev, cdev, queue_pair_id, conf); -cn9k_sso_set_priv_mem (event_dev,NULL ,0 ); +cn9k_sso_set_priv_mem (event_dev,NULL );return ret; }
drivers/event/cnxk/cnxk_tim_evdev.c +1 -1
@@ -265,7 +265,7 @@ cnxk_tim_ring_create(struct rte_event_timer_adapter *adptr)cnxk_sso_updt_xae_cnt (cnxk_sso_pmd_priv (dev->event_dev), tim_ring,RTE_EVENT_TYPE_TIMER );cnxk_sso_xae_reconfigure (dev->event_dev); -sso_set_priv_mem_fn (dev->event_dev,NULL ,0 ); +sso_set_priv_mem_fn (dev->event_dev,NULL ); plt_tim_dbg( "Total memory used %" PRIu64 "MB\n",
drivers/event/cnxk/cnxk_tim_evdev.h +1 -1
@@ -81,7 +81,7 @@ (TIM_BUCKET_CHUNK_REMAIN | (1ull << TIM_BUCKET_W1_S_LOCK))typedef void (*cnxk_sso_set_priv_mem_t )(const struct rte_eventdev *event_dev, -void *lookup_mem,uint64_t aura); +void *lookup_mem);struct cnxk_tim_ctl {uint16_t ring;
drivers/net/cnxk/cn10k_ethdev.c +2 -0
@@ -362,6 +362,8 @@ cn10k_nix_rx_queue_meta_aura_update(struct rte_eth_dev *eth_dev) rxq->meta_aura = rxq_sp->qconf.mp->pool_id; } } +/* Store mempool in lookup mem */ +cnxk_nix_lookup_mem_metapool_set (dev); } static int
drivers/net/cnxk/cnxk_ethdev.c +4 -0
@@ -275,6 +275,8 @@ nix_security_release(struct cnxk_eth_dev *dev)plt_err ("Failed to cleanup nix inline inb, rc=%d" , rc); ret |= rc; +cnxk_nix_lookup_mem_metapool_clear (dev); +if (dev->inb.sa_dptr) {plt_free (dev->inb.sa_dptr); dev->inb.sa_dptr =NULL ;
@@ -1852,6 +1854,8 @@ cnxk_eth_dev_init(struct rte_eth_dev *eth_dev) nix->pci_dev = pci_dev; nix->hw_vlan_ins = true; nix->port_id = eth_dev->data->port_id; +if (roc_feature_nix_has_own_meta_aura ()) + nix->local_meta_aura_ena = true; rc =roc_nix_dev_init (nix);if (rc) {plt_err ("Failed to initialize roc nix rc=%d" , rc);
drivers/net/cnxk/cnxk_ethdev.h +4 -2
@@ -594,6 +594,8 @@ int cnxk_eth_outb_sa_idx_get(struct cnxk_eth_dev *dev, uint32_t *idx_p,int cnxk_eth_outb_sa_idx_put (struct cnxk_eth_dev *dev,uint32_t idx);int cnxk_nix_lookup_mem_sa_base_set (struct cnxk_eth_dev *dev);int cnxk_nix_lookup_mem_sa_base_clear (struct cnxk_eth_dev *dev); +int cnxk_nix_lookup_mem_metapool_set (struct cnxk_eth_dev *dev); +int cnxk_nix_lookup_mem_metapool_clear (struct cnxk_eth_dev *dev);__rte_internal int cnxk_nix_inb_mode_set(struct cnxk_eth_dev *dev, bool use_inl_dev); struct cnxk_eth_sec_sess *cnxk_eth_sec_sess_get_by_spi(struct cnxk_eth_dev *dev,
@@ -601,8 +603,8 @@ struct cnxk_eth_sec_sess *cnxk_eth_sec_sess_get_by_spi(struct cnxk_eth_dev *dev,struct cnxk_eth_sec_sess *cnxk_eth_sec_sess_get_by_sess (struct cnxk_eth_dev *dev,struct rte_security_session *sess); -int cnxk_nix_inl_meta_pool_cb (uint64_t *aura_handle,uint32_t buf_sz,uint32_t nb_bufs, -bool destroy); +int cnxk_nix_inl_meta_pool_cb (uint64_t *aura_handle,uintptr_t *mpool,uint32_t buf_sz, +uint32_t nb_bufs,bool destroy,const char *mempool_name);/* Congestion Management */ int cnxk_nix_cman_info_get (struct rte_eth_dev *dev,struct rte_eth_cman_info *info);
drivers/net/cnxk/cnxk_ethdev_devargs.c +23 -0
@@ -182,6 +182,22 @@ parse_sqb_count(const char *key, const char *value, void *extra_args)return 0 ; } +static int +parse_meta_bufsize (const char *key,const char *value,void *extra_args) +{ +RTE_SET_USED (key); +uint32_t val; + + errno =0 ; + val =strtoul (value,NULL ,0 ); +if (errno) + val =0 ; + + *(uint32_t *)extra_args = val; + +return 0 ; +} +static int parse_switch_header_type (const char *key,const char *value,void *extra_args) {
@@ -248,6 +264,7 @@ parse_sdp_channel_mask(const char *key, const char *value, void *extra_args)#define CNXK_FLOW_PRE_L2_INFO "flow_pre_l2_info"#define CNXK_CUSTOM_SA_ACT "custom_sa_act"#define CNXK_SQB_SLACK "sqb_slack" +#define CNXK_NIX_META_BUF_SZ "meta_buf_sz"int cnxk_ethdev_parse_devargs (struct rte_devargs *devargs,struct cnxk_eth_dev *dev)
@@ -270,6 +287,7 @@ cnxk_ethdev_parse_devargs(struct rte_devargs *devargs, struct cnxk_eth_dev *dev)uint16_t tx_compl_ena =0 ;uint16_t custom_sa_act =0 ;struct rte_kvargs *kvlist; +uint32_t meta_buf_sz =0 ;uint16_t no_inl_dev =0 ;uint8_t lock_rx_ctx =0 ;
@@ -319,6 +337,7 @@ cnxk_ethdev_parse_devargs(struct rte_devargs *devargs, struct cnxk_eth_dev *dev) &custom_sa_act);rte_kvargs_process (kvlist,CNXK_SQB_SLACK , &parse_sqb_count, &sqb_slack); +rte_kvargs_process (kvlist,CNXK_NIX_META_BUF_SZ , &parse_meta_bufsize, &meta_buf_sz);rte_kvargs_free (kvlist); null_devargs:
@@ -337,6 +356,10 @@ cnxk_ethdev_parse_devargs(struct rte_devargs *devargs, struct cnxk_eth_dev *dev) dev->nix.lock_rx_ctx = lock_rx_ctx; dev->nix.custom_sa_action = custom_sa_act; dev->nix.sqb_slack = sqb_slack; + +if (roc_feature_nix_has_own_meta_aura ()) + dev->nix.meta_buf_sz = meta_buf_sz; + dev->npc.flow_prealloc_size = flow_prealloc_size; dev->npc.flow_max_priority = flow_max_priority; dev->npc.switch_header_type = switch_header_type;
drivers/net/cnxk/cnxk_ethdev_dp.h +13 -0
@@ -34,6 +34,9 @@#define ERRCODE_ERRLEN_WIDTH 12#define ERR_ARRAY_SZ ((BIT(ERRCODE_ERRLEN_WIDTH)) * sizeof(uint32_t)) +#define SA_BASE_TBL_SZ (RTE_MAX_ETHPORTS * sizeof(uintptr_t)) +#define MEMPOOL_TBL_SZ (RTE_MAX_ETHPORTS * sizeof(uintptr_t)) +#define CNXK_NIX_UDP_TUN_BITMASK \ ((1ull << (RTE_MBUF_F_TX_TUNNEL_VXLAN >> 45)) | \ (1ull << (RTE_MBUF_F_TX_TUNNEL_GENEVE >> 45)))
@@ -164,4 +167,14 @@ cnxk_nix_sa_base_get(uint16_t port, const void *lookup_mem)return *((const uintptr_t *)sa_base_tbl + port); } +static __rte_always_inline uintptr_t +cnxk_nix_inl_metapool_get (uint16_t port,const void *lookup_mem) +{ +uintptr_t metapool_tbl; + + metapool_tbl = (uintptr_t )lookup_mem; + metapool_tbl +=PTYPE_ARRAY_SZ +ERR_ARRAY_SZ +SA_BASE_TBL_SZ ; +return *((const uintptr_t *)metapool_tbl + port); +} +#endif /* __CNXK_ETHDEV_DP_H__ */
drivers/net/cnxk/cnxk_ethdev_sec.c +16 -5
@@ -38,15 +38,22 @@ bitmap_ctzll(uint64_t slab) }int -cnxk_nix_inl_meta_pool_cb (uint64_t *aura_handle,uint32_t buf_sz,uint32_t nb_bufs,bool destroy) +cnxk_nix_inl_meta_pool_cb (uint64_t *aura_handle,uintptr_t *mpool,uint32_t buf_sz, +uint32_t nb_bufs,bool destroy,const char *mempool_name) { -const char *mp_name =CNXK_NIX_INL_META_POOL_NAME ; +const char *mp_name =NULL ;struct rte_pktmbuf_pool_private mbp_priv;struct npa_aura_s *aura;struct rte_mempool *mp;uint16_t first_skip;int rc; +/* Null Mempool name indicates to allocate Zero aura. */ +if (!mempool_name) + mp_name =CNXK_NIX_INL_META_POOL_NAME ; +else + mp_name = mempool_name; +/* Destroy the mempool if requested */ if (destroy) { mp =rte_mempool_lookup (mp_name);
@@ -62,6 +69,7 @@ cnxk_nix_inl_meta_pool_cb(uint64_t *aura_handle, uint32_t buf_sz, uint32_t nb_burte_mempool_free (mp); *aura_handle =0 ; + *mpool =0 ;return 0 ; }
@@ -83,10 +91,12 @@ cnxk_nix_inl_meta_pool_cb(uint64_t *aura_handle, uint32_t buf_sz, uint32_t nb_bu goto free_mp; } aura->ena =1 ; - aura->pool_addr =0x0 ; +if (!mempool_name) + aura->pool_addr =0 ; +else + aura->pool_addr =1 ;/* Any non zero value, so that alloc from next free Index */ - rc =rte_mempool_set_ops_byname (mp,rte_mbuf_platform_mempool_ops (), - aura); + rc =rte_mempool_set_ops_byname (mp,rte_mbuf_platform_mempool_ops (), aura);if (rc) {plt_err ("Failed to setup mempool ops for meta, rc=%d" , rc); goto free_aura;
@@ -108,6 +118,7 @@ cnxk_nix_inl_meta_pool_cb(uint64_t *aura_handle, uint32_t buf_sz, uint32_t nb_burte_mempool_obj_iter (mp, rte_pktmbuf_init,NULL ); *aura_handle = mp->pool_id; + *mpool = (uintptr_t )mp;return 0 ; free_aura:plt_free (aura);
drivers/net/cnxk/cnxk_lookup.c +35 -2
@@ -7,8 +7,7 @@#include "cnxk_ethdev.h" -#define SA_BASE_TBL_SZ (RTE_MAX_ETHPORTS * sizeof(uintptr_t)) -#define LOOKUP_ARRAY_SZ (PTYPE_ARRAY_SZ + ERR_ARRAY_SZ + SA_BASE_TBL_SZ) +#define LOOKUP_ARRAY_SZ (PTYPE_ARRAY_SZ + ERR_ARRAY_SZ + SA_BASE_TBL_SZ + MEMPOOL_TBL_SZ)const uint32_t *cnxk_nix_supported_ptypes_get (struct rte_eth_dev *eth_dev) {
@@ -371,3 +370,37 @@ cnxk_nix_lookup_mem_sa_base_clear(struct cnxk_eth_dev *dev) *((uintptr_t *)sa_base_tbl + port) =0 ;return 0 ; } + +int +cnxk_nix_lookup_mem_metapool_set (struct cnxk_eth_dev *dev) +{ +void *lookup_mem =cnxk_nix_fastpath_lookup_mem_get (); +uint16_t port = dev->eth_dev->data->port_id; +uintptr_t mp_tbl; + +if (!lookup_mem) +return -EIO ; + +/* Set Mempool in lookup mem */ + mp_tbl = (uintptr_t )lookup_mem; + mp_tbl +=PTYPE_ARRAY_SZ +ERR_ARRAY_SZ +SA_BASE_TBL_SZ ; + *((uintptr_t *)mp_tbl + port) = dev->nix.meta_mempool; +return 0 ; +} + +int +cnxk_nix_lookup_mem_metapool_clear (struct cnxk_eth_dev *dev) +{ +void *lookup_mem =cnxk_nix_fastpath_lookup_mem_get (); +uint16_t port = dev->eth_dev->data->port_id; +uintptr_t mp_tbl; + +if (!lookup_mem) +return -EIO ; + +/* Clear Mempool in lookup mem */ + mp_tbl = (uintptr_t )lookup_mem; + mp_tbl +=PTYPE_ARRAY_SZ +ERR_ARRAY_SZ +SA_BASE_TBL_SZ ; + *((uintptr_t *)mp_tbl + port) = dev->nix.meta_mempool; +return 0 ; +}
Signature · 1 line
2.25.1
PATCH 12/15 common/cnxk: enable one to one SQ QINT mapping
In reply to Nithin DabilpuramFrom: Harman Kalra <[email protected]>
Enabling one to one mapping between SQ to 64 QINTs per LF. So in case of SQ interrupt event NIX can deliver associated QINT MSI-X interrupt to software and increment respective QINT count CSR.
While for some cn10k chip models keeping the workaround (i.e. all SQs assigned to same QINT index), for errata where NIX may use an incorrect QINT_IDX for SQ interrupts.
--- drivers/common/cnxk/roc_errata.h | 8 ++++++++ drivers/common/cnxk/roc_nix_queue.c | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-)
drivers/common/cnxk/roc_errata.h +8 -0
@@ -98,4 +98,12 @@ roc_errata_nix_sdp_send_has_mtu_size_16k(void) roc_model_is_cn96_a0() || roc_model_is_cn96_b0()); } +/* Errata IPBUNIXTX-39300 */ +static inline bool +roc_errata_nix_assign_incorrect_qint (void ) +{ +return (roc_model_is_cn10ka_a0 () ||roc_model_is_cnf10ka_a0 () || +roc_model_is_cnf10kb_a0 () ||roc_model_is_cn10ka_a1 ()); +} +#endif /* _ROC_ERRATA_H_ */
drivers/common/cnxk/roc_nix_queue.c +11 -10
@@ -1103,11 +1103,8 @@ sq_cn9k_init(struct nix *nix, struct roc_nix_sq *sq, uint32_t rr_quantum, aq->sq.sq_int_ena |=BIT (NIX_SQINT_MNQ_ERR );/* Many to one reduction */ -/* Assigning QINT 0 to all the SQs, an errata exists where NIXTX can -* send incorrect QINT_IDX when reporting queue interrupt (QINT). This -* might result in software missing the interrupt. -*/ - aq->sq.qint_idx =0 ; + aq->sq.qint_idx = sq->qid % nix->qints; +return 0 ; }
@@ -1237,11 +1234,15 @@ sq_init(struct nix *nix, struct roc_nix_sq *sq, uint32_t rr_quantum, uint16_t sm aq->sq.sq_int_ena |=BIT (NIX_SQINT_SEND_ERR ); aq->sq.sq_int_ena |=BIT (NIX_SQINT_MNQ_ERR ); -/* Assigning QINT 0 to all the SQs, an errata exists where NIXTX can -* send incorrect QINT_IDX when reporting queue interrupt (QINT). This -* might result in software missing the interrupt. -*/ - aq->sq.qint_idx =0 ; +/* Many to one reduction */ + aq->sq.qint_idx = sq->qid % nix->qints; +if (roc_errata_nix_assign_incorrect_qint ()) { +/* Assigning QINT 0 to all the SQs, an errata exists where NIXTX can +* send incorrect QINT_IDX when reporting queue interrupt (QINT). This +* might result in software missing the interrupt. +*/ + aq->sq.qint_idx =0 ; + }return 0 ; }
Signature · 1 line
2.25.1
PATCH 13/15 common/cnxk: add RSS error messages on mbox failure
In reply to Nithin DabilpuramFrom: Hiral <[email protected]>
Clarifying otx2_process_msgs() RSS error messages
--- .mailmap | 1 + drivers/common/cnxk/roc_dev.c | 4 ++-- drivers/common/cnxk/roc_utils.c | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-)
.mailmap +1 -0
@@ -487,6 +487,7 @@ Herbert Guan <[email protected]> Hernan Vargas <[email protected]> Herry Chen <[email protected]> Hideyuki Yamashita <[email protected]> +Hiral <[email protected]> Hiroki Shirokura <[email protected]> Hiroshi Shimamoto <[email protected]> Hiroyuki Mikita <[email protected]>
drivers/common/cnxk/roc_dev.c +2 -2
@@ -441,8 +441,8 @@ process_msgs(struct dev *dev, struct mbox *mbox)default :if (msg->rc) -plt_err ("Message (%s) response has err=%d" , -mbox_id2name (msg->id), msg->rc); +plt_err ("Message (%s) response has err=%d (%s)" , +mbox_id2name (msg->id), msg->rc,roc_error_msg_get (msg->rc));break ; } offset = mbox->rx_start + msg->next_msgoff;
drivers/common/cnxk/roc_utils.c +6 -0
@@ -229,6 +229,12 @@ roc_error_msg_get(int errorcode)case UTIL_ERR_INVALID_MODEL : err_msg ="Invalid RoC model" ;break ; +case NIX_AF_ERR_RSS_NOSPC_FIELD : + err_msg ="No space or unsupported fields" ; +break ; +case NIX_AF_ERR_RSS_NOSPC_ALGO : + err_msg ="No space to add new flow hash algo" ; +break ;default :/** * Handle general error (as defined in linux errno.h)
Signature · 1 line
2.25.1
PATCH 14/15 common/cnxk: add memory clobber to steor and ldeor
In reply to Nithin DabilpuramTo avoid compiler reordering stores to LMT line and ldeor, add clobber attribute to ldeor, steor etc.
--- drivers/common/cnxk/roc_io.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/common/cnxk/roc_io.h +8 -4
@@ -130,7 +130,8 @@ roc_lmt_submit_ldeor(plt_iova_t io_address) asmvolatile (PLT_CPU_FEATURE_PREAMBLE "ldeor xzr, %x[rf], [%[rs]]" : [rf]"=r" (result) - : [rs]"r" (io_address)); + : [rs]"r" (io_address) + :"memory" );return result; }
@@ -141,7 +142,8 @@ roc_lmt_submit_ldeorl(plt_iova_t io_address) asmvolatile (PLT_CPU_FEATURE_PREAMBLE "ldeorl xzr,%x[rf],[%[rs]]" : [rf]"=r" (result) - : [rs]"r" (io_address)); + : [rs]"r" (io_address) + :"memory" );return result; }
@@ -150,7 +152,8 @@ roc_lmt_submit_steor(uint64_t data, plt_iova_t io_address) { asmvolatile (PLT_CPU_FEATURE_PREAMBLE "steor %x[d], [%[rs]]" ::[d]"r" (data), - [rs]"r" (io_address)); + [rs]"r" (io_address) + :"memory" ); }static __plt_always_inline void
@@ -158,7 +161,8 @@ roc_lmt_submit_steorl(uint64_t data, plt_iova_t io_address) { asmvolatile (PLT_CPU_FEATURE_PREAMBLE "steorl %x[d], [%[rs]]" ::[d]"r" (data), - [rs]"r" (io_address)); + [rs]"r" (io_address) + :"memory" ); }static __plt_always_inline void
Signature · 1 line
2.25.1
PATCH 15/15 common/cnxk: enable SDP channel backpressure to TL4
In reply to Nithin DabilpuramFrom: Veerasenareddy Burru <[email protected]>
Configure TL4 to respond to SDP channel backpressure.
--- drivers/common/cnxk/roc_nix_tm_utils.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/common/cnxk/roc_nix_tm_utils.c +4 -0
@@ -582,8 +582,12 @@ nix_tm_topology_reg_prep(struct nix *nix, struct nix_tm_node *node,/* Configure TL4 to send to SDP channel instead of CGX/LBK */ if (nix->sdp_link) { +plt_tm_dbg ("relchan=%u schq=%u tx_chan_cnt=%u\n" , relchan, schq, + nix->tx_chan_cnt); reg[k] =NIX_AF_TL4X_SDP_LINK_CFG (schq); regval[k] =BIT_ULL (12 ); + regval[k] |=BIT_ULL (13 ); + regval[k] |= relchan; k++; }break ;
Signature · 1 line
2.25.1
Re: [PATCH 15/15] common/cnxk: enable SDP channel backpressure to TL4
Quoted 6 lines · Nithin Dabilpuram
From: Veerasenareddy Burru <[email protected]>
Configure TL4 to respond to SDP channel backpressure.
Signed-off-by Veerasenareddy Burru <[email protected]>
Changed git commit logs and added Fixes: as needed.
Series applied to dpdk-next-net-mrvl/for-next-net. Thanks
Quoted 24 lines
--- drivers/common/cnxk/roc_nix_tm_utils.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/common/cnxk/roc_nix_tm_utils.c +4
-1@@ -582,8 +582,12 @@ nix_tm_topology_reg_prep(struct nix *nix, struct nix_tm_node *node,/* Configure TL4 to send to SDP channel instead of CGX/LBK */ if (nix->sdp_link) { +plt_tm_dbg ("relchan=%u schq=%u tx_chan_cnt=%u\n" , relchan, schq, + nix->tx_chan_cnt); reg[k] =NIX_AF_TL4X_SDP_LINK_CFG (schq); regval[k] =BIT_ULL (12 ); + regval[k] |=BIT_ULL (13 ); + regval[k] |= relchan; k++; }break ; --2.25.1