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 6AFB6A0A0C for ; Mon, 5 Jul 2021 10:59:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E9364003C; Mon, 5 Jul 2021 10:59:15 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2082.outbound.protection.outlook.com [40.107.243.82]) by mails.dpdk.org (Postfix) with ESMTP id D96164003C for ; Mon, 5 Jul 2021 10:59:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fxs/fT3ktOPv/d+9vFazkSNQFG8HZqGgkaqrQqGn9KK9RzpLg/immMsVox1bQsGuEw6KhNbNB7ddkmBU9Kurak5egDSW4UmMhKchEw8jmEeUrIHOHFZeTzpjUHTHlWO0srqg2XOskphhAEbbwbLTAvlpLd04TxacMzqTNivOKT43JXOxz5kSiFpW5P6fT5AhXayjmhl5SGSGqIkr+a2t8V1h0Lmmm+UH/UPmqcV204K0wB6FzuWq4iztVykhMusqUazCQmYdP0qtWlEjGHxfdWp7R+p2s0JqYaAMYw0wLfgnxU4hN3JIfahpArEij94OTdpQ7G491SNIEE1FeMJHKg== 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-SenderADCheck; bh=IzY5pFSOkGL8JpQJbaCEXpi9QMYBC1voTDP6yD5SFSc=; b=SnUBPhqrIHDNrJZ66RyiUVh1f22rAN0ZgCtvMLKaF5KfjwvtHVHHuFCJAP80SuBGffdhbYJj4bxMlZ+fPT83ipUb2EMI0bG9cUikNoMRFNxR3HA76sLppr/jWU3KDUwn93a2KLLurS04zqKi0zXhFEJPv52JnRgElbVSL9h1PdkGrsC9vlRXuAzqQN1pHqxb3xQWw2Kshvn3MMzZKhK+AvxgI6YSLS6KAK9olhVgFs7dmYWTKbqQl5FWd5kgfnQP5Zs1K3Ucxsmd0y/JR3YjRHfCbiWkhIadFDHiU3zmU6+hq4E134G9TVgxJ1CebDAUgeka5p9i2ZiAvCyhryiHXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=IzY5pFSOkGL8JpQJbaCEXpi9QMYBC1voTDP6yD5SFSc=; b=icFwH4J8WPc/qjhTrT/oGQrxJPfGjuU5fwkmDRxsCN561FMRCtg96TV51GC7H+Y6yPcGttLOUfPo/LsnNEwlPPPqLKwKTxX7TBnyV0tRTaGUBuYmvsZTJnbYbKwOkcByZyseQG/ITUmKb6jgRff7YF+pHP9ZoBA/l0CgPg3iKDhTS/cfHk6/81f+C28fi38ciShrD+e8Pd/QqC/cbvsGvK0DY4Aka7r93zAmPz9FdOzIksQ0e7kmKRJbbb+xFBpZ49vi50+pWlQavJNaggFNxxcLMYq9PpZG9O30ucGTswotEm1FQ8iwzI7yvSrgUFvIMNA4QHwOVc05KhuM2BukLw== Received: from MWHPR22CA0009.namprd22.prod.outlook.com (2603:10b6:300:ef::19) by SA0PR12MB4415.namprd12.prod.outlook.com (2603:10b6:806:70::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.33; Mon, 5 Jul 2021 08:59:13 +0000 Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ef:cafe::94) by MWHPR22CA0009.outlook.office365.com (2603:10b6:300:ef::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Mon, 5 Jul 2021 08:59:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; canonical.com; dkim=none (message not signed) header.d=none;canonical.com; 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 CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4287.22 via Frontend Transport; Mon, 5 Jul 2021 08:59:13 +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.2; Mon, 5 Jul 2021 08:59:10 +0000 From: Viacheslav Ovsiienko To: CC: , , , , , , Dekel Peled Date: Mon, 5 Jul 2021 11:58:56 +0300 Message-ID: <20210705085856.13971-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86126352-889e-4a97-48e1-08d93f932922 X-MS-TrafficTypeDiagnostic: SA0PR12MB4415: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:663; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IuTXPBOoSjH/sFYiAVpCoIQrvurg0sUIQx/9B45n4j+q9bzb3gw3qXd09P77HZdIvjLx4iEx2xSh8eRz/AGGX4vLoveh8kw0NthBxXXjUrmJPWxYdxSk9jcw/RrUUzgrCKZgJkhOzETSTBhv5fue812GrKGX3vahTmOXrVKnW5Y6gkpoxlfTerf0lHJk3Fsf181JYEaUShP4X6iQYXjqMB1nvyW5FpSQ1D3uegxUG6EFlLlfeR7W2Kx5OsGs1UvTtTf9X5qndBHXn9JcAtK9Tqb6327n3i4Sr26k95g896BwN4x9iKywZFaqn76m18MtjlsznYAVNXT5a0oiUP3Sa8Vkg5Ku/6i8q9bcL8Mtd2Yn9rkR4M5rusCs0+9xzcXdnMq/OlKTAqShZ1X3u3DUdMeHiLjOXI6vpqL8eT7o9iTEnv0pahhQUsk8lAXInftESaNZRUir7yKxU3CZNo6TcIAqIZouBFhLcDncIMXa2EK5NwtybyVkdBEG3Of7qjlT/7GwAIvcR82QelPUYqhMWWIPiy2kUsccuUUiXmBRQSpiCI+xeeTJelg1slZ0erPnXG6z4+khexVv73iscuZ3BODl+GOGou0GeKd2HOkEQRqSV16iuNmvf+caoNdsLGQN92I5VprdJBeSrFiMyrD1co1jGs1xHKzpu4nQ8tDT1RkRSxc6jlUuOd/45DfKCrnJJ4br6pq9KzyWTGSXHCimFA== 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)(136003)(396003)(346002)(376002)(39860400002)(36840700001)(46966006)(186003)(54906003)(16526019)(1076003)(36756003)(6286002)(36906005)(26005)(55016002)(6666004)(7696005)(4326008)(316002)(47076005)(70206006)(82740400003)(2906002)(107886003)(70586007)(7636003)(336012)(8936002)(2616005)(426003)(356005)(86362001)(5660300002)(6916009)(82310400003)(8676002)(83380400001)(36860700001)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2021 08:59:13.1311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86126352-889e-4a97-48e1-08d93f932922 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: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4415 Subject: [dpdk-stable] [PATC 19.11] net/mlx5: fix flow split combined with counter X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Dekel Peled [ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ] Currently, for a flow containing a count action, if flow is split to sub-flows, a new counter will be created for each sub-flow. However only the counter created for the last sub-flow will be queried on flow query and cleared on flow removal. This behavior is wrong, causing a leak of resources. Need to create just one counter per flow, and use it for all sub-flows. This patch adds the required check to make sure a counter is created just once per flow, and used by all sub-flows. Fixes: fa2d01c87d2b ("net/mlx5: support flow aging") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index cea45a6d96..42ae1bbe2c 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7377,12 +7377,13 @@ __flow_dv_translate(struct rte_eth_dev *dev, rte_errno = ENOTSUP; goto cnt_err; } - flow->counter = flow_dv_counter_alloc(dev, - count->shared, - count->id, - dev_flow->group); - if (flow->counter == NULL) - goto cnt_err; + if (!flow->counter) { + flow->counter = flow_dv_counter_alloc + (dev, count->shared, + count->id, dev_flow->group); + if (flow->counter == NULL) + goto cnt_err; + } dev_flow->dv.actions[actions_n++] = flow->counter->action; action_flags |= MLX5_FLOW_ACTION_COUNT; -- 2.18.1