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 0195B432E9; Thu, 9 Nov 2023 19:05:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFC3640A67; Thu, 9 Nov 2023 19:05:11 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2041.outbound.protection.outlook.com [40.107.101.41]) by mails.dpdk.org (Postfix) with ESMTP id F11184026B; Thu, 9 Nov 2023 19:05:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtlKeTQPT10Wlo61iz3WMCB6vGedr/QYZafv0HwuVUvh1KdxYU4zaZMdNqw4ML0IYc8Pg4b4ZTHxR0F9uozG2A2DtHhNm5ho+IQNZ87RK2UwmUwvBPqQkRJxvXsUz36lvJuiTIKbL9iZzP8ac0vaG9YbA5rGoAIIK7Nc9GT3qDalAq4tx+XX0s+n575tCRs/GpkIcQJXVB9QcUXg2ZStfwzOSURBgxjV9ZKlig/rQjK0qyPz3zdKVF9QptbE7Ne/Zm1zA4Bk8ieAnGj5yDAJSnGdZSS7ENMF91oLWdmxPfJIrWmnDOwtK7uQFimVvJBbPnVd73uWSkGrzQ/VXkXpKQ== 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=oPp2Cc0RITe8elgdz6tkapOLIieRi5i9KhddJdflnp0=; b=N4G4jRf35lT2s6ZmQ94C1BltNHr3SGzsXwD0CyFj0zM1piDuMs+zRMV/39BZ5gT67qOaXpG+njccYx5LiU2F7X7jJwpm6S9W/2Jc0hI8SzJ+2fV3+DRfKEYw1Y41hi0tJFbShJPWYb4dg7FFPVpsfWJeDsV5uhS6Lq6FzK/HOyTO+xm+vAkPbgFIARtH7cWIJ2bmkL78RSINFTp1l8zLBbEmeqab9M7ox9/0cXs0wHodv04EcJB/Pfyqd5N03cHOJLk0pOtDrjR2Pew8OM2sJdyvjMZEFe0oFbPayuRS8K3fxG3YqSYmlZ8m6Tm4jWU9ZMe0eA4lc6Slvr80n7GmKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 (0) 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=oPp2Cc0RITe8elgdz6tkapOLIieRi5i9KhddJdflnp0=; b=owyQw2kFbJmHWvu+R5JGQDeiStCNVdrRU7IRE7ZhCp30JRxSycxKs1C61ccuRgev3SRS3zgEvEtXinUdd0uqNn6OyjjDuwUrcJVMKmlDTNgE7YiDiZ5MFVp0gXLHY8Bz+zo5aANyfbrJP/Q0rcKpJjtVZgKxJ2VG3MKWWPudkGGIvAJn4mZt9/iOHego/RZi8thPM4olwSfdoKejIRilZMxpXBFSWY7kWM6pbVdA1Kgolkt1W5T8oKEkmASgNhm+uKN8qSBTxvpNe7eU5RPLBfWfw13XLy4OFG51S/UJUxqGKNPLHPaST/3pcCHms24xgSp2rnrs8cRVe1/M27mc6w== Received: from PH8PR07CA0006.namprd07.prod.outlook.com (2603:10b6:510:2cd::7) by SJ0PR12MB5504.namprd12.prod.outlook.com (2603:10b6:a03:3ad::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Thu, 9 Nov 2023 18:05:07 +0000 Received: from SA2PEPF000015CA.namprd03.prod.outlook.com (2603:10b6:510:2cd:cafe::ef) by PH8PR07CA0006.outlook.office365.com (2603:10b6:510:2cd::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Thu, 9 Nov 2023 18:05:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF000015CA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 18:05:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 9 Nov 2023 10:04:44 -0800 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.41; Thu, 9 Nov 2023 10:04:42 -0800 From: Dariusz Sosnowski To: Matan Azrad , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Bing Zhao CC: , Raslan Darawsheh , Subject: [PATCH] net/mlx5: fix expected hairpin queue states Date: Thu, 9 Nov 2023 20:04:25 +0200 Message-ID: <20231109180425.3186395-1-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CA:EE_|SJ0PR12MB5504:EE_ X-MS-Office365-Filtering-Correlation-Id: af155ae2-fe0a-4a80-b2a7-08dbe14e67c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7elJ0/nchAx5yzFQlAId6FausPssS6sgU00BvQZ+QpSjkc9mEr5NFpqqbKkCDLhGOuZGnlqbc+AOBl10htBev3JHA28p/z2r2vc8CMoldu4kLhCDVTDbwgYe529k/LodSCYGB7ZmIDehzMmGMvR6HovpOInxYaZIIEqzL/UHZdMuteVDlkOX29u2hXnWt7QrMOY1sPbSa+CGX6DxTZaOd0WvrKemRjlGJPQae9J6ePlooKTDOTAMTzmgCKzF4cD07hplaxJyH5MSuSp4Ttz/wfZNdg8QSHB+YGQhKl+JmKjZPDS78uJeDoq5VfAStGMqC9Vk3l9/2pvZS2c5kzzifB7Xvlf0+0OM5lu6cDduq08VPEL7DkIGp91KIBl9JVB5274qnVfcD9TF462Ih7b5OM/SMHkSb69EiTpTMmhtOf8hrWRfQbmGodQvP9vcms0QFSp/SFbDOHJ64qQIFysl0GYAcLc1NY4BqFoVSufC3bxRRymumMwI+wGBbIyJlrR1vITWYYCEseNhCGT8tqF2dsu8HzFQqL5BUEp4Xjv8br4pDa+p+EWdLk98VtKEwf3t8W8ouV5oO+pJHsPDnmxpYERUuuhuRdGlfjtTKM8FmgsWZ9GF2bb+k72QGuEOzhd+QPqDAqR+2VjHqUIVea8JWUE7BQTltX1ZxuTo+Cumr7G4OEHXe2/SINxabav2Sov4QtimDV+SBVvpn5ne4jGyFG+vFODEw6XTb78v+FHStK1u+17SEf/p6EkOm/2EDUPL X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(396003)(376002)(39860400002)(346002)(230922051799003)(82310400011)(64100799003)(451199024)(1800799009)(186009)(46966006)(36840700001)(40470700004)(55016003)(40480700001)(40460700003)(47076005)(36860700001)(83380400001)(4326008)(41300700001)(8936002)(8676002)(36756003)(2906002)(86362001)(450100002)(356005)(6666004)(110136005)(478600001)(6636002)(82740400003)(316002)(7636003)(16526019)(26005)(5660300002)(7696005)(54906003)(70206006)(6286002)(426003)(1076003)(2616005)(70586007)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 18:05:06.6162 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af155ae2-fe0a-4a80-b2a7-08dbe14e67c2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5504 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 This patch fixes the expected SQ and RQ states used in MODIFY_SQ and MODIFY_RQ during unbinding of the hairpin queues. When unbinding the queue objects, they are in RDY state and are transitioning to RST state, instead of going from RST to RST state. Also, this patch fixes the constants used for RQ states. Instead of MLX5_SQC_STATE_*, now MLX5_RQC_STATE_* are used. Fixes: 6a338ad4f7fe ("net/mlx5: add hairpin binding function") Fixes: 37cd4501e873 ("net/mlx5: support two ports hairpin mode") Cc: bingz@nvidia.com Cc: orika@nvidia.com Cc: stable@dpdk.org Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_trigger.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 329fa7da3e..6d787a7c93 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -346,8 +346,8 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev) ret = mlx5_devx_cmd_modify_sq(sq, &sq_attr); if (ret) goto error; - rq_attr.state = MLX5_SQC_STATE_RDY; - rq_attr.rq_state = MLX5_SQC_STATE_RST; + rq_attr.state = MLX5_RQC_STATE_RDY; + rq_attr.rq_state = MLX5_RQC_STATE_RST; rq_attr.hairpin_peer_sq = sq->id; rq_attr.hairpin_peer_vhca = priv->sh->cdev->config.hca_attr.vhca_id; @@ -601,8 +601,8 @@ mlx5_hairpin_queue_peer_bind(struct rte_eth_dev *dev, uint16_t cur_queue, " mismatch", dev->data->port_id, cur_queue); return -rte_errno; } - rq_attr.state = MLX5_SQC_STATE_RDY; - rq_attr.rq_state = MLX5_SQC_STATE_RST; + rq_attr.state = MLX5_RQC_STATE_RDY; + rq_attr.rq_state = MLX5_RQC_STATE_RST; rq_attr.hairpin_peer_sq = peer_info->qp_id; rq_attr.hairpin_peer_vhca = peer_info->vhca_id; ret = mlx5_devx_cmd_modify_rq(rxq_ctrl->obj->rq, &rq_attr); @@ -666,7 +666,7 @@ mlx5_hairpin_queue_peer_unbind(struct rte_eth_dev *dev, uint16_t cur_queue, return -rte_errno; } sq_attr.state = MLX5_SQC_STATE_RST; - sq_attr.sq_state = MLX5_SQC_STATE_RST; + sq_attr.sq_state = MLX5_SQC_STATE_RDY; ret = mlx5_devx_cmd_modify_sq(txq_ctrl->obj->sq, &sq_attr); if (ret == 0) txq_ctrl->hairpin_status = 0; @@ -700,8 +700,8 @@ mlx5_hairpin_queue_peer_unbind(struct rte_eth_dev *dev, uint16_t cur_queue, dev->data->port_id, cur_queue); return -rte_errno; } - rq_attr.state = MLX5_SQC_STATE_RST; - rq_attr.rq_state = MLX5_SQC_STATE_RST; + rq_attr.state = MLX5_RQC_STATE_RST; + rq_attr.rq_state = MLX5_RQC_STATE_RDY; ret = mlx5_devx_cmd_modify_rq(rxq_ctrl->obj->rq, &rq_attr); if (ret == 0) rxq->hairpin_status = 0; -- 2.25.1