From: Jerin Jacob <jerinjacobk@gmail.com>
To: netdev@vger.kernel.org, davem@davemloft.net
Cc: sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com,
jerinj@marvell.com, Vamsi Attunuru <vamsi.attunuru@marvell.com>
Subject: [PATCH v1 net-next 09/14] octeontx2-af: Enable RSS with promiscuous mode
Date: Sat, 1 Dec 2018 14:43:58 +0530 [thread overview]
Message-ID: <20181201091403.30166-10-jerinjacobk@gmail.com> (raw)
In-Reply-To: <20181201091403.30166-1-jerinjacobk@gmail.com>
From: Vamsi Attunuru <vamsi.attunuru@marvell.com>
This patch adds support for enabling RSS in promiscuous mode
if RSS is already requested by the AF client.
Signed-off-by: Vamsi Attunuru <vamsi.attunuru@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
.../ethernet/marvell/octeontx2/af/rvu_npc.c | 35 ++++++++++++++++---
1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index c203d3fddde9..bf81031f0fdd 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -368,9 +368,9 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
int nixlf, u64 chan, bool allmulti)
{
struct npc_mcam *mcam = &rvu->hw->mcam;
+ int blkaddr, ucast_idx, index, kwi;
struct mcam_entry entry = { {0} };
struct nix_rx_action action = { };
- int blkaddr, index, kwi;
/* Only PF or AF VF can add a promiscuous entry */
if ((pcifunc & RVU_PFVF_FUNC_MASK) && !is_afvf(pcifunc))
@@ -392,9 +392,21 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
entry.kw_mask[kwi] = BIT_ULL(40);
}
- *(u64 *)&action = 0x00;
- action.op = NIX_RX_ACTIONOP_UCAST;
- action.pf_func = pcifunc;
+ ucast_idx = npc_get_nixlf_mcam_index(mcam, pcifunc,
+ nixlf, NIXLF_UCAST_ENTRY);
+
+ /* If the corresponding PF's ucast action is RSS,
+ * use the same action for promisc also
+ */
+ if (is_mcam_entry_enabled(rvu, mcam, blkaddr, ucast_idx))
+ *(u64 *)&action = npc_get_mcam_action(rvu, mcam,
+ blkaddr, ucast_idx);
+
+ if (action.op != NIX_RX_ACTIONOP_RSS) {
+ *(u64 *)&action = 0x00;
+ action.op = NIX_RX_ACTIONOP_UCAST;
+ action.pf_func = pcifunc;
+ }
entry.action = *(u64 *)&action;
npc_config_mcam_entry(rvu, mcam, blkaddr, index,
@@ -539,6 +551,21 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf,
rvu_write64(rvu, blkaddr,
NPC_AF_MCAMEX_BANKX_ACTION(index, bank), *(u64 *)&action);
+ index = npc_get_nixlf_mcam_index(mcam, pcifunc,
+ nixlf, NIXLF_PROMISC_ENTRY);
+
+ /* If PF's promiscuous entry is enabled,
+ * Set RSS action for that entry as well
+ */
+ if (is_mcam_entry_enabled(rvu, mcam, blkaddr, index)) {
+ bank = npc_get_bank(mcam, index);
+ index &= (mcam->banksize - 1);
+
+ rvu_write64(rvu, blkaddr,
+ NPC_AF_MCAMEX_BANKX_ACTION(index, bank),
+ *(u64 *)&action);
+ }
+
rvu_npc_update_rxvlan(rvu, pcifunc, nixlf);
}
--
2.19.2
next prev parent reply other threads:[~2018-12-01 20:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-01 9:13 [PATCH v1 net-next 00/14] octeontx2-af: NIX and NPC enhancements Jerin Jacob
2018-12-01 9:13 ` [PATCH v1 net-next 01/14] octeontx2-af: Skip NIXLF check for bcast MCE entry Jerin Jacob
2018-12-01 9:13 ` [PATCH v1 net-next 02/14] octeontx2-af: Add response for RSS flow key cfg message Jerin Jacob
2018-12-02 1:30 ` David Miller
2018-12-01 9:13 ` [PATCH v1 net-next 03/14] octeontx2-af: Add support for dynamic flow cfg to RSS field generation Jerin Jacob
2018-12-01 9:13 ` [PATCH v1 net-next 04/14] octeontx2-af: Add support for runtime RSS algo index reservation Jerin Jacob
2018-12-01 9:13 ` [PATCH v1 net-next 05/14] octeontx2-af: Restrict TL1 allocation and configuration Jerin Jacob
2018-12-02 1:31 ` David Miller
2018-12-01 9:13 ` [PATCH v1 net-next 06/14] octeontx2-af: Allow freeing single TLx Tx schedule queue Jerin Jacob
2018-12-01 9:13 ` [PATCH v1 net-next 07/14] octeontx2-af: Enable inner IPv4 checksum and its error code Jerin Jacob
2018-12-01 9:13 ` [PATCH v1 net-next 08/14] octeontx2-af: Define all NIX_AF_RX_DEF_* registers Jerin Jacob
2018-12-01 9:13 ` Jerin Jacob [this message]
2018-12-01 9:13 ` [PATCH v1 net-next 10/14] octeontx2-af: Add support for Tx packet marking Jerin Jacob
2018-12-01 9:14 ` [PATCH v1 net-next 11/14] octeontx2-af: Configure VLAN TPIDs Jerin Jacob
2018-12-01 9:14 ` [PATCH v1 net-next 12/14] octeontx2-af: Add L3 and L4 packet verification mailbox Jerin Jacob
2018-12-01 9:14 ` [PATCH v1 net-next 13/14] octeontx2-af: Add LSO format configuration mailbox Jerin Jacob
2018-12-01 9:14 ` [PATCH v1 net-next 14/14] octeontx2-af: Enable mkex profile Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181201091403.30166-10-jerinjacobk@gmail.com \
--to=jerinjacobk@gmail.com \
--cc=davem@davemloft.net \
--cc=gakula@marvell.com \
--cc=jerinj@marvell.com \
--cc=lcherian@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=sgoutham@marvell.com \
--cc=vamsi.attunuru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).