Skip to content

Commit 2e7bc57

Browse files
Hariprasad Kelamdavem330
authored andcommitted
octeontx2-af: Fix mapping for NIX block from CGX connection
Firmware configures NIX block mapping for all MAC blocks. The current implementation reads the configuration and creates the mapping between RVU PF and NIX blocks. But this configuration is only valid for silicons that support multiple blocks. For all other silicons, all MAC blocks map to NIX0. This patch corrects the mapping by adding a check for the same. Fixes: c5a73b6 ("octeontx2-af: Map NIX block from CGX connection") Signed-off-by: Hariprasad Kelam <[email protected]> Signed-off-by: Sunil Goutham <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4c5a331 commit 2e7bc57

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define PCI_DEVID_OCTEONTX2_LBK 0xA061
2424

2525
/* Subsystem Device ID */
26+
#define PCI_SUBSYS_DEVID_98XX 0xB100
2627
#define PCI_SUBSYS_DEVID_96XX 0xB200
2728
#define PCI_SUBSYS_DEVID_CN10K_A 0xB900
2829
#define PCI_SUBSYS_DEVID_CNF10K_B 0xBC00
@@ -686,6 +687,16 @@ static inline u16 rvu_nix_chan_cpt(struct rvu *rvu, u8 chan)
686687
return rvu->hw->cpt_chan_base + chan;
687688
}
688689

690+
static inline bool is_rvu_supports_nix1(struct rvu *rvu)
691+
{
692+
struct pci_dev *pdev = rvu->pdev;
693+
694+
if (pdev->subsystem_device == PCI_SUBSYS_DEVID_98XX)
695+
return true;
696+
697+
return false;
698+
}
699+
689700
/* Function Prototypes
690701
* RVU
691702
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static void rvu_map_cgx_nix_block(struct rvu *rvu, int pf,
114114
p2x = cgx_lmac_get_p2x(cgx_id, lmac_id);
115115
/* Firmware sets P2X_SELECT as either NIX0 or NIX1 */
116116
pfvf->nix_blkaddr = BLKADDR_NIX0;
117-
if (p2x == CMR_P2X_SEL_NIX1)
117+
if (is_rvu_supports_nix1(rvu) && p2x == CMR_P2X_SEL_NIX1)
118118
pfvf->nix_blkaddr = BLKADDR_NIX1;
119119
}
120120

0 commit comments

Comments
 (0)