Skip to content

Commit 7a590bd

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c7ef822 + b814cc9 commit 7a590bd

File tree

5 files changed

+277
-87
lines changed

5 files changed

+277
-87
lines changed

drivers/net/ethernet/marvell/octeontx2/af/mbox.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ M(CPT_STATS, 0xA05, cpt_sts, cpt_sts_req, cpt_sts_rsp) \
195195
M(CPT_RXC_TIME_CFG, 0xA06, cpt_rxc_time_cfg, cpt_rxc_time_cfg_req, \
196196
msg_rsp) \
197197
M(CPT_CTX_CACHE_SYNC, 0xA07, cpt_ctx_cache_sync, msg_req, msg_rsp) \
198+
M(CPT_LF_RESET, 0xA08, cpt_lf_reset, cpt_lf_rst_req, msg_rsp) \
199+
M(CPT_FLT_ENG_INFO, 0xA09, cpt_flt_eng_info, cpt_flt_eng_info_req, \
200+
cpt_flt_eng_info_rsp) \
198201
/* SDP mbox IDs (range 0x1000 - 0x11FF) */ \
199202
M(SET_SDP_CHAN_INFO, 0x1000, set_sdp_chan_info, sdp_chan_info_msg, msg_rsp) \
200203
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 {
16131616
u16 sso_pf_func;
16141617
u16 eng_grpmsk;
16151618
int blkaddr;
1619+
u8 ctx_ilen_valid : 1;
1620+
u8 ctx_ilen : 7;
16161621
};
16171622

16181623
#define CPT_INLINE_INBOUND 0
@@ -1696,6 +1701,28 @@ struct cpt_inst_lmtst_req {
16961701
u64 rsvd;
16971702
};
16981703

1704+
/* Mailbox message format to request for CPT LF reset */
1705+
struct cpt_lf_rst_req {
1706+
struct mbox_msghdr hdr;
1707+
u32 slot;
1708+
u32 rsvd;
1709+
};
1710+
1711+
/* Mailbox message format to request for CPT faulted engines */
1712+
struct cpt_flt_eng_info_req {
1713+
struct mbox_msghdr hdr;
1714+
int blkaddr;
1715+
bool reset;
1716+
u32 rsvd;
1717+
};
1718+
1719+
struct cpt_flt_eng_info_rsp {
1720+
struct mbox_msghdr hdr;
1721+
u64 flt_eng_map[CPT_10K_AF_INT_VEC_RVU];
1722+
u64 rcvrd_eng_map[CPT_10K_AF_INT_VEC_RVU];
1723+
u64 rsvd;
1724+
};
1725+
16991726
struct sdp_node_info {
17001727
/* Node to which this PF belons to */
17011728
u8 node_id;

drivers/net/ethernet/marvell/octeontx2/af/rvu.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,16 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
11641164
goto nix_err;
11651165
}
11661166

1167+
err = rvu_cpt_init(rvu);
1168+
if (err) {
1169+
dev_err(rvu->dev, "%s: Failed to initialize cpt\n", __func__);
1170+
goto mcs_err;
1171+
}
1172+
11671173
return 0;
11681174

1175+
mcs_err:
1176+
rvu_mcs_exit(rvu);
11691177
nix_err:
11701178
rvu_nix_freemem(rvu);
11711179
npa_err:

drivers/net/ethernet/marvell/octeontx2/af/rvu.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ struct rvu_block {
108108
u64 lfreset_reg;
109109
unsigned char name[NAME_SIZE];
110110
struct rvu *rvu;
111+
u64 cpt_flt_eng_map[3];
112+
u64 cpt_rcvrd_eng_map[3];
111113
};
112114

113115
struct nix_mcast {
@@ -459,6 +461,7 @@ struct rvu {
459461
struct rvu_pfvf *pf;
460462
struct rvu_pfvf *hwvf;
461463
struct mutex rsrc_lock; /* Serialize resource alloc/free */
464+
struct mutex alias_lock; /* Serialize bar2 alias access */
462465
int vfs; /* Number of VFs attached to RVU */
463466
int nix_blkaddr[MAX_NIX_BLKS];
464467

@@ -510,6 +513,7 @@ struct rvu {
510513
struct ptp *ptp;
511514

512515
int mcs_blk_cnt;
516+
int cpt_pf_num;
513517

514518
#ifdef CONFIG_DEBUG_FS
515519
struct rvu_debugfs rvu_dbg;
@@ -524,6 +528,8 @@ struct rvu {
524528
struct list_head mcs_intrq_head;
525529
/* mcs interrupt queue lock */
526530
spinlock_t mcs_intrq_lock;
531+
/* CPT interrupt lock */
532+
spinlock_t cpt_intr_lock;
527533
};
528534

529535
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)
546552
return readq(rvu->pfreg_base + offset);
547553
}
548554

555+
static inline void rvu_bar2_sel_write64(struct rvu *rvu, u64 block, u64 offset, u64 val)
556+
{
557+
/* HW requires read back of RVU_AF_BAR2_SEL register to make sure completion of
558+
* write operation.
559+
*/
560+
rvu_write64(rvu, block, offset, val);
561+
rvu_read64(rvu, block, offset);
562+
/* Barrier to ensure read completes before accessing LF registers */
563+
mb();
564+
}
565+
549566
/* Silicon revisions */
550567
static inline bool is_rvu_pre_96xx_C0(struct rvu *rvu)
551568
{
@@ -865,6 +882,7 @@ void rvu_cpt_unregister_interrupts(struct rvu *rvu);
865882
int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int lf,
866883
int slot);
867884
int rvu_cpt_ctx_flush(struct rvu *rvu, u16 pcifunc);
885+
int rvu_cpt_init(struct rvu *rvu);
868886

869887
/* CN10K RVU */
870888
int rvu_set_channels_base(struct rvu *rvu);

0 commit comments

Comments
 (0)