From: Jie Liu <[email protected]>

sxe2_flow_meta_proc() uses a flat else-if chain for the priority
check, while the V3 implementation nests the switchdev mode check
inside the else branch. Align the structure with V3 for consistency.

Cc: [email protected]
Cc: [email protected]
Signed-off-by: Jie Liu <[email protected]>
---
 drivers/net/sxe2/sxe2_flow.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/sxe2/sxe2_flow.c b/drivers/net/sxe2/sxe2_flow.c
index 46f5763f62..037d9e6f9c 100644
--- a/drivers/net/sxe2/sxe2_flow.c
+++ b/drivers/net/sxe2/sxe2_flow.c
@@ -285,14 +285,16 @@ static int32_t sxe2_flow_meta_proc(struct rte_eth_dev 
*dev,
                                        attr, "Only support priority 0.");
                        ret = -rte_errno;
                        goto l_end;
-               } else if (!adapter->switchdev_info.is_switchdev) {
-                       PMD_LOG_ERR(DRV, "Legacy mode only support priority 
0.");
-                       rte_flow_error_set(error, EINVAL, 
RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
-                                       attr, "Legacy mode only priority 0.");
-                       ret = -rte_errno;
-                       goto l_end;
                } else {
-                       flow->meta.flow_prio = attr->priority;
+                       if (!adapter->switchdev_info.is_switchdev) {
+                               PMD_LOG_ERR(DRV, "Legacy mode only support 
priority 0.");
+                               rte_flow_error_set(error, EINVAL, 
RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
+                                               attr, "Legacy mode only 
priority 0.");
+                               ret = -rte_errno;
+                               goto l_end;
+                       } else {
+                               flow->meta.flow_prio = attr->priority;
+                       }
                }
        }
 
-- 
2.52.0

Reply via email to