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 901C3A0548 for ; Mon, 16 Aug 2021 18:30:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 894FA41153; Mon, 16 Aug 2021 18:30:19 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) by mails.dpdk.org (Postfix) with ESMTP id 6761441152 for ; Mon, 16 Aug 2021 18:30:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PTaL57KLIQvarLfN1bGXp9QsuYrJkRPzpH4dgAGGjUBHFKBrzcf1jzM+P2RBRj42eL8dnIFy2N2S0LClTsiZ8TNmb9CwdMMEKXcxsUEhnFI+a47PJ6TvhCJUJcfe5FEVq9pUY88boBRacztzvfhYeEsolSWvR20ugHnOuPkyB62kcawMtypHdHB6VG1xqhqbQau3HvKFXTJaIZ0NyBHbGJJtmeGTIDmUhjHtpo7j5mDF9zWdJeFV5O+F4hJdZ0KGBCgIjewWEi8Y5ztcP7leza/2HMyx82VA317k57PyY2rIhErN1kQYd1uOi0Blkz2pdIa9N8DnLPW2B5MKMMo7xA== 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=mhzpqqDhNPJwZIUaa+EBxH1ZxtOhjvliAyGwy1uv8jE=; b=ncYanDdfggXoA0wbHTEVRNgYTpR/V20soGbkx5heio6cYZOXlJERS+ssOfKKcZ3F/57LQGec4roqFMoLOhaWplKOYgIc2vd+FMpVNoxrN8P7kEcY2BOSgtH5HsVmJcOrK9lz9Ar/tT0Cb9e715Fe505YiNUw+uqUHXbXGE5T52KVi6ng724xxVDKqBqnYuj7vs6luPfqmWp6RYWk2dzBVUdemMzoEF8hlrcQOXbXOjLvxaQ0vLdm1CgGSyqLvQ3kk1gI4iHV2gGaV9m8TznTmaUFaujBw5Cd7TzWTjNb7PB34t2wo1uzPvZgtdcEhs7IcnmuP8jzJ31Ot2CHC5LFmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=canonical.com 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=mhzpqqDhNPJwZIUaa+EBxH1ZxtOhjvliAyGwy1uv8jE=; b=IoxYPQRiazuqigihd3dwLpvwn8q//SJ+lRJfvIyKMpDSs3FN1rYIVENo91avcM9wUlIWNbxczCy5dFTsDjpiAQwfcaG7UyPJUmpGGx7SI3FlU8x3jmlS/MswpMieBLFEmMjkPnB+yG7Y3+TUOJKSr81cApLriDILdkxMu6fJfGhUVHHUcKhk2xnprj/sy5hNkr0c3EiPX1kvGDnnb5Z83LzUWYzMTwFmUb46TmGAzV2/IGTDhgBN54x+Av61jzA/k/QvurQzsSzICro/2eGiJHN6t1JWNNYw1nU3+DtGs8WxOo1fX26iSfjxIbpNnq4TxFG5shfyaaAX3bC14g9ldg== Received: from BN6PR1101CA0007.namprd11.prod.outlook.com (2603:10b6:405:4a::17) by BN6PR12MB1523.namprd12.prod.outlook.com (2603:10b6:405:10::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.21; Mon, 16 Aug 2021 16:30:16 +0000 Received: from BN8NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::f1) by BN6PR1101CA0007.outlook.office365.com (2603:10b6:405:4a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Mon, 16 Aug 2021 16:30:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; canonical.com; dkim=none (message not signed) header.d=none;canonical.com; 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 BN8NAM11FT057.mail.protection.outlook.com (10.13.177.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.16 via Frontend Transport; Mon, 16 Aug 2021 16:30:15 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Aug 2021 16:30:15 +0000 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Aug 2021 16:30:13 +0000 From: Bing Zhao To: , CC: , Date: Mon, 16 Aug 2021 19:29:49 +0300 Message-ID: <20210816162952.1931473-4-bingz@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210816162952.1931473-1-bingz@nvidia.com> References: <20210816162952.1931473-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f857862-02c2-46ad-2578-08d960d32119 X-MS-TrafficTypeDiagnostic: BN6PR12MB1523: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1KPH+Q4kzeZ29wNuncGb70BtGBnalQFJlcOUlOHMGY4n+5SKdaixe3wJxfgXJr3LU248bViyC0jQhpo6a+D/K46MMbRU0PlJ3I1BXn4VdozAAm1syDk7h9VpAYsb1A+PrX6FPSZT8etzCGc8RQ+kj1PrWx5B/FVh413omBvseQFwD5FWMEnVuUcYw4R8dR9U7eCSDoDO7ScagfQqxCHspy/7rL5n6qsBTVA85RXFSkw3C6KIR898Hif9bHbgEAzsyM43Gv64nfhcvduULIkEZyKmNM8dXN8kmtsLjiP81RD/rVe7E0BIOY54gXNPJwFGMAGX3k00/30wLMmmKvChtCzxP0JqqlzXJdahaaPRpYBCm+RcKtn0bGOubzypZGnRoKer8uqGd/G1b032THkb3baXRBqGyawnzKER/hL2e5jkmq04HA7+Ospy+ty021O83m5vWhozwzRNE06TboQtbAYPsqBL+LVNjxjvdYLUim28l7D/oGo4KzaS9hxGrRS3wy7rbXbIElYIaWURwYqCUTEIHmlOpgRufnFzxRV49vew8YLDARoZQBwTOWtnBuQfsxpUlbVySRAN5ZZZ3PWd0hzia6NxQHbKlG2X9fDs0rtI61/lnphJe5xVYqHwVM993iq1bmKGvFkDHG0SpiWamBs3W+vTkxlQ4Cwglk1xORiULHcpmG3fgfNjF3slmJXoRApjTENuLlF7p4kjOSREaA== 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)(346002)(396003)(376002)(36840700001)(46966006)(6286002)(2906002)(8676002)(8936002)(83380400001)(36756003)(316002)(4326008)(36860700001)(107886003)(1076003)(55016002)(6666004)(47076005)(478600001)(356005)(336012)(70206006)(2616005)(5660300002)(82310400003)(7636003)(82740400003)(186003)(26005)(16526019)(54906003)(7696005)(426003)(86362001)(70586007)(110136005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2021 16:30:15.7598 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f857862-02c2-46ad-2578-08d960d32119 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: BN8NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1523 Subject: [dpdk-stable] [PATCH 19.11 3/6] net/mlx5: fix switchdev mode recognition 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 Sender: "stable" From: Viacheslav Ovsiienko [ upstream commit 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 ] 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 Acked-by: Matan Azrad Signed-off-by: Bing Zhao --- drivers/net/mlx5/mlx5.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3208b2eda7..3f14bd5419 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -3364,6 +3364,18 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, 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; + } } assert(ns); /* -- 2.21.0