From: Srujana Challa <schalla@marvell.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <edumazet@google.com>,
<pabeni@redhat.com>, <jerinj@marvell.com>, <sgoutham@marvell.com>,
<lcherian@marvell.com>, <gakula@marvell.com>,
<sbhatta@marvell.com>, <hkelam@marvell.com>,
<schalla@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>
Subject: [PATCH v2 net-next,5/8] octeontx2-af: restore rxc conf after teardown sequence
Date: Wed, 11 Jan 2023 17:53:40 +0530 [thread overview]
Message-ID: <20230111122343.928694-6-schalla@marvell.com> (raw)
In-Reply-To: <20230111122343.928694-1-schalla@marvell.com>
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Restore rxc timeout and threshold config after teardown
sequence is complete as it is global config and not
per CPT LF.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
.../ethernet/marvell/octeontx2/af/rvu_cpt.c | 22 +++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
index f970cb9b0bff..302ff549284e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
@@ -812,10 +812,21 @@ int rvu_mbox_handler_cpt_sts(struct rvu *rvu, struct cpt_sts_req *req,
#define RXC_ZOMBIE_COUNT GENMASK_ULL(60, 48)
static void cpt_rxc_time_cfg(struct rvu *rvu, struct cpt_rxc_time_cfg_req *req,
- int blkaddr)
+ int blkaddr, struct cpt_rxc_time_cfg_req *save)
{
u64 dfrg_reg;
+ if (save) {
+ /* Save older config */
+ dfrg_reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_DFRG);
+ save->zombie_thres = FIELD_GET(RXC_ZOMBIE_THRES, dfrg_reg);
+ save->zombie_limit = FIELD_GET(RXC_ZOMBIE_LIMIT, dfrg_reg);
+ save->active_thres = FIELD_GET(RXC_ACTIVE_THRES, dfrg_reg);
+ save->active_limit = FIELD_GET(RXC_ACTIVE_LIMIT, dfrg_reg);
+
+ save->step = rvu_read64(rvu, blkaddr, CPT_AF_RXC_TIME_CFG);
+ }
+
dfrg_reg = FIELD_PREP(RXC_ZOMBIE_THRES, req->zombie_thres);
dfrg_reg |= FIELD_PREP(RXC_ZOMBIE_LIMIT, req->zombie_limit);
dfrg_reg |= FIELD_PREP(RXC_ACTIVE_THRES, req->active_thres);
@@ -840,7 +851,7 @@ int rvu_mbox_handler_cpt_rxc_time_cfg(struct rvu *rvu,
!is_cpt_vf(rvu, req->hdr.pcifunc))
return CPT_AF_ERR_ACCESS_DENIED;
- cpt_rxc_time_cfg(rvu, req, blkaddr);
+ cpt_rxc_time_cfg(rvu, req, blkaddr, NULL);
return 0;
}
@@ -886,7 +897,7 @@ int rvu_mbox_handler_cpt_lf_reset(struct rvu *rvu, struct cpt_lf_rst_req *req,
static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)
{
- struct cpt_rxc_time_cfg_req req;
+ struct cpt_rxc_time_cfg_req req, prev;
int timeout = 2000;
u64 reg;
@@ -902,7 +913,7 @@ static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)
req.active_thres = 1;
req.active_limit = 1;
- cpt_rxc_time_cfg(rvu, &req, blkaddr);
+ cpt_rxc_time_cfg(rvu, &req, blkaddr, &prev);
do {
reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ACTIVE_STS);
@@ -928,6 +939,9 @@ static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)
if (timeout == 0)
dev_warn(rvu->dev, "Poll for RXC zombie count hits hard loop counter\n");
+
+ /* Restore config */
+ cpt_rxc_time_cfg(rvu, &prev, blkaddr, NULL);
}
#define INFLIGHT GENMASK_ULL(8, 0)
--
2.25.1
next prev parent reply other threads:[~2023-01-11 12:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 12:23 [PATCH v2 net-next,0/8] octeontx2-af: Miscellaneous changes for CPT Srujana Challa
2023-01-11 12:23 ` [PATCH v2 net-next,1/8] octeontx2-af: recover CPT engine when it gets fault Srujana Challa
2023-01-11 12:23 ` [PATCH v2 net-next,2/8] octeontx2-af: add mbox for CPT LF reset Srujana Challa
2023-01-11 12:23 ` [PATCH v2 net-next,3/8] octeontx2-af: modify FLR sequence for CPT Srujana Challa
2023-01-11 12:23 ` [PATCH v2 net-next,4/8] octeontx2-af: optimize cpt pf identification Srujana Challa
2023-01-11 12:23 ` Srujana Challa [this message]
2023-01-11 12:23 ` [PATCH v2 net-next,/8] octeontx2-af: update CPT inbound inline IPsec config mailbox Srujana Challa
2023-01-16 10:30 ` patchwork-bot+netdevbpf
2023-01-11 12:23 ` [PATCH v2 net-next,7/8] octeontx2-af: add ctx ilen to cpt lf alloc mailbox Srujana Challa
2023-01-11 12:23 ` [PATCH v2 net-next,8/8] octeontx2-af: add mbox to return CPT_AF_FLT_INT info Srujana Challa
2023-01-15 8:54 ` [PATCH v2 net-next,0/8] octeontx2-af: Miscellaneous changes for CPT Leon Romanovsky
-- strict thread matches above, loose matches on Subject: below --
2023-01-12 4:41 Srujana Challa
2023-01-12 4:41 ` [PATCH v2 net-next,5/8] octeontx2-af: restore rxc conf after teardown sequence Srujana Challa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230111122343.928694-6-schalla@marvell.com \
--to=schalla@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.