Skip to content

Commit 9978144

Browse files
Hariprasad Kelamdavem330
authored andcommitted
Octeontx2-af: Fetch MAC channel info from firmware
Packet ingress and egress MAC/serdes channel numbers are configurable on CN10K series of silicons. These channel numbers inturn used while installing MCAM rules to match ingress/egress port. Fetch these channel numbers from firmware at driver init time. Signed-off-by: Hariprasad Kelam <[email protected]> Signed-off-by: Sunil Kovvuri Goutham <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b53e846 commit 9978144

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@ struct mbox_wq_info {
443443
struct workqueue_struct *mbox_wq;
444444
};
445445

446+
struct channel_fwdata {
447+
struct sdp_node_info info;
448+
u8 valid;
449+
#define RVU_CHANL_INFO_RESERVED 379
450+
u8 reserved[RVU_CHANL_INFO_RESERVED];
451+
};
452+
446453
struct rvu_fwdata {
447454
#define RVU_FWDATA_HEADER_MAGIC 0xCFDA /* Custom Firmware Data*/
448455
#define RVU_FWDATA_VERSION 0x0001
@@ -461,7 +468,8 @@ struct rvu_fwdata {
461468
u64 msixtr_base;
462469
u32 ptp_ext_clk_rate;
463470
u32 ptp_ext_tstamp;
464-
#define FWDATA_RESERVED_MEM 1022
471+
struct channel_fwdata channel_data;
472+
#define FWDATA_RESERVED_MEM 1014
465473
u64 reserved[FWDATA_RESERVED_MEM];
466474
#define CGX_MAX 9
467475
#define CGX_LMACS_MAX 4

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ int rvu_sdp_init(struct rvu *rvu)
5656
struct rvu_pfvf *pfvf;
5757
u32 i = 0;
5858

59+
if (rvu->fwdata->channel_data.valid) {
60+
sdp_pf_num[0] = 0;
61+
pfvf = &rvu->pf[sdp_pf_num[0]];
62+
pfvf->sdp_info = &rvu->fwdata->channel_data.info;
63+
64+
return 0;
65+
}
66+
5967
while ((i < MAX_SDP) && (pdev = pci_get_device(PCI_VENDOR_ID_CAVIUM,
6068
PCI_DEVID_OTX2_SDP_PF,
6169
pdev)) != NULL) {

0 commit comments

Comments
 (0)