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 8042BA0548; Mon, 26 Apr 2021 14:43:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06275411DD; Mon, 26 Apr 2021 14:43:30 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by mails.dpdk.org (Postfix) with ESMTP id 9352C411D7; Mon, 26 Apr 2021 14:43:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRnsghlnmy6CoN1R2hLcXaqG7s4w4QAYS+MtJQVHr+Lgb+XmNJG4aYizGsEHc2lY6/vesBdanpDA9lDuuz6QOshqfqaQyvwWkQjjkFXk4YWdgKremdAxBwSWATf3o9ihY0Wh1P+WaVSEpPI2D3YGlawBHn87Gdl8tZ4xzOnNPbDeW8v0wIQ1OxAYDOzEq88o2dN+59bYotL6wUOryW2ByPpaOkH1X1M+lveBrG81e9TMnq4ZKIPbLSKaCFtDBn6ZW9n62yTBDq0Yga/4h0PBF4fgvvJnlyxVM4W0sfBRidkMI6P7B5Aa2Y5Dk+xF3Tx0xa/4jnuXX39zaIYOQFBsqg== 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=wx5F7EF0a+2MIOGVOSlZkKbylY3PU1yvs2Phfs31Ia0=; b=XRvYUthk8yJmcfH9DxNazbpEHBQpWrPFyeC5fN7WEWPYPggj8wg7RySzh1CBCACrPw6WK3lSRpU+2/AADb/8hlE1caVrvgewxu9/8JT5tlJR7ivhj8AOh+lmb5EK2Z3wI5Z2XcHyaSEwqiQybgResQ4OhzBRYU9DCYmXkqBUpUij/zuvSk/dz7HsKgdLsjNzz3+/JdC8IDY3cgttundXVzwLlQJPtzXhi293HBpicS8BS19fp8bvVd6eImTqrmqMs9HMd2AAfIt8KloDo3idmmuaPajwpYRQRVGANvVbYyuhA9DZ2p9bvfEUyvy4fIeCUjJ/Qq7N3jK/e8RhCcRCvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=fraudbuster.mobi 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=wx5F7EF0a+2MIOGVOSlZkKbylY3PU1yvs2Phfs31Ia0=; b=JoWIN6W+lHxvUpfT1p73X7lUidHpmcVAhe4R9ZGUBiwt4PfZzNU5P81hyD4o3rtoDuvNN/k7+h5bli3ZcfLv5zXgasDrXcMWQ1Qn5wcWFuFJYkSuO7nFlS6orCIuGFHQ9Lyv86NtB28pym/rMfktYNB384/uUUJla8wLstWmnwnqnFsc6lYZvPd0GDFbztv7cmecvmejV0CPsVptXXjSqKLTWM+7R+aXwpqp8pV1YCVTb0OikfRXF95h3i6vq2soCE/BiV64MZjjWk0TfKfLuUm8k6cQ1s59Qqk41EhZu7+Eax1+MtxnJfBVri7LOem1rvZM7tt7ofbT9LHk15lyHw== Received: from DM5PR21CA0060.namprd21.prod.outlook.com (2603:10b6:3:129::22) by MN2PR12MB3662.namprd12.prod.outlook.com (2603:10b6:208:164::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.23; Mon, 26 Apr 2021 12:43:23 +0000 Received: from DM6NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:3:129:cafe::bd) by DM5PR21CA0060.outlook.office365.com (2603:10b6:3:129::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.1 via Frontend Transport; Mon, 26 Apr 2021 12:43:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; fraudbuster.mobi; dkim=none (message not signed) header.d=none;fraudbuster.mobi; 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 DM6NAM11FT030.mail.protection.outlook.com (10.13.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4065.21 via Frontend Transport; Mon, 26 Apr 2021 12:43:23 +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; Mon, 26 Apr 2021 12:43:21 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , , "David Bouyeure" Date: Mon, 26 Apr 2021 15:42:49 +0300 Message-ID: <20210426124250.42771-5-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210426124250.42771-1-michaelba@nvidia.com> References: <20210426124250.42771-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: 6c915b5f-4e13-4d95-f2ba-08d908b0e11a X-MS-TrafficTypeDiagnostic: MN2PR12MB3662: 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: xLr2WiRwbIcrF3e2ZYK7+FXMFWT6eyhdpennFSx8sI1sfroNZyf5TlRPVXcp+Qz6lrKqujdBb5jPg6dIdPWn7X2k7FIZw6bf5e8M4M93yi4XjlZgEVtbqFYmo/A20IZvTYF+CojXmZG64RGOA7+7okt0awD+SUD1e3BPcV/ZTyndn9ZFdyPJGaUzly4ZQMqQ7/asD6g07jgarnVnS+ZPHyqX+mOHzjUyBW6l7r0TqpKbdR6ql5KeTahuze1AHMgkvxYwYBc1lclTTU4lp9ses1fIBvBmexvhn/kzodBZ87EYJIDfHoPyOLspk9Txto/vqDHlT3zpmnN+MMY3zBDi3TWGuDCZADITzFReTTgNWtwh6BDvMHUfWFIcp+jIW+OBd5NfQQrZlkJqsty2PpwEpqrNU45fqWFEUaa8dDVbYRhf/IMTwmkD01Rpo+0VZ6D6tJ3kiFMEIbGkIM9mCBp3iYtfECvC4cV4vAp2WNsEU6tPSwulo+HCrqwO99ua8+2vWcfoDO4s4mJ6ygS6lnjhN8Eqk1MNT1R4Svguo1e79ARU0k58AkR8tWFOerJ5hlhAIEdB1ANRfEKShy362w8v1k/Th0Ct2nxJTZahKaSHk2EikBu9xVXbwQYepNsdslRP9YOCptoP4w1e52fYmj5SSucLr2kgLVA/1Cwgd7DFmr8= 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)(39860400002)(396003)(346002)(136003)(376002)(46966006)(36840700001)(478600001)(36756003)(36860700001)(1076003)(336012)(8936002)(6916009)(16526019)(356005)(186003)(6286002)(4326008)(86362001)(8676002)(70206006)(26005)(54906003)(2616005)(6666004)(316002)(55016002)(82740400003)(7636003)(5660300002)(2906002)(70586007)(7696005)(82310400003)(36906005)(426003)(47076005)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2021 12:43:23.2392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c915b5f-4e13-4d95-f2ba-08d908b0e11a 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: DM6NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3662 Subject: [dpdk-dev] [PATCH 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" 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 19ffa16..10d44c7 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -662,11 +662,13 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list = 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 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list = * * @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 626abb4..dfa029c 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) \ -- 1.8.3.1