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 4ABF9A0547; Thu, 29 Apr 2021 11:56:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC6084130C; Thu, 29 Apr 2021 11:56:31 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr750054.outbound.protection.outlook.com [40.107.75.54]) by mails.dpdk.org (Postfix) with ESMTP id 91A5E41304; Thu, 29 Apr 2021 11:56:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g593qwRaFXzMLSYriRCdegR6y6bRNt5a4mu3ml7xeJaIdz8/keEmnNh6hvlKe6TLDJwC2/UrOEIQkJ4GFZHO7LyLXwytfRwcTkBCT4EfeW97gzCY9Dkc5GL6n8KFDLm8xpcOwvGC+dkTZJYegW1O7hqBUrOMoyr+BUT9R0WV4TharCwBB7rcHrmlD+wLKxp2tbAcp5624V7A7zvhlm94LZcpJpyEhSJsc/LZ/a5rxjR9uRK55idhTfBEf0bdBMoeIS4L9gIlmtgKHu11NI4XtdqhrJlGSJ8FagDtNTC9NOUMLQZq21ZkdLNJLAD3P074aFDjL0nvNpLu7A2no2g1LA== 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=0vdspAkLeZbsLLAohRKxVH8QIhO2/kc1NS/h2oiUcws=; b=OuXn/oryHWYLDax0CvA+wORfWUPHD70mXvUdBgiCKZCX/rmEeKG/cZkzeuzFNH31THWIoDWWVwzzXJyVIvnsAIEI3x+sIj5rCULn3b5jiQwuCu6/ziKKbx07X7g9pVpDJAljcrBW+ooFGAT16uJMsr5Uv86+h2RYX9KR9bMppE+VIcKrTpLI86wKmI3PSBdOn02eZ8bQ3VsfvyE5u/BJmy/699NMlSuOhKvYj6+OUymq2wrQjsfMfgDpf6C/A+l5XodWVUl4ulVfIine5PpJUIlUmEwOaI/xkcImZwB9L3fD7WSqk8sn+YGlUAkU6l2XjXM/gPg1zpzGzfgBkGqiLA== 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=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=0vdspAkLeZbsLLAohRKxVH8QIhO2/kc1NS/h2oiUcws=; b=Xx8mmO3T0rD2asgorGz3O7hov1l8pHr7rKJ24BqeHzLdmx3NSJ69xFH8LxftTSTGIXSBAGr6Do3EiuwTBNwZAqtOKZUnTkVBs9D1Ph36SCI9YrbM2NLCqeMBOwqeny1o/JykC6BHS2U9Nsm6xONrajDbXwp7v8cSzx7XwHTE70N0DbrQOi0cximbF1IXY+Nhz4atuX71KL/kbm8BLj5mkV/UH6Rgzx98c/GSjmV1wDr5LnnFPhyCHu3Lb+qlXQTQJM6FJxsqfl2fy/EHjX3cY7mbQKSIwWQTJGExbY1dpIzpEU7TxUNcYWb5+QVGsFsd5Ti7rfpoTMaDwLsz4XQAEg== Received: from BN6PR22CA0045.namprd22.prod.outlook.com (2603:10b6:404:37::31) by CH2PR12MB3911.namprd12.prod.outlook.com (2603:10b6:610:2f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.25; Thu, 29 Apr 2021 09:56:25 +0000 Received: from BN8NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:404:37:cafe::40) by BN6PR22CA0045.outlook.office365.com (2603:10b6:404:37::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Thu, 29 Apr 2021 09:56:25 +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 BN8NAM11FT050.mail.protection.outlook.com (10.13.177.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4087.27 via Frontend Transport; Thu, 29 Apr 2021 09:56:25 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Apr 2021 09:56:23 +0000 From: Viacheslav Ovsiienko To: CC: , , , Michael Baum , Date: Thu, 29 Apr 2021 12:55:41 +0300 Message-ID: <20210429095542.7800-5-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210429095542.7800-1-viacheslavo@nvidia.com> References: <20210426124250.42771-1-michaelba@nvidia.com> <20210429095542.7800-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.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: 462902ad-0962-4d33-f401-08d90af50d35 X-MS-TrafficTypeDiagnostic: CH2PR12MB3911: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R9o1H9Jh7X5Jv80vzmnWoA5TIOmBbD3iu+OAYHgns8T0+guwD9w8VIi9RWnGyK3YXxuYpccUJqIiBps243eHEek9WXDru3oW/2iOCl8bCenNA1xflKAZekeG7MNMQcZtmBnj2hScBD4eb0UaEXSY5+yO751TV0HUYFr9ZyD92R4GbK9uJSxGeqpUVzp4piB2hEw6TcTxg6/2UCO3A9MPAXVRzBx4SZSVnXbYaTgeYEBXplgMm0o+jVdO+BzVcGqriMOS/c7rsfVCOQEs8f43HGN9xssb/i2WwdZSYK9ACH1MMOiQ5Xs77fkhXUaoE3y04+rWkuK17IiDqKNZsi12bjD0u/I8B2MfYs4W+79Vo3x/P04P4w92iu5oiX8vxqHz/8cvhSj7JE1DHGM+A6eqXzM04MG+iaJGiGt7CVXH1iop6hQt5vWLuH1j9jALSLG/GqAiMhUFodGvjunaPH0bap326vpQekFKeFRJrY1tQ1vDE3Iu0lUtPGL8G5/M28kLSQMNSgZxCC/DMZMbh6QPpLDhdCQPW02DvHwDeEzZCa+jBSj7wCb8r+4qhWhIIDg7bky68ieg1fCqYdRsVgZbOEnMYkxCmK6ceTkFulN0dY+t6re4APM2X2Lem/s7RNepB4SVUnGVqJ4OSdfL0WZEE7sFptGawB1aRkGSwNzagjA= 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)(376002)(396003)(39860400002)(136003)(346002)(46966006)(36840700001)(70586007)(4326008)(70206006)(336012)(186003)(16526019)(6286002)(8936002)(54906003)(26005)(356005)(316002)(7636003)(426003)(2906002)(8676002)(36860700001)(82740400003)(86362001)(5660300002)(83380400001)(6916009)(2616005)(478600001)(6666004)(55016002)(82310400003)(1076003)(36756003)(47076005)(36906005)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 09:56:25.2591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 462902ad-0962-4d33-f401-08d90af50d35 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: BN8NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3911 Subject: [dpdk-dev] [PATCH v2 4/5] net/mlx5: fix flow age event triggering 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" From: Michael Baum A FLOW_AGE event should be invoked when a new aged-out flow is detected by the PMD after the last user get-aged query calling. The PMD manages 2 flags for this information and check them in order to decide if an event should be invoked: MLX5_AGE_EVENT_NEW - a new aged-out flow was detected. after the last check. MLX5_AGE_TRIGGER - get-aged query was called after the last aged-out flow. The 2 flags were unset after the event invoking. When the user calls get-aged query from the event callback, the TRIGGER flag was set inside the user callback and unset directly after the callback what may stop the event invoking forever. Unset the TRIGGER flag before the event invoking in order to allow set it by the user callback. Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Cc: stable@dpdk.org Reported-by: David Bouyeure Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 8 +++++--- drivers/net/mlx5/mlx5.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 19ffa16769..10d44c7bbe 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -662,11 +662,13 @@ mlx5_age_event_prepare(struct mlx5_dev_ctx_shared *sh) age_info = &sh->port[i].age_info; if (!MLX5_AGE_GET(age_info, MLX5_AGE_EVENT_NEW)) continue; - if (MLX5_AGE_GET(age_info, MLX5_AGE_TRIGGER)) + MLX5_AGE_UNSET(age_info, MLX5_AGE_EVENT_NEW); + if (MLX5_AGE_GET(age_info, MLX5_AGE_TRIGGER)) { + MLX5_AGE_UNSET(age_info, MLX5_AGE_TRIGGER); rte_eth_dev_callback_process (&rte_eth_devices[sh->port[i].devx_ih_port_id], RTE_ETH_EVENT_FLOW_AGED, NULL); - age_info->flags = 0; + } } } @@ -675,7 +677,7 @@ mlx5_age_event_prepare(struct mlx5_dev_ctx_shared *sh) * * @param[in] sh * Pointer to mlx5_dev_ctx_shared object. - * @param[in] sh + * @param[in] config * Pointer to user dev config. */ static void diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index efb80a4a49..79ae8fbef1 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -563,6 +563,8 @@ struct mlx5_geneve_tlv_option_resource { #define MLX5_AGE_TRIGGER 2 #define MLX5_AGE_SET(age_info, BIT) \ ((age_info)->flags |= (1 << (BIT))) +#define MLX5_AGE_UNSET(age_info, BIT) \ + ((age_info)->flags &= ~(1 << (BIT))) #define MLX5_AGE_GET(age_info, BIT) \ ((age_info)->flags & (1 << (BIT))) #define GET_PORT_AGE_INFO(priv) \ -- 2.18.1