* [PATCH net] octeontx2-af: Check return value of nix_get_nixlf before using nixlf
@ 2023-11-25 16:34 Subbaraya Sundeep
2023-11-28 3:02 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Subbaraya Sundeep @ 2023-11-25 16:34 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: kuba, davem, pabeni, edumazet, sgoutham, gakula, hkelam,
Subbaraya Sundeep
If a NIXLF is not attached to a PF/VF device then
nix_get_nixlf function fails and returns proper error
code. But npc_get_default_entry_action does not check it
and uses garbage value in subsequent calls. Fix this
by cheking the return value of nix_get_nixlf.
Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 16cfc80..f658058 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -389,7 +389,13 @@ static u64 npc_get_default_entry_action(struct rvu *rvu, struct npc_mcam *mcam,
int bank, nixlf, index;
/* get ucast entry rule entry index */
- nix_get_nixlf(rvu, pf_func, &nixlf, NULL);
+ if (nix_get_nixlf(rvu, pf_func, &nixlf, NULL)) {
+ dev_err(rvu->dev, "%s: nixlf not attached to pcifunc:0x%x\n",
+ __func__, pf_func);
+ /* Action 0 is drop */
+ return 0;
+ }
+
index = npc_get_nixlf_mcam_index(mcam, pf_func, nixlf,
NIXLF_UCAST_ENTRY);
bank = npc_get_bank(mcam, index);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] octeontx2-af: Check return value of nix_get_nixlf before using nixlf
2023-11-25 16:34 [PATCH net] octeontx2-af: Check return value of nix_get_nixlf before using nixlf Subbaraya Sundeep
@ 2023-11-28 3:02 ` Jakub Kicinski
2023-11-28 3:13 ` [EXT] " Subbaraya Sundeep Bhatta
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2023-11-28 3:02 UTC (permalink / raw)
To: Subbaraya Sundeep
Cc: netdev, linux-kernel, davem, pabeni, edumazet, sgoutham, gakula,
hkelam
On Sat, 25 Nov 2023 22:04:58 +0530 Subbaraya Sundeep wrote:
> If a NIXLF is not attached to a PF/VF device then
> nix_get_nixlf function fails and returns proper error
> code. But npc_get_default_entry_action does not check it
> and uses garbage value in subsequent calls. Fix this
> by cheking the return value of nix_get_nixlf.
>
> Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature")
You need to run the patch thru scripts/get_maintainer,
here you missed CCing Naveen, who authored 967db3529eca.
Also lcherian@marvell.com and jerinj@marvell.com
LMK if these people are no longer at marvell, I can add their
addresses to our ignore list.
Same goes for the pauseparam patch, you'll need to repost the two.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [EXT] Re: [PATCH net] octeontx2-af: Check return value of nix_get_nixlf before using nixlf
2023-11-28 3:02 ` Jakub Kicinski
@ 2023-11-28 3:13 ` Subbaraya Sundeep Bhatta
0 siblings, 0 replies; 3+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2023-11-28 3:13 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
Sunil Kovvuri Goutham, Geethasowjanya Akula, Hariprasad Kelam
Hi Jakub,
>-----Original Message-----
>From: Jakub Kicinski <kuba@kernel.org>
>Sent: Tuesday, November 28, 2023 8:32 AM
>To: Subbaraya Sundeep Bhatta <sbhatta@marvell.com>
>Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
>davem@davemloft.net; pabeni@redhat.com; edumazet@google.com; Sunil
>Kovvuri Goutham <sgoutham@marvell.com>; Geethasowjanya Akula
><gakula@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>
>Subject: [EXT] Re: [PATCH net] octeontx2-af: Check return value of
>nix_get_nixlf before using nixlf
>
>----------------------------------------------------------------------
>On Sat, 25 Nov 2023 22:04:58 +0530 Subbaraya Sundeep wrote:
>> If a NIXLF is not attached to a PF/VF device then nix_get_nixlf
>> function fails and returns proper error code. But
>> npc_get_default_entry_action does not check it and uses garbage value
>> in subsequent calls. Fix this by cheking the return value of
>> nix_get_nixlf.
>>
>> Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc
>> packet replication feature")
>
>You need to run the patch thru scripts/get_maintainer, here you missed CCing
>Naveen, who authored 967db3529eca.
>Also lcherian@marvell.com and jerinj@marvell.com LMK if these people are
>no longer at marvell, I can add their addresses to our ignore list.
>
>Same goes for the pauseparam patch, you'll need to repost the two.
Sure will do it.
Thanks,
Sundeep
>--
>pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-28 3:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-25 16:34 [PATCH net] octeontx2-af: Check return value of nix_get_nixlf before using nixlf Subbaraya Sundeep
2023-11-28 3:02 ` Jakub Kicinski
2023-11-28 3:13 ` [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).