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 35F55A0C51; Tue, 13 Jul 2021 15:16:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D1B341286; Tue, 13 Jul 2021 15:16:36 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2066.outbound.protection.outlook.com [40.107.243.66]) by mails.dpdk.org (Postfix) with ESMTP id F35F5410DF for ; Tue, 13 Jul 2021 15:16:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jG6QYIuHM1Y62rv8JD4P8OD7GZgOtJwiyKcA+V3gFBWxRQNO6ZSKnElENOQO4a7qroehwH1HVfqdCVF15zpWR1/2l2OXdyun3V8U/yzsROwOF3h1/qa0sDUH9+ljOBNT/NZLU20lbGYZHnTsLaQlKc4+x8P0v0iYohe6TqVrTmNJ/RRH0XjcOcRSEFCHyV00Q2onHU/0MlKRGQhwcs/HjPlzXc4bopAYPRU+HGkkbY2odjnytZxXXsWkgYYdV4SUNxl1LZKV6k2wXiIOaAC8M7g8sU+82fep/Uy781MQhJ4S2ZWnrAYtGPUixtlY40kzz+uEd0SPc+qKnC8Cl0VTeg== 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-SenderADCheck; bh=+j+tm3/0tMtOHqCMZJ4kzDrLje6xFgBdBo35vHtR+l4=; b=Yb9uYrlOZXAyZUlzsQ2Ah+EGQaiw1M8mlxOhEIkcA9/8w80IVh+uxEDWSTBsDRbwEFUHXYh9+4SqS41nGfYTQdXwPpYOxd2yRk9tOHsl2Mo1HgSWs5LGPBV8czb8a0nS0YqHQ3/p7xBRHgY/xAdRAGDfeu2TMlIxPAYL4yafabMOPKmW3Ge4sK6moy5VL0V63T7Yr9pBP/NrEyqPTHow1Qzy5+LN9f9l56HuFtUKf6ffCruzFg/xWWAuvP7YnFe6oDbIx5MxkkUO3EsvlZgGmj8KLVc5rcKEyS7QwOtK4H4PvKFgzzAqho665d08Xgjf6JYtEA4+IfqRKSyF7KacWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=+j+tm3/0tMtOHqCMZJ4kzDrLje6xFgBdBo35vHtR+l4=; b=qW0xl+nF1/gbdx5c4aki2S2jl3rC7oZ3F2RqAjgH/fxUAttX2ivXbUlwabzbngiqBsyy1dbvTGuweu1ExMNWUnY4Vxi/qEE0ieUe3BrGduvNsVxYtPRIx9EQzHAyNQfwMN85CnviMWDygRR4HwskkEvuWQrHvSOaRxwtJnap3oNahNfNa17Cnz40Z6pj6pRxwW/j4icIe88QB0OLaj1a9TrrH5NEwGQ3ny8tYI8X4Q+dqkMnRZlnr6qcnSxaSooVaDXdiZcLKnLXYYWQ7sqIVVxgI8TmbHsBxpBimHWMs4BDiYGo0qlhfZZIH+UCKQp4IQ4Vvj59kJ66rngUjuEB5A== Received: from MW4PR03CA0040.namprd03.prod.outlook.com (2603:10b6:303:8e::15) by BL1PR12MB5285.namprd12.prod.outlook.com (2603:10b6:208:31f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Tue, 13 Jul 2021 13:16:32 +0000 Received: from CO1NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::fa) by MW4PR03CA0040.outlook.office365.com (2603:10b6:303:8e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 13:16:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT023.mail.protection.outlook.com (10.13.175.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 13:16:31 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Jul 2021 13:16:08 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: , , Matan Azrad , Shahaf Shuler Date: Tue, 13 Jul 2021 21:14:31 +0800 Message-ID: <20210713131437.30170-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210616040935.311733-2-xuemingl@nvidia.com> References: <20210616040935.311733-2-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c92fb6c-1d82-4ecf-dca0-08d946006ef9 X-MS-TrafficTypeDiagnostic: BL1PR12MB5285: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:346; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sy11XGFsYT9HdBWkAuKGO3nxcGb6OaUTkwB6THvWtSLvEvHJzU0rxgG1kApSFdi8DKdZDKCov/DG9GH86X/xgQjerTninbklJhew6zpyZm6kUSopst/mhq1fDp2wU4kCU/3O79t/8Mo4TvwZY2lAOW/ds9IUNiRt4AHpi/DHUw3gipX0en7LkC3WLg96Qd6rBBBipaA5W0hDpLYbySIO2XrKSF5wFZE/lLvCfzV6SrIB2BBjy/KPQplP3AOfzLqHs9bK9m2h7wRTaXllAaKYaeu5BFgBfq4ugETKg3rWWbRvxHZQinPIyezTXLLfwR0xil+F006OoIl3LtcWGEOSzBUdAc8zJNVgvX2cUEkMRU3TbEtynkCCYPiMSzjGVVaGqipieuwLZaD+2HzQtEyC6f/Ehwy+2qOTeIb9SRlMC2+LD/Epfa2zZlbyhfdAvnRUrNIoZau3HPmB7G+5gkKPdFL/PYgnAgr3grdY2tp1eshiiItcxIAiS2JHDPLE8FL0H5a500oU7wXL3xqCGkSDtW4iWZrchRGf79ZCO5eKGjcvK6kwXaMH2RD+t6uRWI4VrtIUgUyGxA+P6xk6k+f4pUlm/H+hbrhwPcGmXd4EB6hnQ7dggY3lycfVcyTSp0Rh65HY78EvRrdnE5Q32ZD4Q1buAKU2KneIc16/XAEcLQS0+TY/MvY6MckQ9jSF4O4Cf8HDQtsGzQuv0j6bdnVbmOhy0wxVkH5Q9PA++ExS0Sw= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(39860400002)(376002)(346002)(136003)(46966006)(36840700001)(70206006)(426003)(7696005)(82310400003)(70586007)(34020700004)(82740400003)(336012)(356005)(316002)(37006003)(478600001)(6636002)(2616005)(36756003)(36860700001)(54906003)(55016002)(6666004)(47076005)(4326008)(86362001)(8936002)(6286002)(16526019)(186003)(1076003)(6862004)(26005)(107886003)(4744005)(5660300002)(8676002)(7636003)(36906005)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 13:16:31.9392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c92fb6c-1d82-4ecf-dca0-08d946006ef9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5285 Subject: [dpdk-dev] [PATCH v2 08/14] net/mlx5: check max Verbs port number 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 Sender: "dev" Verbs API doesn't support Device port number larger than 255 by design. Adds check and fails probing with proper error log. Signed-off-by: Xueming Li --- drivers/net/mlx5/linux/mlx5_os.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 4b3feb48a4..73ab5b9d9f 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1219,6 +1219,12 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->dv_flow_en = 0; } #endif + if (spawn->max_port > UINT8_MAX) { + /* Verbs can't support ports larger than 255 by design. */ + DRV_LOG(ERR, "can't support IB ports > UINT8_MAX"); + err = EINVAL; + goto error; + } config->ind_table_max_size = sh->device_attr.max_rwq_indirection_table_size; /* -- 2.25.1