From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3DB9EA0C43; Mon, 18 Oct 2021 15:53:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC4BB40DF5; Mon, 18 Oct 2021 15:53:29 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.87]) by mails.dpdk.org (Postfix) with ESMTP id 72A6740141; Mon, 18 Oct 2021 15:53:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xf63gDIj5Y18mMcMNPBVwSb8NSwzuc/wQa6ddT8x0Yj69WDxzpplA6IyhXZQXIlJd0EU9s8tX6OFHMSTkhjNb3cYmRv7J0X+y1kyaluUiHk4sHd2ygViF2ROb9rfjx6CFH7js+zj+DC33iKmhPvzGBkUQ+ZmI52iQmzdtp4ZDW9aRK7c/EGBQRCMZmU0qwbKwR98HGQ1sHEYOUmrCPsg+dJPmd9mfs6KI/jeBDG1V4t0q8oADG9NVogImxwudL3KL+SK4noiy4eeiZFOgnEsl8CfUKy8miFyGN+na/Ltdlawn/ofgMBITzcrvh06pto3MBGMxVj8G/U37qUxg4clvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6RrCFysDwdxng+e9piGK8SqSMB+j5SX6tYR3JFKZymQ=; b=K8Tr3bgW4eubgo41tjmuMrfVT1ZVxqw6YvwUBeXRtHmgKSFpZNgx/qEQ6yXeIVlbO5pD2uiVZRMBWml4dGEezBbs3zfxQFSl+Hr2HKO9NV/Yo0ow0j4m/QM723cYGkQYTZVcSgIV0HNV2XLGkTXuCOD+D6expWj7ksxl+U0scVS2VFOvDxtcJ2jcfRCiRKDkkDrh750it1heB0KQxwvDpxRYvLjJ25igX6rRKVx3orQ12zeEYVKF0YMezh6KythEh922RZuGH9zr7znaNR6uzxDJS7e2owtv7RyuV2Wt5sLNGOuzlnIdO328x52lvubJoGW9jVe5tKv2k/X1fLUZpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6RrCFysDwdxng+e9piGK8SqSMB+j5SX6tYR3JFKZymQ=; b=XrAKQOjUb9ZA4VREA4ntuOcHt4bf7K6Uc7weacB1Np7G+1YAdNHOpHIybCLAHiWdbaFA7frvx5e8ECC+S7tcr5p6vi+98wP+5IhH4fu00V4fN2jGEG5KcrXXLa1D0H3IGVHEUHOCvzkZ9zbj/+sakRSNTd7SrAAGURBaxgJtjzfnj4G8yTAnm0HFmRz27hlzck9yNohuSqKJ/XzxG/8oEtajOVJtKwgoNH8C9QltChl6IbV32mEsbc+l9pEznd1zyyIiShDhR/W8sIrXh+9S4YgdpZi97Mdx8JfdNhJ9P28CWU0dc4nwwbGdDaa/SD7KKsRadAfBHGGf4vp6KyX3RA== Received: from MWHPR11CA0024.namprd11.prod.outlook.com (2603:10b6:301:1::34) by MN2PR12MB3904.namprd12.prod.outlook.com (2603:10b6:208:165::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Mon, 18 Oct 2021 13:53:26 +0000 Received: from CO1NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:301:1:cafe::48) by MWHPR11CA0024.outlook.office365.com (2603:10b6:301:1::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 13:53:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT055.mail.protection.outlook.com (10.13.175.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 13:53:26 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 18 Oct 2021 13:53:22 +0000 From: Bing Zhao To: , CC: , , Date: Mon, 18 Oct 2021 16:53:05 +0300 Message-ID: <20211018135305.146594-1-bingz@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211018131855.145323-1-bingz@nvidia.com> References: <20211018131855.145323-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57be36c1-a648-486a-431e-08d9923ea8b0 X-MS-TrafficTypeDiagnostic: MN2PR12MB3904: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PMgiZEoWxjZFIbbqgdN1qjGU8MmEBpfplhzzPdLl4tj2bwfGGXOp8Ox2VBuFQzj30Bnch2EF2y/C+IgAv/VljYNgaPbbl2NFf5T31nS5UDRO70ZgZ+iSrpnQBLiSw2+PvSsSdpJPoouGGS4PUK6cGDS8hE4wFgpxZ+m4BMvPWBi/VTbimh32nfqeUSbCNzswTGTGNB9DTOw9/Qwt2PiOVq40hZ43LuLmyDbxTWveBu6KhRimmABfWQpjwcdELe7J1tVBW3FryAgthctSgOb7M5Zw81Imn9aFkSKknJQ1OJRZlIj/2b9j0+MKCSs66deJ70Gn2yq28IEHd7vzQxhUjRfLlZhF79z93dh+z4m6Jy/dbqnpc6dOf4IltsEvdEQR+S2wCqJHXNxBRgD/sKbPfEVIZ0GVNyeXtWVgAl4Dc1aEzaxtEaIg7RVmEaZIbDOo24ZJvXtsjgmgJ6wOKw2hLPMWom+W7rypgDy9dxebrc6pwAfIWCd0qGYPuuYgfF4FBaGO8RrHD6L8XJHBNJe+Vhvv0DcdWEV6+Z0h35/UwMN9MA8W4uwPBHFyCve1qQi4DcG23kmOlBdt/Cy4nmXNe2sAj3dQxY/mKA4V0O+U+ZggDFlAQkAxx++MR/kh7skFUBebTBBe+mVBiT9yWeVlrFyfkHkJy98HdQfr4xRm/oakpe6n0zbzG1O5qz8XVpJ2XTPXTdROXogIkT7k58kzDA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(83380400001)(36756003)(55016002)(2616005)(426003)(7696005)(316002)(4326008)(2906002)(6286002)(6636002)(5660300002)(16526019)(450100002)(7636003)(508600001)(36860700001)(356005)(6666004)(336012)(54906003)(8936002)(70206006)(82310400003)(70586007)(26005)(110136005)(47076005)(86362001)(1076003)(186003)(8676002)(36906005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 13:53:26.3728 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57be36c1-a648-486a-431e-08d9923ea8b0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3904 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix meter yellow policy with RSS action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The RSS configuration in a policy action container was a pointer inside a union, and the pointer area could be used as other fate action. In the current implementation, the RSS of the green color was prior to that of the yellow color. There was a high possibility the pointer was considered as the RSS and result in a error flow expansion when only the yellow color had the RSS action. The check of the fate action type should also be done to get rid of the misjudgment. Fixes: b38a12272b3a ("net/mlx5: split meter color policy handling") Cc: stable@dpdk.org Signed-off-by: Bing Zhao Acked-by: Matan Azrad --- v2: fix the spelling typo in the commit log --- drivers/net/mlx5/mlx5_flow.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 509ca01859..4f5211a90d 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3594,6 +3594,8 @@ flow_get_rss_action(struct rte_eth_dev *dev, { struct mlx5_priv *priv = dev->data->dev_private; const struct rte_flow_action_rss *rss = NULL; + struct mlx5_meter_policy_action_container *acg; + struct mlx5_meter_policy_action_container *acy; for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { switch (actions->type) { @@ -3629,9 +3631,18 @@ flow_get_rss_action(struct rte_eth_dev *dev, if (!policy) return NULL; } - if (policy->is_rss) - rss = - policy->act_cnt[RTE_COLOR_GREEN].rss->conf; + if (policy->is_rss) { + acg = + &policy->act_cnt[RTE_COLOR_GREEN]; + acy = + &policy->act_cnt[RTE_COLOR_YELLOW]; + if (acg->fate_action == + MLX5_FLOW_FATE_SHARED_RSS) + rss = acg->rss->conf; + else if (acy->fate_action == + MLX5_FLOW_FATE_SHARED_RSS) + rss = acy->rss->conf; + } } break; } -- 2.27.0