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 4D787A0503; Fri, 6 May 2022 05:57:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BAAA42825; Fri, 6 May 2022 05:57:09 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) by mails.dpdk.org (Postfix) with ESMTP id 638E14069F for ; Fri, 6 May 2022 05:57:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nM8jil+vsKplB2xBcyk3ANDJH4ksTeDJWCWkG9av3BnyOiaZC4B9x0OM8qRbAMzmoX3Qb4z2Arb4HTBSaQipmnNsJeJp0/Nu5DDk9JpE9ZOZqwe5iHODuOs2/ZoRR/NlWmTiQKo2P3HgchJvdFHbcphRCtnsIf8wZRCz7ElAHJA0WGqHRWJbNuJqHR+bKQsna9g1GdDBjZswblhFLClWWw5sOcUZj/FjeBr6A4UBI3oPdBXwmmMR2aAebSLypzduUPEZM9WccxGHLqg4t0lS3GNAKfDorZmsMKkdtZQ2/e8L/6+PV3+8UBvk7jzt3S2DEiEWV04yOB+1fv3Oq4krtw== 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=/2f1Fe+XXAnugarTuzM+I+1RcdZsr4LXMJDicwRb6Oc=; b=ExpeXByATr+vpR13uLM2Qnx6yVdCXu2NEfqWQIpv918WbW3Jtf/FycUcNDK4J5ssVwcIBzTL1d5TLiT5DG9lniFOPofUE7X17RKIbuIgkzU6aPiOHGxYcsccM5JrbYIiV85GPuDjcHtXDQlJTLh/Y8M944Q5bRt+4yxcFUgA3gDwafNxj6UJ4yN2dR7jCwewfuWBwr20SrKPT7rHxFsVGxVAh9Lzzw5gvwbovfGWGZsVbtPI8HkC+FEldXlyeUgVO2jlyNiTD7u/1HRZwG1xOQfFZm+M5+zLEYyvccwoWRducAOVmETz3hSjgG8XYT/dzmBr8tp81swYjpyQxsTn3Q== 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=/2f1Fe+XXAnugarTuzM+I+1RcdZsr4LXMJDicwRb6Oc=; b=pspcFVrSLHgXmPgYTcSOGl0EtI51h4PbJ1agzrUb478eNGek5azJ7Ij+gg4jwvoaASb5IpOR3VuKXafeKV/EuO4vp++EoN3gAkxcyFlF+ObSxzArMIfRzmT69eSQnhJRGDwAgYCpxgESs0wLpoRIM/dCUIKPpKe5py2hlSUlwyJQiLNp9f2HHtfnGxBaPGcgugCJAsAIj4E7B5Cjp6FTtfSPWic75Kg7GUcYPKpZUbTSybIRX+UMWjqc5sRPayeNIOYtU00ub9chQPURIjOf5wfSxdql0hDsaWMkeygD4SVqmN2JJRCkB7yLMyZF8IofPylx9ChuJpzQ6L7nYtVsNg== Received: from DS7PR05CA0078.namprd05.prod.outlook.com (2603:10b6:8:57::24) by BN8PR12MB3617.namprd12.prod.outlook.com (2603:10b6:408:47::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Fri, 6 May 2022 03:57:05 +0000 Received: from DM6NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::19) by DS7PR05CA0078.outlook.office365.com (2603:10b6:8:57::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.6 via Frontend Transport; Fri, 6 May 2022 03:57:05 +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; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT005.mail.protection.outlook.com (10.13.172.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5227.15 via Frontend Transport; Fri, 6 May 2022 03:57:04 +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; Fri, 6 May 2022 03:57:04 +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; Thu, 5 May 2022 20:57:02 -0700 From: Spike Du To: , , , CC: , Subject: [RFC v1 1/7] net/mlx5: add LWM support for Rxq Date: Fri, 6 May 2022 06:56:39 +0300 Message-ID: <20220506035645.4101714-2-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220506035645.4101714-1-spiked@nvidia.com> References: <20220401032232.1267376-2-spiked@nvidia.com> <20220506035645.4101714-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: 97132d59-821e-448a-7238-08da2f147bd8 X-MS-TrafficTypeDiagnostic: BN8PR12MB3617: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: K36TMRfyV+PE2GfAw8ca0DocHFqz+LzX8fBBo0QfZ9dq41LZ+ez3WHYSEkY3RrqjyvpZN7HUdvCTZHWyj5g2TDxYxoWJJyi4+frEhT5o138sb3UhtwgybsrOjU4D2A6AlhRABk3zB7OLufSqN/8KgqnXUSB50JewrfHHPB2mySTPxSuwRUlPEUj3BJYlSx9t94Q8k1SibTWO/OgwLZnlsMFqp0dqGZ4I5wy3L0XCHboIVdc662o1wTS1X+ha9H101/xbSFeqMgnJ2B/5mCp9zWvxAGzS1sNYFYN/5ZfblDeabKQNpJI5sfMCgd3PPbGZjJrLYDcVVdCM39yEetc9vfvpB4MQQgcipMejHneIml0J+B/8HRvwGdqEwowi6vflhbftWvEyL5FZeOjQ3gW/Vsn0hnfWjdIVm17bQty+PFLdftoCtUOJPBJe0BZ9Wc2dF5X27ulIQJsDq58h3dTvff34YnsC2cFmD7rJ1kxc1nLaXPq+FJhEq0LUMxfah27LumeU/hS7iHQIP0aGSkqtXn0o4qnCc5EYGomSsRNgpmuph/AMSE4UiSqiqacBZ9OAFAq+b65tkK5pLav3Nv6GDBTNrY3yumEwbu5Iw8bNnvz1MQcZNvY3R9H5oyGAnif7d3yFhVgT2uXvjBdRiVHpkR0WibgEkN+FmRnq4wAMYn2Gdt1+x9GNH0pHON1heJMUeLrWL1vdEJh1pJD6r4gSUQ== 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)(46966006)(40470700004)(36840700001)(8936002)(2906002)(508600001)(86362001)(4326008)(8676002)(70586007)(5660300002)(70206006)(316002)(54906003)(110136005)(83380400001)(356005)(81166007)(82310400005)(1076003)(107886003)(2616005)(26005)(55016003)(40460700003)(426003)(336012)(6286002)(47076005)(16526019)(36756003)(186003)(6666004)(36860700001)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2022 03:57:04.8730 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97132d59-821e-448a-7238-08da2f147bd8 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: DM6NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3617 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 23a28f6..f3e6682 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1391,6 +1391,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 03c0fac..4fbfcaa 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