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 4363CA0C3F for ; Mon, 10 May 2021 15:14:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B1A3410FE; Mon, 10 May 2021 15:14:12 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2074.outbound.protection.outlook.com [40.107.237.74]) by mails.dpdk.org (Postfix) with ESMTP id DE2374003E; Mon, 10 May 2021 15:14:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I6nFdldbBpXIdLQXcIEYzK8N5CtL7lS2VmHQDub7isoAeAPPIwoE1wPWSl+quh//fZ3EYAaGLZSag3jK+e3e6nAVmaEK5jswGR4N21tbpJPr7YCUCtBgIYpTfy1rEo3ufQVF1eD4I9AvnCdnrFJOBMtvk0dlRz9at5zUMfmw8z9GDRojaBbS9PlqL927LMxl2CByZ6p+UoRYag9Iv2u+viDimGgQJCpiqaFBAjXRRjlggpeUx6hqbsAdt5wfsyJNEb46sEdszG3vUxiIcCW7co6z0s95MOehoTNRTmSqKN4vT1wHoOyWZR9fMwiGCzK/aaToXp8cpMScPwdJM2zlgw== 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=2nwlBbXNHOsTs8WurE2kP/P57ZCeuWxFuSoJ1rmL7WU=; b=L4Vg2HSUBUG5si+nE4mx/WDQbCp+EhXHKj8RldU7jvUQaY+biK4aWV9D2RnrF+UMZDQwM0NL3XKhSlkKZmad1AuW8CNEIU2VYmGQbcxtKvRGk+5LrhME/Ywgof5s0YevDSmhBtp1b9vqrIsdPNRnxlEO9+Pq/4MioRSuNf1rgyp09sPhkPHPCB/wObXsPnPQngEn0PLJO13x5E5E8yyUOPub6kueQalXAFZJjzmw18x7atgqxqSKMqTwjrc0Ej8H7MrNOvtxHWlBm3dkKJHAFtmI6j/vpbwv/oKv6ZitrUyty2HH8PGcdMu+gfLsd0pAgMydJDWxzXrJNhAiIKgbbw== 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=2nwlBbXNHOsTs8WurE2kP/P57ZCeuWxFuSoJ1rmL7WU=; b=ePEVDLfQONEO4NkP8GNeaXgLTr+BfzrnNGdPI+6+yv13kBCyA2FP5O6T59+T+c7ZMUNLswbzAz6xLADlfs3uUxndV+MBTBHUvsrVlIGAfBTbGc85dO3AnsxjTHe05l3+xiXGEsY77QeJmqqcrfzPpexWcgfubOwnQTaqn2aedQWFkG53hnltdCLnHbdbtmhogeqZQWPp5lvv9zixXA7Ws/8U5Hri7wuF9/mQVO6H2zXMuE8VsabLL5pcPzaKPbPjY6zyTL5OtWgh2bspVclJ7ZqHMrwtC0uY0y3hznZxO43c1wKIGZP/Rk6vz3ablo8lYOPxcw6H1tFlRMG8UCiXbQ== Received: from BN6PR22CA0027.namprd22.prod.outlook.com (2603:10b6:404:37::13) by DM5PR12MB1660.namprd12.prod.outlook.com (2603:10b6:4:9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Mon, 10 May 2021 13:14:08 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:404:37:cafe::3) by BN6PR22CA0027.outlook.office365.com (2603:10b6:404:37::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 13:14:08 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 13:14:07 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 13:14:05 +0000 From: Xueming Li To: CC: , , Date: Mon, 10 May 2021 16:13:42 +0300 Message-ID: <20210510131342.18911-1-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210422072446.29455-1-xuemingl@nvidia.com> References: <20210422072446.29455-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] 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: 6b159c04-a298-4a21-d08a-08d913b57e5f X-MS-TrafficTypeDiagnostic: DM5PR12MB1660: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:663; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H5zU2xMrDqVQ12OrpcO3fIKU1/3XWLEQw+2lYkYGuzHuPsAobbi/Sbz2Ei6WCvRo7iqhwaruYZa42YUoUScMIUaYJ9E1mCRvCdO8R0niEXwXHA0ip3JA9spHfhxjdyAeCtnuEMTa20kIsdGIt/urDKrZxZp5hBtCbpLewY3MDWVN8/YsQd5b3Voo/IMdRKcaAhGxNpIilo3DTcbC5HlZnDziWE+h8PERq/hkBUkBu51mMOdBRuUB2xAOhdZlbvqkGqCRlNuGxzBrNvntwCTBNLHlWLfvbCgl+oBwts23ehmGrLRX7UK/TF0IOTQL8tXv8J0K5oDvd6zR8nymghX2y/6mwx36lBdoVDffJPK7Mxn+2B8ky9tAx+6u4GTA/zGYC5REl6ydUJNXW4yaaD1Pnu5G8p7BEfJPHbRUq1lXej4XewBsWzTAnveafib2M0ekWXc6t3P+qX/e2Wl8jFDx4QPrXtMzfSMw3so1Kg6omwpNkrQB074jMS4mR0jvRx5ztLBVMswQrS0RTbpn9azAEcWdtXhsXTG+GYPoJjepYYkvoX3LFsQ5MmMM4ywdfZVl4/wUF21/IamVSqNCZP3TJFuqzAn0AZUWRjLVG7hobqDMoz803Ny3aWWPazO2t4iKXJ4K9I+nSXztOIK/ddWnVXauENxAhtygMh5lwSPS95M= 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)(136003)(39860400002)(396003)(376002)(36840700001)(46966006)(426003)(70586007)(8676002)(70206006)(8936002)(2906002)(336012)(4326008)(2616005)(450100002)(7636003)(36860700001)(55016002)(1076003)(82310400003)(83380400001)(356005)(54906003)(5660300002)(86362001)(36756003)(109986005)(6286002)(7696005)(82740400003)(16526019)(186003)(47076005)(36906005)(478600001)(26005)(316002)(6666004)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 13:14:07.7953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b159c04-a298-4a21-d08a-08d913b57e5f 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1660 Subject: [dpdk-stable] [PATCH v2] net/mlx5: fix LAG representor probe on PF1 PCI 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" In case of bonding, orchestrator wants to use same devargs for LAG and non-LAG scenario to probe representor on PF1 using PF1 PCI address like ",representor=pf1vf[0-3]". This patch changes PCI address check policy to allow PF1 PCI address for representors on PF1. Note: detaching PF0 device can't remove representors on PF1. It's recommended to use primary(PF0) PCI address to probe representors on both PFs. Fixes: f926cce3fa94 ("net/mlx5: refactor bonding representor probing") Cc: stable@dpdk.org Signed-off-by: Xueming Li --- drivers/net/mlx5/linux/mlx5_os.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 5ac787106d..47606d292a 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1877,11 +1877,14 @@ mlx5_device_bond_pci_match(const struct ibv_device *ibv_dev, tmp_str); break; } - /* Match PCI address. */ + /* Match PCI address, allows BDF0+pfx or BDFx+pfx. */ if (pci_dev->domain == pci_addr.domain && pci_dev->bus == pci_addr.bus && pci_dev->devid == pci_addr.devid && - pci_dev->function + owner == pci_addr.function) + ((pci_dev->function == 0 && + pci_dev->function + owner == pci_addr.function) || + (pci_dev->function == owner && + pci_addr.function == owner))) pf = info.port_name; /* Get ifindex. */ snprintf(tmp_str, sizeof(tmp_str), -- 2.25.1