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 25EA9429D9; Mon, 24 Apr 2023 11:23:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE01542D17; Mon, 24 Apr 2023 11:22:56 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D789142D0E; Mon, 24 Apr 2023 11:22:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682328175; x=1713864175; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RK7fyiHoyLMQxXyX4hOsfkk4UnwbUcIPDnJlGO9pB5c=; b=JG+RNr77NQBQ1asbqM1d0YRdat7kYXTWIlZ3ycTC+hLqAmkgKGWhgVK/ 2M0yoLLO+u9hNatOATu4YpoKHJUuZb2+d384xIXh3ZMe6rgduG/vMqSBz qrfTTTkDymYd+MgTSOWxXmfi5CV67TzGOEWWbXV24WykxZp9DPRUzAt8x J6gUHikBKMkSENs1vE1Q5CcXdeDg0o6IcgrNktGPRgxcRPz4VAbBoRFJL SUm2bArOsqZEd5IDUH6pV0d6H8vxFYPmO/Nd5noMjZPR4tIB7pEN0s23O FgaJ1iGLAb+8iOiS1bMHpHlvYMyJcnHwQkB4iDcQ3zxqq2AzJbFyFKgyu A==; X-IronPort-AV: E=McAfee;i="6600,9927,10689"; a="411680039" X-IronPort-AV: E=Sophos;i="5.99,222,1677571200"; d="scan'208";a="411680039" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 02:22:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10689"; a="836895027" X-IronPort-AV: E=Sophos;i="5.99,222,1677571200"; d="scan'208";a="836895027" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.239]) by fmsmga001.fm.intel.com with ESMTP; 24 Apr 2023 02:22:52 -0700 From: Wenjing Qiao To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, mingxia.liu@intel.com, Wenjing Qiao , stable@dpdk.org Subject: [PATCH v3 2/7] net/idpf: save main time by alarm Date: Mon, 24 Apr 2023 05:17:02 -0400 Message-Id: <20230424091707.488045-3-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230424091707.488045-1-wenjing.qiao@intel.com> References: <20230421071603.55680-2-wenjing.qiao@intel.com> <20230424091707.488045-1-wenjing.qiao@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 Using alarm to save main time from registers every 1 second. Fixes: 8c6098afa075 ("common/idpf: add Rx/Tx data path") Cc: stable@dpdk.org Signed-off-by: Wenjing Qiao --- drivers/net/idpf/idpf_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index e02ec2ec5a..3f33ffbc78 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -761,6 +761,12 @@ idpf_dev_start(struct rte_eth_dev *dev) goto err_vec; } + if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + rte_eal_alarm_set(1000 * 1000, + &idpf_dev_read_time_hw, + (void *)base); + } + ret = idpf_vc_vectors_alloc(vport, req_vecs_num); if (ret != 0) { PMD_DRV_LOG(ERR, "Failed to allocate interrupt vectors"); @@ -810,6 +816,7 @@ static int idpf_dev_stop(struct rte_eth_dev *dev) { struct idpf_vport *vport = dev->data->dev_private; + struct idpf_adapter *base = vport->adapter; if (vport->stopped == 1) return 0; @@ -822,6 +829,11 @@ idpf_dev_stop(struct rte_eth_dev *dev) idpf_vc_vectors_dealloc(vport); + if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + rte_eal_alarm_cancel(idpf_dev_read_time_hw, + base); + } + vport->stopped = 1; return 0; -- 2.25.1