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 6A8DA42B46 for ; Fri, 19 May 2023 08:52:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AB2342BFE; Fri, 19 May 2023 08:52:43 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3C3E8406B5; Fri, 19 May 2023 08:52:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684479160; x=1716015160; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=G1K1HezZqLrNJ55JdOb/sGnR9S8iyhfJjKt9ZY6SeBk=; b=fZ0upPwlizaDQOgLDKEcjJ/TOfLk9xVFEU15cDR1bSqFzlHvbbZVxwRF OlBf1gabzG0Mymh22kOsRpg8XA6fOhdJdcFnOQ4ys8N2giH/jF8NZoXjE gwIKnRfhUggGm75yrFYwB/wckhoo9FkG3ZIFCfubLhROHzapkDaLhFZ9t 6fkZcuG1/zd+UyuwUZgNXZeWnTk8LgyaA+5/7c5KfwLODI58Ue0C9kal7 C8CR/Wj5fSyCafRTcqFvEuZbTT6Kdztc2B7BT88E7kvI0VSRrXfzZLcEw 8jPtH9VshYXbFEalkm+XxkbQAR3SNfq5BuRi1AYHWB4YD0D1NpwSgPJm5 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="341735171" X-IronPort-AV: E=Sophos;i="6.00,175,1681196400"; d="scan'208";a="341735171" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 23:52:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="772193246" X-IronPort-AV: E=Sophos;i="6.00,175,1681196400"; d="scan'208";a="772193246" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.161]) by fmsmga004.fm.intel.com with ESMTP; 18 May 2023 23:52:37 -0700 From: Wenjing Qiao To: qiming.yang@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Wenjing Qiao , stable@dpdk.org Subject: [PATCH] net/ice: fix timestamp enable error Date: Fri, 19 May 2023 02:47:38 -0400 Message-Id: <20230519064738.671977-1-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use the following command: 1. dpdk-testpmd -c 0x3 -n 4 --force-max-simd-bitwidth=64 -- -i --enable-rx-timestamp 2. port stop 0 3. port config 0 rx_offload timestamp off 4. port start 0 Then start it, log will show timestamp info, which should not appear. Because ice_timestamp_dynflag is still more than 0, code will still calculate timestamp. So fix it. Fixes: f9c561ffbccc ("net/ice: fix performance for Rx timestamp") Cc: stable@dpdk.org Signed-off-by: Wenjing Qiao --- drivers/net/ice/ice_rxtx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index d3a45ec609..cee5c3c554 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -1764,7 +1764,8 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq) ice_rxd_to_vlan_tci(mb, &rxdp[j]); rxd_to_pkt_fields_ops[rxq->rxdid](rxq, mb, &rxdp[j]); #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC - if (ice_timestamp_dynflag > 0) { + if (ice_timestamp_dynflag > 0 && + (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) { rxq->time_high = rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high); if (unlikely(is_tsinit)) { @@ -2130,7 +2131,8 @@ ice_recv_scattered_pkts(void *rx_queue, rxd_to_pkt_fields_ops[rxq->rxdid](rxq, first_seg, &rxd); pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0); #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC - if (ice_timestamp_dynflag > 0) { + if (ice_timestamp_dynflag > 0 && + (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) { rxq->time_high = rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high); if (unlikely(is_tsinit)) { @@ -2620,7 +2622,8 @@ ice_recv_pkts(void *rx_queue, rxd_to_pkt_fields_ops[rxq->rxdid](rxq, rxm, &rxd); pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0); #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC - if (ice_timestamp_dynflag > 0) { + if (ice_timestamp_dynflag > 0 && + (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) { rxq->time_high = rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high); if (unlikely(is_tsinit)) { -- 2.25.1