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 6FF24A0C4D; Thu, 7 Oct 2021 00:05:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA754411D7; Thu, 7 Oct 2021 00:04:29 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2081.outbound.protection.outlook.com [40.107.93.81]) by mails.dpdk.org (Postfix) with ESMTP id 86B16411D0 for ; Thu, 7 Oct 2021 00:04:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GFIa+j12A321uQ3eGgNttwzNSQO7fwfg3lVp3Xyv8XBQoLNiBBdZo1PAQEVrvbShnI0SGmc5qhSX1NZ0C4TdhUdI+KnNLbAbSx6bOEvMTf2oP3JI1GGlANyA5Frbzdc53v2039bEmXOhSpNG+wKTJhARxL4kGIM5VurMy2LpIk+GstoIGOu9Exi2HIC6Wf8FuGU+xk1cTHpp143Zbz/QK3gS0cm5evkoK+5IyZwS2EiOusGPTHygGKMkL+rRJnygzkTIoQrHD+Foq3M5PmOvhMHBzl2Zd9Vayx61T+d/DUE4ggRJA7Bw+GHqdrjN6A2RVc0v5+qV0EPXcXNhBdz3Cg== 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=+9cYdbPIG16coDjbAlF4n7nzDow3YPfdNYSPgfEKOpY=; b=f4aIml4roQ/HNsHliSzGYvbKnToFxb6BXeQUuXMXpQgVEcYQqFnnvaAKu5dqqVjlOY1UV2yf+yad9vCYMdQJYtnRsHEk0abH77Z4/OqASahcz+PdANrdZonpHmWS5ThtFRaQKiddh67sKFoGqJGu0gmMDTerpYY+lUA4kMxmoDy5LRkQflAI7h3R9zBY4SlSRQcoimTsxhxbziOgaYAoRCLTnm1KJAqBC6f3flibN/9o+QvuywWvH0dkPZbr1xkrePZXqXfmPwbaGMs4Orhx7OPdVajEgSzvYwpJA8y1dKxvr+28YubwWJIZdSec01Ep8zzRZRQEzzT8wTIrJE/HRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=+9cYdbPIG16coDjbAlF4n7nzDow3YPfdNYSPgfEKOpY=; b=Skq6oxVhGOpZnzGo/ApHRI2Srjsp4/u2h9Djz7q2Hoz+UU8ESNR6jgbxU6jdvQJV2f2Ae+v+Tt9ONIuvn5YFue5eNj6RDNzmWxd748rQRRjnlNCZwQsydn6VKzhBxeBUlE4zlcckRpWMvjb1sOB+3HFIlzuQVoUd+yxbtfJKfv6hi6pRcswtK9T1BzfG5cnrZGt4Uj+QOb/45gpjRDj1tAOInXpIGgKP0sgMvaNHSll3DYRbM3MfSuLx4zf7Pdehkvzu6alWEEVmwv1/qb8PwvyI9S595cqdWyilkrXUoglEadf5WY9MBpQcMlAQLEVsdwE5g7FDbdsVzFBh+xkGYw== Received: from CO2PR04CA0192.namprd04.prod.outlook.com (2603:10b6:104:5::22) by BN6PR12MB1874.namprd12.prod.outlook.com (2603:10b6:404:fd::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Wed, 6 Oct 2021 22:04:26 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:104:5:cafe::d2) by CO2PR04CA0192.outlook.office365.com (2603:10b6:104:5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Wed, 6 Oct 2021 22:04:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Wed, 6 Oct 2021 22:04:26 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 6 Oct 2021 22:04:23 +0000 From: To: CC: Matan Azrad , Thomas Monjalon , Michael Baum Date: Thu, 7 Oct 2021 01:03:39 +0300 Message-ID: <20211006220350.2357487-8-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211006220350.2357487-1-michaelba@nvidia.com> References: <20210930172822.1949969-1-michaelba@nvidia.com> <20211006220350.2357487-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bcc0baf0-f58e-454d-9d46-08d989154313 X-MS-TrafficTypeDiagnostic: BN6PR12MB1874: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nw8VHmcspbAtHCURn7/F5YSsDnOuWKWxIXrFHvuHKr2fKIy+taoFLZlxBzBua9Ttu/BcKbKlqlnpKW5FBXhpCGhEcXEFACZb9oJFNp3Orj5vFbJkjL/EkndeD1mzWB+or1l6KdeUkFQguWRSkiDOBr3xZeH/GWRkFP+osxQBDjTl0zXNZwxsHT3jGo0+hFR1TcW3KRMZ6WLKFtqcbpbvzbex5wWXVtY2Mac8yQzp2/5PdCDi9rcwOh3DYzs1oFwdRYH52sMcjwE5BybsseGGGuM2lZ26+jCQUwjfexnL/m74IQ/9KfNpBE/HfeqqzagDsQUeyY+AYdh1+LddLcRmE3ZGzjdCKaDeT0Aj8TVZUSmXL0kJvuwOR3jpfkJp+uEhfwy20muUFD0F97vjxgdJ7jJeRb4c+Dztyovrlvwpibc/3Ik4heMNkgrk/nqEzu7Tmia+rAOYt/PIO5imqYYHcVwGBHAQlTXsUQsM5A/MaX/+A4znaSQlizfrtIdpQhBJx2m6VJh9xUOCmcvBDDghJuUy/brayu7/51PVpTiwQPOxeVzPaJdVO6BOEJuncGOoNa/ZldzkSlsz29zsv1Ak2JN4k0d3j34wH/XQ4xtCcJ46E+bLBvyVxTeOxgAOjzRQrh5xQLwTrPSrMnPcWMGjf2Q1PgYaRMCHfw+4wwoEX+Q5Oaga81Uun50iDdh1aOmwsCMRkz+Ska9IRidsVB4EMw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(356005)(7636003)(4326008)(55016002)(6286002)(336012)(107886003)(8676002)(6666004)(70586007)(26005)(186003)(70206006)(86362001)(8936002)(426003)(36860700001)(83380400001)(2906002)(16526019)(1076003)(6916009)(47076005)(7696005)(508600001)(316002)(82310400003)(54906003)(2876002)(5660300002)(36756003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2021 22:04:26.1303 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcc0baf0-f58e-454d-9d46-08d989154313 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1874 Subject: [dpdk-dev] [PATCH v2 07/18] net/mlx5: remove redundant flag in device config 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 Sender: "dev" From: Michael Baum Device configure structure has flag named devx as same as SH structure with the same meaning. Remove the flag from the configuration structure and move all the usages to the SH flag. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_os.c | 15 +++++++-------- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow_dv.c | 18 +++++++++--------- drivers/net/mlx5/mlx5_trigger.c | 2 +- drivers/net/mlx5/windows/mlx5_os.c | 9 ++++----- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index c1b828a422..07ba0ff43b 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -718,7 +718,7 @@ mlx5_flow_counter_mode_config(struct rte_eth_dev *dev __rte_unused) fallback = true; #else fallback = false; - if (!priv->config.devx || !priv->config.dv_flow_en || + if (!sh->devx || !priv->config.dv_flow_en || !priv->config.hca_attr.flow_counters_dump || !(priv->config.hca_attr.flow_counter_bulk_alloc_bitmap & 0x4) || (mlx5_flow_dv_discover_counter_offset_support(dev) == -ENOTSUP)) @@ -1025,7 +1025,6 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, sh = mlx5_alloc_shared_dev_ctx(spawn, config); if (!sh) return NULL; - config->devx = sh->devx; #ifdef HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR config->dest_tir = 1; #endif @@ -1325,7 +1324,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 (config->devx) { + if (sh->devx) { err = mlx5_devx_cmd_query_hca_attr(sh->ctx, &config->hca_attr); if (err) { err = -err; @@ -1468,13 +1467,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->cqe_comp = 0; } if (config->cqe_comp_fmt == MLX5_CQE_RESP_FORMAT_FTAG_STRIDX && - (!config->devx || !config->hca_attr.mini_cqe_resp_flow_tag)) { + (!sh->devx || !config->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 && - (!config->devx || !config->hca_attr.mini_cqe_resp_l3_l4_tag)) { + (!sh->devx || !config->hca_attr.mini_cqe_resp_l3_l4_tag)) { DRV_LOG(WARNING, "L3/L4 Header CQE compression" " format isn't supported."); config->cqe_comp = 0; @@ -1497,7 +1496,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->hca_attr.log_max_static_sq_wq); DRV_LOG(DEBUG, "WQE rate PP mode is %ssupported", config->hca_attr.qos.wqe_rate_pp ? "" : "not "); - if (!config->devx) { + if (!sh->devx) { DRV_LOG(ERR, "DevX is required for packet pacing"); err = ENODEV; goto error; @@ -1544,7 +1543,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, goto error; #endif } - if (config->devx) { + if (sh->devx) { uint32_t reg[MLX5_ST_SZ_DW(register_mtutc)]; err = config->hca_attr.access_register_user ? @@ -1722,7 +1721,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, if (err) goto error; } - if (config->devx && config->dv_flow_en && config->dest_tir) { + if (sh->devx && config->dv_flow_en && config->dest_tir) { priv->obj_ops = devx_obj_ops; priv->obj_ops.drop_action_create = ibv_obj_ops.drop_action_create; diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index becd8722de..d2eabe04a5 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -265,7 +265,6 @@ struct mlx5_dev_config { unsigned int lacp_by_user:1; /* Enable user to manage LACP traffic. */ unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */ - unsigned int devx:1; /* Whether devx interface is available or not. */ unsigned int dest_tir:1; /* Whether advanced DR API is available. */ unsigned int reclaim_mode:2; /* Memory reclaim mode. */ unsigned int rt_timestamp:1; /* realtime timestamp format. */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index c6370cd1d6..de994c602b 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3350,7 +3350,7 @@ flow_dv_validate_action_count(struct rte_eth_dev *dev, bool shared, { struct mlx5_priv *priv = dev->data->dev_private; - if (!priv->config.devx) + if (!priv->sh->devx) goto notsup_err; if (action_flags & MLX5_FLOW_ACTION_COUNT) return rte_flow_error_set(error, EINVAL, @@ -5297,7 +5297,7 @@ 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->config.devx || (priv->sh->cmng.counter_fallback && + if (!priv->sh->devx || (priv->sh->cmng.counter_fallback && !priv->sh->aso_age_mng)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -5582,7 +5582,7 @@ 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->config.devx || (sample->ratio > 0 && !priv->sampler_en)) + if (!priv->sh->devx || (sample->ratio > 0 && !priv->sampler_en)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -6166,7 +6166,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->config.devx) { + if (!priv->sh->devx) { rte_errno = ENOTSUP; return 0; } @@ -6553,7 +6553,7 @@ flow_dv_mtr_alloc(struct rte_eth_dev *dev) struct mlx5_aso_mtr_pool *pool; uint32_t mtr_idx = 0; - if (!priv->config.devx) { + if (!priv->sh->devx) { rte_errno = ENOTSUP; return 0; } @@ -12438,7 +12438,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->config.devx) { + if (!priv->sh->devx) { rte_errno = ENOTSUP; return 0; } @@ -12874,7 +12874,7 @@ flow_dv_translate(struct rte_eth_dev *dev, } break; case RTE_FLOW_ACTION_TYPE_COUNT: - if (!dev_conf->devx) { + if (!priv->sh->devx) { return rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ -15718,7 +15718,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->config.devx) + if (!priv->sh->devx) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -17331,7 +17331,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->config.devx) + if (!priv->sh->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 3cbf5816a1..e93647aafd 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -1112,7 +1112,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) dev->data->port_id, strerror(rte_errno)); goto error; } - if ((priv->config.devx && priv->config.dv_flow_en && + if ((priv->sh->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 1e76f63fc1..a882a18439 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -272,7 +272,7 @@ mlx5_flow_counter_mode_config(struct rte_eth_dev *dev __rte_unused) fallback = true; #else fallback = false; - if (!priv->config.devx || !priv->config.dv_flow_en || + if (!sh->devx || !priv->config.dv_flow_en || !priv->config.hca_attr.flow_counters_dump || !(priv->config.hca_attr.flow_counter_bulk_alloc_bitmap & 0x4) || (mlx5_flow_dv_discover_counter_offset_support(dev) == -ENOTSUP)) @@ -349,7 +349,6 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, sh = mlx5_alloc_shared_dev_ctx(spawn, config); if (!sh) return NULL; - config->devx = sh->devx; /* Initialize the shutdown event in mlx5_dev_spawn to * support mlx5_is_removed for Windows. */ @@ -452,7 +451,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, DRV_LOG(WARNING, "Rx CQE compression isn't supported."); config->cqe_comp = 0; } - if (config->devx) { + if (sh->devx) { err = mlx5_devx_cmd_query_hca_attr(sh->ctx, &config->hca_attr); if (err) { err = -err; @@ -471,7 +470,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, DRV_LOG(DEBUG, "checksum offloading is %ssupported", (config->hw_csum ? "" : "not ")); } - if (config->devx) { + if (sh->devx) { uint32_t reg[MLX5_ST_SZ_DW(register_mtutc)]; err = config->hca_attr.access_register_user ? @@ -642,7 +641,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, goto error; } } - if (config->devx && config->dv_flow_en) { + if (sh->devx && config->dv_flow_en) { priv->obj_ops = devx_obj_ops; } else { DRV_LOG(ERR, "Flow mode %u is not supported " -- 2.25.1