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 4FA7AA0C42; Fri, 11 Jun 2021 17:37:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAEE84067C; Fri, 11 Jun 2021 17:37:40 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2070.outbound.protection.outlook.com [40.107.237.70]) by mails.dpdk.org (Postfix) with ESMTP id E99D54014F; Fri, 11 Jun 2021 17:37:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBIib8rqJ0/OaJ+OtG4p2X7sB00KTZPCWh4a9DNm8EMk2V7X1VvMpPIWFZK+0pJoS7W8LDQtC6RYEu/WHx8QSKWD22AruRtgagzt75+4Rds+IfVa4nf5RgwUV6fLQUnG8FSs2ameB1vb4fdJ52/4d87WBNYWNLEPmKi0eOlUsltVzm0u510FI2f9ETYf+JCcvwsb083wC29Y+OXqfyFE8ivqFy2xAJ+sQlseyhRdbvTMpnCdXpkTopJAYclodShPBI4R4qJKAaWp9nUDGbTP4fq6WLe8fOzx/7BG4q1vFJZRoc5SaSWN281/jqUE9oShYCK6jGztav3fjGoRk3Kq2Q== 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=KevuZO1l8h6XxbtYNxv78O8l5uI/9KfAlnU0P9jGNUo=; b=a5IGFnppjQoDx9ljHz2fg1mvfrO/KmLB7RB8nTrTM5t9jYcCroo/62P2l9GL+jmtP7v+Jo6jVof/CPR0QfHZjaZErcUD7blDmahU2fQHIza+HspUVmhOdOZB+iGDxA/WmxuQW/9CvQJ6Ys+rt+rWBVLqk4Dh+kOpMFjzL3F2XeOkWvYJCHPPyQbHPJ6DvbZ3beOapWN+CiJW/yo0/hrlgfEPorsIocyM8j+KIzh5Y9U0XpZezha4ic1M+CRFuprYf9dhtTKh4cvZmJ6dRAW6XudSbbP7vCsVqcpLAr2TM/sljrp38ZwH6GIyYlymvjWTpWVyLmJohLYSSm29qxZFlA== 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=KevuZO1l8h6XxbtYNxv78O8l5uI/9KfAlnU0P9jGNUo=; b=Xk0/drKQDeG375BqsvQMnpxJcHkpavBf5pueUkRsSN6bHWu4WISoHOeApY998m0vGU4jGoCblTjpX3on7nJ5btRvG+okIDjqWwyE2evcHmrSAGN25tENl2VN5FBST3wccvcEWxVsCnPAwxIqb3Llf9P5buJt/JHYt8lDDIQMgvBjjEf4YUcPCqHcAD7xrr0ZtYW8fTgHkFYC25T92JvbVMZjpgayJk4ClWpt7TlhnXuzF/cIPJ+Vh1agomHEuhhWAq+cZ5DLQHJfqdvqPq5O3ZCgt90eacP3/VJuSJZbucFruZxuGrhD+jjZ7Jd2oAcXzioQfgSeR26OaBMxRBPiag== Received: from DM6PR02CA0116.namprd02.prod.outlook.com (2603:10b6:5:1b4::18) by BN6PR12MB1459.namprd12.prod.outlook.com (2603:10b6:405:e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Fri, 11 Jun 2021 15:37:38 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b4:cafe::31) by DM6PR02CA0116.outlook.office365.com (2603:10b6:5:1b4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Fri, 11 Jun 2021 15:37:38 +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 DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 15:37:38 +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; Fri, 11 Jun 2021 15:37:36 +0000 From: Viacheslav Ovsiienko To: CC: , , Date: Fri, 11 Jun 2021 18:37:19 +0300 Message-ID: <20210611153719.30210-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: f0de4f8c-a887-4b79-f3a1-08d92ceed7fc X-MS-TrafficTypeDiagnostic: BN6PR12MB1459: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jYhzh7co3qWLLsQNzGjokC2sZ+MOrqmsK31+zHedNZPYeUJIdkwuS5kRFDMAcNPOi0klUmeJWKho82DIH4/jbA5pbByOuu8NJlqKtclff50ryh92orlDuRIL9tOhXOZ5wckX4juL0esD8mjyhGIJIgF5wCXScsDmKcusAY1XoBeHr2SvoTdxtd5KBZ1J1Ug7z+uN6VX854pSr+oolm1vvSdf0nfBovtYaHtz04f3R5URzqJBO0dPgEIGt6tM9bBgzPNqfeihz4vMkiJ6/FbKmlCWveJ5Q2+T0mdyCbF/zq44ekmnqXrrLfLNFE85tIstYVv0/UoQlQ3/6TkF6T2TvbUeq1VhAnyDTL/RpXZJE3Kc9CukPAKL4VzvmFpUiC0e8XHLVm55Nf8WG5tD75Rprtpbi9n5PfSchTTsOiR3N/r9KU8DXYuM0P30n+WhniUuxnEZm8sb4Kg6/VVWvQnx7B000aZW4+1SanI/ykONmRSHe6ja0PWmY96TGVe1wIdW3i1ULofAE6HnzU2rI1qDHv6f/6W4za45ofY3r2c/sW0FSEU/oKrSZw9++JhsTA3UI1s3j0Y3wCMk0XaUPkHHeIpj7TBVDodRdlWFuTc9yiSVJ68zMNTKe62MjOdDv6p+VIG3yd4rU5i9ZPMVAr9h983HVkgDVRMSa7HwrMvPi8o= 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)(346002)(396003)(136003)(376002)(39860400002)(36840700001)(46966006)(36756003)(8676002)(5660300002)(16526019)(55016002)(356005)(478600001)(336012)(83380400001)(2616005)(70586007)(450100002)(82310400003)(426003)(70206006)(26005)(186003)(54906003)(1076003)(4326008)(47076005)(2906002)(6916009)(7696005)(6666004)(36860700001)(86362001)(6286002)(316002)(82740400003)(36906005)(7636003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 15:37:38.6013 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0de4f8c-a887-4b79-f3a1-08d92ceed7fc 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: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1459 Subject: [dpdk-dev] [PATCH] net/mlx5: fix switchdev mode recognition 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" The new kernels might add the switch_id attribute to the Netlink replies and this caused the wrong recognition of the E-Switch presence. The single uplink device was erroneously recognized as master and it caused the extending match for source vport index on all installed flows, including the default ones, and adding extra hops in the steering engine, that affected the maximal throughput packet rate. The extra check for the new device name format (it supposes the new kernel) and the device is only one is added. If this check succeeds the E-Switch presence is considered as wrongly detected and overridden. Fixes: 30a86157f6d5 ("net/mlx5: support PF representor") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/linux/mlx5_os.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 54e4a1fe60..92b3009786 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -2290,6 +2290,18 @@ mlx5_os_pci_probe_pf(struct rte_pci_device *pci_dev, ret = -rte_errno; goto exit; } + /* + * New kernels may add the switch_id attribute for the case + * there is no E-Switch and we wrongly recognized the + * only device as master. Override this if there is the + * single device with single port and new device name + * format present. + */ + if (nd == 1 && + list[0].info.name_type == MLX5_PHYS_PORT_NAME_TYPE_UPLINK) { + list[0].info.master = 0; + list[0].info.representor = 0; + } } MLX5_ASSERT(ns); /* -- 2.18.1