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 C6AFBA04FF; Tue, 24 May 2022 17:21:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFBBA42BA1; Tue, 24 May 2022 17:21:05 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2069.outbound.protection.outlook.com [40.107.220.69]) by mails.dpdk.org (Postfix) with ESMTP id A445C42B95 for ; Tue, 24 May 2022 17:21:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBa1zAexj7FDKvnBwe5e3s+sVrdrVCGV08SrjMGO9eDiCuU5QviOJXUUG9PQjZuXutc4p7Mrb6unMrIhZXBwOOxzJNsY0yOVTUsD8uN8Pamdm+ahwpGFUbupkcZZvC9ytAWuKD9aZeonFt4qjKc4SRaIc1yEjpLbOT5pjqeAxSEcKJSbwroJfOhHwZdyNnCImnsOAR5gFw44DZLTbnVmxglGajSnsbDIDFxgZXTRTWrV62Fo6XkP4dOfgIV0Op9usyO2yg+3m8kd4z0FEMHSDZSkho7XEt/Xin0Br2i5oSOjB1s3SlYBuQS4CJkDmZem9z+rYygk6XbJfP4kewWWtQ== 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=iOrOwPl2WABJtY0AzdDf3Qa4AzLjsopfa1G0Np03HG8=; b=dDKKgWN6ZrOXlHOeBWcPV021SjWVJ5vTcqKKSxFBBfGsDBRJjDb7pTbNEB7Dm7lE2d1cd6u4ba02hWLRk12sFjg9y86TCSh48cAsJdzJMn2P4kzM1wUUnkD4ckwkWVzLFvFBrgLBBJpMx5t8eBu5t4AGsOtZa8Iu8k5ehcS5Z5k7cYvB3eLdyPKmzno6AM/7R3hbIzqflzdbHvaHCiCgrva2zPiWcW/K2qtrXZR+9ZdkHZKUx5jBvfkmI1Z+0I3t4RUD1WeSngxQ3oUwF2lkLhG0rzwSG7booClweHZxH8D9BlVHQ6MJS+Lky1ZktascPx2VHp2BbkMTEF4i2JCCUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=iOrOwPl2WABJtY0AzdDf3Qa4AzLjsopfa1G0Np03HG8=; b=UiIdRz69cxzokXCyxbaBua+FNm/C2EexauNmS9RM/WNvsDntoY5QGslAKnwvlUWe230U2S+QZNEnIVdAKe+F+afIvRJZklFbXSj9ZMazzOytCzuRqkS+DAOLQxJP5fXNqkPm/Kb1JbJpYOv4e3HxI/ulj6EvPL/gIfvrpBTJdTMgcMF/L2moQf8QcF6gHsi+T4IoU9QlxF0M4lYeNWbPLDq1HHJCaqlud4mz/z0RSAsSrqi4n1Uf4AjxK9CPTc/A3TXNZE2t9698CFRy+zQLE5TZcWAfl7t0WqssgSv6wrmiCkqC6c+EKbQy65pzL63v14Cl5+rF/0tuR0kAjwIL6A== Received: from MW4PR03CA0220.namprd03.prod.outlook.com (2603:10b6:303:b9::15) by BYAPR12MB2661.namprd12.prod.outlook.com (2603:10b6:a03:67::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Tue, 24 May 2022 15:21:01 +0000 Received: from CO1NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::74) by MW4PR03CA0220.outlook.office365.com (2603:10b6:303:b9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16 via Frontend Transport; Tue, 24 May 2022 15:21:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT066.mail.protection.outlook.com (10.13.175.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5273.14 via Frontend Transport; Tue, 24 May 2022 15:21:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 24 May 2022 15:21:00 +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; Tue, 24 May 2022 08:20:58 -0700 From: Spike Du To: , , , CC: , Subject: [PATCH v3 1/7] net/mlx5: add LWM support for Rxq Date: Tue, 24 May 2022 18:20:35 +0300 Message-ID: <20220524152041.737154-2-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220524152041.737154-1-spiked@nvidia.com> References: <20220522055900.417282-1-spiked@nvidia.com> <20220524152041.737154-1-spiked@nvidia.com> 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-Office365-Filtering-Correlation-Id: d6a05d8c-6d13-4901-d2fe-08da3d9902ef X-MS-TrafficTypeDiagnostic: BYAPR12MB2661:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: jklX9lkYFN84ADEnQc7yeeoekb8d3XSe1yQrklzWO3P6s42LCMgWLr/qx4/B19kPIm4zz0JKEgTdn/FHXoKyv5iFLQmJuBYylRY72ZjyHNnh4nj5BbKMe8DtWQ1e3ansuPJEeo2YSaTvZ4kp2QHWbIPLwF8m4AYlaHKTaj2JVXoa/gWlgyg6qAER973fPbF+HXXwpIriO20QoY3511AX+UJESZMOyb28ZpoZNEr5ZRh3b+oegFmJ/ZCTWaWT7hi6rWrhxwklxLTK32y1iqxwdb3pBjI0o3DoJPhi3cOTHB/5NLU2UN5MsLHYt2NUmkcUkIfg5cTBCOGreN71cJp9AW0dzkEl5o716+xrW2o0Us18Cl8U5lY9/lKGVOYYS8bCmwI6mr0w8ulovWvoTKGCn6Go2l3r6NOw6ItbsGoW9oN30dUSDpoqVD2TMIIq9qfcq/qmEs32LzYwK4SZ4TlFJZzQJVUfdzLCz67gNLw2mYs3W+Xv6YYeFdN65OOWZv35CgK31mBz9Gopau+Rbcv7DEcuEHzfGzLdbP+gEx+UMDjgog7TCynrsaipU1cQ4e2SF/Zg+wHxnJRG6DUETRa8kbbMOC89ko6SWPDXw95A/EN1z0XX8VH4dM40upSCuP8BAhm2Mmp57F1saWwVEmLIjSlQ78URtmSVG3P/YhrEqVEZaNID+Ty+t/Vzd0L/Bihy9MkrHxnfHhXao69AeOMIvg== X-Forefront-Antispam-Report: CIP:12.22.5.238; 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)(2906002)(36860700001)(508600001)(316002)(5660300002)(47076005)(336012)(110136005)(36756003)(426003)(54906003)(16526019)(55016003)(83380400001)(70206006)(356005)(82310400005)(81166007)(186003)(6286002)(8676002)(1076003)(4326008)(86362001)(107886003)(2616005)(70586007)(40460700003)(7696005)(26005)(8936002)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 15:21:01.3815 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6a05d8c-6d13-4901-d2fe-08da3d9902ef 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2661 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 Add lwm(Limit WaterMark) field to Rxq object which indicates the percentage of RX queue size used by HW to raise LWM event to the user. Allow LWM setting in modify_rq command. Allow the LWM configuration dynamically by adding RDY2RDY state change. Signed-off-by: Spike Du --- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_devx.c | 13 ++++++++++++- drivers/net/mlx5/mlx5_devx.h | 1 + drivers/net/mlx5/mlx5_rx.h | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index ef755ee8cf..305edffe71 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1395,6 +1395,7 @@ enum mlx5_rxq_modify_type { MLX5_RXQ_MOD_RST2RDY, /* modify state from reset to ready. */ MLX5_RXQ_MOD_RDY2ERR, /* modify state from ready to error. */ MLX5_RXQ_MOD_RDY2RST, /* modify state from ready to reset. */ + MLX5_RXQ_MOD_RDY2RDY, /* modify state from ready to ready. */ }; enum mlx5_txq_modify_type { diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index 4b48f9433a..c918a50ae9 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -62,7 +62,7 @@ mlx5_rxq_obj_modify_rq_vlan_strip(struct mlx5_rxq_priv *rxq, int on) * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */ -static int +int mlx5_devx_modify_rq(struct mlx5_rxq_priv *rxq, uint8_t type) { struct mlx5_devx_modify_rq_attr rq_attr; @@ -76,6 +76,11 @@ mlx5_devx_modify_rq(struct mlx5_rxq_priv *rxq, uint8_t type) case MLX5_RXQ_MOD_RST2RDY: rq_attr.rq_state = MLX5_RQC_STATE_RST; rq_attr.state = MLX5_RQC_STATE_RDY; + if (rxq->lwm) { + rq_attr.modify_bitmask |= + MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_WQ_LWM; + rq_attr.lwm = rxq->lwm; + } break; case MLX5_RXQ_MOD_RDY2ERR: rq_attr.rq_state = MLX5_RQC_STATE_RDY; @@ -85,6 +90,12 @@ mlx5_devx_modify_rq(struct mlx5_rxq_priv *rxq, uint8_t type) rq_attr.rq_state = MLX5_RQC_STATE_RDY; rq_attr.state = MLX5_RQC_STATE_RST; break; + case MLX5_RXQ_MOD_RDY2RDY: + rq_attr.rq_state = MLX5_RQC_STATE_RDY; + rq_attr.state = MLX5_RQC_STATE_RDY; + rq_attr.modify_bitmask |= MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_WQ_LWM; + rq_attr.lwm = rxq->lwm; + break; default: break; } diff --git a/drivers/net/mlx5/mlx5_devx.h b/drivers/net/mlx5/mlx5_devx.h index a95207a6b9..ebd1da455a 100644 --- a/drivers/net/mlx5/mlx5_devx.h +++ b/drivers/net/mlx5/mlx5_devx.h @@ -11,6 +11,7 @@ int mlx5_txq_devx_obj_new(struct rte_eth_dev *dev, uint16_t idx); int mlx5_txq_devx_modify(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, uint8_t dev_port); void mlx5_txq_devx_obj_release(struct mlx5_txq_obj *txq_obj); +int mlx5_devx_modify_rq(struct mlx5_rxq_priv *rxq, uint8_t type); extern struct mlx5_obj_ops devx_obj_ops; diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h index e715ed6b62..25a5f2c1fa 100644 --- a/drivers/net/mlx5/mlx5_rx.h +++ b/drivers/net/mlx5/mlx5_rx.h @@ -175,6 +175,7 @@ struct mlx5_rxq_priv { struct mlx5_devx_rq devx_rq; struct rte_eth_hairpin_conf hairpin_conf; /* Hairpin configuration. */ uint32_t hairpin_status; /* Hairpin binding status. */ + uint32_t lwm:16; }; /* External RX queue descriptor. */ -- 2.27.0