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 60355A00BE; Thu, 16 Jun 2022 10:42:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55AA142BDE; Thu, 16 Jun 2022 10:42:37 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2074.outbound.protection.outlook.com [40.107.94.74]) by mails.dpdk.org (Postfix) with ESMTP id D114442BE3 for ; Thu, 16 Jun 2022 10:42:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pk1C0LEz6cytJiqJ/qMRcjxxDKhdjcp3ds+ni8cYpD1XP2At8AeX0SV6K85j24GdVSTfMlAUqzbQOhgI+qaNfziopkFaAfgyhznVqd6T9tqZ2kbjdOGWQ8K9St2DlyHHdnb+DDhjz4neDgYJAMGaE57ScgXay+cJrgTWP/ea3u9GIlBXA1z+hjhgz1oP4gWm/5J0opPjs6Ak3WY0lcBNrM8HEbkKc6HZl1oQRmxuATFubZoxZf58Lm5kH+mvNR/MkYOD/1ISJLQt5M1LEZqqrmOThq/TBVuOowxY4OcBQ5PHRzA8i9TRvwHX1iBaRUm7+H1rQnxaZrmeZ/8rCsFe1A== 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=opuWIHZPM25ovFz94zaADbsLov4fpWvaf9GM0StfIeQ=; b=WnJftSmukCpO0CiTt0EbgWX+bQd/zrDwPzka+UcOx7zIpMrlISc63eCt0kFmK/HjPqOeiV1PMpoTUTJ+hkuo/7kTpywwPbHfM1WCo0Z+atIi5QE4YEecGFf/593VghGAmosRK/9DgRFcR6wL3xHtPHiM8gzRb+gh2ANz4Dq8E9ut/zhFkA79+9dmc1tu8pwIp8clzkWqT5jupopHQ8XoGpSb0hR+Ig7TNHDSqRFumLPj8HvvMae0gP0isToCI5Mpk9FT+FVccpt+T5hU28QB7yXgnLZdSHFRDGl2hCsjk6czjRK+L9Il8c131WMC0ki3qffE8GzbJOSyvbCYAk52TQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=opuWIHZPM25ovFz94zaADbsLov4fpWvaf9GM0StfIeQ=; b=V/DDOSUfS3Iey/zTh5okeqzuhfBV/zAe1JD2eKN4BO6CbW253ew0iESfUWI4fRpGAfoM8KVVCA+ulCPRaoc9YSyubwSyl/iNGb9CkWPQdk96M75e1hNtTXbao4psKZByr3YRPFCvFH+VhxIvKbE4WllSvfbqjyQ4UgRkliZxC4DAqQRzxNOQJEns8PFZqyqqstur4NIgKI704YTPh8DWisygN6S42dz0yuy6MBG5wEuLcC9s3Xdn2pmBX59cH29j0BYGzPFC9A4Wm7XLU/SCPupSEWvyAfVLOVGgqQ9DycpG/MTtmzSMvxmgMEe3uH9aUacuotzghfrZujh0hUhpTQ== Received: from DM6PR06CA0088.namprd06.prod.outlook.com (2603:10b6:5:336::21) by DM6PR12MB3577.namprd12.prod.outlook.com (2603:10b6:5:3a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15; Thu, 16 Jun 2022 08:42:34 +0000 Received: from DM6NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::f1) by DM6PR06CA0088.outlook.office365.com (2603:10b6:5:336::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.20 via Frontend Transport; Thu, 16 Jun 2022 08:42:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT019.mail.protection.outlook.com (10.13.172.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5332.12 via Frontend Transport; Thu, 16 Jun 2022 08:42:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 16 Jun 2022 08:42:32 +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; Thu, 16 Jun 2022 01:42:17 -0700 From: Spike Du To: , , , , Shahaf Shuler CC: , , , , Subject: [PATCH v10 1/6] net/mlx5: add LWM support for Rxq Date: Thu, 16 Jun 2022 11:41:49 +0300 Message-ID: <20220616084154.635508-2-spiked@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220616084154.635508-1-spiked@nvidia.com> References: <20220615144341.399152-2-spiked@nvidia.com> <20220616084154.635508-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: ef635921-684e-4dc2-0b25-08da4f742813 X-MS-TrafficTypeDiagnostic: DM6PR12MB3577: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: dJ3jJDuGUBwxrIMD2oKE/dALlEBMxXFFbp/rvQHMSeWNvaGoh76fMJhiS7L4zDx8fNk0pSshAxtnp8j29FCXhdvL7IVV8+5e8kLSe4I4buBEIBLV1TfLtjcyeHdWb6yUg2f17pYYlzwIiE0nknd2KJfv0i9Gs7liv7pRq1PUub3Tm8J+2V0lJ6T8nEzzPRFpus1NbyEwSSf8pamVt8ZAHtUNMRlK4rukD59FD/3S2pzbL/2Ejp6ReNKla2UM0dO5EyH/PnLuq7vq7EPP2c5Sx7scazi+GmgX/bnslwb2bCk+TWgcKCMgYCgeFW3tCU+GPOLXT11Kq+Sez1FlbCFmzCNQzUKTN+IC2X7MKry16xJPK9WqWCdotEtxVZUHybWDabChBmIDTV+emYbf7XsqsBjxiJB4oLIl1auzJx6Ejad6FuupHpEi9bLr0xImWqmWxFUbZXpNdhrGoB8sqCivln50gNChzj1de9hQ+PVelCG2g6M7FZEEPttusUHIvvNALOQUuV6JP6rp3h8EXTfmOSchtLsBKLgTsXeu4X5Q7lUtZzT84tGqF3P7pq+MXmAk9CJ+4vc7XoxsxrCJLWoUmcZlbo/sucqNGbxhBpnDA6kKDG+QBWnh9IOYRhA7i39/ay4UvWBbGjHMozno9WoTxFwdP46QIdNT2WfYotxQYPwBtvxzB2n6n0jF437YCJtXQRMnA+/Nq4ZbQhqLI+2NYQ== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(46966006)(40470700004)(36840700001)(26005)(316002)(6666004)(36860700001)(110136005)(356005)(7696005)(6636002)(54906003)(5660300002)(86362001)(508600001)(6286002)(107886003)(16526019)(55016003)(36756003)(186003)(2616005)(82310400005)(40460700003)(4326008)(8676002)(426003)(70586007)(1076003)(47076005)(336012)(81166007)(8936002)(83380400001)(70206006)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2022 08:42:33.2233 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef635921-684e-4dc2-0b25-08da4f742813 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3577 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 Acked-by: Matan Azard --- 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