From patchwork Thu Jan 20 10:21:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 106118 X-Patchwork-Delegate: qi.z.zhang@intel.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 2D337A00C3; Thu, 20 Jan 2022 11:38:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE790426DC; Thu, 20 Jan 2022 11:38:38 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 5437940042; Thu, 20 Jan 2022 11:38:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642675116; x=1674211116; h=from:to:cc:subject:date:message-id; bh=v3EzzbWR3rvHfPsV2KLH+vj5Aw1nLMa8b0K1Q7qxGk8=; b=BC9+IMkuQzsCw4PC5vYaO5uD7JbSLYQGqt84Mtm7LiJdlzHjCbbO4EUk vkNvU6jHmaioS7/R7OJ+pg+1ZGB9O/DRpplHqgX8BIYdudBu7vP3pGtSY himcDqjtpEWO+rhNaQhMONf0sj2IDhB091+Vgsd8vzDGcLitOQM0fQmrO X5LtaiHzogqyZY/F82vGPH8yJf04zrxiUhQ1phFGABMydHz8xXLjsed31 RJ95JgKgCbij0wGohwV6cC5GFZ4sgEbzG+SWqlcBGPzgm90DXay1KGubU HThLOXcrRvo5bzetayM9pcSKq3FTraTQaVBxjXVT/TCD+0knjh0BAaapV A==; X-IronPort-AV: E=McAfee;i="6200,9189,10232"; a="245277737" X-IronPort-AV: E=Sophos;i="5.88,302,1635231600"; d="scan'208";a="245277737" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 02:38:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,302,1635231600"; d="scan'208";a="532717362" Received: from unknown (HELO npg-dpdk-simeisu-cvl-119d218.sh.intel.com) ([10.67.119.218]) by orsmga008.jf.intel.com with ESMTP; 20 Jan 2022 02:38:33 -0800 From: Simei Su To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, wenjun1.wu@intel.com, Simei Su , stable@dpdk.org Subject: [PATCH] net/ice: fix ieee1588fwd not show PTP timestamp Date: Thu, 20 Jan 2022 18:21:52 +0800 Message-Id: <20220120102152.281951-1-simei.su@intel.com> X-Mailer: git-send-email 2.9.5 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 For received PTP packets, the flag "RTE_MBUF_F_RX_IEEE1588_TMST" has not been set which leads to received PTP packet not timestamped by hardware shown in testpmd/ieee1588 fwd. Fixes: 646dcbe6c701 ("net/ice: support IEEE 1588 PTP") Cc: stable@dpdk.org Signed-off-by: Simei Su Acked-by: Qi Zhang --- drivers/net/ice/ice_rxtx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index d50acf5..d7276d7 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -1554,6 +1554,9 @@ ice_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union ice_rx_flex_desc *rxdp) #if (ICE_LOOK_AHEAD != 8) #error "PMD ICE: ICE_LOOK_AHEAD must be 8\n" #endif + +#define ICE_PTP_TS_VALID 0x1 + static inline int ice_rx_scan_hw_ring(struct ice_rx_queue *rxq) { @@ -1634,6 +1637,10 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq) rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high); mb->timesync = rxq->queue_id; pkt_flags |= RTE_MBUF_F_RX_IEEE1588_PTP; + if (rxdp[j].wb.time_stamp_low & + ICE_PTP_TS_VALID) + pkt_flags |= + RTE_MBUF_F_RX_IEEE1588_TMST; } #endif mb->ol_flags |= pkt_flags;