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 22338A0A0E for ; Mon, 10 May 2021 18:09:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BF054003E; Mon, 10 May 2021 18:09:29 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2070.outbound.protection.outlook.com [40.107.237.70]) by mails.dpdk.org (Postfix) with ESMTP id 1BF964003E for ; Mon, 10 May 2021 18:09:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J+am3v/XbdzuSNTuhaMlN8l+wyIpW2n9zB2Kdhc8Ffznt9Xw3DVsuo8ysX6QG+wWujWLQLwNnnqqMqaB0NHBc1oYKP9+3Jy30E1gGTzELK2uVndOc2+dCUbYG3htebLwcak6cqWqmR7zjrbWVf5F6ghi8/W30AeDE83gEj6p6Msumg5+/qxVK9Yo/GnqKCGKVxsZA5kvtt4vLsss6847qJ1wcWXveLud+eppBOQtSkya59NztS5q/JgsDktXa5f7yRfRyvAAqYuEsXmZ70zxSFMLk2LhbTgChAb/CZRTqyoiKr/m561FGcAL1Dg3orz7+EPgmcimhdzNyojy7FAAng== 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-SenderADCheck; bh=lSNoShnHSsUwoiy3zgBCg5BzCojvIi8QF/37zK2V2MI=; b=gP0ZAPwv3YTAWFOl1O69D31XjUdo3eTjf21GM2wjzxSkcJdEHvQ7arf3ELt7z0soqcrm6joBe7D/SWqo5L/qkO/aXHdtwObcp3gYPgXpWgVxbMNLIOyEtuWRzSenAjWSYxcPWUqILjrWQEFAlMWdZ3LRlEQqPoHcgXaEe8AsUJVJklngfguFpnqvn3DqDQXC1/NL3ZlD7fAapBRHRJ1T0O5R8wTwoK7SExl4oeFs6ZNSdkJ+1/H+Xerf0o997DHGID7ed2J7eJ4O9wapFzG2qSg3j0Cm6rtAgnktpE0j56XV2W/Qw9O+a4uFkVaGjJGvUTi9lOts0TBftg+kuJ02/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none 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=lSNoShnHSsUwoiy3zgBCg5BzCojvIi8QF/37zK2V2MI=; b=Tm3XGJ6gbQpNhbnNFwgGQbFbStNvhlWFkaIW2t1C7R9ZGp+sDZqSJx8uKaJ6RRG0NxspwIBvRM+mXBlyrcj0OzsmJDMsm/WmkZ+FGZECRPcLMRDuejwp3vhs7odxMuMfMf0NLV9YXDakb7OixJvG1HrQKMPD/kbUJrmJm9Vy92ISkYI2vY5bGHW+u0oL0ROXW9ss4PyPs11oGuDl+wY8F2wLl6MP1oWt8kLYvSc8jhtWanWIWcGtTQ2wh6tgV+STTtG0kEjRaLDRAh88febPaI13oegBxKeiNBHrvFVNcDtzZMpac8i+vuny714lhPYRXEsxWU+SkjA/tgynyA1iFA== Received: from BN9PR03CA0748.namprd03.prod.outlook.com (2603:10b6:408:110::33) by MN2PR12MB3775.namprd12.prod.outlook.com (2603:10b6:208:159::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Mon, 10 May 2021 16:09:26 +0000 Received: from BN8NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::61) by BN9PR03CA0748.outlook.office365.com (2603:10b6:408:110::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:09:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN8NAM11FT035.mail.protection.outlook.com (10.13.177.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:09:25 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:09:23 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Luca Boccassi , Matan Azrad , Ori Kam , dpdk stable Date: Tue, 11 May 2021 00:00:12 +0800 Message-ID: <20210510160258.30982-63-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: caa75e3a-1df4-4f84-6825-08d913cdfba4 X-MS-TrafficTypeDiagnostic: MN2PR12MB3775: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UU/7t+EA7kfPNUm0RaEtSPUoTZP+BwirtA5W/lrleQz83unlgPhc7qpt+GKEmyU2pwtBxackquDztjtQPsHijCbNmAIoeO9957y2n3wSULn4E/CvzkNf1cDLyStujbpyYoKeL+rc5kGEIL7z2cKNK+TWHTFgBYRIkkaDLV38dNFCvvWrPFcoMUy7D9Y2qdv2zf8adrn3aAWQo0EJF+E8AvjqX4JD+xmzL+PhJa3XcYHzqMSu0EdK3reFG45t4+DbNGX9x4JCng9Qjo9Z6/MNIR8AiM1oNu9s+9vaVsfKHN78UjpUrok3baaULNa/lQbYGSDt6uElj2TrgqpcgtPFBuDkZxeQukg4lVK7CLRl8d2+97MXZl6JP0dYgRinmzwBPY3GAsiwr09HENEGT7NHHgcdlJcqGnSaS4gyLXErzqeB88TTlcyabMy//F0HfzJyHqnek4ITha9AZ7wQJTYFpmzUhho1KRYTHRPZDyNNQ9dy5gCFPRQH/22nZ8WGbh5swUjiGOmJkHSWvpiOiWTy3erFTOq6m+nXO2H9JdZfKyRJlRzdkWDeVmvdTydTq6jKQmqQTpYNkJ492PVqAeggAud131KHczj4kHwfIik2C1ZA45RR9BxTjnIqqab5ZHuIzunu2jbMb9UM6XSOOSsniiTCZEEGVNB1yrf9qxExb/aGuINHkgBPHYAwQbptEuZ+POGSd7vSVbQumGTaaDAa+9GujVoGFsPs3uaMjc2h4St6+O+4uWY4eRD9ia9ckASRZFjG4Ud/cbCOd6EZaD34+g== 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)(136003)(396003)(39860400002)(376002)(346002)(36840700001)(46966006)(30864003)(26005)(82310400003)(1076003)(16526019)(478600001)(53546011)(186003)(966005)(82740400003)(7696005)(5660300002)(2906002)(86362001)(47076005)(55016002)(36756003)(36860700001)(54906003)(70206006)(70586007)(37006003)(6862004)(2616005)(6666004)(6286002)(336012)(356005)(7636003)(6636002)(83380400001)(8936002)(4326008)(36906005)(316002)(426003)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:09:25.8166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: caa75e3a-1df4-4f84-6825-08d913cdfba4 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: BN8NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3775 Subject: [dpdk-stable] patch 'common/mlx5: add timestamp format support to DevX' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/7ddf9eaed91f90263a427efd69a4373db73469fa Thanks. Xueming Li --- >From 7ddf9eaed91f90263a427efd69a4373db73469fa Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Sun, 14 Mar 2021 12:12:58 +0000 Subject: [PATCH] common/mlx5: add timestamp format support to DevX Cc: Luca Boccassi [ upstream commit 569ffbc9815bce27b4dbc68f05f02714fb8e1688 ] This patch handles the NIC-supported timestamp formats via DevX. Two different timestamp formats can be provided potentially. The free-running format provides opaque values captured from the internal clock counter fed by some independent oscillator. The free-running frequency is not pre-defined and should be queried from the NIC. The real-time timestamps are expressed in nanoseconds, captured from the dedicated UTC counter, that can be adjusted on the fly and synchronized with some external reference clock. Depending on the version and configuration the hardware might support either FR (free-running) or RT (real-time) timestamps, per queue basis. The commit provides the querying information about the supported timestamp formats and provides the means to configure ones at queue creation time. Fixes: e2b4925ef7c1 ("net/mlx5: support Direct Rules E-Switch") Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad Acked-by: Ori Kam --- drivers/common/mlx5/mlx5_devx_cmds.c | 35 ++++++++++++++++-- drivers/common/mlx5/mlx5_devx_cmds.h | 7 ++++ drivers/common/mlx5/mlx5_prm.h | 55 ++++++++++++++++++++++++++-- 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index e3196f86f9..ee1a3ddbaf 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -714,6 +714,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, device_frequency_khz); attr->scatter_fcs_w_decap_disable = MLX5_GET(cmd_hca_cap, hcattr, scatter_fcs_w_decap_disable); + attr->roce = MLX5_GET(cmd_hca_cap, hcattr, roce); + attr->rq_ts_format = MLX5_GET(cmd_hca_cap, hcattr, rq_ts_format); + attr->sq_ts_format = MLX5_GET(cmd_hca_cap, hcattr, sq_ts_format); attr->regex = MLX5_GET(cmd_hca_cap, hcattr, regexp); attr->regexp_num_of_engines = MLX5_GET(cmd_hca_cap, hcattr, regexp_num_of_engines); @@ -839,9 +842,32 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->tunnel_stateless_gtp = MLX5_GET (per_protocol_networking_offload_caps, hcattr, tunnel_stateless_gtp); - if (attr->wqe_inline_mode != MLX5_CAP_INLINE_MODE_VPORT_CONTEXT) - return 0; - if (attr->eth_virt) { + /* Query HCA attribute for ROCE. */ + if (attr->roce) { + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + MLX5_SET(query_hca_cap_in, in, opcode, + MLX5_CMD_OP_QUERY_HCA_CAP); + MLX5_SET(query_hca_cap_in, in, op_mod, + MLX5_GET_HCA_CAP_OP_MOD_ROCE | + MLX5_HCA_CAP_OPMOD_GET_CUR); + rc = mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), + out, sizeof(out)); + if (rc) + goto error; + status = MLX5_GET(query_hca_cap_out, out, status); + syndrome = MLX5_GET(query_hca_cap_out, out, syndrome); + if (status) { + DRV_LOG(DEBUG, + "Failed to query devx HCA ROCE capabilities, " + "status %x, syndrome = %x", status, syndrome); + return -1; + } + hcattr = MLX5_ADDR_OF(query_hca_cap_out, out, capability); + attr->qp_ts_format = MLX5_GET(roce_caps, hcattr, qp_ts_format); + } + if (attr->eth_virt && + attr->wqe_inline_mode == MLX5_CAP_INLINE_MODE_VPORT_CONTEXT) { rc = mlx5_devx_cmd_query_nic_vport_context(ctx, 0, attr); if (rc) { attr->eth_virt = 0; @@ -982,6 +1008,7 @@ mlx5_devx_cmd_create_rq(void *ctx, MLX5_SET(rqc, rq_ctx, cqn, rq_attr->cqn); MLX5_SET(rqc, rq_ctx, counter_set_id, rq_attr->counter_set_id); MLX5_SET(rqc, rq_ctx, rmpn, rq_attr->rmpn); + MLX5_SET(sqc, rq_ctx, ts_format, rq_attr->ts_format); wq_ctx = MLX5_ADDR_OF(rqc, rq_ctx, wq); wq_attr = &rq_attr->wq_attr; devx_cmd_fill_wq_data(wq_ctx, wq_attr); @@ -1354,6 +1381,7 @@ mlx5_devx_cmd_create_sq(void *ctx, sq_attr->packet_pacing_rate_limit_index); MLX5_SET(sqc, sq_ctx, tis_lst_sz, sq_attr->tis_lst_sz); MLX5_SET(sqc, sq_ctx, tis_num_0, sq_attr->tis_num); + MLX5_SET(sqc, sq_ctx, ts_format, sq_attr->ts_format); wq_ctx = MLX5_ADDR_OF(sqc, sq_ctx, wq); wq_attr = &sq_attr->wq_attr; devx_cmd_fill_wq_data(wq_ctx, wq_attr); @@ -1800,6 +1828,7 @@ mlx5_devx_cmd_create_qp(void *ctx, MLX5_SET(create_qp_in, in, opcode, MLX5_CMD_OP_CREATE_QP); MLX5_SET(qpc, qpc, st, MLX5_QP_ST_RC); MLX5_SET(qpc, qpc, pd, attr->pd); + MLX5_SET(qpc, qpc, ts_format, attr->ts_format); if (attr->uar_index) { MLX5_SET(qpc, qpc, pm_state, MLX5_QP_PM_MIGRATED); MLX5_SET(qpc, qpc, uar_page, attr->uar_index); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index a9aa8a3ebf..541f526194 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -112,6 +112,10 @@ struct mlx5_hca_attr { uint32_t dev_freq_khz; /* Timestamp counter frequency, kHz. */ uint32_t scatter_fcs_w_decap_disable:1; uint32_t flow_hit_aso:1; /* General obj type FLOW_HIT_ASO supported. */ + uint32_t roce:1; + uint32_t rq_ts_format:2; + uint32_t sq_ts_format:2; + uint32_t qp_ts_format:2; uint32_t regex:1; uint32_t regexp_num_of_engines; uint32_t log_max_ft_sampler_num:8; @@ -161,6 +165,7 @@ struct mlx5_devx_create_rq_attr { uint32_t state:4; uint32_t flush_in_error_en:1; uint32_t hairpin:1; + uint32_t ts_format:2; uint32_t user_index:24; uint32_t cqn:24; uint32_t counter_set_id:8; @@ -244,6 +249,7 @@ struct mlx5_devx_create_sq_attr { uint32_t hairpin:1; uint32_t non_wire:1; uint32_t static_sq_wq:1; + uint32_t ts_format:2; uint32_t user_index:24; uint32_t cqn:24; uint32_t packet_pacing_rate_limit_index:16; @@ -324,6 +330,7 @@ struct mlx5_devx_qp_attr { uint32_t rq_size:17; /* Must be power of 2. */ uint32_t log_rq_stride:3; uint32_t sq_size:17; /* Must be power of 2. */ + uint32_t ts_format:2; uint32_t dbr_umem_valid:1; uint32_t dbr_umem_id; uint64_t dbr_address; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index cce55c8ddd..4792835200 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1056,6 +1056,7 @@ enum { MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0 << 1, MLX5_GET_HCA_CAP_OP_MOD_ETHERNET_OFFLOAD_CAPS = 0x1 << 1, MLX5_GET_HCA_CAP_OP_MOD_QOS_CAP = 0xc << 1, + MLX5_GET_HCA_CAP_OP_MOD_ROCE = 0x4 << 1, MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE = 0x7 << 1, MLX5_GET_HCA_CAP_OP_MOD_VDPA_EMULATION = 0x13 << 1, }; @@ -1091,6 +1092,20 @@ enum { MLX5_INLINE_MODE_INNER_TCP_UDP, }; +/* The supported timestamp formats reported in HCA attributes. */ +enum { + MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR = 0x0, + MLX5_HCA_CAP_TIMESTAMP_FORMAT_RT = 0x1, + MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR_RT = 0x2, +}; + +/* The timestamp format attributes to configure queues (RQ/SQ/QP). */ +enum { + MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING = 0x0, + MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT = 0x1, + MLX5_QPC_TIMESTAMP_FORMAT_REAL_TIME = 0x2, +}; + /* HCA bit masks indicating which Flex parser protocols are already enabled. */ #define MLX5_HCA_FLEX_IPV4_OVER_VXLAN_ENABLED (1UL << 0) #define MLX5_HCA_FLEX_IPV6_OVER_VXLAN_ENABLED (1UL << 1) @@ -1353,7 +1368,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_3f8[0x3]; u8 log_max_current_uc_list[0x5]; u8 general_obj_types[0x40]; - u8 reserved_at_440[0x20]; + u8 sq_ts_format[0x2]; + u8 rq_ts_format[0x2]; + u8 reserved_at_444[0x1C]; u8 reserved_at_460[0x10]; u8 max_num_eqs[0x10]; u8 reserved_at_480[0x3]; @@ -1543,6 +1560,12 @@ struct mlx5_ifc_flow_table_prop_layout_bits { u8 reserved_at_c0[0x140]; }; +struct mlx5_ifc_roce_caps_bits { + u8 reserved_0[0x1e]; + u8 qp_ts_format[0x2]; + u8 reserved_at_20[0x7e0]; +}; + struct mlx5_ifc_flow_table_nic_cap_bits { u8 reserved_at_0[0x200]; struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties; @@ -1555,6 +1578,7 @@ union mlx5_ifc_hca_cap_union_bits { struct mlx5_ifc_qos_cap_bits qos_cap; struct mlx5_ifc_virtio_emulation_cap_bits vdpa_caps; struct mlx5_ifc_flow_table_nic_cap_bits flow_table_nic_cap; + struct mlx5_ifc_roce_caps_bits roce_caps; u8 reserved_at_0[0x8000]; }; @@ -1771,7 +1795,9 @@ struct mlx5_ifc_rqc_bits { u8 reserved_at_c[0x1]; u8 flush_in_error_en[0x1]; u8 hairpin[0x1]; - u8 reserved_at_f[0x11]; + u8 reserved_at_f[0xB]; + u8 ts_format[0x02]; + u8 reserved_at_1c[0x4]; u8 reserved_at_20[0x8]; u8 user_index[0x18]; u8 reserved_at_40[0x8]; @@ -2077,7 +2103,9 @@ struct mlx5_ifc_sqc_bits { u8 hairpin[0x1]; u8 non_wire[0x1]; u8 static_sq_wq[0x1]; - u8 reserved_at_11[0xf]; + u8 reserved_at_11[0x9]; + u8 ts_format[0x02]; + u8 reserved_at_1c[0x4]; u8 reserved_at_20[0x8]; u8 user_index[0x18]; u8 reserved_at_40[0x8]; @@ -2539,7 +2567,9 @@ struct mlx5_ifc_qpc_bits { u8 log_rq_stride[0x3]; u8 no_sq[0x1]; u8 log_sq_size[0x4]; - u8 reserved_at_55[0x6]; + u8 reserved_at_55[0x3]; + u8 ts_format[0x2]; + u8 reserved_at_5a[0x1]; u8 rlky[0x1]; u8 ulp_stateless_offload_mode[0x4]; u8 counter_set_id[0x8]; @@ -3261,4 +3291,21 @@ mlx5_flow_mark_get(uint32_t val) #endif } +/** + * Convert a timestamp format to configure settings in the queue context. + * + * @param val + * timestamp format supported by the queue. + * + * @return + * Converted timstamp format settings. + */ +static inline uint32_t +mlx5_ts_format_conv(uint32_t ts_format) +{ + return ts_format == MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR ? + MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING : + MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; +} + #endif /* RTE_PMD_MLX5_PRM_H_ */ -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:28.290389000 +0800 +++ 0064-common-mlx5-add-timestamp-format-support-to-DevX.patch 2021-05-10 23:59:26.420000000 +0800 @@ -1 +1 @@ -From 569ffbc9815bce27b4dbc68f05f02714fb8e1688 Mon Sep 17 00:00:00 2001 +From 7ddf9eaed91f90263a427efd69a4373db73469fa Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 569ffbc9815bce27b4dbc68f05f02714fb8e1688 ] @@ -25 +27,0 @@ -Cc: stable@dpdk.org @@ -37 +39 @@ -index 8df14f5b7d..c90e020643 100644 +index e3196f86f9..ee1a3ddbaf 100644 @@ -40 +42 @@ -@@ -715,6 +715,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, +@@ -714,6 +714,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, @@ -50,2 +52,2 @@ -@@ -859,9 +862,32 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, - attr->rss_ind_tbl_cap = MLX5_GET +@@ -839,9 +842,32 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, + attr->tunnel_stateless_gtp = MLX5_GET @@ -53 +55 @@ - hcattr, rss_ind_tbl_cap); + hcattr, tunnel_stateless_gtp); @@ -86 +88 @@ -@@ -1004,6 +1030,7 @@ mlx5_devx_cmd_create_rq(void *ctx, +@@ -982,6 +1008,7 @@ mlx5_devx_cmd_create_rq(void *ctx, @@ -94 +96 @@ -@@ -1376,6 +1403,7 @@ mlx5_devx_cmd_create_sq(void *ctx, +@@ -1354,6 +1381,7 @@ mlx5_devx_cmd_create_sq(void *ctx, @@ -102 +104 @@ -@@ -1825,6 +1853,7 @@ mlx5_devx_cmd_create_qp(void *ctx, +@@ -1800,6 +1828,7 @@ mlx5_devx_cmd_create_qp(void *ctx, @@ -111 +113 @@ -index bc66d28e83..2826c0b2c6 100644 +index a9aa8a3ebf..541f526194 100644 @@ -114 +116 @@ -@@ -121,6 +121,10 @@ struct mlx5_hca_attr { +@@ -112,6 +112,10 @@ struct mlx5_hca_attr { @@ -123 +124,0 @@ - uint32_t reg_c_preserve:1; @@ -125 +126,2 @@ -@@ -188,6 +192,7 @@ struct mlx5_devx_create_rq_attr { + uint32_t log_max_ft_sampler_num:8; +@@ -161,6 +165,7 @@ struct mlx5_devx_create_rq_attr { @@ -133 +135 @@ -@@ -271,6 +276,7 @@ struct mlx5_devx_create_sq_attr { +@@ -244,6 +249,7 @@ struct mlx5_devx_create_sq_attr { @@ -141 +143 @@ -@@ -354,6 +360,7 @@ struct mlx5_devx_qp_attr { +@@ -324,6 +330,7 @@ struct mlx5_devx_qp_attr { @@ -150 +152 @@ -index 01a039f1f7..0ef0574f92 100644 +index cce55c8ddd..4792835200 100644 @@ -153 +155 @@ -@@ -1116,6 +1116,7 @@ enum { +@@ -1056,6 +1056,7 @@ enum { @@ -161 +163 @@ -@@ -1153,6 +1154,20 @@ enum { +@@ -1091,6 +1092,20 @@ enum { @@ -182 +184 @@ -@@ -1431,7 +1446,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { +@@ -1353,7 +1368,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { @@ -193 +195 @@ -@@ -1623,6 +1640,12 @@ struct mlx5_ifc_flow_table_prop_layout_bits { +@@ -1543,6 +1560,12 @@ struct mlx5_ifc_flow_table_prop_layout_bits { @@ -206 +208 @@ -@@ -1635,6 +1658,7 @@ union mlx5_ifc_hca_cap_union_bits { +@@ -1555,6 +1578,7 @@ union mlx5_ifc_hca_cap_union_bits { @@ -214 +216 @@ -@@ -1851,7 +1875,9 @@ struct mlx5_ifc_rqc_bits { +@@ -1771,7 +1795,9 @@ struct mlx5_ifc_rqc_bits { @@ -225 +227 @@ -@@ -2157,7 +2183,9 @@ struct mlx5_ifc_sqc_bits { +@@ -2077,7 +2103,9 @@ struct mlx5_ifc_sqc_bits { @@ -236 +238 @@ -@@ -2684,7 +2712,9 @@ struct mlx5_ifc_qpc_bits { +@@ -2539,7 +2567,9 @@ struct mlx5_ifc_qpc_bits { @@ -247 +249 @@ -@@ -3440,4 +3470,21 @@ mlx5_flow_mark_get(uint32_t val) +@@ -3261,4 +3291,21 @@ mlx5_flow_mark_get(uint32_t val)