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 8AAB2A0553 for ; Sun, 26 Jun 2022 12:43:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B5B441141; Sun, 26 Jun 2022 12:43:56 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2041.outbound.protection.outlook.com [40.107.94.41]) by mails.dpdk.org (Postfix) with ESMTP id 3E4AA41141 for ; Sun, 26 Jun 2022 12:43:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y9el0ELApB4Azg9yJdQYePjUsM11tZu+3AdvhR81Exi1+LrLI8JguplYtXwqnCjfEb0AwzaAvCoPWruaA6YNaottM4oa164MRP9iX8iy8liXdNE2NxTgHSYMcJeNm4p7ZE3BVflZtJQQ1dN0rwNmgHzcJZsY32Ohbn8XdrTRspwkHeER4YN9XfyNK4oZbgDu0lyMBkEurxdZr7vzK6oEl9wWGqNHgqihyxRkz2vFQsz8A0mHE9muSQhrh6Z3s0y2QLyqfdkOHOqDtfpaHCTmTh5AtIJKB1rQztXUypLj2Y4j/8s2Ud1fHPiasAyBoc8tJ5zqfFAA3DWiIHRaaTbe9w== 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=4a3y8phcB7i5zwb+mIXz+rt5FSu35yzmtcejYIq76fk=; b=SIGtKP0DUjEqio+Cq9byarDNuvt31ORtd936AJ2EOa2qz/B3dxZ6wKcmlUX06ein53go9NG5w6MympS4YZwjRc+DYAYy45L8r1hZScXP3PnqZVgfOVxT8BojhjzCrWXSOxOug5X5rzCGzxiFAAfWJ5bWQaqo1WWwZS+BoR87nG18wXCJ6e+jp7cYgRZLxcy9qE8eo3kISGRfFCFkWwZnjvz0Wya/2X9LMHEcZVceGRvamQ4LmwwS4f280K4uOmZjU/t1w8Wgpq+z8t3h7KxgKzMYpRFtKeA1DjnCBotjUNEaOelFJRp/VGsq+d0u8D+PVGBU6nvkPnl723cgJyERrQ== 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=4a3y8phcB7i5zwb+mIXz+rt5FSu35yzmtcejYIq76fk=; b=ErIO7vxQv5T/b21Uh1U4n88do0GneJM2e7RvaQ9aUyTwifXWyHJgw3qzgn5KJRI4QP+pNzg0Bj9EdKxOGsJAjGoZ862hocWVjoqrD/ki2lad2hP+W+yWt0ay5gLTkTPd9pO7u3rSJiPwQYqgwDN1Ex8XvO8hLGL92zrNlRsjBmULQvKTj+bNOK5udY1Kh5WRLMmnF48LwbvGGcCdfgZOsinrQRhmYzNiEpERZcnkto3qt+ZT5qey5QhXoWDaxsb/18rgTCOAwDgHxKYvCji2Ub0Z1o/BvtT2jl5klEOqy+mfrHQ+SCyCf32YV/xRK9LTi7qE+BVYr322JMU0ZOS+3A== Received: from MW4PR04CA0381.namprd04.prod.outlook.com (2603:10b6:303:81::26) by IA1PR12MB6436.namprd12.prod.outlook.com (2603:10b6:208:3ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Sun, 26 Jun 2022 10:43:53 +0000 Received: from CO1NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:303:81:cafe::86) by MW4PR04CA0381.outlook.office365.com (2603:10b6:303:81::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17 via Frontend Transport; Sun, 26 Jun 2022 10:43:52 +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 CO1NAM11FT018.mail.protection.outlook.com (10.13.175.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5373.15 via Frontend Transport; Sun, 26 Jun 2022 10:43:52 +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; Sun, 26 Jun 2022 10:43:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.26; Sun, 26 Jun 2022 03:43:50 -0700 Received: from nvidia.com (10.127.8.13) by mail.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.26 via Frontend Transport; Sun, 26 Jun 2022 03:43:49 -0700 From: Michael Baum To: CC: Matan Azrad , Viacheslav Ovsiienko , Xueming Li Subject: [PATCH 20.11] net/mlx5: fix LRO validation in Rx setup Date: Sun, 26 Jun 2022 13:43:44 +0300 Message-ID: <20220626104344.3047555-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 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: 3b7efc4e-a4dd-4088-7a44-08da5760c316 X-MS-TrafficTypeDiagnostic: IA1PR12MB6436:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pjfBOfPUTflrkS+fZ6WDH4kB8kd/3uIMVowJI1rq273WNwZF2iTPodHIYnhCHhb9mnnkH8JSTHA+BqFJTNO8XwYwkoLAjxDNPrnJEnI7znDdT8sf61jVuVtWA+h+wHO3+OdveSFPul14gqqyCy/u3zgBMnPTrPG9l1rFa8wVIaCg3tnYNiAuMtWDKweERTM95ffFIsp54SfMp7O2ftNdbM4SEOlMKqXzu6gimSw4KIBqsZxAbjmB0ORkiZnVebHH5YwPJ5cUrxW/vi3OtbqktsA1bsBD75gYS5bTwn+XJNVnBWHoLl7tyEEKqF34VnhWUcmUxovHzpgM2vGJqZRWAvn3rBvAIA8jZBZhVEE3suhZZGIf7i4993j+xzPMbftRfEUTyGEj8pJl63N0OYHBcTIndkYHz/BV4rHnuGxmqSsVPtJjyVrkGEhMnZFpQ7hVtxPJiWHDlp0c3HWp1OARtr50K1K2wy7MNK/H8/nRIeXVBmo4K0Rp3mOz2ynxpAqOxAap8CUTtz5ljBmH63QyReO6EExGvkP/ZwLdU7oa9mfGVn4fZvcX1g/BrYBIeof8ZP4m6+7/bnooIOVMAYH/wOi2Qj8oJZy+9i+E3NOS5uri5j1/oFUL/GTdoYCUKMA0XQooHgrtWJ29lrgn62sRmEwwe/pki17Ak8RkrIETbm7JWYQ2WW53ffRruJgBEKcwenapr++xDLMqSnWzTPAeoqdmqMrKirzDBEYO4MmjV44aQj9oufjmgbb4q2yOie84LYiWlwu/dnSuEEjyaireuIIHr5k0K6P6Kf/PVSYChGsC/5RvT2Cp5yEbY0kbJEjw4Ah84aRN3kM7MsVo7MIljg== 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)(396003)(136003)(346002)(39860400002)(376002)(36840700001)(40470700004)(46966006)(82310400005)(186003)(6916009)(55016003)(81166007)(316002)(8936002)(356005)(36756003)(86362001)(40480700001)(5660300002)(2616005)(47076005)(336012)(107886003)(54906003)(426003)(1076003)(7696005)(70586007)(6286002)(36860700001)(8676002)(4326008)(70206006)(26005)(40460700003)(41300700001)(82740400003)(2906002)(478600001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2022 10:43:52.6603 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b7efc4e-a4dd-4088-7a44-08da5760c316 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: CO1NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6436 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 --- drivers/net/mlx5/mlx5_rxq.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 4a263a5803..6fad968eee 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -756,6 +756,14 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, uint16_t n_seg = conf->rx_nseg; int res; + if ((offloads & RTE_ETH_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. -- 2.25.1