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 E81F9A09EC; Wed, 19 Oct 2022 20:41:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39FA442C1A; Wed, 19 Oct 2022 20:41:32 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by mails.dpdk.org (Postfix) with ESMTP id 2383E42BFA for ; Wed, 19 Oct 2022 20:41:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MctEazQuC/uSqFMt6a4kf91PwSZ15xKZhxsr1RLTPaa5B0Lkzc4tKJKS/02aK/DhQZFY1CoVkU4OzX7Ki+PdRXwVKFLjkcf9DwrJ9vZX3y6S9ZkSWQXwArGCr2kjJbFHn0gtJlYQb3EZqgbXAKiJSYp1vad0B8QUXlL1ws62oYTKyjmvxDZDcWXIP4SPK9XgQkQFiN7FsUQp6uOS7nXo/izbjl6Cw6vv1MldgUgHUCN8hPHJaDVT5gaRmjXOxlwb4Ho0DIQ6temXwM3diLCzAV4yjDquL/ubWjtyPCvLXTAYZZvMqnHb0u7uiAl4Ho6sfa7G743kp8uJfqHK0MdjIg== 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=LnuVPaj2uWWUsGLhX2uhnrWfH0q/0iLExGGqbjs9Wtw=; b=l4vV7iNccP8kYYIv1KnvCS6wdUogpO52IFrV0+aL5W5I0Sg6CRekXS8nOy4Q/cXcVZTsRzxq1rxZd0CQyPdK+Mlh84GL73YAQtG58eMfKjjtCHZN/Iy4CIsbJ6VvR5eEnAE3sVl8MKXBYaVW39/F0FyqfYkgbu86AWdyb2VvwqC/QY3nNNCET2KBRI212xBj5k2FVY1AxUaTQ8J3dq3+oWcXanGCi4W62MJkODgV8j14FAfBwCKPTttyIW9G++71sNsbDkDxq/3xJRjl8NjCmaO1hK35yV3v+1xFELx6PY0Q+3jNfBC7iBkke2SmVcP/8mxpyJZPDpVmLwU2Cp0/zQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject 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=LnuVPaj2uWWUsGLhX2uhnrWfH0q/0iLExGGqbjs9Wtw=; b=QX3FgGFN5+oSX6wK7mu+7WIhGjy4G9JvOII6lygapRKFReTv5oAddA8ox9Py2W0i5Q61UND1/BVLsXsf3wQQj7EgKibKomnN1CT/xItBOstRzdrnx1rQzLeOBRXOk3sQne+RlsOxh9ymkCJxt6h6liCIfeaWaspVYk3z/S8fmqVHowOVHBiS6XYFV2lSiOPgglNuEL6egkaxbojMsO7de9P/JIfcUWAkg7du1gbpwBl14SShF3QN0NjWowK54fmaLab0EwzhSFO2zyggS97DFmvscsWujJtpH0ln/g4SDtD8Drq4nePIvs1QLO5Yc4cOzPmFwjV3HTkGQuVJYKJ0Ow== Received: from MW4PR04CA0334.namprd04.prod.outlook.com (2603:10b6:303:8a::9) by DM6PR12MB4169.namprd12.prod.outlook.com (2603:10b6:5:215::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Wed, 19 Oct 2022 18:41:29 +0000 Received: from CO1NAM11FT073.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::3) by MW4PR04CA0334.outlook.office365.com (2603:10b6:303:8a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Wed, 19 Oct 2022 18:41:29 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=nvidia.com; Received-SPF: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT073.mail.protection.outlook.com (10.13.174.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Wed, 19 Oct 2022 18:41:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 19 Oct 2022 11:41:13 -0700 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.29; Wed, 19 Oct 2022 11:41:11 -0700 From: Michael Savisko To: CC: , , , , Matan Azrad Subject: [PATCH v2 2/4] net/mlx5: introduce new mlx5 action flag Date: Wed, 19 Oct 2022 21:40:05 +0300 Message-ID: <20221019184007.1032874-3-michaelsav@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221019184007.1032874-1-michaelsav@nvidia.com> References: <20221019184007.1032874-1-michaelsav@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT073:EE_|DM6PR12MB4169:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d96ca97-4b47-4253-4e1e-08dab2018944 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PZ0yqQ+LWurE5k5Ag766dYdFRFaVT8SiFOSr++K7sEYgz+6J0qwA4WkC2U3lQKEpjxv1yOM5ufaA//4OhepWudSUQmqtNkKchSK97mw1ZcY64j8/JydY6+rCvm2vUL+5rNaezl0bx5O5li42BZpIIYs/L3Pu3zjAVoXcJlwiHuAf6i5UpGmLXketpme1ZaMEUEujbNtlaEXPNOUEO2W9gZjhcJTWNy/05FdoE9Xi59JgbGZ+m14+3dgylKVehu62LGMFnHpRwtPqvYltthqY6ACqygYgpDjywcOZhys2MJXA5/jll50UbpsT+Fuz6lJTAs/SdE00dC8lDx+C//+0AumC8WhjH+bB05vbeojfLYsC76qEchD0bdMrZD5JmdNxhrbkgyI7YW4rS+jx529pmuHPPFcFHFHN5VH7HAJ6cIpyk/Flrb7ECUKwHisQjB9iBbwUMCGqbApO4cBCoVNAMYcljX6G0g5zMmqPBhbZOr9KXtz3OmBSEaS1LUnJvGJMhxtvwVnphBKQThoXkzvTmp0ZDxFVtR2juNhq04VSFu5mGgkXVFcuPlztmLs+IJvCuHuYYT3heU7s2hxKLfB5cl95o8PHlZQZAocpzZHlaekXLK7/RrNcicJUILMKgoRTRCSmgYCf2+pXWKxnsp13QTDCXus3eoGCTFk2IjCgBmun62wvhz1wuABhgHnm8lO7txVPWhv43XzV++P/8OQhYsO2jIUblyBmIyoxsCkO5/y3zXVm9bn7oMN3EFOlEazqezKZ5qnkYnCd5+qDIMMdJg== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(316002)(6916009)(4326008)(186003)(7696005)(2616005)(40460700003)(36756003)(54906003)(26005)(8936002)(16526019)(2906002)(86362001)(41300700001)(6286002)(83380400001)(47076005)(6666004)(336012)(107886003)(70206006)(70586007)(426003)(40480700001)(55016003)(8676002)(1076003)(5660300002)(82310400005)(82740400003)(36860700001)(7636003)(356005)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 18:41:29.2138 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d96ca97-4b47-4253-4e1e-08dab2018944 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT073.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4169 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 Add new mlx5 action flag MLX5_FLOW_ACTION_SEND_TO_KERNEL. Add element MLX5_FLOW_FATE_SEND_TO_KERNEL in enum mlx5_flow_fate_type. For that purpose field 'fate_action' in structure mlx5_flow_handle must be expanded from 3 bits to 4 bits. Signed-off-by: Michael Savisko Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.h | 7 +++++-- drivers/net/mlx5/mlx5_flow_dv.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 0fa1735b1a..18a77ec619 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -277,12 +277,14 @@ enum mlx5_feature_name { #define MLX5_FLOW_ACTION_MODIFY_FIELD (1ull << 39) #define MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY (1ull << 40) #define MLX5_FLOW_ACTION_CT (1ull << 41) +#define MLX5_FLOW_ACTION_SEND_TO_KERNEL (1ull << 42) #define MLX5_FLOW_FATE_ACTIONS \ (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | \ MLX5_FLOW_ACTION_RSS | MLX5_FLOW_ACTION_JUMP | \ MLX5_FLOW_ACTION_DEFAULT_MISS | \ - MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY) + MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY | \ + MLX5_FLOW_ACTION_SEND_TO_KERNEL) #define MLX5_FLOW_FATE_ESWITCH_ACTIONS \ (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID | \ @@ -477,6 +479,7 @@ enum mlx5_flow_fate_type { MLX5_FLOW_FATE_DEFAULT_MISS, MLX5_FLOW_FATE_SHARED_RSS, MLX5_FLOW_FATE_MTR, + MLX5_FLOW_FATE_SEND_TO_KERNEL, MLX5_FLOW_FATE_MAX, }; @@ -709,7 +712,7 @@ struct mlx5_flow_handle { void *drv_flow; /**< pointer to driver flow object. */ uint32_t split_flow_id:27; /**< Sub flow unique match flow id. */ uint32_t is_meter_flow_id:1; /**< Indicate if flow_id is for meter. */ - uint32_t fate_action:3; /**< Fate action type. */ + uint32_t fate_action:4; /**< Fate action type. */ union { uint32_t rix_hrxq; /**< Hash Rx queue object index. */ uint32_t rix_jump; /**< Index to the jump action resource. */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 91f287af5c..6c355efed7 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7970,6 +7970,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, * list it here as a supported type */ break; +#ifdef HAVE_MLX5DV_DR_ACTION_CREATE_DEST_ROOT_TABLE + case RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL: + action_flags |= MLX5_FLOW_ACTION_SEND_TO_KERNEL; + ++actions_n; + break; +#endif default: return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, @@ -13694,6 +13700,11 @@ flow_dv_translate(struct rte_eth_dev *dev, actions_n++; action_flags |= MLX5_FLOW_ACTION_CT; break; + case RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL: + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + NULL, "send to kernel action is not supported."); + break; case RTE_FLOW_ACTION_TYPE_END: actions_end = true; if (mhdr_res->actions_num) { @@ -14742,6 +14753,12 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev, flow_dv_port_id_action_resource_release(dev, handle->rix_port_id_action); break; + case MLX5_FLOW_FATE_SEND_TO_KERNEL: + /* In case of send_to_kernel action the actual release of + * resource is done when all shared DR resources are released + * since this resource is created once and always reused. + */ + break; default: DRV_LOG(DEBUG, "Incorrect fate action:%d", handle->fate_action); break; -- 2.27.0