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 56DAC45955; Tue, 10 Sep 2024 13:09:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5611F42E1D; Tue, 10 Sep 2024 13:09:35 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mails.dpdk.org (Postfix) with ESMTP id 7844D400D6 for ; Tue, 10 Sep 2024 13:09:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725966574; x=1757502574; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=81xNSzhy/dQceQBqY/WEmZ7Z2Atjn1oXEgJnjws280Y=; b=muA1PhVCYpwKJwfZFZmbmfLIC1l6rWBe+Ty3V4ftVUorXb9j6LFJUHwo 7T0Fr91CFOWnJjlXc08N62q+RKndg6vd0cxIJ//Jwxo+F+hgt/5fMlyFO jTF7a5BEM3PDk42tqRS/jUbxuXMjE77PxPWEcFMJtei1kUVhMW7hBQpUw eUF/qaFlJlOR9jOV6UQlKnpl/MbpViEQ++6JPLtamLcR4pPMDXMe9GJpM Mn2AFmDk+sWuiNR7Go+oVIO5y/SCP72NMNYKZcCUCJ0qgoJ0c5/2DKIGT 50tXbVELjv61B4nnhf3FfIfIzWK835bIbAItz/SmgPd+SBrVLAknDNTe4 g==; X-CSE-ConnectionGUID: YLJ8ymeESTKrifdZ1S07+g== X-CSE-MsgGUID: 4wZEFBR9Tpy2gznzWBVsAA== X-IronPort-AV: E=McAfee;i="6700,10204,11190"; a="35276903" X-IronPort-AV: E=Sophos;i="6.10,217,1719903600"; d="scan'208";a="35276903" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2024 04:09:33 -0700 X-CSE-ConnectionGUID: 0hH3Fq4mTcuyfzwmT1P3eQ== X-CSE-MsgGUID: VS7HGSomQ7SQQBtx6XUfJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,217,1719903600"; d="scan'208";a="71969815" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by orviesa004.jf.intel.com with ESMTP; 10 Sep 2024 04:09:31 -0700 From: Soumyadeep Hore To: bruce.richardson@intel.com, aman.deep.singh@intel.com Cc: dev@dpdk.org, shaiq.wani@intel.com, Jacob Keller Subject: [PATCH v1 1/9] common/iavf: update the PTP enablement in virtchnl Date: Tue, 10 Sep 2024 10:12:16 +0000 Message-ID: <20240910101224.497044-2-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910101224.497044-1-soumyadeep.hore@intel.com> References: <20240910101224.497044-1-soumyadeep.hore@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Jacob Keller The virtchnl now supports the PTP Tx Timestamp attributes in iavf. Signed-off-by: Jacob Keller Signed-off-by: Soumyadeep Hore --- drivers/common/iavf/virtchnl.h | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h index e02eec4935..2c541ac411 100644 --- a/drivers/common/iavf/virtchnl.h +++ b/drivers/common/iavf/virtchnl.h @@ -161,6 +161,10 @@ enum virtchnl_ops { VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 = 59, VIRTCHNL_OP_1588_PTP_GET_CAPS = 60, VIRTCHNL_OP_1588_PTP_GET_TIME = 61, + VIRTCHNL_OP_1588_PTP_SET_TIME = 62, + VIRTCHNL_OP_1588_PTP_ADJ_TIME = 63, + VIRTCHNL_OP_1588_PTP_ADJ_FREQ = 64, + VIRTCHNL_OP_1588_PTP_TX_TIMESTAMP = 65, VIRTCHNL_OP_GET_QOS_CAPS = 66, VIRTCHNL_OP_CONFIG_QUEUE_TC_MAP = 67, VIRTCHNL_OP_ENABLE_QUEUES_V2 = 107, @@ -284,6 +288,14 @@ static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode) return "VIRTCHNL_OP_1588_PTP_GET_CAPS"; case VIRTCHNL_OP_1588_PTP_GET_TIME: return "VIRTCHNL_OP_1588_PTP_GET_TIME"; + case VIRTCHNL_OP_1588_PTP_SET_TIME: + return "VIRTCHNL_OP_1588_PTP_SET_TIME"; + case VIRTCHNL_OP_1588_PTP_ADJ_TIME: + return "VIRTCHNL_OP_1588_PTP_ADJ_TIME"; + case VIRTCHNL_OP_1588_PTP_ADJ_FREQ: + return "VIRTCHNL_OP_1588_PTP_ADJ_FREQ"; + case VIRTCHNL_OP_1588_PTP_TX_TIMESTAMP: + return "VIRTCHNL_OP_1588_PTP_TX_TIMESTAMP"; case VIRTCHNL_OP_FLOW_SUBSCRIBE: return "VIRTCHNL_OP_FLOW_SUBSCRIBE"; case VIRTCHNL_OP_FLOW_UNSUBSCRIBE: @@ -2125,8 +2137,11 @@ struct virtchnl_quanta_cfg { VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_quanta_cfg); +#define VIRTCHNL_1588_PTP_CAP_TX_TSTAMP BIT(0) #define VIRTCHNL_1588_PTP_CAP_RX_TSTAMP BIT(1) #define VIRTCHNL_1588_PTP_CAP_READ_PHC BIT(2) +#define VIRTCHNL_1588_PTP_CAP_WRITE_PHC BIT(3) +#define VIRTCHNL_1588_PTP_CAP_PHC_REGS BIT(4) struct virtchnl_phc_regs { u32 clock_hi; @@ -2137,6 +2152,11 @@ struct virtchnl_phc_regs { VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_phc_regs); +enum virtchnl_ptp_tstamp_format { + VIRTCHNL_1588_PTP_TSTAMP_40BIT = 0, + VIRTCHNL_1588_PTP_TSTAMP_64BIT_NS = 1, +}; + struct virtchnl_ptp_caps { struct virtchnl_phc_regs phc_regs; u32 caps; @@ -2158,6 +2178,24 @@ struct virtchnl_phc_time { VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_phc_time); +struct virtchnl_phc_adj_time { + s64 delta; + u8 rsvd[8]; +}; +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_phc_adj_time); + +struct virtchnl_phc_adj_freq { + s64 scaled_ppm; + u8 rsvd[8]; +}; +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_phc_adj_freq); + +struct virtchnl_phc_tx_tstamp { + u64 tstamp; + u8 rsvd[8]; +}; +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_phc_tx_tstamp); + /* Since VF messages are limited by u16 size, precalculate the maximum possible * values of nested elements in virtchnl structures that virtual channel can * possibly handle in a single message. @@ -2487,6 +2525,18 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, case VIRTCHNL_OP_1588_PTP_GET_TIME: valid_len = sizeof(struct virtchnl_phc_time); break; + case VIRTCHNL_OP_1588_PTP_SET_TIME: + valid_len = sizeof(struct virtchnl_phc_time); + break; + case VIRTCHNL_OP_1588_PTP_ADJ_TIME: + valid_len = sizeof(struct virtchnl_phc_adj_time); + break; + case VIRTCHNL_OP_1588_PTP_ADJ_FREQ: + valid_len = sizeof(struct virtchnl_phc_adj_freq); + break; + case VIRTCHNL_OP_1588_PTP_TX_TIMESTAMP: + valid_len = sizeof(struct virtchnl_phc_tx_tstamp); + break; case VIRTCHNL_OP_ENABLE_QUEUES_V2: case VIRTCHNL_OP_DISABLE_QUEUES_V2: valid_len = sizeof(struct virtchnl_del_ena_dis_queues); -- 2.34.1