* [net PATCH] octeontx2-af: Fix installation of PF multicast rules
@ 2024-11-27 11:48 Geetha sowjanya
2024-12-03 9:40 ` Paolo Abeni
0 siblings, 1 reply; 3+ messages in thread
From: Geetha sowjanya @ 2024-11-27 11:48 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: kuba, davem, pabeni, horms, andrew+netdev, edumazet, sgoutham,
gakula, sbhatta, hkelam
Due to target variable is being reassigned in npc_install_flow()
function, PF multicast rules are not getting installed.
This patch addresses the issue by fixing the "IF" condition
checks when rules are installed by AF.
Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support").
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
index da69e454662a..8a2444a8b7d3 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
@@ -1457,14 +1457,14 @@ int rvu_mbox_handler_npc_install_flow(struct rvu *rvu,
target = req->vf;
/* PF installing for its VF */
- if (!from_vf && req->vf && !from_rep_dev) {
+ else if (!from_vf && req->vf && !from_rep_dev) {
target = (req->hdr.pcifunc & ~RVU_PFVF_FUNC_MASK) | req->vf;
pf_set_vfs_mac = req->default_rule &&
(req->features & BIT_ULL(NPC_DMAC));
}
/* Representor device installing for a representee */
- if (from_rep_dev && req->vf)
+ else if (from_rep_dev && req->vf)
target = req->vf;
else
/* msg received from PF/VF */
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [net PATCH] octeontx2-af: Fix installation of PF multicast rules
2024-11-27 11:48 [net PATCH] octeontx2-af: Fix installation of PF multicast rules Geetha sowjanya
@ 2024-12-03 9:40 ` Paolo Abeni
2024-12-05 10:20 ` [EXTERNAL] " Geethasowjanya Akula
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Abeni @ 2024-12-03 9:40 UTC (permalink / raw)
To: Geetha sowjanya, netdev, linux-kernel
Cc: kuba, davem, horms, andrew+netdev, edumazet, sgoutham, sbhatta, hkelam
On 11/27/24 12:48, Geetha sowjanya wrote:
> Due to target variable is being reassigned in npc_install_flow()
> function, PF multicast rules are not getting installed.
> This patch addresses the issue by fixing the "IF" condition
> checks when rules are installed by AF.
>
> Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support").
> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
> ---
> drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> index da69e454662a..8a2444a8b7d3 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> @@ -1457,14 +1457,14 @@ int rvu_mbox_handler_npc_install_flow(struct rvu *rvu,
> target = req->vf;
>
> /* PF installing for its VF */
> - if (!from_vf && req->vf && !from_rep_dev) {
> + else if (!from_vf && req->vf && !from_rep_dev) {
This IMHO makes the code quite unreadable and error-prone, as the else
branches are quite separate from the 'if' statement and easy to miss.
It also breaks the kernel style, as you must apply the curly brackets on
all the branches, if one of them is using them.
Please restructure the code a bit:
if (!req->hdr.pcifunc) {
/* AF installing for a PF/VF */
target = req->vf;
} else if (!from_vf && req->vf && !from_rep_dev) {
/* PF installing for its VF */
...
Thanks,
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [EXTERNAL] Re: [net PATCH] octeontx2-af: Fix installation of PF multicast rules
2024-12-03 9:40 ` Paolo Abeni
@ 2024-12-05 10:20 ` Geethasowjanya Akula
0 siblings, 0 replies; 3+ messages in thread
From: Geethasowjanya Akula @ 2024-12-05 10:20 UTC (permalink / raw)
To: Paolo Abeni, netdev, linux-kernel
Cc: kuba, davem, horms, andrew+netdev, edumazet,
Sunil Kovvuri Goutham, Subbaraya Sundeep Bhatta,
Hariprasad Kelam
>-----Original Message-----
>From: Paolo Abeni <pabeni@redhat.com>
>Sent: Tuesday, December 3, 2024 3:11 PM
>To: Geethasowjanya Akula <gakula@marvell.com>; netdev@vger.kernel.org;
>linux-kernel@vger.kernel.org
>Cc: kuba@kernel.org; davem@davemloft.net; horms@kernel.org;
>andrew+netdev@lunn.ch; edumazet@google.com; Sunil Kovvuri Goutham
><sgoutham@marvell.com>; Subbaraya Sundeep Bhatta
><sbhatta@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>
>Subject: [EXTERNAL] Re: [net PATCH] octeontx2-af: Fix installation of PF
>multicast rules
>
>On 11/27/24 12:48, Geetha sowjanya wrote:
>> Due to target variable is being reassigned in npc_install_flow()
>> function, PF multicast rules are not getting installed.
>> This patch addresses the issue by fixing the "IF" condition checks
>> when rules are installed by AF.
>>
>> Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support").
>> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
>> ---
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
>> b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
>> index da69e454662a..8a2444a8b7d3 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
>> @@ -1457,14 +1457,14 @@ int rvu_mbox_handler_npc_install_flow(struct
>rvu *rvu,
>> target = req->vf;
>>
>> /* PF installing for its VF */
>> - if (!from_vf && req->vf && !from_rep_dev) {
>> + else if (!from_vf && req->vf && !from_rep_dev) {
>
>This IMHO makes the code quite unreadable and error-prone, as the else
>branches are quite separate from the 'if' statement and easy to miss.
>
>It also breaks the kernel style, as you must apply the curly brackets on all the
>branches, if one of them is using them.
>
>Please restructure the code a bit:
Ok will restructure in next version.
Thanks,
Geetha.
>
> if (!req->hdr.pcifunc) {
> /* AF installing for a PF/VF */
> target = req->vf;
> } else if (!from_vf && req->vf && !from_rep_dev) {
> /* PF installing for its VF */
> ...
>
>Thanks,
>
>Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-05 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-27 11:48 [net PATCH] octeontx2-af: Fix installation of PF multicast rules Geetha sowjanya
2024-12-03 9:40 ` Paolo Abeni
2024-12-05 10:20 ` [EXTERNAL] " Geethasowjanya Akula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®