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 74438A057F for ; Tue, 28 Jun 2022 17:34:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C5D540042; Tue, 28 Jun 2022 17:34:07 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2088.outbound.protection.outlook.com [40.107.94.88]) by mails.dpdk.org (Postfix) with ESMTP id 1B65940042 for ; Tue, 28 Jun 2022 17:34:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cw7v4q/9yF8gUx4Yr77G6FzIgUM7MSK4OldfO+I90wLXNeEAcNcZzDk23DE5oJY2n5RbLNnHF28vM9Es+ga1bzce/xv91MGvdiJZU81YKf/wIcM18ZTiz7xQ0qDikMw4VbQ1SkCxOurq1RyI+VNJcY1Q3kmPkW/1P1wWs35gH6+kZhiWakTYmwjwznejvuM9/otudf4HquDn9t/+1fK4n6M5UCLkcp718JjbO5YQ1YKLUAVZRR7RAJlIf0grhutIm5OCswfM/RXhGSsiytenkDmLcQT2pNnrPtYjrY/8EjRjMFz/D0t552upfvjx/QZ+GNJw4RHKJg4h2PsTsCXyMA== 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=1xuWV3WKHNbpKAqTVy/MOBvCrFlrSqqziaYohDVLDic=; b=We0cMfCMGByuCK+9BNPL+bSwqgn8H3Trn7QkOxgGYp5avl9V9sS9wcI+GSeQYxEXsLYTFPt8OOF0AwFn5L/6zVkyRrPNrea1yycC5Ix98lYYisAvYVnfv2jggm/gQ9uwrt0c52J9IfrGT5OTkklDlHzInxwe0R/WKNMywDXMB9fUVlJ4BkHVRThfEMewZEYXJByxxnBT4GaWuaFtBCCFWSJzZ3DeQ9sLC/0hShJahe+VDJM99dNeN3/dvxtGkLX15XbGPC6I2c2LzgzKbPOvufAYl3x1RHtAS1lh6yULsgmH5k4FwyP7i31u9kCESliEXoEYffgZADztAEQiQ0Gx4g== 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=1xuWV3WKHNbpKAqTVy/MOBvCrFlrSqqziaYohDVLDic=; b=hyGImAtscrV2ygVSeFEN0gVgnYd938WNALS+FUcj4ueZMnyxJTZSFlngYT0MqaqakaQ521tOU6wBdTZEXWFVRaEdJLER7Xl8L1ZbI1cJ9mu4yKDBA4MOCXUo20PC8/IguGgcplDqk8uU3EerXKSSkrd4PheWk0IaNCi99w9MShhBONcuX4VOXHj9Cch4Qf7o7GR1psOuBrYB5imrtqcM9CRj3RzwvsL93HedyYWP55IMU+E+hB9wQBfd9Q8lQD8dmRHkDvBz47jS1pzZJBJoZ+7ONHOVUqDnyGAi1OPJOzHNOMobe4P8+uceGC68aenA0xYKQqMLX6FCVatoKyLgnA== Received: from DS7PR05CA0016.namprd05.prod.outlook.com (2603:10b6:5:3b9::21) by DM4PR12MB5748.namprd12.prod.outlook.com (2603:10b6:8:5f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17; Tue, 28 Jun 2022 15:34:03 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::8) by DS7PR05CA0016.outlook.office365.com (2603:10b6:5:3b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.12 via Frontend Transport; Tue, 28 Jun 2022 15:34:03 +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 DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5373.15 via Frontend Transport; Tue, 28 Jun 2022 15:34:03 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 28 Jun 2022 15:34:02 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 28 Jun 2022 08:34:02 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26 via Frontend Transport; Tue, 28 Jun 2022 08:34:00 -0700 From: Michael Baum To: CC: Matan Azrad , Viacheslav Ovsiienko , Xueming Li Subject: [PATCH 20.11 v2] net/mlx5: fix LRO validation in Rx setup Date: Tue, 28 Jun 2022 18:33:56 +0300 Message-ID: <20220628153356.3390193-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220626104344.3047555-1-michaelba@nvidia.com> References: <20220626104344.3047555-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e995522-b072-4d91-1e0c-08da591ba15c X-MS-TrafficTypeDiagnostic: DM4PR12MB5748:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1Ag+xu+Lgk5ocYoB5lw52gHSdfZiyiizbR+4OnqfuwkpB7Qctn5sPUSI9jhRNQVNXLjYtHraM9aXfQmuk1jqELmzfMuVkqSY7wYPtLI8fIqWi6GvfKINcdyql6O6QMDlJrQukPsLUAhcddIm+t+d4aFiw1Eh2If8yxFmriOsMTsL5VPvc/gervQBLuZ3TMRfhcl+LmzreYtkPLkjppJTgFZBwFTuxtOcYprwPLwpS/5BahKkY3Pgtg4hiuEKv4ND6tQxcH/BaTDDj+mp5XEesc0RlILhuQkFkdHsw1E/5eYThkYLdFoxLuh+bXWCOtIrGCRsbwIQm3D931L+bMAOT6XBGj14AhrGMfj1Isadh8ynMDXArNmJy1ID0LKBOKiafhwCi2LargCh/TTF1Ji42NMW/zmydiP8SZG0HHx+quIyqF3Sry21/eMEOMGG14RAaIqStDb80wwGikd7QJIBSl1QJeFNc1AUm6kMUJMOB9bMqlSRDqq+D9DtkWRF+8dc4n11iJF2D4yDoQaDaO8Kt3FEzmkd7qMAT8dSd0Vdcy6uHSTtqOFZwlv3onHrjILV3Ka98mVvJLEbmHL0zrIFIzEh6rfrC5sdUp1lRdEeFhflP9UGudgBb+fozmWnEESe28ozIPJ1rkWzBCreXcDZ1LP/8RJoM6H0ERNi+DaMoYMkElfD+/Xq/NQKKbRbDA2WaOc9zjIpPJqupa3/e4FrCNgE4cH6RJFb/i900RA8VNIHNFiSBv9dTWTmyzEE2Y0I5k2nS1p+BDJ24HdKe7XiQ9SBpxdjoRpt+d9vZJVOZqok8e8xacQhaCM0EPeBMkz8B1KrNkwZemL1fgVBJ5MwDw== 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:(13230016)(4636009)(346002)(376002)(39860400002)(396003)(136003)(40470700004)(36840700001)(46966006)(40480700001)(5660300002)(478600001)(2616005)(7696005)(6666004)(8936002)(55016003)(36860700001)(107886003)(6916009)(6286002)(47076005)(36756003)(82740400003)(81166007)(2906002)(83380400001)(356005)(1076003)(86362001)(4326008)(54906003)(70586007)(40460700003)(8676002)(26005)(316002)(41300700001)(82310400005)(426003)(336012)(70206006)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 15:34:03.1254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e995522-b072-4d91-1e0c-08da591ba15c 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5748 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ upstream commit a213b8682117711c8e92475c5bbb321a3d8428dd ] The mlx5_rx_queue_setup() get LRO offload from user. When LRO is configured, the LRO flag in rxq_data is set to 1. This patch adds validation to make sure the LRO is supported. Fixes: 17ed314 ("net/mlx5: allow LRO per Rx queue") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- v2: fix compilation issue. drivers/net/mlx5/mlx5_rxq.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 4a263a5803..cb743a773c 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -754,8 +754,18 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, (struct rte_eth_rxseg_split *)conf->rx_seg; struct rte_eth_rxseg_split rx_single = {.mp = mp}; uint16_t n_seg = conf->rx_nseg; + uint64_t offloads = conf->offloads | + dev->data->dev_conf.rxmode.offloads; int res; + if ((offloads & DEV_RX_OFFLOAD_TCP_LRO) && + !priv->config.lro.supported) { + DRV_LOG(ERR, + "Port %u queue %u LRO is configured but not supported.", + dev->data->port_id, idx); + rte_errno = EINVAL; + return -rte_errno; + } if (mp) { /* * The parameters should be checked on rte_eth_dev layer. @@ -766,9 +776,6 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, n_seg = 1; } if (n_seg > 1) { - uint64_t offloads = conf->offloads | - dev->data->dev_conf.rxmode.offloads; - /* The offloads should be checked on rte_eth_dev layer. */ MLX5_ASSERT(offloads & DEV_RX_OFFLOAD_SCATTER); if (!(offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT)) { -- 2.25.1