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 15DC6A0C41; Mon, 2 Aug 2021 16:55:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95DD041147; Mon, 2 Aug 2021 16:55:45 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2068.outbound.protection.outlook.com [40.107.100.68]) by mails.dpdk.org (Postfix) with ESMTP id DC61D40140 for ; Mon, 2 Aug 2021 16:55:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VOqfE6KZ1phemu/kgDJjHTFr2OVnmZ3gJjdLp4pxXbbnV4W5UqH6GTT6cFNIA2HRYivnQPi2786a7hQVz40alFBsgjpuzRZj1FzkgZjNd/nrK0abhOdenisdU8gnDod/368MEmCTyaRgbliCQAZLPcqcBUBtgKivcQiQ8mfQt3SKT9l71ICvO3AgFyMYIECQg1he2n0RQSCeeRP2PLTSyOZAJFtxn8IVS341cWkl+JC5SiW+BOh7V9hQqjMcd+8eeqzRWGj/nxxxd+jXcR0zKNlbnJS3Z0IAz3dRLSxeBSzFXmwmZUbnkHILnQOP/yddyg4eSH3bpFrXUTN6Po8obw== 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=dUiQl5wTDfbx707NRRxIEZDrM16j1PFa4ULLN3a3Knw=; b=CmRP5/C4BB3hsi+78M8dLdpgR7H4kgzG9iTi3MMwfARW2IDyHksggUVGv5hjW1P8vqzcNgbrkQQAvE0KQ12Uc+nUm+UeFldwaR/WXZ1W0ai+4ejKHf8z7KqH4a/yt7qNK6Ma209AJYYxxTP3ayucy0OEfJmjsvVvy5oH9yy9tjnr8X9uYDUq6zsoySjyCkygFJpJ9oI/traQFRluOJdZUb//xowcxID/HXoyhZ+tQdphRd+BH9SIgGpIN4mnRcSylmElEoZCUzX/53pHquyV5jlN6ZZ7q1So0exPxYwKGb3FQx1pnl6pWobLkd3VqtncS2bpPkrkQdZv5qI9OIRG5w== 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=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=dUiQl5wTDfbx707NRRxIEZDrM16j1PFa4ULLN3a3Knw=; b=mStgebKnd8yVzOOSBbBPyFeK0RuXCkv51wfz06jgrvmrVibDAs6Kx88+KGqietHGyjVOsue/h5W82nZzC292+FvYaonjC8PVSg5wqAIw5zFayxwTqlSGS1Pv9SfMQPSsqVAnQQ0/b/6HxhATzbxiVXDVvrgsZy5zuLWE9k3/SKYpRa1qgnTWRJsGOLd2fvjg9ZV40zx7JJ7AbU430xCngwg+Gl5tm4UCTUp4v8gesPadXZNNFJA/J5aFzOrczCD3DiAzmqFARJBdzSs7GT47GsnADQigBcAYNx6ybnxZn2CzZDTHxb+jWv6YrTwIGbDirKA8tHCODnxHxJysU7uz6A== Received: from DM5PR16CA0004.namprd16.prod.outlook.com (2603:10b6:3:c0::14) by BN6PR12MB1380.namprd12.prod.outlook.com (2603:10b6:404:1f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Mon, 2 Aug 2021 14:55:42 +0000 Received: from DM6NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:3:c0:cafe::6e) by DM5PR16CA0004.outlook.office365.com (2603:10b6:3:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Mon, 2 Aug 2021 14:55:42 +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 DM6NAM11FT050.mail.protection.outlook.com (10.13.173.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4373.18 via Frontend Transport; Mon, 2 Aug 2021 14:55:41 +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, 2 Aug 2021 14:55:40 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Aug 2021 14:55:38 +0000 From: Gregory Etelson To: CC: , , , Viacheslav Ovsiienko , Shahaf Shuler , Xueming Li Date: Mon, 2 Aug 2021 17:55:24 +0300 Message-ID: <20210802145524.3248-1-getelson@nvidia.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38728694-266d-412a-34fc-08d955c59956 X-MS-TrafficTypeDiagnostic: BN6PR12MB1380: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:949; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uTN5aTGi+hiEJWWKbqijfjEppzK8xteFThveTrT/xZ4P2LVJx8C/xU6gYVvhUJ9bQyDF2z46O3wIQY9fG+ESlpnw3sIiZEkJ4IAT2vBQCgIvn70OuaTvopxPpepKtiQyKWfYe82QN4dC+W1j5knFcP65bEQQX3Kn1ikOwRZV+TDBs9E/mTlxfuysgHVGr/nUtDO7bfgZxu7Pm9DGzwSUVJtZsTqMxfVVLUgvJiVOFGernAj1zdFqaOo+iY38w1SU/XKrP8V9I8mhieLri7luU+GB9kCYkiiw948MHeyrX3LowNhvCeNw9H3W3fp6rcH9uB7S5JlERF5JcHc4j8jpBy416TEDPC40vkkQ+Nq/oSzTEICltZrRB7PDy/89UAGmD5cRIfJ9wEQ3Z3VTjw4qNb4RiBGNUWPDkpLDDGnBZVA0LaENnsuQI7HaRgRG95uQufDPQ5OSI2z+GU5RmQxwaldZ1AdmlXR8hZ9XUPqsDtGoaIPFJvTmqfNvToBFoD/HZTJrXkcOv4LcnMnJOf8k9Kfs9UgG1SyKhjCbALgBn0A5zDfOmD9SrDG2lvS01lcnb+e6kL07Qo9MjTYHvGH1ThyvdigRs3NNj9kapBaA7xxLi1eiMrzB1Ugo3IUh+vFrSd3WFS4fD0dCsOgUwNF5WnQx8okfaqFSYN+nZq3ESmpdTw761vnOm1h1WqjqtNK8E8hA3UtaZ3vpKfRd1XpWag== 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)(376002)(136003)(346002)(39860400002)(396003)(46966006)(36840700001)(8936002)(36860700001)(478600001)(6666004)(2906002)(83380400001)(8676002)(82310400003)(47076005)(16526019)(107886003)(426003)(186003)(356005)(7696005)(2616005)(26005)(36756003)(336012)(6286002)(4326008)(5660300002)(1076003)(316002)(86362001)(36906005)(55016002)(70206006)(6916009)(7636003)(82740400003)(70586007)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2021 14:55:41.8008 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38728694-266d-412a-34fc-08d955c59956 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: DM6NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1380 Subject: [dpdk-dev] [PATCH] net/mlx5: fix port domain_id initialization 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" All active ports that belong to the same E-switch share domain_id value. Port initialization procedure searches through a database for existing port with matching properties. New domain_id allocated if match was not located. Otherwise, new port inherits existing domain_id. Port initialization did not pass enough info to search procedure to find existing matches. Therefore, each port was created with a private domain_id value. As the result, port_id flow action failed because it could not match ports in a rule to E-switch. The patch adds dpdk_dev with port properties to device search. Fixes: 56bb3c84e982 ("net/mlx5: reduce PCI dependency") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/linux/mlx5_os.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 8f98cf1716..c15a44de86 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1181,6 +1181,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->vport_meta_tag = 0; priv->vport_meta_mask = 0; priv->pf_bond = spawn->pf_bond; + + DRV_LOG(DEBUG, + "dev_port=%u bus=%s pci=%s master=%d representor=%d pf_bond=%d\n", + priv->dev_port, dpdk_dev->bus->name, + priv->pci_dev ? priv->pci_dev->name : "NONE", + priv->master, priv->representor, priv->pf_bond); + /* * If we have E-Switch we should determine the vport attributes. * E-Switch may use either source vport field or reg_c[0] metadata @@ -1253,7 +1260,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, * Look for sibling devices in order to reuse their switch domain * if any, otherwise allocate one. */ - MLX5_ETH_FOREACH_DEV(port_id, NULL) { + MLX5_ETH_FOREACH_DEV(port_id, dpdk_dev) { const struct mlx5_priv *opriv = rte_eth_devices[port_id].data->dev_private; @@ -1263,6 +1270,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) continue; priv->domain_id = opriv->domain_id; + DRV_LOG(DEBUG, "dev_port-%u inherit domain_id=%u\n", + priv->dev_port, priv->domain_id); break; } if (priv->domain_id == RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) { @@ -1274,6 +1283,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, goto error; } own_domain_id = 1; + DRV_LOG(DEBUG, "dev_port-%u new domain_id=%u\n", + priv->dev_port, priv->domain_id); } /* Override some values set by hardware configuration. */ mlx5_args(config, dpdk_dev->devargs); -- 2.32.0