Commit 1c1935c9 authored by Subbaraya Sundeep's avatar Subbaraya Sundeep Committed by Jakub Kicinski
Browse files

octeontx2-af: Add NIX1 interfaces to NPC



On 98xx silicon, NPC block has additional
mcam entries, counters and NIX1 interfaces.
Extended set of registers are present for the
new mcam entries and counters.
This patch does the following:
- updates the register accessing macros
  to use extended set if present.
- configures the MKEX profile for NIX1 interfaces also.
- updates mcam entry write functions to use assigned
  NIX0/1 interfaces for the PF/VF.

Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: default avatarRakesh Babu <rsaladi2@marvell.com>
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 55efcc57
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -174,8 +174,12 @@ enum nix_scheduler {
#define NPC_MCAM_KEY_X2			1
#define NPC_MCAM_KEY_X4			2

#define NIX_INTF_RX			0
#define NIX_INTF_TX			1
#define NIX_INTFX_RX(a)			(0x0ull | (a) << 1)
#define NIX_INTFX_TX(a)			(0x1ull | (a) << 1)

/* Default interfaces are NIX0_RX and NIX0_TX */
#define NIX_INTF_RX			NIX_INTFX_RX(0)
#define NIX_INTF_TX			NIX_INTFX_TX(0)

#define NIX_INTF_TYPE_CGX		0
#define NIX_INTF_TYPE_LBK		1
+1 −1
Original line number Diff line number Diff line
@@ -13380,7 +13380,7 @@ static const struct npc_lt_def_cfg npc_lt_defaults = {
	},
};

static const struct npc_mcam_kex npc_mkex_default = {
static struct npc_mcam_kex npc_mkex_default = {
	.mkex_sign = MKEX_SIGN,
	.name = "default",
	.kpu_version = NPC_KPU_PROFILE_VER,
+4 −0
Original line number Diff line number Diff line
@@ -1276,10 +1276,14 @@ static int rvu_get_nix_blkaddr(struct rvu *rvu, u16 pcifunc)
	switch (blkaddr) {
	case BLKADDR_NIX1:
		pfvf->nix_blkaddr = BLKADDR_NIX1;
		pfvf->nix_rx_intf = NIX_INTFX_RX(1);
		pfvf->nix_tx_intf = NIX_INTFX_TX(1);
		break;
	case BLKADDR_NIX0:
	default:
		pfvf->nix_blkaddr = BLKADDR_NIX0;
		pfvf->nix_rx_intf = NIX_INTFX_RX(0);
		pfvf->nix_tx_intf = NIX_INTFX_TX(0);
		break;
	}

+12 −1
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ struct rvu_pfvf {
	int	cgx_users;  /* number of cgx users - used only by PFs */

	u8	nix_blkaddr; /* BLKADDR_NIX0/1 assigned to this PF */
	u8	nix_rx_intf; /* NIX0_RX/NIX1_RX interface to NPC */
	u8	nix_tx_intf; /* NIX0_TX/NIX1_TX interface to NPC */
};

struct nix_txsch {
@@ -257,6 +259,11 @@ struct rvu_hwinfo {
	u8	lbk_links;
	u8	sdp_links;
	u8	npc_kpus;          /* No of parser units */
	u8	npc_pkinds;        /* No of port kinds */
	u8	npc_intfs;         /* No of interfaces */
	u8	npc_kpu_entries;   /* No of KPU entries */
	u16	npc_counters;	   /* No of match stats counters */
	bool	npc_ext_set;	   /* Extended register set */

	struct hw_cap    cap;
	struct rvu_block block[BLK_COUNT]; /* Block info */
@@ -307,7 +314,7 @@ struct npc_kpu_profile_adapter {
	const struct npc_lt_def_cfg	*lt_def;
	const struct npc_kpu_profile_action	*ikpu; /* array[pkinds] */
	const struct npc_kpu_profile	*kpu; /* array[kpus] */
	const struct npc_mcam_kex	*mkex;
	struct npc_mcam_kex		*mkex;
	size_t				pkinds;
	size_t				kpus;
};
@@ -524,6 +531,10 @@ void rvu_npc_get_mcam_entry_alloc_info(struct rvu *rvu, u16 pcifunc,
void rvu_npc_get_mcam_counter_alloc_info(struct rvu *rvu, u16 pcifunc,
					 int blkaddr, int *alloc_cnt,
					 int *enable_cnt);
bool is_npc_intf_tx(u8 intf);
bool is_npc_intf_rx(u8 intf);
bool is_npc_interface_valid(struct rvu *rvu, u8 intf);
int rvu_npc_get_tx_nibble_cfg(struct rvu *rvu, u64 nibble_ena);

#ifdef CONFIG_DEBUG_FS
void rvu_dbg_init(struct rvu *rvu);
+5 −5
Original line number Diff line number Diff line
@@ -1565,7 +1565,7 @@ static int rvu_dbg_npc_mcam_info_display(struct seq_file *filp, void *unsued)
	struct rvu *rvu = filp->private;
	int pf, vf, numvfs, blkaddr;
	struct npc_mcam *mcam;
	u16 pcifunc;
	u16 pcifunc, counters;
	u64 cfg;

	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
@@ -1573,6 +1573,7 @@ static int rvu_dbg_npc_mcam_info_display(struct seq_file *filp, void *unsued)
		return -ENODEV;

	mcam = &rvu->hw->mcam;
	counters = rvu->hw->npc_counters;

	seq_puts(filp, "\nNPC MCAM info:\n");
	/* MCAM keywidth on receive and transmit sides */
@@ -1595,10 +1596,9 @@ static int rvu_dbg_npc_mcam_info_display(struct seq_file *filp, void *unsued)
	seq_printf(filp, "\t\t Available \t: %d\n", mcam->bmap_fcnt);

	/* MCAM counters */
	cfg = rvu_read64(rvu, blkaddr, NPC_AF_CONST);
	cfg = (cfg >> 48) & 0xFFFF;
	seq_printf(filp, "\n\t\t MCAM counters \t: %lld\n", cfg);
	seq_printf(filp, "\t\t Reserved \t: %lld\n", cfg - mcam->counters.max);
	seq_printf(filp, "\n\t\t MCAM counters \t: %d\n", counters);
	seq_printf(filp, "\t\t Reserved \t: %d\n",
		   counters - mcam->counters.max);
	seq_printf(filp, "\t\t Available \t: %d\n",
		   rvu_rsrc_free_count(&mcam->counters));

Loading