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 4EB0EA050A; Thu, 14 Apr 2022 09:55:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E284F40687; Thu, 14 Apr 2022 09:55:42 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2066.outbound.protection.outlook.com [40.107.237.66]) by mails.dpdk.org (Postfix) with ESMTP id 8B9EC4003F; Thu, 14 Apr 2022 09:55:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TeW2sG1Pul2OsxwYO1kiLs4vANOC9Tw12ReS3wGBFD0/ktOu7g+oy27ozQVyU5SwCyuKKgGHArZOGp5PkLOPf2jWRAk4mUBkHjphaCW7RdxHZmjdLrK+aD6frKey+cP2x3ewKDQOdEp/oMMC0/1hGy9nZ9lAJgjbT/tdfDItIzIfDMEXnl7coy3WfSHlw/lz3dTLOmuYQ/y68QROl962wWyOozqKLET3fnM2mE/MIf5AIY+ewflu5hWK9MVHR349DKP/jPmDLfp5ZOmy+y5m3XqcmnY/5joqWoXhFM+DKpV5P/6OIh2XVUFMVKeO/xItzzjmiZDlU+xFP5uvkxWsDw== 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=uWVN85d1p5mQYmJcse8eIBNleBE56hZP4xtxSnYCqiY=; b=UNJXGdNioT4hKkgICtCONb+/HvQPs3uklC64nRgfihUqzzgOceJoq/N88f3ZmhUA3akLjz84clj064Wb7ltkDQk38gLv6raygZq9KzZdIdk5lrhFzcmymOw6M2uUB70YEcEHFUBIrSTupm5zbN+yRyLDwmXME6j2mbjvrQSN+Xpt2hGqzr0aFFxPh9H1Xl04mBCwW1TkX0wry4TnsVXAYkGi9c+hNsyuK7ZlfURh9nS6SNtm0MvD9NNfMOVg/Vah+P6bTD0qp4jamdNNS9cqDxXmkVSE78x95GryL2z8S4eP5nIgS5sZ3RNAIObAgONvamJplVi9SWPSV6rMrL9rUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=uWVN85d1p5mQYmJcse8eIBNleBE56hZP4xtxSnYCqiY=; b=Fpp2StlBN3ZmYHk+Joy+n0AumbRb3HsjcDLjDWeXsy/245uuQfpAmd1M72KsVX6WGDSNaMDviWB7SnLFE3M0SMR7WEy4YmEwprzJdvttoBgOxDc3RJ1cP6WUYlYGT1/6Br3MGZXH6GtQDFHUvjsgs+/DW0WcVISFj0TJ7Mf3gEFD+TB1XNCI2vzFEKL4q4Nu11r21X3t/VZ20Swo30PFUK63smI1kXreOAqOn7OtCVbe+S3i7OPBmpK0m1bmCz+3C5r0Kpia8B4BLdVEJk7MftwvI2RlT0WtE9Cjf3Kn3cedGrpEIyQeYOPB12l7JTNqFjMayXer7fIH0TRNsLCK6Q== Received: from MW4PR03CA0177.namprd03.prod.outlook.com (2603:10b6:303:8d::32) by BN6PR1201MB2499.namprd12.prod.outlook.com (2603:10b6:404:b2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 07:55:40 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::d) by MW4PR03CA0177.outlook.office365.com (2603:10b6:303:8d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20 via Frontend Transport; Thu, 14 Apr 2022 07:55:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5164.19 via Frontend Transport; Thu, 14 Apr 2022 07:55:39 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 14 Apr 2022 07:55:39 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 14 Apr 2022 00:55:36 -0700 From: Shun Hao To: , , , "Bing Zhao" CC: , , Subject: [PATCH v1] net/mlx5: fix quit assert when no meter green action Date: Thu, 14 Apr 2022 10:55:20 +0300 Message-ID: <20220414075521.11239-1-shunh@nvidia.com> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1eede2bc-18d7-4e2c-9ca8-08da1dec2b22 X-MS-TrafficTypeDiagnostic: BN6PR1201MB2499:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lapXiMUK9V1jLjAcnCaa9ThJkWLqAtkQhbxaJ9WiXlpJvYV/3cN1FDflMykGpEY9JKgQ+X1GAov1+xjL8G6RdgqXhc866NvC1QRbRvlejA2VMB8rP7gwJoX+CIe8RBedXPf1LTUtzRwNqxYWHfQlu1Vr2Ic+gu8C9StEF7Red7du6psxV+UXHLXyyoxIzRPibqIREboXLAeRkxYaB3dT7/l1ubO6Bpt6W348ftAEdzf7x/+obr9bLIXEsTisLeE5zORy92u61ZOOKawin5+J3rHLyDiktgIe/pvB/Bd4mOdof8l1k1QN7tLT2DmMqraqdGkLtmQdAqWPKYmqTvbiDeUxXgSUewcsDJgUZdE26UyjOzkL1t8UTEfKNvZfNZmXf9W1Ow5m2x3SbJyetY3TO0PqWMKsJgc3xKGJN0ZUC2h1NLDtwaanrXGkfMcw+U1+rel5j7OzJHhgCpyPgOmjKX4WA87mw3bQON/tIvWuB6szQJkZ6r2TrkyZAYVbvXwr0XJyScEv1WTCjBgwEsOFhq+WjO40+sEREdOW4FiwQux2SsCqCoakXODAPB1Oqzrg6fBPAeT5a2GWr+IAGrqtGxXMurhST7co2n5uEbwUqjpAZ9+aJu+GeLmvYjCk9RBv8nxwLA0AwZS5nBikuW/4NkEYMoh6JboRz6GE6Pz4Fjb0ejeO1hNsaKhMtyF2wzsQ1NHsIK8xLv2ADR+yVlBRiA== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(6666004)(36756003)(26005)(47076005)(1076003)(81166007)(356005)(2616005)(7696005)(336012)(36860700001)(2906002)(426003)(6286002)(450100002)(16526019)(508600001)(186003)(70586007)(70206006)(8676002)(4326008)(8936002)(5660300002)(55016003)(54906003)(316002)(83380400001)(6636002)(110136005)(82310400005)(86362001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 07:55:39.8428 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1eede2bc-18d7-4e2c-9ca8-08da1dec2b22 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB2499 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 When a meter with RSS action being used, there might be several sub-flows using different sub-policies in the flow splitting stage. If there's no green action, there's an error that will always use the same sub-policy for all sub-flows, some resources will be overwritten and cannot be released, leading assert during port close. This patch fixes this issue by checking both green and yellow queue index during getting a blank sub-policy, to avoid the incorrect resource overwrite. Fixes: b38a12272b3a ("net/mlx5: split meter color policy handling") Cc: stable@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azard --- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 1e9bd63635..14f85efc90 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -17051,7 +17051,8 @@ __flow_dv_meter_get_rss_sub_policy(struct rte_eth_dev *dev, } } /* Create sub policy. */ - if (!mtr_policy->sub_policys[domain][0]->rix_hrxq[0]) { + if (!mtr_policy->sub_policys[domain][0]->rix_hrxq[RTE_COLOR_GREEN] && + !mtr_policy->sub_policys[domain][0]->rix_hrxq[RTE_COLOR_YELLOW]) { /* Reuse the first pre-allocated sub_policy. */ sub_policy = mtr_policy->sub_policys[domain][0]; sub_policy_idx = sub_policy->idx; -- 2.20.0