From patchwork Thu Jan 27 15:39:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 106626 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3216EA04A6; Thu, 27 Jan 2022 16:41:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 580CD42871; Thu, 27 Jan 2022 16:40:17 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2085.outbound.protection.outlook.com [40.107.93.85]) by mails.dpdk.org (Postfix) with ESMTP id 8C75D42854 for ; Thu, 27 Jan 2022 16:40:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZeHQEjaXMD5aSJqTisGYP5YlUkJcwlkbsxlI/uWgDL40u7mCYOA3du/5E6pvEcnUXDjpbiSIraduKtwbS57M0WmMwrLhb1vwMGFH49cyqUjPK/r1NXGArNCshbiu9f78rKYLKN1ANQG9J0wwmKVYgiNhrStNzxs2q+WhNv8eZyG/cAKJFqHGq/yrh/m33UJwBUY1tZJOJncGviPkWLNlB/k86zuMl8pgHTvH2chYnlbcRqeyoO7Rb7NdZgi2KoCbCRr3nKTCLItP0kTY5zC6iQFZLMCUnwQLptlbIlsmELffaDl9dFAe/ppENi8OTMP5iv3omR/1wdM8JdFGIIaGQ== 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=5I9UwXq8ByeKDQxZTBe6xJRB32u6SnO0EVlJqQGNa/0=; b=HQk4tTOVEpIeQ+QqIns98+7zpnzl8HyBA3Avql5oroVUf9o4MmG7Tbdw36QTWQ4GVDUgIMbMcvzgdUb/YZivSw4CFiVNvitXq9vbikEWj5iSccAZQxOjSc3cUbkZNTtxdIndF3hqvRoC0IM/hpXh23W5idUu5tcKvx0kvo1JdG0drYWmutN/X3TmLGsm4YmBcUTnuy+oKECliJa5xx7Z3tH4QeZule/wVcsUjy+dCSDP2HJRZb8YeviilhduLePvLaeI7y9KIg5KvObOd5lfT1IqiKtP3C8w9t11nG9lUUDNwBna0e4jENjnWIKtNYqnkINcEIJkf7532v3yeUYw2w== 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=5I9UwXq8ByeKDQxZTBe6xJRB32u6SnO0EVlJqQGNa/0=; b=KYHc/KhZ2FZgFrSl57dItBSfjMhQXNNQeZMmTlZMuASosQZUVrnPKwhGQ1htP2AaTQqbckr/kpR2ad4sp2HJQoMmCxqAZzNEABBbm/scyos1HE84FCkSabqAPjcoEumPqUV3moSTtJG+Pi0xvm+qPzEoRXJkfHSMIUeBOB+HWTdsEe/MNO4W+sA+QSzaDV7eSeE368/Oqo0je9eBHftvVte8+lWgfmK/Yte5emt5WoahAjs45z15R0KbphO9NqRsiL0A3fbMsiDBPV+k+FBgUv6+PRQfmpW2VLmkTwOSGwz66MoOZPiGlphmsL4jdHaLEltgNnl/w3gVDQ5Fhj6OcA== Received: from BN1PR13CA0027.namprd13.prod.outlook.com (2603:10b6:408:e2::32) by MWHPR12MB1567.namprd12.prod.outlook.com (2603:10b6:301:d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Thu, 27 Jan 2022 15:40:13 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e2:cafe::e8) by BN1PR13CA0027.outlook.office365.com (2603:10b6:408:e2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.5 via Frontend Transport; Thu, 27 Jan 2022 15:40:13 +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 BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4930.15 via Frontend Transport; Thu, 27 Jan 2022 15:40:12 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 27 Jan 2022 15:40:11 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Thu, 27 Jan 2022 07:40:11 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9 via Frontend Transport; Thu, 27 Jan 2022 07:40:09 -0800 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko Subject: [PATCH 08/20] net/mlx5: remove DevX flag duplication Date: Thu, 27 Jan 2022 17:39:38 +0200 Message-ID: <20220127153950.812953-9-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127153950.812953-1-michaelba@nvidia.com> References: <20220127153950.812953-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c019f24c-e138-4997-34f2-08d9e1ab4ec3 X-MS-TrafficTypeDiagnostic: MWHPR12MB1567:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZC66k4NmuxJrk5BWzOPL0JbxjUgDHBKDxSMqPbC6CK/N+9n62skXkC8fv2J/Z+s6a8wTOSqelQIPCFf6rJK/X9Qd9KQINbvhv5b1rccQ/bLe94iDtBQNpuN0PoV9Fr+l1lGIbviYvH/2yni8uVdrfs3J7k5pkmRnbahxlBf/glBZY24XWKZkdk15I/FUouZS0BYDltedTxSM5OfqcJ9VdvXPBltxGRYC1s/SmbrqEei/o14YfKGoftyW+a1cAuXdxRJIbpz6/Fwscx0LIqDTPuYeVwrl4tJa44Z5fWFHuTADYS0sCaJNgmSmQZv4k/aA9nWmo39MFmuupxOeVnceDEuKt8vBJ76EFg/e6mQtSayAr2Y1auWuLoemg23Yey5Wu8bJtNWMAqhZfOM1c1UepryGDb6UDaKi78XaW6amVU8XRkHrWLEk1qYXu8PLCoUaPK6cpcYMr+ZJCb/wm2IWsUsIYJf/k8qeHQIgzAv0gpvvX6o33Pdy30ixQzM1yfn22crfGxqC4Uq7ksguGN1Ide+Ga61yHzCLdW/qo85QI1v1T1RKNjjlJSj49gyzM1BGFdUdgdxNnp1YQbDqhDManeW4o2FmdQmIzdE+XATFfQ9UAa3XTMLIaoK5OpTuyvXWvbZhEc/rZhRQj6kGsQDJbIukrGK4hQhLSeh96LzSPE+TCtbnBFTycVCSfJJXczqyx5lrR/z/ROm+pK0jmjLJyw== 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)(86362001)(2906002)(83380400001)(336012)(55016003)(54906003)(6666004)(40460700003)(6916009)(426003)(7696005)(47076005)(5660300002)(36756003)(4326008)(70586007)(2616005)(6286002)(508600001)(8936002)(36860700001)(8676002)(186003)(356005)(70206006)(81166007)(82310400004)(30864003)(26005)(107886003)(316002)(1076003)(36900700001)(20210929001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 15:40:12.4209 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c019f24c-e138-4997-34f2-08d9e1ab4ec3 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: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1567 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 The sharing device context structure has a field named "devx" which indicates if DevX is supported. The common configure stracture has also field named "devx" with the same meaning. There is no need for this duplication, because there is a reference to the common structure from within the sharing device context structure. This patch removes it from sharing device context structure and uses the common config structure instead. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_os.c | 16 ++++++++-------- drivers/net/mlx5/linux/mlx5_verbs.c | 4 ++-- drivers/net/mlx5/mlx5.c | 3 +-- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_ethdev.c | 3 ++- drivers/net/mlx5/mlx5_flow.c | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 23 ++++++++++++----------- drivers/net/mlx5/mlx5_trigger.c | 2 +- drivers/net/mlx5/windows/mlx5_os.c | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 39ca145e4a..b579be25cb 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -682,7 +682,7 @@ mlx5_flow_counter_mode_config(struct rte_eth_dev *dev __rte_unused) fallback = true; #else fallback = false; - if (!sh->devx || !priv->config.dv_flow_en || + if (!sh->cdev->config.devx || !priv->config.dv_flow_en || !hca_attr->flow_counters_dump || !(hca_attr->flow_counter_bulk_alloc_bitmap & 0x4) || (mlx5_flow_dv_discover_counter_offset_support(dev) == -ENOTSUP)) @@ -1316,7 +1316,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->mps == MLX5_MPW_ENHANCED ? "enhanced " : config->mps == MLX5_MPW ? "legacy " : "", config->mps != MLX5_MPW_DISABLED ? "enabled" : "disabled"); - if (sh->devx) { + if (sh->cdev->config.devx) { sh->steering_format_version = hca_attr->steering_format_version; /* Check for LRO support. */ if (config->dest_tir && hca_attr->lro_cap && @@ -1434,13 +1434,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->cqe_comp = 0; } if (config->cqe_comp_fmt == MLX5_CQE_RESP_FORMAT_FTAG_STRIDX && - (!sh->devx || !hca_attr->mini_cqe_resp_flow_tag)) { + (!sh->cdev->config.devx || !hca_attr->mini_cqe_resp_flow_tag)) { DRV_LOG(WARNING, "Flow Tag CQE compression" " format isn't supported."); config->cqe_comp = 0; } if (config->cqe_comp_fmt == MLX5_CQE_RESP_FORMAT_L34H_STRIDX && - (!sh->devx || !hca_attr->mini_cqe_resp_l3_l4_tag)) { + (!sh->cdev->config.devx || !hca_attr->mini_cqe_resp_l3_l4_tag)) { DRV_LOG(WARNING, "L3/L4 Header CQE compression" " format isn't supported."); config->cqe_comp = 0; @@ -1463,7 +1463,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, hca_attr->log_max_static_sq_wq); DRV_LOG(DEBUG, "WQE rate PP mode is %ssupported", hca_attr->qos.wqe_rate_pp ? "" : "not "); - if (!sh->devx) { + if (!sh->cdev->config.devx) { DRV_LOG(ERR, "DevX is required for packet pacing"); err = ENODEV; goto error; @@ -1519,7 +1519,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->dev_port); } } - if (sh->devx) { + if (sh->cdev->config.devx) { uint32_t reg[MLX5_ST_SZ_DW(register_mtutc)]; err = hca_attr->access_register_user ? @@ -1676,7 +1676,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, if (mlx5_flex_item_port_init(eth_dev) < 0) goto error; } - if (sh->devx && config->dv_flow_en && config->dest_tir) { + if (sh->cdev->config.devx && config->dv_flow_en && config->dest_tir) { priv->obj_ops = devx_obj_ops; mlx5_queue_counter_id_prepare(eth_dev); priv->obj_ops.lb_dummy_queue_create = @@ -2735,7 +2735,7 @@ mlx5_os_dev_shared_handler_install(struct mlx5_dev_ctx_shared *sh) rte_intr_fd_set(sh->intr_handle, -1); } } - if (sh->devx) { + if (sh->cdev->config.devx) { #ifdef HAVE_IBV_DEVX_ASYNC sh->intr_handle_devx = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED); diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c index 2b6eef44a7..722017efa4 100644 --- a/drivers/net/mlx5/linux/mlx5_verbs.c +++ b/drivers/net/mlx5/linux/mlx5_verbs.c @@ -998,7 +998,7 @@ mlx5_txq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx) qp.comp_mask = MLX5DV_QP_MASK_UAR_MMAP_OFFSET; #ifdef HAVE_IBV_FLOW_DV_SUPPORT /* If using DevX, need additional mask to read tisn value. */ - if (priv->sh->devx && !priv->sh->tdn) + if (priv->sh->cdev->config.devx && !priv->sh->tdn) qp.comp_mask |= MLX5DV_QP_MASK_RAW_QP_HANDLES; #endif obj.cq.in = txq_obj->cq; @@ -1042,7 +1042,7 @@ mlx5_txq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx) * This is done once per port. * Will use this value on Rx, when creating matching TIR. */ - if (priv->sh->devx && !priv->sh->tdn) { + if (priv->sh->cdev->config.devx && !priv->sh->tdn) { ret = mlx5_devx_cmd_qp_query_tis_td(txq_obj->qp, qp.tisn, &priv->sh->tdn); if (ret) { diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 920b174b96..b371a87355 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1182,7 +1182,6 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn, pthread_mutex_init(&sh->txpp.mutex, NULL); sh->numa_node = spawn->cdev->dev->numa_node; sh->cdev = spawn->cdev; - sh->devx = sh->cdev->config.devx; if (spawn->bond_info) sh->bond = *spawn->bond_info; err = mlx5_os_get_dev_attr(sh->cdev, &sh->device_attr); @@ -1205,7 +1204,7 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn, sh->port[i].ih_port_id = RTE_MAX_ETHPORTS; sh->port[i].devx_ih_port_id = RTE_MAX_ETHPORTS; } - if (sh->devx) { + if (sh->cdev->config.devx) { sh->td = mlx5_devx_cmd_create_td(sh->cdev->ctx); if (!sh->td) { DRV_LOG(ERR, "TD allocation failure"); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index ee485343ff..6bc7a34f60 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1146,7 +1146,6 @@ struct mlx5_flex_item { struct mlx5_dev_ctx_shared { LIST_ENTRY(mlx5_dev_ctx_shared) next; uint32_t refcnt; - uint32_t devx:1; /* Opened with DV. */ uint32_t flow_hit_aso_en:1; /* Flow Hit ASO is supported. */ uint32_t steering_format_version:4; /* Indicates the device steering logic format. */ diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 5b0eee3321..801c467bba 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -723,7 +723,8 @@ mlx5_hairpin_cap_get(struct rte_eth_dev *dev, struct rte_eth_hairpin_cap *cap) struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_dev_config *config = &priv->config; - if (!priv->sh->devx || !config->dest_tir || !config->dv_flow_en) { + if (!priv->sh->cdev->config.devx || !config->dest_tir || + !config->dv_flow_en) { rte_errno = ENOTSUP; return -rte_errno; } diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5a21803e18..907f3fd75a 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -9966,7 +9966,7 @@ mlx5_flow_discover_priorities(struct rte_eth_dev *dev) type = mlx5_flow_os_get_type(); if (type == MLX5_FLOW_TYPE_MAX) { type = MLX5_FLOW_TYPE_VERBS; - if (priv->sh->devx && priv->config.dv_flow_en) + if (priv->sh->cdev->config.devx && priv->config.dv_flow_en) type = MLX5_FLOW_TYPE_DV; } fops = flow_get_drv_ops(type); diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index b0ed9f93a0..4e60a54df3 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3291,7 +3291,7 @@ flow_dv_validate_action_count(struct rte_eth_dev *dev, bool shared, { struct mlx5_priv *priv = dev->data->dev_private; - if (!priv->sh->devx) + if (!priv->sh->cdev->config.devx) goto notsup_err; if (action_flags & MLX5_FLOW_ACTION_COUNT) return rte_flow_error_set(error, EINVAL, @@ -5302,8 +5302,8 @@ flow_dv_validate_action_age(uint64_t action_flags, struct mlx5_priv *priv = dev->data->dev_private; const struct rte_flow_action_age *age = action->conf; - if (!priv->sh->devx || (priv->sh->cmng.counter_fallback && - !priv->sh->aso_age_mng)) + if (!priv->sh->cdev->config.devx || + (priv->sh->cmng.counter_fallback && !priv->sh->aso_age_mng)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -5587,7 +5587,8 @@ flow_dv_validate_action_sample(uint64_t *action_flags, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "ratio value starts from 1"); - if (!priv->sh->devx || (sample->ratio > 0 && !priv->sampler_en)) + if (!priv->sh->cdev->config.devx || + (sample->ratio > 0 && !priv->sampler_en)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -6175,7 +6176,7 @@ flow_dv_counter_alloc(struct rte_eth_dev *dev, uint32_t age) age ? MLX5_COUNTER_TYPE_AGE : MLX5_COUNTER_TYPE_ORIGIN; uint32_t cnt_idx; - if (!priv->sh->devx) { + if (!priv->sh->cdev->config.devx) { rte_errno = ENOTSUP; return 0; } @@ -6498,7 +6499,7 @@ flow_dv_mtr_alloc(struct rte_eth_dev *dev) struct mlx5_aso_mtr_pool *pool; uint32_t mtr_idx = 0; - if (!priv->sh->devx) { + if (!priv->sh->cdev->config.devx) { rte_errno = ENOTSUP; return 0; } @@ -12515,7 +12516,7 @@ flow_dv_aso_ct_alloc(struct rte_eth_dev *dev, struct rte_flow_error *error) uint32_t ct_idx; MLX5_ASSERT(mng); - if (!priv->sh->devx) { + if (!priv->sh->cdev->config.devx) { rte_errno = ENOTSUP; return 0; } @@ -12953,7 +12954,7 @@ flow_dv_translate(struct rte_eth_dev *dev, } break; case RTE_FLOW_ACTION_TYPE_COUNT: - if (!priv->sh->devx) { + if (!priv->sh->cdev->config.devx) { return rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -15834,7 +15835,7 @@ flow_dv_query_count(struct rte_eth_dev *dev, uint32_t cnt_idx, void *data, struct mlx5_priv *priv = dev->data->dev_private; struct rte_flow_query_count *qc = data; - if (!priv->sh->devx) + if (!priv->sh->cdev->config.devx) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -15887,7 +15888,7 @@ flow_dv_query_count_ptr(struct rte_eth_dev *dev, uint32_t cnt_idx, { struct mlx5_priv *priv = dev->data->dev_private; - if (!priv->sh->devx || !action_ptr) + if (!priv->sh->cdev->config.devx || !action_ptr) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -17491,7 +17492,7 @@ flow_dv_counter_query(struct rte_eth_dev *dev, uint32_t counter, bool clear, uint64_t inn_pkts, inn_bytes; int ret; - if (!priv->sh->devx) + if (!priv->sh->cdev->config.devx) return -1; ret = _flow_dv_query_count(dev, counter, &inn_pkts, &inn_bytes); diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 4bb0331464..1dfe7da435 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -1104,7 +1104,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) dev->data->port_id, strerror(rte_errno)); goto error; } - if ((priv->sh->devx && priv->config.dv_flow_en && + if ((priv->sh->cdev->config.devx && priv->config.dv_flow_en && priv->config.dest_tir) && priv->obj_ops.lb_dummy_queue_create) { ret = priv->obj_ops.lb_dummy_queue_create(dev); if (ret) diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 3d8bd2e100..5396365ec9 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -275,7 +275,7 @@ mlx5_flow_counter_mode_config(struct rte_eth_dev *dev __rte_unused) fallback = true; #else fallback = false; - if (!sh->devx || !priv->config.dv_flow_en || + if (!sh->cdev->config.devx || !priv->config.dv_flow_en || !hca_attr->flow_counters_dump || !(hca_attr->flow_counter_bulk_alloc_bitmap & 0x4) || (mlx5_flow_dv_discover_counter_offset_support(dev) == -ENOTSUP)) @@ -476,7 +476,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, DRV_LOG(WARNING, "Rx CQE compression isn't supported."); config->cqe_comp = 0; } - if (sh->devx) { + if (sh->cdev->config.devx) { hca_attr = &sh->cdev->config.hca_attr; config->hw_csum = hca_attr->csum_cap; DRV_LOG(DEBUG, "checksum offloading is %ssupported", @@ -661,7 +661,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, goto error; } } - if (sh->devx) { + if (sh->cdev->config.devx) { priv->obj_ops = devx_obj_ops; } else { DRV_LOG(ERR, "Windows flow must be DevX.");