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 44D38A00BE; Thu, 10 Feb 2022 17:30:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9EC341190; Thu, 10 Feb 2022 17:29:58 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) by mails.dpdk.org (Postfix) with ESMTP id 2EEE841161 for ; Thu, 10 Feb 2022 17:29:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+P5OxW2QMLB38wFJp2CZcv1cUQJpQ7MICrQvuLV/Na06+9cyEpY5ITLXZcmJnzR2CgRH7I4Ox5N/9ug7uEe7wFRwhuxYDJAydd2Pv/xuc0MrLRzBOy3NoAjoVIwrJ84nphHez1P070y7/GaB9hSAlF1txxedQxvzkakCOc5nmW0ByOG5ifhQ71ZM1XTroQsyH6Y61dbXaqS3QbcywLMVWT6D8SWZr7TSPZRWygqiOkUkSW0zPW3QPPMPvei7c10HfwVoOPULOF1zYygksi3D0cu2g7cpVY9GLHoU/vc5M818CPwUgQov9MI41DpgMrQqUGwGT0lZBXcglIeRokIZg== 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=tapSWVmXbZvPTZRHYyGV6ZqRwsKtQjk9lfDR12QfRCs=; b=fBsfKi8hessi53aojzfDLZ/Ut+M+FiCN9ln0lHqrohaFwq3AqcStppjNT3dq/TgfTYGP6ihD1SwvYVKSfYpzfj2nhjZQJxNpTlk/vAA/NZ0QH4jwIC/glb/uj0otaq7lUdOUWkT1SdknZA6iYi+/0TeY7gKvH+NoEQm02h2O0dpbf6v2os/hdsoFednb7Xf8JtM99GJoRd8nj6MWbZZSkRds81LPKlGgkYEi+EhYXrElnXFOXMqhAhiDNc8Bg8XUTAcod1DIih5tpcSApMxU1U4gwVeFHOhGNZ8hMA+VKNL4v18k9rcQDf5Ky90pr8Gr4juFkpVJ5Pk9oM7QRWyjZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=tapSWVmXbZvPTZRHYyGV6ZqRwsKtQjk9lfDR12QfRCs=; b=lvfnTnaTf6jbZAGs9jU1NcMSHOEGiqrnpa1Iwqlp+ZCf8RYoLixJBTFqfDZDBbYDk2hynOY9pbVs6D7J9ftHESB5ZeyMkdQsMzgVlzKIGFrf1u610lHVwuPI/DO9lWT9+Nd6zmuhQZ8SdSKzoQ0fRX4YPFXMReuC+33jTgYoe9FVjJXpdadbr+13AemRLvA+VKpIMndFLi7CqYCjk6T6dV7EUCJTu83dYf0T06oKrPGQDCkycjf8cXH9at3btwztaaWGJFK3uObbofRw9kK8s4D0cYaBkVI6kzQOgCyZ1kasYgNfcDnZtI/y4+DsPCZL8V+/GTkwcQtO8K+V4WkKPw== Received: from BN9PR03CA0327.namprd03.prod.outlook.com (2603:10b6:408:112::32) by CH0PR12MB5387.namprd12.prod.outlook.com (2603:10b6:610:d6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Thu, 10 Feb 2022 16:29:51 +0000 Received: from BN8NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::67) by BN9PR03CA0327.outlook.office365.com (2603:10b6:408:112::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 16:29:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by BN8NAM11FT062.mail.protection.outlook.com (10.13.177.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 16:29:50 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 10 Feb 2022 16:29:49 +0000 Received: from nvidia.com (10.126.230.35) 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.9; Thu, 10 Feb 2022 08:29:47 -0800 From: Suanming Mou To: , CC: , , Subject: [PATCH 02/13] net/mlx5: introduce hardware steering enable routine Date: Thu, 10 Feb 2022 18:29:15 +0200 Message-ID: <20220210162926.20436-3-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20220210162926.20436-1-suanmingm@nvidia.com> References: <20220210162926.20436-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bc13c40-5ed6-4208-2f7b-08d9ecb28f9d X-MS-TrafficTypeDiagnostic: CH0PR12MB5387:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hyYCnosgFipD8+6kYbZ4g06+tAu4GB+odjB7GuQC7jL4Ejod1p7zuQY0rqHVD0UFgmPO08G3WTD7HXCEKUIzrDi4x0wnU1cpWuFYBjvssD5tLaBuoxNTWJU/u8+SsjDK6hp+h1ETpdWK+2fc3eJc5sjjf5qZ74ym/XQuxYo2X3a8PclqgO3psR+x1X1H2TgPTPcaGc9t88QpCivaLs59phXNNS5/vsQl8xbj7Fn11/t1sl7fFbLSvqNN8tA9Og+RvDcDz1Vo9C5W6PCNNuhM7RE0hJ3ZROxC6s1RdxpH8jaSNNTk4ZhpImW49pgLN/2juNdhnno+kMxFJonc3tqE3Fwoa6BNBmLlCS/AlybYEItcm3QtgFRGZUABUbH7pxgJnzNZ74ag5psCIJ5Xp6sqf7Uglp7Rdh7lS0Qyyn8U3aqaDa/2OyBkOYWVt/c/1k5Of9H/tuPSOhiA+m8UUVfwUhcnsyP/gqLByns8OS7GzC+jqAqo4BSa4j5CgeRP2K/2zGQ+3/giVpL2XoiMWv1ZUSVflKuhCjau408zUHBrRWugacxJP7HV4lcB3SVSlj0M1X50d/wzu/Vg1nef6eb7FX8UVircdUSFdxg7gve+OfpmxdnIwDCR74e3VPfj1swlJnp9aqCOzOVEsOCJ+ddMrCxX9xGvQUE41KpnaAmk+v+3/oB3nKXlkK3hMr7s09L9PqZ6cwZEDTS9Vx6H9Js/hrw9ulJNMxpQuiuxBPTTzTIwzueacoTU6NeF+a+8asw9 X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(26005)(110136005)(54906003)(82310400004)(86362001)(316002)(36756003)(8936002)(6636002)(70206006)(70586007)(8676002)(4326008)(508600001)(5660300002)(356005)(83380400001)(81166007)(1076003)(7696005)(40460700003)(426003)(186003)(16526019)(2906002)(55016003)(6286002)(6666004)(336012)(47076005)(36860700001)(2616005)(36900700001)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 16:29:50.5694 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc13c40-5ed6-4208-2f7b-08d9ecb28f9d 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.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5387 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 As the new hardware steering operation will be implemented under the new rte_flow_q APIs. This is not compatible with the existing rte_flow PMD's Direct Rules flow operation routine. This commit introduces an extra dv_flow_en = 2 to specify the new flow operation initialize routine. Signed-off-by: Suanming Mou --- drivers/net/mlx5/linux/mlx5_os.c | 4 ++++ drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5.h | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index aecdc5a68a..52e52a4ad7 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -295,6 +295,8 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) err = mlx5_alloc_table_hash_list(priv); if (err) goto error; + if (priv->config.dv_flow_en == 2) + return 0; /* The resources below are only valid with DV support. */ #ifdef HAVE_IBV_FLOW_DV_SUPPORT /* Init port id action list. */ @@ -1712,6 +1714,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->drop_queue.hrxq = mlx5_drop_action_create(eth_dev); if (!priv->drop_queue.hrxq) goto error; + if (priv->config.dv_flow_en == 2) + return eth_dev; /* Port representor shares the same max priority with pf port. */ if (!priv->sh->flow_priority_check_flag) { /* Supported Verbs flow priority number detection. */ diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 67eda41a60..a4826a583b 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1933,7 +1933,7 @@ mlx5_args_check(const char *key, const char *val, void *opaque) } else if (strcmp(MLX5_DV_ESW_EN, key) == 0) { config->dv_esw_en = !!tmp; } else if (strcmp(MLX5_DV_FLOW_EN, key) == 0) { - config->dv_flow_en = !!tmp; + config->dv_flow_en = tmp; } else if (strcmp(MLX5_DV_XMETA_EN, key) == 0) { if (tmp != MLX5_XMETA_MODE_LEGACY && tmp != MLX5_XMETA_MODE_META16 && diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 737ad6895c..f3b991e549 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -259,7 +259,8 @@ struct mlx5_dev_config { unsigned int l3_vxlan_en:1; /* Enable L3 VXLAN flow creation. */ unsigned int vf_nl_en:1; /* Enable Netlink requests in VF mode. */ unsigned int dv_esw_en:1; /* Enable E-Switch DV flow. */ - unsigned int dv_flow_en:1; /* Enable DV flow. */ + /* Enable DV flow. 1 means SW steering, 2 means HW steering. */ + unsigned int dv_flow_en:2; unsigned int dv_xmeta_en:2; /* Enable extensive flow metadata. */ unsigned int lacp_by_user:1; /* Enable user to manage LACP traffic. */ -- 2.25.1