From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: <jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>,
"Kiran Kumar K" <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, Srujana Challa <schalla@marvell.com>
Subject: [PATCH 7/9] common/cnxk: update CPT inbound inline IPsec mailbox
Date: Mon, 16 Jan 2023 15:09:52 +0530 [thread overview]
Message-ID: <20230116093954.172938-7-ndabilpuram@marvell.com> (raw)
In-Reply-To: <20230116093954.172938-1-ndabilpuram@marvell.com>
From: Srujana Challa <schalla@marvell.com>
Updates CPT inbound inline configuration mailbox message
format to set CPT credit threshold and bpid, which are
introduced for CN10KB.
This patch also fixes inline inbound config read API.
Fixes: 37da58509579 ("common/cnxk: update inbound inline IPsec config mailbox")
Cc: schalla@marvell.com
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
drivers/common/cnxk/roc_cpt.c | 14 +++++++++++++-
drivers/common/cnxk/roc_cpt.h | 14 ++++++++++++--
drivers/common/cnxk/roc_mbox.h | 6 +++++-
3 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c
index 48430096dc..6d3052c9be 100644
--- a/drivers/common/cnxk/roc_cpt.c
+++ b/drivers/common/cnxk/roc_cpt.c
@@ -268,9 +268,10 @@ roc_cpt_inline_ipsec_cfg(struct dev *cpt_dev, uint8_t lf_id,
int
roc_cpt_inline_ipsec_inb_cfg_read(struct roc_cpt *roc_cpt,
- struct nix_inline_ipsec_cfg *inb_cfg)
+ struct roc_cpt_inline_ipsec_inb_cfg *cfg)
{
struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
+ struct nix_inline_ipsec_cfg *inb_cfg;
struct dev *dev = &cpt->dev;
struct mbox *mbox = mbox_get(dev->mbox);
struct msg_req *req;
@@ -283,6 +284,17 @@ roc_cpt_inline_ipsec_inb_cfg_read(struct roc_cpt *roc_cpt,
}
rc = mbox_process_msg(mbox, (void *)&inb_cfg);
+ if (rc) {
+ rc = -EIO;
+ goto exit;
+ }
+ cfg->cpt_credit = inb_cfg->cpt_credit;
+ cfg->egrp = inb_cfg->gen_cfg.egrp;
+ cfg->opcode = inb_cfg->gen_cfg.opcode;
+ cfg->param1 = inb_cfg->gen_cfg.param1;
+ cfg->param2 = inb_cfg->gen_cfg.param2;
+ cfg->bpid = inb_cfg->bpid;
+ cfg->credit_th = inb_cfg->credit_th;
exit:
mbox_put(mbox);
return rc;
diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h
index bc9cc19edd..96d066dee3 100644
--- a/drivers/common/cnxk/roc_cpt.h
+++ b/drivers/common/cnxk/roc_cpt.h
@@ -144,6 +144,16 @@ struct roc_cpt_rxc_time_cfg {
uint16_t zombie_thres;
};
+struct roc_cpt_inline_ipsec_inb_cfg {
+ uint32_t cpt_credit;
+ uint16_t opcode;
+ uint16_t param1;
+ uint16_t param2;
+ uint16_t bpid;
+ uint32_t credit_th;
+ uint8_t egrp;
+};
+
int __roc_api roc_cpt_rxc_time_cfg(struct roc_cpt *roc_cpt,
struct roc_cpt_rxc_time_cfg *cfg);
int __roc_api roc_cpt_dev_init(struct roc_cpt *roc_cpt);
@@ -159,8 +169,8 @@ int __roc_api roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, void *cptr,
int __roc_api roc_cpt_lf_ctx_reload(struct roc_cpt_lf *lf, void *cptr);
int __roc_api roc_cpt_inline_ipsec_cfg(struct dev *dev, uint8_t slot,
struct roc_nix *nix);
-int __roc_api roc_cpt_inline_ipsec_inb_cfg_read(
- struct roc_cpt *roc_cpt, struct nix_inline_ipsec_cfg *inb_cfg);
+int __roc_api roc_cpt_inline_ipsec_inb_cfg_read(struct roc_cpt *roc_cpt,
+ struct roc_cpt_inline_ipsec_inb_cfg *cfg);
int __roc_api roc_cpt_inline_ipsec_inb_cfg(struct roc_cpt *roc_cpt,
uint16_t param1, uint16_t param2,
uint16_t opcode);
diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index b74eb71275..c1769567b5 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -266,7 +266,7 @@ struct mbox_msghdr {
msg_rsp) \
M(NIX_RX_SW_SYNC, 0x8022, nix_rx_sw_sync, msg_req, msg_rsp) \
M(NIX_READ_INLINE_IPSEC_CFG, 0x8023, nix_read_inline_ipsec_cfg, \
- msg_req, nix_inline_ipsec_cfg) \
+ msg_req, nix_inline_ipsec_cfg) \
M(NIX_LF_INLINE_RQ_CFG, 0x8024, nix_lf_inline_rq_cfg, \
nix_rq_cpt_field_mask_cfg_req, msg_rsp) \
M(NIX_SPI_TO_SA_ADD, 0x8026, nix_spi_to_sa_add, nix_spi_to_sa_add_req, \
@@ -1198,6 +1198,8 @@ struct nix_inline_ipsec_cfg {
uint8_t __io cpt_slot;
} inst_qsel;
uint8_t __io enable;
+ uint16_t __io bpid;
+ uint32_t __io credit_th;
};
/* Per NIX LF inline IPSec configuration */
@@ -1503,6 +1505,8 @@ struct cpt_rx_inline_lf_cfg_msg {
uint16_t __io param2;
uint16_t __io opcode;
uint32_t __io credit;
+ uint32_t __io credit_th;
+ uint16_t __io bpid;
uint32_t __io reserved;
};
--
2.25.1
next prev parent reply other threads:[~2023-01-16 9:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 9:39 [PATCH 1/9] common/cnxk: get mbox lock before NDC sync Nithin Dabilpuram
2023-01-16 9:39 ` [PATCH 2/9] common/cnxk: enable CQ late BP with valid CPT BPID Nithin Dabilpuram
2023-01-16 9:39 ` [PATCH 3/9] common/cnxk: configure fc hist bits Nithin Dabilpuram
2023-01-16 9:39 ` [PATCH 4/9] net/cnxk: reset pfc mode and flow control Nithin Dabilpuram
2023-01-16 9:39 ` [PATCH 5/9] common/cnxk: dump inline device RQ context Nithin Dabilpuram
2023-01-16 9:39 ` [PATCH 6/9] common/cnxk: free tm resources in order from leaf to root Nithin Dabilpuram
2023-01-16 9:39 ` Nithin Dabilpuram [this message]
2023-01-16 9:39 ` [PATCH 8/9] net/cnxk: make flow control op for SDP as no-op Nithin Dabilpuram
2023-01-16 9:39 ` [PATCH 9/9] common/cnxk: skip L4 checks on inline IPsec traffic Nithin Dabilpuram
2023-01-17 11:47 ` Jerin Jacob
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=20230116093954.172938-7-ndabilpuram@marvell.com \
--to=ndabilpuram@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=schalla@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).