* [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules
@ 2024-02-11 18:36 Subbaraya Sundeep
2024-02-11 18:46 ` Subbaraya Sundeep Bhatta
0 siblings, 1 reply; 4+ messages in thread
From: Subbaraya Sundeep @ 2024-02-11 18:36 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: davem, edumazet, kuba, pabeni, sgoutham, lcherian, gakula, hkelam,
naveenm, horms, Subbaraya Sundeep
NPC transmit side mcam rules can use the pcifunc of transmitting
device for mcam lookup. The commit 18603683d766 ("octeontx2-af: Remove
channel verification while installing MCAM rules") removed the receive
side channel verification to save hardware MCAM filters while switching
packets across interfaces but missed removing transmit side checks.
This patch removes transmit side rules validation.
Fixes: 18603683d766 ("octeontx2-af: Remove channel verification while installing MCAM rules")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
.../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 32 ----------------------
1 file changed, 32 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 8cfd74a..e5d6156 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -61,28 +61,6 @@ int rvu_npc_get_tx_nibble_cfg(struct rvu *rvu, u64 nibble_ena)
return 0;
}
-static int npc_mcam_verify_pf_func(struct rvu *rvu,
- struct mcam_entry *entry_data, u8 intf,
- u16 pcifunc)
-{
- u16 pf_func, pf_func_mask;
-
- if (is_npc_intf_rx(intf))
- return 0;
-
- pf_func_mask = (entry_data->kw_mask[0] >> 32) &
- NPC_KEX_PF_FUNC_MASK;
- pf_func = (entry_data->kw[0] >> 32) & NPC_KEX_PF_FUNC_MASK;
-
- pf_func = be16_to_cpu((__force __be16)pf_func);
- if (pf_func_mask != NPC_KEX_PF_FUNC_MASK ||
- ((pf_func & ~RVU_PFVF_FUNC_MASK) !=
- (pcifunc & ~RVU_PFVF_FUNC_MASK)))
- return -EINVAL;
-
- return 0;
-}
-
void rvu_npc_set_pkind(struct rvu *rvu, int pkind, struct rvu_pfvf *pfvf)
{
int blkaddr;
@@ -2851,12 +2829,6 @@ int rvu_mbox_handler_npc_mcam_write_entry(struct rvu *rvu,
else
nix_intf = pfvf->nix_rx_intf;
- if (!is_pffunc_af(pcifunc) &&
- npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf, pcifunc)) {
- rc = NPC_MCAM_INVALID_REQ;
- goto exit;
- }
-
/* For AF installed rules, the nix_intf should be set to target NIX */
if (is_pffunc_af(req->hdr.pcifunc))
nix_intf = req->intf;
@@ -3208,10 +3180,6 @@ int rvu_mbox_handler_npc_mcam_alloc_and_write_entry(struct rvu *rvu,
if (!is_npc_interface_valid(rvu, req->intf))
return NPC_MCAM_INVALID_REQ;
- if (npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf,
- req->hdr.pcifunc))
- return NPC_MCAM_INVALID_REQ;
-
/* Try to allocate a MCAM entry */
entry_req.hdr.pcifunc = req->hdr.pcifunc;
entry_req.contig = true;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules
2024-02-11 18:36 [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules Subbaraya Sundeep
@ 2024-02-11 18:46 ` Subbaraya Sundeep Bhatta
2024-02-13 0:47 ` Jakub Kicinski
0 siblings, 1 reply; 4+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2024-02-11 18:46 UTC (permalink / raw)
To: Subbaraya Sundeep Bhatta, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, Sunil Kovvuri Goutham, Linu Cherian,
Geethasowjanya Akula, Hariprasad Kelam, Naveen Mamindlapalli,
horms@kernel.org
Hi,
Please ignore this patch. My bad this is single patch but sent as 1/2.
Thanks,
Sundeep
>-----Original Message-----
>From: Subbaraya Sundeep <sbhatta@marvell.com>
>Sent: Monday, February 12, 2024 12:06 AM
>To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
>Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
>pabeni@redhat.com; Sunil Kovvuri Goutham <sgoutham@marvell.com>; Linu
>Cherian <lcherian@marvell.com>; Geethasowjanya Akula <gakula@marvell.com>;
>Hariprasad Kelam <hkelam@marvell.com>; Naveen Mamindlapalli
><naveenm@marvell.com>; horms@kernel.org; Subbaraya Sundeep Bhatta
><sbhatta@marvell.com>
>Subject: [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC
>transmit rules
>
>NPC transmit side mcam rules can use the pcifunc of transmitting
>device for mcam lookup. The commit 18603683d766 ("octeontx2-af: Remove
>channel verification while installing MCAM rules") removed the receive
>side channel verification to save hardware MCAM filters while switching
>packets across interfaces but missed removing transmit side checks.
>This patch removes transmit side rules validation.
>
>Fixes: 18603683d766 ("octeontx2-af: Remove channel verification while installing
>MCAM rules")
>Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
>---
> .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 32 ----------------------
> 1 file changed, 32 deletions(-)
>
>diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
>b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
>index 8cfd74a..e5d6156 100644
>--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
>+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
>@@ -61,28 +61,6 @@ int rvu_npc_get_tx_nibble_cfg(struct rvu *rvu, u64
>nibble_ena)
> return 0;
> }
>
>-static int npc_mcam_verify_pf_func(struct rvu *rvu,
>- struct mcam_entry *entry_data, u8 intf,
>- u16 pcifunc)
>-{
>- u16 pf_func, pf_func_mask;
>-
>- if (is_npc_intf_rx(intf))
>- return 0;
>-
>- pf_func_mask = (entry_data->kw_mask[0] >> 32) &
>- NPC_KEX_PF_FUNC_MASK;
>- pf_func = (entry_data->kw[0] >> 32) & NPC_KEX_PF_FUNC_MASK;
>-
>- pf_func = be16_to_cpu((__force __be16)pf_func);
>- if (pf_func_mask != NPC_KEX_PF_FUNC_MASK ||
>- ((pf_func & ~RVU_PFVF_FUNC_MASK) !=
>- (pcifunc & ~RVU_PFVF_FUNC_MASK)))
>- return -EINVAL;
>-
>- return 0;
>-}
>-
> void rvu_npc_set_pkind(struct rvu *rvu, int pkind, struct rvu_pfvf *pfvf)
> {
> int blkaddr;
>@@ -2851,12 +2829,6 @@ int rvu_mbox_handler_npc_mcam_write_entry(struct
>rvu *rvu,
> else
> nix_intf = pfvf->nix_rx_intf;
>
>- if (!is_pffunc_af(pcifunc) &&
>- npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf, pcifunc)) {
>- rc = NPC_MCAM_INVALID_REQ;
>- goto exit;
>- }
>-
> /* For AF installed rules, the nix_intf should be set to target NIX */
> if (is_pffunc_af(req->hdr.pcifunc))
> nix_intf = req->intf;
>@@ -3208,10 +3180,6 @@ int
>rvu_mbox_handler_npc_mcam_alloc_and_write_entry(struct rvu *rvu,
> if (!is_npc_interface_valid(rvu, req->intf))
> return NPC_MCAM_INVALID_REQ;
>
>- if (npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf,
>- req->hdr.pcifunc))
>- return NPC_MCAM_INVALID_REQ;
>-
> /* Try to allocate a MCAM entry */
> entry_req.hdr.pcifunc = req->hdr.pcifunc;
> entry_req.contig = true;
>--
>2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules
2024-02-11 18:46 ` Subbaraya Sundeep Bhatta
@ 2024-02-13 0:47 ` Jakub Kicinski
2024-02-13 5:05 ` [EXT] " Subbaraya Sundeep Bhatta
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-02-13 0:47 UTC (permalink / raw)
To: Subbaraya Sundeep Bhatta
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
Sunil Kovvuri Goutham, Linu Cherian, Geethasowjanya Akula,
Hariprasad Kelam, Naveen Mamindlapalli, horms@kernel.org
On Sun, 11 Feb 2024 18:46:40 +0000 Subbaraya Sundeep Bhatta wrote:
> Please ignore this patch. My bad this is single patch but sent as 1/2.
Thanks for the heads up, but please keep in mind that "obvious mistakes"
are no excuse to ignore the 24h rule.
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#tl-dr
--
pv-bot: 24h
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [EXT] Re: [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules
2024-02-13 0:47 ` Jakub Kicinski
@ 2024-02-13 5:05 ` Subbaraya Sundeep Bhatta
0 siblings, 0 replies; 4+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2024-02-13 5:05 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
Sunil Kovvuri Goutham, Linu Cherian, Geethasowjanya Akula,
Hariprasad Kelam, Naveen Mamindlapalli, horms@kernel.org
Hi,
>-----Original Message-----
>From: Jakub Kicinski <kuba@kernel.org>
>Sent: Tuesday, February 13, 2024 6:17 AM
>To: Subbaraya Sundeep Bhatta <sbhatta@marvell.com>
>Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; davem@davemloft.net;
>edumazet@google.com; pabeni@redhat.com; Sunil Kovvuri Goutham
><sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>;
>Geethasowjanya Akula <gakula@marvell.com>; Hariprasad Kelam
><hkelam@marvell.com>; Naveen Mamindlapalli <naveenm@marvell.com>;
>horms@kernel.org
>Subject: [EXT] Re: [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for
>NPC transmit rules
>
>On Sun, 11 Feb 2024 18:46:40 +0000 Subbaraya Sundeep Bhatta wrote:
>> Please ignore this patch. My bad this is single patch but sent as 1/2.
>
>Thanks for the heads up, but please keep in mind that "obvious mistakes"
>are no excuse to ignore the 24h rule.
Sure noted.
Thanks,
Sundeep
>https://urldefense.proofpoint.com/v2/url?u=https-
>3A__www.kernel.org_doc_html_next_process_maintainer-2Dnetdev.html-23tl-
>2Ddr&d=DwICAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=wYboOaw70DU5hRM5HDwO
>RJx_MfD-
>hXXKii2eobNikgU&m=xFW8Pfvppu05waEU4SRwpomQKxwPcvOsIiwULXFg9apf2_8
>xH4Lch066VxedIOTh&s=vuSx17RQHZZAXIRBDC8UuNKHgYvt91gLuztiN6SqUKw&e=
>--
>pv-bot: 24h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-13 5:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-11 18:36 [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules Subbaraya Sundeep
2024-02-11 18:46 ` Subbaraya Sundeep Bhatta
2024-02-13 0:47 ` Jakub Kicinski
2024-02-13 5:05 ` [EXT] " Subbaraya Sundeep Bhatta
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).