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 D5F5BA00C2; Fri, 14 Oct 2022 07:43:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B747842C1C; Fri, 14 Oct 2022 07:43:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3609842C28 for ; Fri, 14 Oct 2022 07:43:35 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29E2JnDS006062 for ; Thu, 13 Oct 2022 22:43:34 -0700 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=Zsc24S5RVFmtiGdiLW0SE77B+10vXl3e7NZnG11bTV0=; b=k/fx8a89jGIN1VhEtfhIb1O4A6WQQFJOVBJv+XFsbBix3LqH8jj7avW3iNq5pixR+NTZ dHYbhY+P2JOUHdazc5Ox6MV6WWBZALp+YcrebS4sckEeBYRvQsU5wmK62++jGZINoXn0 HEUcPsgLFLpUCMo0v8DsWz4anyc8q8nnO1ijm270y+K1cFNPy7ieZC+CJdFOKu+DXqZX q6mgjTbrSWRg79xa89NrNJStMRQQEGHLnVPxiNglqFNY82XK57dJdImeIbEdclTB93UD fNnPpKn04FblS/ji31qSUS9Xao8+7S/ZPsm+P+g1JaRUAp74EuARD1N0kiYtcxx/sBUu ew== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3k6xvp0k6q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 13 Oct 2022 22:43:34 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 13 Oct 2022 22:43:32 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 13 Oct 2022 22:43:32 -0700 Received: from localhost.localdomain (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id B421B3F7048; Thu, 13 Oct 2022 22:43:30 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Subject: [PATCH v3 05/13] common/cnxk: fix RQ mask config for cn10kb chip Date: Fri, 14 Oct 2022 11:13:09 +0530 Message-ID: <20221014054317.1151306-5-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221014054317.1151306-1-ndabilpuram@marvell.com> References: <20221011120135.45846-1-ndabilpuram@marvell.com> <20221014054317.1151306-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: e5TtGtQYrU-9GNelxOHAdD24StFCBaRg X-Proofpoint-GUID: e5TtGtQYrU-9GNelxOHAdD24StFCBaRg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-14_02,2022-10-13_01,2022-06-22_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 RQ mask config needs to enable SPB_ENA in order for Zero for being able to override it with Meta aura. Also fix flow control config to catch invalid rxchan config errors. Fixes: ddf955d3917e ("common/cnxk: support CPT second pass") Fixes: da57d4589a6f ("common/cnxk: support NIX flow control") Signed-off-by: Nithin Dabilpuram --- drivers/common/cnxk/roc_nix_fc.c | 4 ++- drivers/common/cnxk/roc_nix_inl.c | 43 +++++++++++++++++-------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/drivers/common/cnxk/roc_nix_fc.c b/drivers/common/cnxk/roc_nix_fc.c index f4cfa11c0f..033e17a4bf 100644 --- a/drivers/common/cnxk/roc_nix_fc.c +++ b/drivers/common/cnxk/roc_nix_fc.c @@ -52,8 +52,10 @@ nix_fc_rxchan_bpid_set(struct roc_nix *roc_nix, bool enable) req->bpid_per_chan = true; rc = mbox_process_msg(mbox, (void *)&rsp); - if (rc || (req->chan_cnt != rsp->chan_cnt)) + if (rc || (req->chan_cnt != rsp->chan_cnt)) { + rc = -EIO; goto exit; + } nix->chan_cnt = rsp->chan_cnt; for (i = 0; i < rsp->chan_cnt; i++) diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c index 213d71e684..0da097c9e9 100644 --- a/drivers/common/cnxk/roc_nix_inl.c +++ b/drivers/common/cnxk/roc_nix_inl.c @@ -454,27 +454,29 @@ nix_inl_rq_mask_cfg(struct roc_nix *roc_nix, bool enable) msk_req->rq_set.lpb_drop_ena = 0; msk_req->rq_set.spb_drop_ena = 0; msk_req->rq_set.xqe_drop_ena = 0; + msk_req->rq_set.spb_ena = 1; - msk_req->rq_mask.len_ol3_dis = ~(msk_req->rq_set.len_ol3_dis); - msk_req->rq_mask.len_ol4_dis = ~(msk_req->rq_set.len_ol4_dis); - msk_req->rq_mask.len_il3_dis = ~(msk_req->rq_set.len_il3_dis); + msk_req->rq_mask.len_ol3_dis = 0; + msk_req->rq_mask.len_ol4_dis = 0; + msk_req->rq_mask.len_il3_dis = 0; - msk_req->rq_mask.len_il4_dis = ~(msk_req->rq_set.len_il4_dis); - msk_req->rq_mask.csum_ol4_dis = ~(msk_req->rq_set.csum_ol4_dis); - msk_req->rq_mask.csum_il4_dis = ~(msk_req->rq_set.csum_il4_dis); + msk_req->rq_mask.len_il4_dis = 0; + msk_req->rq_mask.csum_ol4_dis = 0; + msk_req->rq_mask.csum_il4_dis = 0; - msk_req->rq_mask.lenerr_dis = ~(msk_req->rq_set.lenerr_dis); - msk_req->rq_mask.port_ol4_dis = ~(msk_req->rq_set.port_ol4_dis); - msk_req->rq_mask.port_il4_dis = ~(msk_req->rq_set.port_il4_dis); + msk_req->rq_mask.lenerr_dis = 0; + msk_req->rq_mask.port_ol4_dis = 0; + msk_req->rq_mask.port_il4_dis = 0; - msk_req->rq_mask.lpb_drop_ena = ~(msk_req->rq_set.lpb_drop_ena); - msk_req->rq_mask.spb_drop_ena = ~(msk_req->rq_set.spb_drop_ena); - msk_req->rq_mask.xqe_drop_ena = ~(msk_req->rq_set.xqe_drop_ena); + msk_req->rq_mask.lpb_drop_ena = 0; + msk_req->rq_mask.spb_drop_ena = 0; + msk_req->rq_mask.xqe_drop_ena = 0; + msk_req->rq_mask.spb_ena = 0; aura_handle = roc_npa_zero_aura_handle(); msk_req->ipsec_cfg1.spb_cpt_aura = roc_npa_aura_handle_to_aura(aura_handle); msk_req->ipsec_cfg1.rq_mask_enable = enable; - msk_req->ipsec_cfg1.spb_cpt_sizem1 = inl_cfg->buf_sz; + msk_req->ipsec_cfg1.spb_cpt_sizem1 = (inl_cfg->buf_sz >> 7) - 1; msk_req->ipsec_cfg1.spb_cpt_enable = enable; return mbox_process(mbox); @@ -544,13 +546,6 @@ roc_nix_inl_inb_init(struct roc_nix *roc_nix) idev->inl_cfg.refs++; } - if (roc_model_is_cn10kb_a0()) { - rc = nix_inl_rq_mask_cfg(roc_nix, true); - if (rc) { - plt_err("Failed to get rq mask rc=%d", rc); - return rc; - } - } nix->inl_inb_ena = true; return 0; } @@ -1043,6 +1038,14 @@ roc_nix_inl_rq_ena_dis(struct roc_nix *roc_nix, bool enable) if (!idev) return -EFAULT; + if (roc_model_is_cn10kb_a0()) { + rc = nix_inl_rq_mask_cfg(roc_nix, true); + if (rc) { + plt_err("Failed to get rq mask rc=%d", rc); + return rc; + } + } + if (nix->inb_inl_dev) { if (!inl_rq || !idev->nix_inl_dev) return -EFAULT; -- 2.25.1