]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
octeontx2-af: Fix installation of PF multicast rule
authorGeetha sowjanya <gakula@marvell.com>
Thu, 5 Dec 2024 11:34:35 +0000 (17:04 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Dec 2024 09:11:07 +0000 (10:11 +0100)
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>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241205113435.10601-1-gakula@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c

index da69e454662a7d4c5954cd13c135c3bcbccebe3c..1b765045aa636b42422514997818da36a3c4d16c 100644 (file)
@@ -1452,23 +1452,21 @@ process_flow:
         * hence modify pcifunc accordingly.
         */
 
-       /* AF installing for a PF/VF */
-       if (!req->hdr.pcifunc)
+       if (!req->hdr.pcifunc) {
+               /* AF installing for a PF/VF */
                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) {
+               /* PF installing for its VF */
                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) {
+               /* Representor device installing for a representee */
                target = req->vf;
-       else
+       } else {
                /* msg received from PF/VF */
                target = req->hdr.pcifunc;
+       }
 
        /* ignore chan_mask in case pf func is not AF, revisit later */
        if (!is_pffunc_af(req->hdr.pcifunc))