From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2AD541DC3; Fri, 3 Mar 2023 09:11:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61C2B42C76; Fri, 3 Mar 2023 09:11:12 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id EDB1C42D13 for ; Fri, 3 Mar 2023 09:11:09 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32373jY8024813 for ; Fri, 3 Mar 2023 00:11:09 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=OET8acqNcFr7aBVz45Kbr3Eutl9pxmYvvjlyBIUnn/0=; b=V4VERgEajWsd5+z7uKzFgAH6wHmCptLvFSMpSuwZD8gkaIFP59A4/zOvybV5m77/d1R5 uzGkOXksMhME1+WDPEYWijNB8j1WiK0ZKoH9DUdk40oStduousKOEXAnpkgqOkUB4gTY QD9aG1n5awJ2eW5FofhWOV89PDJmAr4/DVesv3TSQt6/xNljL10aERPPAO9C2cBIuLfi sGUrNH9qCK3a+6Hu3Su58RnWf+lQU7EqO73goVVsWBxITrBYH06vo1h98W1w8NuHRwf5 eD/FORuxoXGYh2qraysNwa7kMXs19+++IODkCglhymbI6k0UWANB2lQhodSfldOk+Aa0 Ew== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3p2vg53du1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 03 Mar 2023 00:11:08 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 3 Mar 2023 00:11:06 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Fri, 3 Mar 2023 00:11:06 -0800 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 20FDA3F705E; Fri, 3 Mar 2023 00:11:03 -0800 (PST) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Subject: [PATCH 07/15] common/cnxk: enable 10K B0 support for inline IPsec Date: Fri, 3 Mar 2023 13:40:05 +0530 Message-ID: <20230303081013.589868-7-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303081013.589868-1-ndabilpuram@marvell.com> References: <20230303081013.589868-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: E5bIG2d4JHB9fjopiE0zbNykPtvtSP2k X-Proofpoint-GUID: E5bIG2d4JHB9fjopiE0zbNykPtvtSP2k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-03_01,2023-03-02_02,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Enable support similar to CN10KB as CN10KA_B0 is similar to CN10KB. Signed-off-by: Nithin Dabilpuram --- 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 diff --git a/drivers/common/cnxk/roc_api.h b/drivers/common/cnxk/roc_api.h index 9d7f5417c2..993a2f7a68 100644 --- a/drivers/common/cnxk/roc_api.h +++ b/drivers/common/cnxk/roc_api.h @@ -47,6 +47,9 @@ /* HW Errata */ #include "roc_errata.h" +/* HW Features */ +#include "roc_features.h" + /* Mbox */ #include "roc_mbox.h" diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h index 6966e0f10b..d3a5683dc8 100644 --- a/drivers/common/cnxk/roc_cpt.h +++ b/drivers/common/cnxk/roc_cpt.h @@ -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 diff --git a/drivers/common/cnxk/roc_features.h b/drivers/common/cnxk/roc_features.h new file mode 100644 index 0000000000..27bccd6b9c --- /dev/null +++ b/drivers/common/cnxk/roc_features.h @@ -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 diff --git a/drivers/common/cnxk/roc_nix_debug.c b/drivers/common/cnxk/roc_nix_debug.c index 97d86f9a97..399d0d7eae 100644 --- a/drivers/common/cnxk/roc_nix_debug.c +++ b/drivers/common/cnxk/roc_nix_debug.c @@ -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); diff --git a/drivers/common/cnxk/roc_nix_fc.c b/drivers/common/cnxk/roc_nix_fc.c index 39c16995cd..7574a88bf6 100644 --- a/drivers/common/cnxk/roc_nix_fc.c +++ b/drivers/common/cnxk/roc_nix_fc.c @@ -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); diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c index 70b4ae9277..19f500ee54 100644 --- a/drivers/common/cnxk/roc_nix_inl.c +++ b/drivers/common/cnxk/roc_nix_inl.c @@ -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); diff --git a/drivers/common/cnxk/roc_nix_inl.h b/drivers/common/cnxk/roc_nix_inl.h index 3bb37ce225..105a9e4ec4 100644 --- a/drivers/common/cnxk/roc_nix_inl.h +++ b/drivers/common/cnxk/roc_nix_inl.h @@ -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); diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c index 07ec1270d7..33b2cdf90f 100644 --- a/drivers/common/cnxk/roc_nix_queue.c +++ b/drivers/common/cnxk/roc_nix_queue.c @@ -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; } diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map index 6c69c425df..53f2129e71 100644 --- a/drivers/common/cnxk/version.map +++ b/drivers/common/cnxk/version.map @@ -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; diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c index b84fed6d90..cb88bd2dc1 100644 --- a/drivers/net/cnxk/cn10k_ethdev.c +++ b/drivers/net/cnxk/cn10k_ethdev.c @@ -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) { diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c index ed5c335787..3c32de0f94 100644 --- a/drivers/net/cnxk/cn10k_ethdev_sec.c +++ b/drivers/net/cnxk/cn10k_ethdev_sec.c @@ -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 */ -- 2.25.1