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 7DAB3429A9; Fri, 21 Apr 2023 09:21:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39D8F42C76; Fri, 21 Apr 2023 09:21:13 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 41A29410DD; Fri, 21 Apr 2023 09:21:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682061671; x=1713597671; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RK7fyiHoyLMQxXyX4hOsfkk4UnwbUcIPDnJlGO9pB5c=; b=AQJNM6bisi3B5nIvz9CXqxJYiy6st7No+JtGAzwgHD1SL/P/PlNBWPam fj7t+ybq17G66qbUxAHVdjZLixQZYiNbsPDQUTRx/tprhBKS1wMDdru2L Hq2iX1xDbQ/ir7h3eSdA4TxvE+RmZLVBNvKEfhVy+Qol9DIw++gOXQ55s PyNnFpeRVHldLi22oBs/B4I4pv4PkwXLSkFvTGO52y3E5wjq5+X8YdCSr yv6ptGfLsULB6pU6IQSF71VA6eHMEi+oyNGg4Ft5nQzg0BBJKy9A71+xi A6/rMBip2hWnIgDrT6pePKUYu+o6K0wYKDX2zPUBayQz7iYThDpmzEY3b w==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="343424994" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="343424994" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 00:21:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="756811903" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="756811903" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.239]) by fmsmga008.fm.intel.com with ESMTP; 21 Apr 2023 00:21:00 -0700 From: Wenjing Qiao To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Wenjing Qiao , stable@dpdk.org Subject: [PATCH v2 2/7] net/idpf: save main time by alarm Date: Fri, 21 Apr 2023 03:15:58 -0400 Message-Id: <20230421071603.55680-3-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230421071603.55680-1-wenjing.qiao@intel.com> References: <20230420091935.43116-2-wenjing.qiao@intel.com> <20230421071603.55680-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