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 450CCA034C; Wed, 21 Dec 2022 09:40:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B19742D27; Wed, 21 Dec 2022 09:40:47 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2055.outbound.protection.outlook.com [40.107.95.55]) by mails.dpdk.org (Postfix) with ESMTP id ABD8642D20 for ; Wed, 21 Dec 2022 09:40:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MGI3o1FPCkh/w9VBwb7w+4oKzD6J6SYgAZjV4xOuWT2KLy5L5xOEt90bo2yy8+t/Ized4Ek2yeksd6Sy0rURXBLgwxQKEBna7ob6WQLHe+yaI1mo72r+5aJO2woBztUu7a3mdwIoBz1SKctevqHSOHTVxVbg0WrvDzZXTPnCNyiYscr4is2jiK7reole2ySnI0bk7HbKG1AF0xRzGUM0KlmSc9Zhbn2CAqIBfV32rtVn/gOVU9NXHydQuudjHQ5E9NqtTdsAYqunX34Jr/fqHGbWsB4GnDhwE51lut1rfynEyAMt/2RIfQZgSWzmHZkOjNsR7JauQECqejcVc7d8qQ== 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=qKD/beZ8HYMOo0Axqwo79FTadLxyfPR+G7yt0LgCyL4=; b=GN7zJLPSfC6F8z48yDBCAWf9n+jK/B2DCPXvHjqZ2lEQeUPyoLdhrj8rWueSrYuUzGv7Lbrkxm4SToaLQd3+ZN3ybxvSdzqyT1+EFfaVb9IN/bfTnnOmVeqRo64nj37HvLOb3S3+hCopJkE+gJFshaAo0cT+nDlbw34AgQ31nnzOLxUD6J5rS5Vzzm+ckVgRi9a7kfyiO8O3GMZRgZ6x6fLwBghtMLkS/M764vwnkG7dsm69LnP2Yyd+9h+iKAQslEBr/nvNKVspkvrmZG+FViJtB8i8tYtHSGjOUzwSdDhVDvt3vgmx7HzcVPYjcuqtDVgZnj7gKLMvBSS/bTk0UA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net 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=qKD/beZ8HYMOo0Axqwo79FTadLxyfPR+G7yt0LgCyL4=; b=heCTbMQw//zz5WG4/gzJuGkWcvJmUUDkot5PWGhPhtGCb5v45ptMtGhO1+8w1zMO21+P0u68nuel0S/JSt73YBbN3UrD9uooajJ4L67xp00PZnZKKO1gxj5pNVMc8fD72xMxFnBmPDNQDhDFetwXFKQw3GQOqBQIRfd6T6QmbjIwJVFV6IpC5StM7nD5PsKTM/glw18WFfvyiD6Be7L5yzoCgrpTb8h3/Iegc9pQRdQm/cB8yHv3DhjqFvSyE9ahybwZzIXjJ9eaK1vR2QqBoK79mAMpXoGu8FDUvO6I4lAYqfDBYEANrBplqKYf/1RfjOtXNVyjyZE/DDi1avE38A== Received: from MW4PR04CA0342.namprd04.prod.outlook.com (2603:10b6:303:8a::17) by PH7PR12MB7163.namprd12.prod.outlook.com (2603:10b6:510:202::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 08:40:43 +0000 Received: from CO1NAM11FT099.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8a:cafe::5c) by MW4PR04CA0342.outlook.office365.com (2603:10b6:303:8a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Wed, 21 Dec 2022 08:40:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT099.mail.protection.outlook.com (10.13.175.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.6 via Frontend Transport; Wed, 21 Dec 2022 08:40:42 +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.36; Wed, 21 Dec 2022 00:40:27 -0800 Received: from nvidia.com (10.126.231.37) 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.36; Wed, 21 Dec 2022 00:40:25 -0800 From: Rongwei Liu To: , , , CC: , Subject: [RFC 4/9] net/mlx5: enable hws flex item create Date: Wed, 21 Dec 2022 10:39:55 +0200 Message-ID: <20221221084000.3680015-5-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221221084000.3680015-1-rongweil@nvidia.com> References: <20221221084000.3680015-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT099:EE_|PH7PR12MB7163:EE_ X-MS-Office365-Filtering-Correlation-Id: d30a6ee1-5efc-40c2-840a-08dae32f0be9 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xe2n7/YfR7M7HPM22gw48NRoJqh2x2pvsChyf5MZNQt8FhuqPzMCJ28Y4Nt8l9UfsqceHd50lsa1ALTYIKuLQygKn59PsycbscyGFFFCQbEBYIt3BsnvZpZqOqCVctAoEhDjCPPk2/9RZIXxh6iI7KJUuIrBX7N1v3A6Xzk1Nem4e1P+Q1ykNFqgabcDfnmd0IRYTaLVsBeTT6i0SibgwQtsioFi2ca4lWmPH51UvAXmIBv5wbREXj/4gFkLHGryRv5z2qUarrC4qAzU6SAR22jHuZz9EVaQilcul9DIPfCawcHipxwcbLNpYFGjzqMyanth9C2JJXL382gzYA+2WI+Ymo/uca8RfHQ9DYpv3sPJhKfnmWSlktShAZHKNXC3HS3+UKJsvFP1/myHxMyhTZEgPMh05OX1gveO5MU4rgbjCp5gsYHlUhU/dgRaUrVUsAft/2b7EXatlz+1Rp48RGdvKqN8eGPCJLy4sokg3319LP9EWF7JnsfyBgiQX0E3qWaqZWqdOk7XBExp3x8H1d6uKuYIALR/ABqk2OY2b/Ky7w1zZ8GOx6nG4zdm3HZZLb1UPV2xAPESiAq5xgokG40UsSXiy1AvlYd7LdpplOH8E1/68OckhHOlHSYNWjuGUr4RJ4h4rGDLTFw5Tth6nKtsko9EDAFevpIxVeByAHWskEUFZNK277XjrNNLO3oDPXAfsVHoIZVAJaqG0q4PZw== 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)(376002)(136003)(39860400002)(346002)(451199015)(46966006)(40470700004)(36840700001)(16526019)(1076003)(6286002)(186003)(6666004)(26005)(107886003)(2616005)(86362001)(2906002)(478600001)(7696005)(5660300002)(336012)(47076005)(316002)(54906003)(426003)(110136005)(82310400005)(70586007)(83380400001)(70206006)(36756003)(8936002)(41300700001)(8676002)(4326008)(36860700001)(82740400003)(40460700003)(40480700001)(356005)(55016003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 08:40:42.7449 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d30a6ee1-5efc-40c2-840a-08dae32f0be9 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: CO1NAM11FT099.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7163 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 Enable flex item create and destroy with dv_flow_en=2 Signed-off-by: Rongwei Liu --- drivers/net/mlx5/linux/mlx5_os.c | 27 +++++++++++++++------------ drivers/net/mlx5/mlx5_flow_hw.c | 2 ++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index a71474c90a..f5b3edea99 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -474,10 +474,20 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) err = mlx5_alloc_table_hash_list(priv); if (err) goto error; - if (priv->sh->config.dv_flow_en == 2) - return 0; /* The resources below are only valid with DV support. */ #ifdef HAVE_IBV_FLOW_DV_SUPPORT + /* Init shared flex parsers list, no need lcore_share */ + snprintf(s, sizeof(s), "%s_flex_parsers_list", sh->ibdev_name); + sh->flex_parsers_dv = mlx5_list_create(s, sh, false, + mlx5_flex_parser_create_cb, + mlx5_flex_parser_match_cb, + mlx5_flex_parser_remove_cb, + mlx5_flex_parser_clone_cb, + mlx5_flex_parser_clone_free_cb); + if (!sh->flex_parsers_dv) + goto error; + if (priv->sh->config.dv_flow_en == 2) + return 0; /* Init port id action list. */ snprintf(s, sizeof(s), "%s_port_id_action_list", sh->ibdev_name); sh->port_id_action_list = mlx5_list_create(s, sh, true, @@ -518,16 +528,9 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) flow_dv_dest_array_clone_free_cb); if (!sh->dest_array_list) goto error; - /* Init shared flex parsers list, no need lcore_share */ - snprintf(s, sizeof(s), "%s_flex_parsers_list", sh->ibdev_name); - sh->flex_parsers_dv = mlx5_list_create(s, sh, false, - mlx5_flex_parser_create_cb, - mlx5_flex_parser_match_cb, - mlx5_flex_parser_remove_cb, - mlx5_flex_parser_clone_cb, - mlx5_flex_parser_clone_free_cb); - if (!sh->flex_parsers_dv) - goto error; +#else + if (priv->sh->config.dv_flow_en == 2) + return 0; #endif #ifdef HAVE_MLX5DV_DR void *domain; diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 20c71ff7f0..44953451d5 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8336,6 +8336,8 @@ const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = { .query = flow_hw_query, .get_aged_flows = flow_hw_get_aged_flows, .get_q_aged_flows = flow_hw_get_q_aged_flows, + .item_create = flow_dv_item_create, + .item_release = flow_dv_item_release, }; /** -- 2.27.0