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 6DDBBA0548; Wed, 15 Jun 2022 16:44:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0334440F1A; Wed, 15 Jun 2022 16:44:06 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2089.outbound.protection.outlook.com [40.107.236.89]) by mails.dpdk.org (Postfix) with ESMTP id B2AB140F19 for ; Wed, 15 Jun 2022 16:44:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n93rckKs0X1Pi7ARk52+YNn2WatgdKeRxIP/vP+IV+4BfMeChRTq7uGHCt1sr46rG9Aq1yFnDvfniKQg0BOFf6KoaoKw4V44PpDNlazC7acEIkiTsrn6nccfQGf0Pwh1lsjbq+F8tYBhCuNlB8E705DJdT6BlyWHf3ynKSwkSFLZQmQpNbgucpTohz6lT+cbQ0FIbhTVxWUKhpAKItdR1kWPFI8OVTG8EQhfdVHaTC4rCXemktb8HxRShVsMB2tc8YLyMnXOryVeBfXviaCfWa77eFUgHvAidQDzkvoWAk+IRJVFNnHpsbX/EW6PHv4RENaxra5wwIVtMClMk3bGeg== 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=pg+675AZbOTwl+uP1L76mj0+hcvbGz+qkG/pSn7NMe8=; b=H7h4Sn87rR6Rlx+ZSvr5IixDCDATp1wCS0hfm/unMADZJ9MYSXyk+y0zoaxfRG/Ke6I7jDc4290lL7j+K3V92ozxpM9KLGdm6VUnZV7gZtOCOk7AIrLBXfD84P1tDP29LBRDMnpUy+IDp+VTJqLaWGcy76asOdd57zviVYMBZHVlkgGup2XVCi29pjpBq/uQBM+5w3M9d1/t+8BCocNWTtyMP4jvCjEZ8gDbDZ1MBDzjLwCuhGSfdfznj6Z3PCbtbh0FODMnL6+TErbM23jBorrQPWWK96+T/EU+Z61ucb2CTy7OZT+jD7+Kjg2P3q4q1so35Zi1brfWAIgML9CuBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=smartsharesystems.com 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=pg+675AZbOTwl+uP1L76mj0+hcvbGz+qkG/pSn7NMe8=; b=RSrWqlY16QH5W+nTe+Hrfn5CoDd4lOpBpQTwp5Kqg+u4EnhudqgXIeWGYwM7TKcqsSR2c/IT58KxhGC158hgiXIeC9+r8sQNYgkn/7DgVRPVjotcrgPFEU/FGG33RQMhhbPLcDGreNQFgv5eS77v5iyHhbbQZlIqoqaLa6hd0jzpnyJhp00w2dUskVt3h0tyf0RkoAt32RqwB+6oX9gpeA4tZ3b1wCONaeIbtV90Zg12NhMbq4MyqcLtvs3unEcgBKDCbbUCFbASRAh9MUhqYeFJaGR9MLtRemGl0RqOHDf6UQa+5f7YMGPBDzCSuiU/Xb1c/8OUB8m35mgPqmvqrQ== Received: from BN6PR13CA0045.namprd13.prod.outlook.com (2603:10b6:404:13e::31) by BY5PR12MB4163.namprd12.prod.outlook.com (2603:10b6:a03:202::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15; Wed, 15 Jun 2022 14:44:03 +0000 Received: from BN8NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:404:13e:cafe::2c) by BN6PR13CA0045.outlook.office365.com (2603:10b6:404:13e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.11 via Frontend Transport; Wed, 15 Jun 2022 14:44:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT008.mail.protection.outlook.com (10.13.177.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5332.12 via Frontend Transport; Wed, 15 Jun 2022 14:44:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 15 Jun 2022 14:44:01 +0000 Received: from nvidia.com (10.126.230.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; Wed, 15 Jun 2022 07:43:58 -0700 From: Spike Du To: , , , , Shahaf Shuler CC: , , , , Subject: [PATCH v9 1/6] net/mlx5: add LWM support for Rxq Date: Wed, 15 Jun 2022 17:43:36 +0300 Message-ID: <20220615144341.399152-2-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220615144341.399152-1-spiked@nvidia.com> References: <20220615125836.391771-2-spiked@nvidia.com> <20220615144341.399152-1-spiked@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: 8db79228-7c54-4046-56b5-08da4edd7d7b X-MS-TrafficTypeDiagnostic: BY5PR12MB4163: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: j25BZBDIxq63rKowdHAAlBY8aiEirq8n7fTgFqc7UAezfJockQrw1QHXCnJV79nivlMRXDtXRSQU4YKj0nqsyf3hEnLdMfX6K9GBSd0dZmny9otUXncds+/9FRTUlsDAnX+QtVIXURQvCkLXvKRD3kWatx73ZnNeybck2H/pBDOoV4qAPXj+ayLegZQQ4SA8pvV8h1zTPhbjNy0v/DLM4UOxhEBzYo45zXK3yMdDQfYxof1uzeWw5wAIr5700dVd0n+AUWbR+rvhZRQ4NMPG3eZspckfhel93e8DGC3XBKZIeMQKn4nFm7uumlzDxpT9quUFjFXzfI/DtJGnlU5Gy5LxSrocB4VZYS0JcsWXr21IIMlUPA6r0BNXdpr9KmSUwHUr89pKkJMs7KvsDTxsRxX9FQu4Yv3A9531VCDvAqJWDXBaZeRYa8Oxn+DJ7749nxxV8rxAN2vyNLw4/iJC8s91zHMDGpFW0+zLQGTtT0/E0fWCvoAKD9+tG/L7o7bNnvJL6Gl2GglWG8mu/SsYKoNFfAid4mRoYdlbgzG5hMde5x4hn2aDbgEM3eRZei09NRctX1XGf76Wk7Hnty7/lA6TNE6nmhs/KfdYCBiwT3TAIDsfeOJTWbNR+LSHFDUKmkj366vlGv0ODFC7jVMX5Ub9XWbotXHSFOEh1RSswT8wsczp4jvP5drGdEsfBPMu50acN4nCDvwfphX/+F2F9A== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(40470700004)(36840700001)(46966006)(336012)(5660300002)(70206006)(16526019)(186003)(83380400001)(86362001)(70586007)(426003)(8676002)(110136005)(4326008)(316002)(2906002)(47076005)(8936002)(36756003)(6666004)(508600001)(82310400005)(2616005)(6286002)(26005)(1076003)(356005)(55016003)(36860700001)(81166007)(107886003)(7696005)(40460700003)(54906003)(6636002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2022 14:44:02.4601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8db79228-7c54-4046-56b5-08da4edd7d7b 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4163 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 ef755ee..305edff 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 4b48f94..c918a50 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -62,7 +62,7 @@ * @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 @@ 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 @@ 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 a95207a..ebd1da4 100644 --- a/drivers/net/mlx5/mlx5_devx.h +++ b/drivers/net/mlx5/mlx5_devx.h @@ -11,6 +11,7 @@ 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 e715ed6..25a5f2c 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. */ -- 1.8.3.1