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 689B1A04A9; Wed, 2 Mar 2022 20:14:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A9184068B; Wed, 2 Mar 2022 20:14:43 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2052.outbound.protection.outlook.com [40.107.220.52]) by mails.dpdk.org (Postfix) with ESMTP id 09C9240141 for ; Wed, 2 Mar 2022 20:14:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FiFjT4dyOHwrlzqT4C6YyZHATglDjIn6xD2F/Cd6phN9JD7lXbZWhtPQ426q4/WFb+keLch3pRNxZ0FT4HK153NZ4S5gsv1N3Id2sxsY66VwFtkKFXSmACi8U0tfrtomUexaLV4Z3g9T9eA8u2IPGuoC4BEuX/4G7Lgx/yP2myBenG9F2X0p251k7zLuB96atpXMkSJ7aI419gsHlO7VItWsSALo1/u03zu6fi+CDucAKL1LrxG/V5p0lCrQEE+Ig6FFWSvjWUb6Rg7OED5F551ajD8WCRWhJ0BPCLGHvPdriXpe+t19qdtNoi9M9h9RfHfd7Acpdex+uKIqoqioDw== 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=XMsJCoDE3e6wbg/gJax284u+rD/eD4jlOtt6EUNCDTQ=; b=GPqm0SgPDa/LwBscGKexErCKzyP6U2ct/WHaQZEy3AGowfdrLdIQ6JsLHI17iYEe003wqgKW2ZYZgjxAeAkkEwSAZL/l0YGgEbsLNZK1JEshypR//5R6eJYLp23/A+8azqQ+0XOM3IsN3I+dJ0dHInWAdBeiatMV1psozm82yQedkkK6k2L8Ilkl1c3vnTgBEbgSNJakoBP9xHuVjB6Gjnys1fI1waDVZdEUnyRenBiHJJUGk/AFNNQcwkA/9iconDYFMwut4kJhazCBCnBy1MLwiJC6TR02pA3FjCMZC8JcG2qXTjr3QyjBUCf6edpSOZ6o4pkW0J+gJVLTHCDcLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=XMsJCoDE3e6wbg/gJax284u+rD/eD4jlOtt6EUNCDTQ=; b=DVjrzg/qTEP1AoB+c4MCExlMSJDxQMAIRL1DnJgcsjnCaX67ybJz2Py3nMf+nhj3bUR2pHZKeEKqglkb1pLagSSBJK2j0WVTQkV1LOIzWcGpo+2E8jw+Dmgr7+BqtSnlot4MG/isRir4nx7nTkiT4OpvyrnAvLPPhP8uk6ucKTUK63QUp9GAH+8FHyiYb+6EByRWAipzxioiNZ55ZJYguJvyDk+a/Lk3UeW3RkB7E+DbEJxciSqVGDGUXIBWGfI7jrUrOHzk3/OtjGI9AfMHHN277V/SA7nmfbNQTCPMwhyCzc4a5SjgCVyeh6dfG4Vmym1MZEdTNW0UISDfnN8wnA== Received: from DM5PR21CA0006.namprd21.prod.outlook.com (2603:10b6:3:ac::16) by BY5PR12MB4050.namprd12.prod.outlook.com (2603:10b6:a03:207::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13; Wed, 2 Mar 2022 19:14:39 +0000 Received: from DM6NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:3:ac:cafe::ec) by DM5PR21CA0006.outlook.office365.com (2603:10b6:3:ac::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.0 via Frontend Transport; Wed, 2 Mar 2022 19:14:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT044.mail.protection.outlook.com (10.13.173.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Wed, 2 Mar 2022 19:14:39 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 2 Mar 2022 19:14:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Wed, 2 Mar 2022 11:14:37 -0800 Received: from nvidia.com (10.127.8.13) by mail.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.9 via Frontend Transport; Wed, 2 Mar 2022 11:14:36 -0800 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko Subject: [PATCH] net/mlx5: fix E-Switch disabling when DV flow disable Date: Wed, 2 Mar 2022 21:14:31 +0200 Message-ID: <20220302191431.88476-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 37982cfc-7d6e-4c91-ba1e-08d9fc80e5fa X-MS-TrafficTypeDiagnostic: BY5PR12MB4050:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NpadU+18sZN2lfMZkzYIdvukGAKA4fntJEBaNVkP+H38qiTFWmn7OmGx40dkXYoaLZnGUa0l1JWgs8Tua0sve2cswjrX8aSQuplj/z8sr5DyaaIEaDZYhX0xo3UhgLSvcXrALmBbvNTrZGzVgob26eY4YTaHeSIQwTTA1B8DMn099ol4ljtUlTAgFbJXqUnfYMZXxakgnlsoZo6I59BMRuPSYOm/vvzKmNccpECsUdV/g3aEeNP8ks3zB8IwsxYISRaEU3t/WRkMPuGAKtqs1GCQFi15CAlr9Av6dpDaAo8gGdJSIRgOkbtqdXRXhtZfCcUGUHRgh5ixSPQkSGAhdb8epPtOu96NU0+9bArprrHA+lj8PjB5et5MtL7EqX/lmd4DPN8mo/Ml/l0YDbjvX6RFa/3SScV5ree3+VoLAghlJW1ZtPXlhdGfvr8SSDU3GWFy7fmcGPkNbR7D7+9W3/ag6EHjJvYMOgR7H/UuEBu3zzZ6cSSH+5ylYT13mU8J8cHHtdfVicUR2wYr9bwTtDtmtk1bDNIE+bMTbaIeXfxzXq6TxMKz6wIGOtFtPbZY0H0eLb7gn1b1uEBqwiixo6RhW94JqqGtmBd0Rrv4I6HudOJCCDHpJnYWkmRvlmjg48MIk40pR5zAKYCVb6anAz9MmAGUf1StsDF1MUVUw4L6KHmjc26xB7V4rkEjoFr3HcltxxiI20VgRNBTHslMFw== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(36756003)(508600001)(6916009)(54906003)(4326008)(55016003)(107886003)(26005)(1076003)(6666004)(5660300002)(86362001)(8936002)(316002)(40460700003)(8676002)(70206006)(70586007)(36860700001)(2906002)(7696005)(6286002)(356005)(81166007)(2616005)(186003)(82310400004)(426003)(336012)(47076005)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 19:14:39.2657 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37982cfc-7d6e-4c91-ba1e-08d9fc80e5fa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4050 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 E-Switch DV flow is supported only when DV flow is supported and enabled. The mlx5_shared_dev_ctx_args_config() function ensures that when the environment does not support DV, the "dv_esw_en" flag is turned off. However, when the environment is supportive but the user has requested to disable it, the "dv_esw_en" flag remains on and causes the PMD to try to create an E-Switch through the Verbs engine. This patch adds check to ensure that "dv_esw_en" flag will be turned off when DV flow is disabled. Fixes: a13ec19c1993 ("net/mlx5: add shared device context config structure") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 09cd1367db..72b1e35673 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1298,6 +1298,11 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh, DRV_LOG(DEBUG, "E-Switch DV flow is not supported."); config->dv_esw_en = 0; } + if (config->dv_esw_en && !config->dv_flow_en) { + DRV_LOG(DEBUG, + "E-Switch DV flow is supported only when DV flow is enabled."); + config->dv_esw_en = 0; + } if (config->dv_miss_info && config->dv_esw_en) config->dv_xmeta_en = MLX5_XMETA_MODE_META16; if (!config->dv_esw_en && -- 2.25.1