Commit 7a590bd6 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'octeontx2-af-miscellaneous-changes-for-cpt'

Srujana Challa says:

====================
octeontx2-af: Miscellaneous changes for CPT

This patchset consists of miscellaneous changes for CPT.
- Adds a new mailbox to reset the requested CPT LF.
- Modify FLR sequence as per HW team suggested.
- Adds support to recover CPT engines when they gets fault.
- Updates CPT inbound inline IPsec configuration mailbox,
  as per new generation of the OcteonTX2 chips.
- Adds a new mailbox to return CPT FLT Interrupt info.
====================

Link: https://lore.kernel.org/r/20230118120354.1017961-1-schalla@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c7ef8221 b814cc90
...@@ -195,6 +195,9 @@ M(CPT_STATS, 0xA05, cpt_sts, cpt_sts_req, cpt_sts_rsp) \ ...@@ -195,6 +195,9 @@ M(CPT_STATS, 0xA05, cpt_sts, cpt_sts_req, cpt_sts_rsp) \
M(CPT_RXC_TIME_CFG, 0xA06, cpt_rxc_time_cfg, cpt_rxc_time_cfg_req, \ M(CPT_RXC_TIME_CFG, 0xA06, cpt_rxc_time_cfg, cpt_rxc_time_cfg_req, \
msg_rsp) \ msg_rsp) \
M(CPT_CTX_CACHE_SYNC, 0xA07, cpt_ctx_cache_sync, msg_req, msg_rsp) \ M(CPT_CTX_CACHE_SYNC, 0xA07, cpt_ctx_cache_sync, msg_req, msg_rsp) \
M(CPT_LF_RESET, 0xA08, cpt_lf_reset, cpt_lf_rst_req, msg_rsp) \
M(CPT_FLT_ENG_INFO, 0xA09, cpt_flt_eng_info, cpt_flt_eng_info_req, \
cpt_flt_eng_info_rsp) \
/* SDP mbox IDs (range 0x1000 - 0x11FF) */ \ /* SDP mbox IDs (range 0x1000 - 0x11FF) */ \
M(SET_SDP_CHAN_INFO, 0x1000, set_sdp_chan_info, sdp_chan_info_msg, msg_rsp) \ M(SET_SDP_CHAN_INFO, 0x1000, set_sdp_chan_info, sdp_chan_info_msg, msg_rsp) \
M(GET_SDP_CHAN_INFO, 0x1001, get_sdp_chan_info, msg_req, sdp_get_chan_info_msg) \ M(GET_SDP_CHAN_INFO, 0x1001, get_sdp_chan_info, msg_req, sdp_get_chan_info_msg) \
...@@ -1613,6 +1616,8 @@ struct cpt_lf_alloc_req_msg { ...@@ -1613,6 +1616,8 @@ struct cpt_lf_alloc_req_msg {
u16 sso_pf_func; u16 sso_pf_func;
u16 eng_grpmsk; u16 eng_grpmsk;
int blkaddr; int blkaddr;
u8 ctx_ilen_valid : 1;
u8 ctx_ilen : 7;
}; };
#define CPT_INLINE_INBOUND 0 #define CPT_INLINE_INBOUND 0
...@@ -1696,6 +1701,28 @@ struct cpt_inst_lmtst_req { ...@@ -1696,6 +1701,28 @@ struct cpt_inst_lmtst_req {
u64 rsvd; u64 rsvd;
}; };
/* Mailbox message format to request for CPT LF reset */
struct cpt_lf_rst_req {
struct mbox_msghdr hdr;
u32 slot;
u32 rsvd;
};
/* Mailbox message format to request for CPT faulted engines */
struct cpt_flt_eng_info_req {
struct mbox_msghdr hdr;
int blkaddr;
bool reset;
u32 rsvd;
};
struct cpt_flt_eng_info_rsp {
struct mbox_msghdr hdr;
u64 flt_eng_map[CPT_10K_AF_INT_VEC_RVU];
u64 rcvrd_eng_map[CPT_10K_AF_INT_VEC_RVU];
u64 rsvd;
};
struct sdp_node_info { struct sdp_node_info {
/* Node to which this PF belons to */ /* Node to which this PF belons to */
u8 node_id; u8 node_id;
......
...@@ -1164,8 +1164,16 @@ static int rvu_setup_hw_resources(struct rvu *rvu) ...@@ -1164,8 +1164,16 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
goto nix_err; goto nix_err;
} }
err = rvu_cpt_init(rvu);
if (err) {
dev_err(rvu->dev, "%s: Failed to initialize cpt\n", __func__);
goto mcs_err;
}
return 0; return 0;
mcs_err:
rvu_mcs_exit(rvu);
nix_err: nix_err:
rvu_nix_freemem(rvu); rvu_nix_freemem(rvu);
npa_err: npa_err:
......
...@@ -108,6 +108,8 @@ struct rvu_block { ...@@ -108,6 +108,8 @@ struct rvu_block {
u64 lfreset_reg; u64 lfreset_reg;
unsigned char name[NAME_SIZE]; unsigned char name[NAME_SIZE];
struct rvu *rvu; struct rvu *rvu;
u64 cpt_flt_eng_map[3];
u64 cpt_rcvrd_eng_map[3];
}; };
struct nix_mcast { struct nix_mcast {
...@@ -459,6 +461,7 @@ struct rvu { ...@@ -459,6 +461,7 @@ struct rvu {
struct rvu_pfvf *pf; struct rvu_pfvf *pf;
struct rvu_pfvf *hwvf; struct rvu_pfvf *hwvf;
struct mutex rsrc_lock; /* Serialize resource alloc/free */ struct mutex rsrc_lock; /* Serialize resource alloc/free */
struct mutex alias_lock; /* Serialize bar2 alias access */
int vfs; /* Number of VFs attached to RVU */ int vfs; /* Number of VFs attached to RVU */
int nix_blkaddr[MAX_NIX_BLKS]; int nix_blkaddr[MAX_NIX_BLKS];
...@@ -510,6 +513,7 @@ struct rvu { ...@@ -510,6 +513,7 @@ struct rvu {
struct ptp *ptp; struct ptp *ptp;
int mcs_blk_cnt; int mcs_blk_cnt;
int cpt_pf_num;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct rvu_debugfs rvu_dbg; struct rvu_debugfs rvu_dbg;
...@@ -524,6 +528,8 @@ struct rvu { ...@@ -524,6 +528,8 @@ struct rvu {
struct list_head mcs_intrq_head; struct list_head mcs_intrq_head;
/* mcs interrupt queue lock */ /* mcs interrupt queue lock */
spinlock_t mcs_intrq_lock; spinlock_t mcs_intrq_lock;
/* CPT interrupt lock */
spinlock_t cpt_intr_lock;
}; };
static inline void rvu_write64(struct rvu *rvu, u64 block, u64 offset, u64 val) static inline void rvu_write64(struct rvu *rvu, u64 block, u64 offset, u64 val)
...@@ -546,6 +552,17 @@ static inline u64 rvupf_read64(struct rvu *rvu, u64 offset) ...@@ -546,6 +552,17 @@ static inline u64 rvupf_read64(struct rvu *rvu, u64 offset)
return readq(rvu->pfreg_base + offset); return readq(rvu->pfreg_base + offset);
} }
static inline void rvu_bar2_sel_write64(struct rvu *rvu, u64 block, u64 offset, u64 val)
{
/* HW requires read back of RVU_AF_BAR2_SEL register to make sure completion of
* write operation.
*/
rvu_write64(rvu, block, offset, val);
rvu_read64(rvu, block, offset);
/* Barrier to ensure read completes before accessing LF registers */
mb();
}
/* Silicon revisions */ /* Silicon revisions */
static inline bool is_rvu_pre_96xx_C0(struct rvu *rvu) static inline bool is_rvu_pre_96xx_C0(struct rvu *rvu)
{ {
...@@ -865,6 +882,7 @@ void rvu_cpt_unregister_interrupts(struct rvu *rvu); ...@@ -865,6 +882,7 @@ void rvu_cpt_unregister_interrupts(struct rvu *rvu);
int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int lf, int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int lf,
int slot); int slot);
int rvu_cpt_ctx_flush(struct rvu *rvu, u16 pcifunc); int rvu_cpt_ctx_flush(struct rvu *rvu, u16 pcifunc);
int rvu_cpt_init(struct rvu *rvu);
/* CN10K RVU */ /* CN10K RVU */
int rvu_set_channels_base(struct rvu *rvu); int rvu_set_channels_base(struct rvu *rvu);
......
...@@ -545,6 +545,8 @@ ...@@ -545,6 +545,8 @@
#define CPT_LF_CTL 0x10 #define CPT_LF_CTL 0x10
#define CPT_LF_INPROG 0x40 #define CPT_LF_INPROG 0x40
#define CPT_LF_Q_SIZE 0x100
#define CPT_LF_Q_INST_PTR 0x110
#define CPT_LF_Q_GRP_PTR 0x120 #define CPT_LF_Q_GRP_PTR 0x120
#define CPT_LF_CTX_FLUSH 0x510 #define CPT_LF_CTX_FLUSH 0x510
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment