Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3930144imm; Mon, 8 Oct 2018 11:52:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV60boMjHXxOfeja/i7lrIxF+ZDl1Ase7JFpRYjsuTsnynjV6yfGxBwcWo7fiRQLFiI1eum20 X-Received: by 2002:a17:902:8687:: with SMTP id g7-v6mr25843674plo.30.1539024737340; Mon, 08 Oct 2018 11:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024737; cv=none; d=google.com; s=arc-20160816; b=wreq3TSdHsZ1WANGs2MaJ62Y2Rgw7+2DsLAr/7d0kb/4Il0QP5+75pogPReMbbtQMY GBbIOBY9jfcpqF8lztlHpGQEGyIWQejuRhGsso4QWP3uJr5eyMhRgLguOr8c2dDJTvwK 3ob4LtwQK532Y2+5PBsTDZ2ztZ79f8+b/NSo3kIEmlwrTMJlVSVKWHDiIrI90dWivHFn DCcLxkmg6hX68O1R8UNC+B0eDCAWCj9/U48hz/2U9ycrrXdDPguvpXO7UQPUK0SG0sGU t2jkHd34YiPspvHvKGMcR8dAkS4P4uXp9PvFxgUVYFVnAarfYfGQHx5HZpJZf4u+CdHY aWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ORHokd14RXEomNoJzHzKOcpqKFn+Tskd9zV9PHZmD0E=; b=jMCJtXTKKOjQWH2FyMmWCITd3MGpNgtUTQcfrW8QVqF716LHoM00Y65Drs+FI3YtA1 HRTTRE9Uul9dkk/2C5i0sOzWOS7lGF2xHF8MFVmEXq6mN/sGZFjc6uOcyTeinJmTXweR VCeLuswlLrCJWx8dJkgzQ3Bgwo3ntVJi2Eql64hH6PZXlgintsgHDkBb3CEtTMMWhwWm q3mwjSJGahnJiJ6BRNqM70RfxiAcbrLCOJODNdt1ZXt6c22si45P55vOrD7Kaa7FZjUH zvDUPud8FrB9gbVoPm6A2XT6DY5GS/PRRPS8NN9igf184iTTnawnTUXVdNOHVvNyx9my +Uqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ftnPZXKe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18-v6si19327969pfj.25.2018.10.08.11.52.02; Mon, 08 Oct 2018 11:52:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ftnPZXKe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732150AbeJICDt (ORCPT + 99 others); Mon, 8 Oct 2018 22:03:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:53398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729987AbeJICDs (ORCPT ); Mon, 8 Oct 2018 22:03:48 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 898F3204FD; Mon, 8 Oct 2018 18:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024641; bh=eqpZzmYfIRgJCXgqJEOPmPHWdY+9mrWGEieDEjBm3LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ftnPZXKebp/jrYXql5u+HNathfVR44poDiwqMYm+SQ7j1URGCHuYOOx9ogj+JOCnr ef/FXfjrgIawc9YB6Sav2NygL9dIuohqW0Z+magC22DBj4c8RlDjSdwqD8NpHAPgMw PkJ953TudvtCoYKF9SG7H1xzSDubaDD1jJKgGsh8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Jurgens , Aviv Heller , Saeed Mahameed , Sasha Levin Subject: [PATCH 4.18 105/168] net/mlx5: Consider PCI domain in search for next dev Date: Mon, 8 Oct 2018 20:31:25 +0200 Message-Id: <20181008175624.044473639@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daniel Jurgens [ Upstream commit df7ddb2396cd162e64aaff9401be05e31e438961 ] The PCI BDF is not unique. PCI domain must also be considered when searching for the next physical device during lag setup. Example below: mlx5_core 0000:01:00.0: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0000:01:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0001:01:00.0: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) mlx5_core 0001:01:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(128) RxCqeCmprss(0) Signed-off-by: Daniel Jurgens Reviewed-by: Aviv Heller Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/dev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c @@ -396,16 +396,17 @@ void mlx5_remove_dev_by_protocol(struct } } -static u16 mlx5_gen_pci_id(struct mlx5_core_dev *dev) +static u32 mlx5_gen_pci_id(struct mlx5_core_dev *dev) { - return (u16)((dev->pdev->bus->number << 8) | + return (u32)((pci_domain_nr(dev->pdev->bus) << 16) | + (dev->pdev->bus->number << 8) | PCI_SLOT(dev->pdev->devfn)); } /* Must be called with intf_mutex held */ struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev) { - u16 pci_id = mlx5_gen_pci_id(dev); + u32 pci_id = mlx5_gen_pci_id(dev); struct mlx5_core_dev *res = NULL; struct mlx5_core_dev *tmp_dev; struct mlx5_priv *priv;