From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id CEF1941DB0;
	Thu,  2 Mar 2023 03:22:37 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 62D4942D75;
	Thu,  2 Mar 2023 03:21:03 +0100 (CET)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by mails.dpdk.org (Postfix) with ESMTP id 9559742D56
 for <dev@dpdk.org>; Thu,  2 Mar 2023 03:21:00 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1677723660; x=1709259660;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=/9EYazzyGI3OrlAW6aTt+w/WMBdsG7dbN3oS7hhwr/A=;
 b=hWob9lQjNFSsUQWnqxivNjxgS4KqE4ocJHowCPQZkNZzQWkUptQxWATP
 fd41kiPZ8rmXtrdtIVcfo1PNTjQoBigQXf2jHhwL4+rZc2WbAAAtWX4L/
 4qMzCadzSRQpfgnxtmvQUaLy1QPXzhQ1ig2ubsLvWmXrdFMZfoP1j3GPc
 HuDqtOuaZm1eA9adbhlz0kdHqd0rq3kgAYYelF+XWjeoolPorcVjysArB
 mUTcjx0uOhirqVX+U/G3xQOzjowVhcPhnTrQuuCYb7a8FjQPQMHilI/TD
 BdHb6GenrIxTzZ4MBJUjv/eDbw6bFvdeqKoAnYXbZLizoYEzclLfs7cVe g==;
X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="315013589"
X-IronPort-AV: E=Sophos;i="5.98,226,1673942400"; d="scan'208";a="315013589"
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 01 Mar 2023 18:21:00 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="784607601"
X-IronPort-AV: E=Sophos;i="5.98,226,1673942400"; d="scan'208";a="784607601"
Received: from dpdk-mingxial-ice.sh.intel.com ([10.67.110.191])
 by fmsmga002.fm.intel.com with ESMTP; 01 Mar 2023 18:20:59 -0800
From: Mingxia Liu <mingxia.liu@intel.com>
To: dev@dpdk.org,
	beilei.xing@intel.com,
	yuying.zhang@intel.com
Cc: Mingxia Liu <mingxia.liu@intel.com>
Subject: [PATCH v8 16/21] net/cpfl: support timestamp offload
Date: Thu,  2 Mar 2023 10:35:22 +0000
Message-Id: <20230302103527.931071-17-mingxia.liu@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230302103527.931071-1-mingxia.liu@intel.com>
References: <20230216003010.3439881-1-mingxia.liu@intel.com>
 <20230302103527.931071-1-mingxia.liu@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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Add support for timestamp offload.

Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
---
 drivers/net/cpfl/cpfl_ethdev.c | 3 ++-
 drivers/net/cpfl/cpfl_rxtx.c   | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index 8685c6e27b..8ed6308a36 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -100,7 +100,8 @@ cpfl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		RTE_ETH_RX_OFFLOAD_IPV4_CKSUM           |
 		RTE_ETH_RX_OFFLOAD_UDP_CKSUM            |
 		RTE_ETH_RX_OFFLOAD_TCP_CKSUM            |
-		RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM     |
+		RTE_ETH_RX_OFFLOAD_TIMESTAMP;
 
 	dev_info->tx_offload_capa =
 		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM		|
diff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c
index a3832acd4f..ea28d3978c 100644
--- a/drivers/net/cpfl/cpfl_rxtx.c
+++ b/drivers/net/cpfl/cpfl_rxtx.c
@@ -516,6 +516,13 @@ cpfl_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		return -EINVAL;
 	}
 
+	err = idpf_qc_ts_mbuf_register(rxq);
+	if (err != 0) {
+		PMD_DRV_LOG(ERR, "fail to register timestamp mbuf %u",
+			    rx_queue_id);
+		return -EIO;
+	}
+
 	if (rxq->adapter->is_rx_singleq) {
 		/* Single queue */
 		err = idpf_qc_single_rxq_mbufs_alloc(rxq);
-- 
2.34.1