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 056D84301F for ; Thu, 10 Aug 2023 02:02:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3BA040DD8; Thu, 10 Aug 2023 02:02:45 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2050.outbound.protection.outlook.com [40.107.223.50]) by mails.dpdk.org (Postfix) with ESMTP id 33576406B6 for ; Thu, 10 Aug 2023 02:02:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hspgq2Bo8RNrD86iR3yNXDR4FB8zfs/Xj1M5WKSmSozBUkoSMpqv8RXsRpukJOTqmUugKtWiXEbSAOXR0U+Xb5uXWISC64TwnrzQMP5adsuTpZkup8XlBUSEf9Xva05swhkcgcCWdqI+yiOHI/Liy25I7czpIziYJkuvLVfHzgu11/11Rdk2GTarW5y9J6DkP8BnyVvnZ74IPDEWuC+acTkLyYPfYYEpaU9b+8dGlLevJjkSlNVfPq0opG7z778o1C0E10UXu4IWA4/dQlbfcSXLWl9Jvznm2q2nonLxUC2VjLNlDJfO3bfRSpLg8efw6Jp1tJenrBMjMgk7F+1xfA== 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=mYum4o8SfA+/qqeLPsVxpH9uAnGR6dWOXRc2/gKQDlU=; b=S0padX1eJwOg9t3wXCw8FRij/gy6u/UhjNhFG+fJYXydQZmdlkyULjdXf75DTl1gGPYqLfQ4rF25tSVMp54hQLX+PolNui9k3VoTzySPCxaoLrEYhQsI/NfTp6UDxH1xRY2+hi4q9yO3bT5FwsUsxXHv4ltJL5yieAgkgVGOB8iIcR0nmk0GRr6IfDpl3kap9Uqk63oZ68QcZMTe28A89c6o6ilaaJdgmiRNDktEUOB7odobki4iKLOsRMbDmpE4++7M00QVgPI6TgXHcpAPDQA3UNs/vl+ZVElQKHyH5TAhZf4m87EiuWXlYeNib/4jfk05l8tNHWZ2S4Dms1nviA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=mYum4o8SfA+/qqeLPsVxpH9uAnGR6dWOXRc2/gKQDlU=; b=mfktJVtn/00DyATrRM2szGNEU0xqaOMMSN+G6OC9bOVllDU3weEEWl/TMej7oxG9YC18RYt8xe51RZgma8KTdSBxB2OLZaF+Y9g0IhnkNPe+XclpFmo/oJlgRvn5Bi1QjGI+7RrujIKZN+2r7QLNy8P2uxFciOVBxqw31uT4QmSa4NCj+8lnQHxwWRQ1UKjMgmDzBiUFdSZe8NJNKf3dIAB7/aOJM89N4Mllyj/1fsBiVGzHh7UE30yNvNRC+/sWsvkg3kFxzaTqCQLdK7eI1WkuG4eNcPlysIpoxPUsdf/wgw0tru9WUY9nBfuwYBtFl7dda4N4dwvb6rKRuFl/JA== Received: from CYZPR20CA0015.namprd20.prod.outlook.com (2603:10b6:930:a2::9) by CH3PR12MB8332.namprd12.prod.outlook.com (2603:10b6:610:131::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.30; Thu, 10 Aug 2023 00:02:41 +0000 Received: from CY4PEPF0000E9D2.namprd03.prod.outlook.com (2603:10b6:930:a2:cafe::f8) by CYZPR20CA0015.outlook.office365.com (2603:10b6:930:a2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.28 via Frontend Transport; Thu, 10 Aug 2023 00:02:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000E9D2.mail.protection.outlook.com (10.167.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.19 via Frontend Transport; Thu, 10 Aug 2023 00:02:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 9 Aug 2023 17:02:31 -0700 Received: from nvidia.com (10.126.230.37) 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.37; Wed, 9 Aug 2023 17:02:29 -0700 From: Xueming Li To: Bing Zhao CC: Viacheslav Ovsiienko , dpdk stable Subject: patch 'common/mlx5: fix obtaining IB device in LAG mode' has been queued to stable release 22.11.3 Date: Thu, 10 Aug 2023 07:58:58 +0800 Message-ID: <20230809235947.1187-26-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230809235947.1187-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> <20230809235947.1187-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D2:EE_|CH3PR12MB8332:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b1844ed-5471-496b-d146-08db99351dec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AZvc9wiNoWireyXDMwhheJJvlavlPVTn0rlEce8NgeZyhgXeRsVrIiN9Z2NfUpT13/VBe1N7z93ly+LIkMFgMK837g9+bGKXmd37b99m4EQMbAZyBOtuDO39zUMJ1ymmTdYfiflaLRWPMh0lgRqnWXEufj3HaXGcjumBth6862P0qOoCTdTrlR4c2pa7+gPYoro9WsF/56F+tYgKqk/XX7MfBHlN6INrBT0KbGgsRdqjf+A6eVI7eBqXgoWup865sqAMyq/YNezP44maMzx6jDJVqVlrxCvdYIT9FH8i1LXdnMLbJkUg6oOmY09PyhudjvSLjpEfA8GcuvPV/ugyQOZO4EJQ0oidDjhwvU1o1byKc/lTmknkCxYHNm14M45lFmWHasXIE+NSFG+lljtvS0wZlqXGwlks1bk8nW/Ys9DLw3MAAFd/fiVQ/vCl2H+L114YNAG+gNurRRgCoFCZyA3qSda8rMfaXTg5muWjahv2UDBbzg/rJod0yQhBjdH2iWDKVtw9lIUe2ePF5Im6mZjA8jajksPe8+OxTztS4GIiaNSepBNVnTZ1w8505gw+WcbT+8uUQyEnhXoMV1BEz3NtT/+6+aSmUqn5AoaaFlnA0/y4tfCkSlsRWwyN8PG3syQy8DTKjUbX67HBPkNcVl2/T1mFWSA3qcXGyq3cfLRNX6iWxoKHgRIqlkoTp86i7XraNU3BlGWTKDfH2OQfiQKBQ8rJofKljCzlEn+eI2eaQrPIlCMZX5u16pPtksYDshh+U+lwmzBc4/+8A9jzNQ== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(376002)(39860400002)(346002)(396003)(136003)(186006)(451199021)(82310400008)(1800799006)(36840700001)(46966006)(40470700004)(36860700001)(316002)(966005)(478600001)(2906002)(5660300002)(426003)(41300700001)(16526019)(86362001)(82740400003)(6666004)(7696005)(8936002)(8676002)(6862004)(6636002)(53546011)(26005)(4326008)(40460700003)(1076003)(47076005)(70206006)(70586007)(37006003)(54906003)(55016003)(336012)(6286002)(40480700001)(83380400001)(356005)(2616005)(36756003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2023 00:02:41.6026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b1844ed-5471-496b-d146-08db99351dec X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8332 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 Hi, FYI, your patch has been queued to stable release 22.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/11/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=0aafd35f651d58e0566eca43fe8cd9b93c5ff18b Thanks. Xueming Li --- >From 0aafd35f651d58e0566eca43fe8cd9b93c5ff18b Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Fri, 30 Jun 2023 15:41:39 +0300 Subject: [PATCH] common/mlx5: fix obtaining IB device in LAG mode Cc: Xueming Li [ upstream commit 37ca457d3fa69730714761a9dce8c673241d17d6 ] In hardware LAG mode, both PFs are in the same E-Switch domain but the VFs are in the other domains. Moreover, VF has its own dedicated IB device. When probing a VF created on the 1st PF, usually its PCIe address is the same as the PF's except the function part. Then there would be some wrong VF BDF match on the IB "bond" device due to incomplete comparison (we do not compare the function part of BDF for bonding devices to match all bonded PFs). Adding one extra condition to check whether the current PCIe address device is a VF will solve the incorrect IB device recognition. Thus the full address comparison will be done. Fixes: f956d3d4c33c ("net/mlx5: fix probing with secondary bonding member") Signed-off-by: Bing Zhao Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/linux/mlx5_common_os.c | 16 +++++++++------- drivers/common/mlx5/mlx5_common.h | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c index aafff60eeb..2ebb8ac8b6 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -555,7 +555,7 @@ mlx5_os_pd_prepare(struct mlx5_common_device *cdev) } static struct ibv_device * -mlx5_os_get_ibv_device(const struct rte_pci_addr *addr) +mlx5_os_get_ibv_device(const struct rte_pci_device *pci_dev) { int n; struct ibv_device **ibv_list = mlx5_glue->get_device_list(&n); @@ -564,6 +564,8 @@ mlx5_os_get_ibv_device(const struct rte_pci_addr *addr) uint8_t guid2[32] = {0}; int ret1, ret2 = -1; struct rte_pci_addr paddr; + const struct rte_pci_addr *addr = &pci_dev->addr; + bool is_vf_dev = mlx5_dev_is_vf_pci(pci_dev); if (ibv_list == NULL || !n) { rte_errno = ENOSYS; @@ -579,11 +581,11 @@ mlx5_os_get_ibv_device(const struct rte_pci_addr *addr) if (ret1 > 0) ret2 = mlx5_get_device_guid(&paddr, guid2, sizeof(guid2)); /* Bond device can bond secondary PCIe */ - if ((strstr(ibv_list[n]->name, "bond") && - ((ret1 > 0 && ret2 > 0 && !memcmp(guid1, guid2, sizeof(guid1))) || - (addr->domain == paddr.domain && addr->bus == paddr.bus && - addr->devid == paddr.devid))) || - !rte_pci_addr_cmp(addr, &paddr)) { + if ((strstr(ibv_list[n]->name, "bond") && !is_vf_dev && + ((ret1 > 0 && ret2 > 0 && !memcmp(guid1, guid2, sizeof(guid1))) || + (addr->domain == paddr.domain && addr->bus == paddr.bus && + addr->devid == paddr.devid))) || + !rte_pci_addr_cmp(addr, &paddr)) { ibv_match = ibv_list[n]; break; } @@ -697,7 +699,7 @@ mlx5_os_get_ibv_dev(const struct rte_device *dev) struct ibv_device *ibv; if (mlx5_dev_is_pci(dev)) - ibv = mlx5_os_get_ibv_device(&RTE_DEV_TO_PCI_CONST(dev)->addr); + ibv = mlx5_os_get_ibv_device(RTE_DEV_TO_PCI_CONST(dev)); else ibv = mlx5_get_aux_ibv_device(RTE_DEV_TO_AUXILIARY_CONST(dev)); if (ibv == NULL) { diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 1ff91f81d4..02b5d54363 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -558,7 +558,7 @@ mlx5_dev_is_pci(const struct rte_device *dev); */ __rte_internal bool -mlx5_dev_is_vf_pci(struct rte_pci_device *pci_dev); +mlx5_dev_is_vf_pci(const struct rte_pci_device *pci_dev); __rte_internal int diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c index 73178ce0f3..fdf03f2a53 100644 --- a/drivers/common/mlx5/mlx5_common_pci.c +++ b/drivers/common/mlx5/mlx5_common_pci.c @@ -109,7 +109,7 @@ mlx5_dev_is_pci(const struct rte_device *dev) } bool -mlx5_dev_is_vf_pci(struct rte_pci_device *pci_dev) +mlx5_dev_is_vf_pci(const struct rte_pci_device *pci_dev) { switch (pci_dev->id.device_id) { case PCI_DEVICE_ID_MELLANOX_CONNECTX4VF: -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-08-09 21:51:20.201823100 +0800 +++ 0079-common-mlx5-fix-obtaining-IB-device-in-LAG-mode.patch 2023-08-09 21:51:18.234352000 +0800 @@ -1 +1 @@ -From 37ca457d3fa69730714761a9dce8c673241d17d6 Mon Sep 17 00:00:00 2001 +From 0aafd35f651d58e0566eca43fe8cd9b93c5ff18b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 37ca457d3fa69730714761a9dce8c673241d17d6 ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org @@ -80 +82 @@ -index 42d938776a..28f9f41528 100644 +index 1ff91f81d4..02b5d54363 100644 @@ -83 +85 @@ -@@ -600,7 +600,7 @@ mlx5_dev_is_pci(const struct rte_device *dev); +@@ -558,7 +558,7 @@ mlx5_dev_is_pci(const struct rte_device *dev); @@ -93 +95 @@ -index 5122c596bc..04aad0963c 100644 +index 73178ce0f3..fdf03f2a53 100644