net/cnxk: use NIX Tx offset for CN10KB

In outbound inline case, use NIX Tx offset instead of
NIX Tx address for cn10kb as per new instruction format.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
This commit is contained in:
Nithin Dabilpuram 2022-10-14 11:13:08 +05:30 committed by Jerin Jacob
parent 480b03be9d
commit b354dc053a
6 changed files with 16 additions and 3 deletions

View File

@ -12,6 +12,7 @@
/* [CN10K, .) */
#define ROC_LMT_LINE_SZ 128
#define ROC_NUM_LMT_LINES 2048
#define ROC_LMT_LINES_PER_STR_LOG2 4
#define ROC_LMT_LINES_PER_CORE_LOG2 5
#define ROC_LMT_LINE_SIZE_LOG2 7
#define ROC_LMT_BASE_PER_CORE_LOG2 \

View File

@ -595,6 +595,9 @@ cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
ws->gw_rdata = roc_sso_hws_head_wait(ws->base);
cn10k_sso_txq_fc_wait(txq);
if (flags & NIX_TX_OFFLOAD_SECURITY_F && sec)
cn10k_nix_sec_fc_wait_one(txq);
roc_lmt_submit_steorl(lmt_id, pa);
if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {

View File

@ -538,6 +538,9 @@ 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))
return -ENOTSUP;
if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
reassembly_capa->timeout_ms = 60 * 1000;
reassembly_capa->max_frags = 4;
@ -565,6 +568,9 @@ 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))
return -ENOTSUP;
if (!conf->flags) {
/* Clear offload flags on disable */
dev->rx_offload_flags &= ~NIX_RX_REAS_F;

View File

@ -75,7 +75,8 @@ struct cn10k_sec_sess_priv {
uint16_t partial_len : 10;
uint16_t chksum : 2;
uint16_t dec_ttl : 1;
uint16_t rsvd : 3;
uint16_t nixtx_off : 1;
uint16_t rsvd : 2;
};
uint64_t u64;

View File

@ -798,6 +798,8 @@ 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())
sess_priv.nixtx_off = 1;
/* Pointer from eth_sec -> outb_sa */
eth_sec->sa = outb_sa;

View File

@ -397,7 +397,7 @@ cn10k_nix_prep_sec_vec(struct rte_mbuf *m, uint64x2_t *cmd0, uint64x2_t *cmd1,
/* DLEN passed is excluding L2 HDR */
pkt_len -= l2_len;
}
w0 |= nixtx;
w0 |= sess_priv.nixtx_off ? ((((int64_t)nixtx - (int64_t)dptr) & 0xFFFFF) << 32) : nixtx;
/* CPT word 0 and 1 */
cmd01 = vdupq_n_u64(0);
cmd01 = vsetq_lane_u64(w0, cmd01, 0);
@ -539,7 +539,7 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
sg->seg1_size = pkt_len + dlen_adj;
pkt_len -= l2_len;
}
w0 |= nixtx;
w0 |= sess_priv.nixtx_off ? ((((int64_t)nixtx - (int64_t)dptr) & 0xFFFFF) << 32) : nixtx;
/* CPT word 0 and 1 */
cmd01 = vdupq_n_u64(0);
cmd01 = vsetq_lane_u64(w0, cmd01, 0);