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 C6443A0C45; Mon, 19 Jul 2021 04:55:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 163644119C; Mon, 19 Jul 2021 04:55:36 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by mails.dpdk.org (Postfix) with ESMTP id 08BA5411AE for ; Mon, 19 Jul 2021 04:55:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WegADU1qvKYKk1ySCbD/rAS4rj8fMMHngBC+OnvK9yeNC3YkS+wkwx3X9L+GtNBCBWmCFMWeHn2pw76ccni0DXISaqHTUQXyIY/k1idp76yJkzQupKu3zE17URG1W7/N43VbdOSHdXvmnijCkj+PYXAXxLjfHfLb4Gh+v0MQ/VDlVJi1Cno5m9Yr3XINGCQOvPfLbHSgZbpqHdsh16Pr3/m6ZhzoYBcOAgl3qUnJcJ4JPsD1yLhX2TM7WR8NEgLLXejFkhKenfv2N8AoCUFIfyT5zFJJaA3JGzdxVxAi6NK8LMqsZJ7kDL3wwCZ24dstYjhb91JR9BT/YYWcRLhueQ== 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=2fZX5UDRzFr2SlAboioNqlFjpBFYcd8TFWulryAmL/c=; b=j16ewOu5UkJadWbGdBo0tT7te1V0OdMSJjOCagqinDFjiemCSS5wdnD8d4hUn4Ge/mHZnjtNaEWCIwuu7mkc8XIXMUFEsLJXOdSOb/kceHNKc+UWM5JOP94QgUUETFPlSmbsSGse/qdohKqo6K+VcLYBSwfRAhf27R51JhpQlCBddzZRB5QtMVz7lXiuok49foAeIMJXMV51bmY8Ns3JWosU1pI+u6gXeGcV3cgCOf6XXO/uBU0Jy1DOgMEywnDMV0yrzOvPa0NzCi9NC/KkYNW097LwWLobbCrSV86Uo1xGaq6V0ayGy6Mu6ZKufCkjnAcDhZSyV/xaJQceb1USfg== 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=quarantine 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=2fZX5UDRzFr2SlAboioNqlFjpBFYcd8TFWulryAmL/c=; b=pjXaOGH1EY0LbNnYJ7NXZ6McmUDwbHYgcYd0zPCIRJyEgmTu+eAFdnXmlrk+mloKxz99zU1GoWTthos7wC1uSLoUVZ0zu8k6Qv/zMdnuU6pqp1wCdQNXGgK6ASEuaqYKhpyBfmuAH00hQxqDlOiuDDwGlZ5e1Fe33YMTJZmc4nsSNGQlKVjZ6/jxj0eD0dP+8siIh404GrO7NK8GA1iMpRqeOiErPKl+PLlmA+XbUyIqiUJTtROZkd7il+ODrrsuUbWt+5mSdzXJB3+ABvJinXyTCSRwqFzEeAH0WehQzrpnAFO5TzXySDErnTUZpllZ1HISyBMIFPOd5q4hLIjnkw== Received: from MW3PR06CA0018.namprd06.prod.outlook.com (2603:10b6:303:2a::23) by BL1PR12MB5126.namprd12.prod.outlook.com (2603:10b6:208:312::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Mon, 19 Jul 2021 02:55:31 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2a:cafe::4f) by MW3PR06CA0018.outlook.office365.com (2603:10b6:303:2a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24 via Frontend Transport; Mon, 19 Jul 2021 02:55:31 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 02:55:30 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 19 Jul 2021 02:55:29 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: , , Matan Azrad , Shahaf Shuler Date: Mon, 19 Jul 2021 10:54:04 +0800 Message-ID: <20210719025410.15483-10-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210713131437.30170-2-xuemingl@nvidia.com> References: <20210713131437.30170-2-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a335efb9-a659-4790-baa2-08d94a60abe2 X-MS-TrafficTypeDiagnostic: BL1PR12MB5126: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:346; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q19pnPAPfX9c5OeGyv7BK82ThzmY4cwTT+3NtkWnvn1g2gGy0EuksJDAq1d/qZ2xEgPv9RsdsU5P6FzCcVPhBBF0EzZacOweFA7kSXPDiQvmHi/junjmP4Sw9m0zFRLqS7dqi0CiHozoQTG/NNqncanKR5KZNsbIaQbarRytXIVS3681h5G6xt5DjNlzfKOPLrYReVfF6HcYm2UfPRRKDT74xL6rebHy6XtOxRBUUQCpQzSD0RTlOKvOQ+o+vR1VBlzi9sqltaZZay5c28I3/MxK/oIUd5b92TIJWBSc8tap5ZnxsnnV1GNjIh7H/62umc2etOcQA4pWm6ydHJhwXVXj/wm+AR+iGQUpN1kzXGOiaJfacyMKeSf9kCSbHmL8wlAB5sRmncdRaBO7R153mGLswG34sPQto31K3YXr2Vs9yWe9Zj2Oj/5p53hufpnmNxzaGRH1BvauCJ64eVKinBjXcdo8z22wI2i8hQ6oRYmrPOqbvWNvAWfLfSSZauFReH5PMaj6TEYxvM2kr3mwE+VSGzAzmfmuYwlhv38QmJhcPW2P254U2VJ525XDKaanmdezpZ1mWYzF+cTkdSBuLP05s6CP0nF84pS9k4Z7rBPMSZ+nmjst9nHs0Q+OopuLCcC4451PZ1j/vH/AaH+mV5jtUgbEJNraWrFUyE0xIG9haeGYcxaW+1D9dS0Biv1Pht2QW7Q7ESs2VUelaETMXg== 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)(39860400002)(136003)(396003)(376002)(346002)(46966006)(36840700001)(36860700001)(7696005)(6862004)(2906002)(6286002)(26005)(1076003)(86362001)(478600001)(70206006)(16526019)(107886003)(336012)(37006003)(186003)(6666004)(426003)(54906003)(70586007)(47076005)(6636002)(7636003)(82740400003)(4744005)(36906005)(8676002)(4326008)(55016002)(82310400003)(316002)(36756003)(8936002)(356005)(5660300002)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2021 02:55:30.9665 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a335efb9-a659-4790-baa2-08d94a60abe2 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5126 Subject: [dpdk-dev] [PATCH v3 09/15] 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 f041f9054f..db44169b84 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1294,6 +1294,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