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 0A349429A9; Fri, 21 Apr 2023 09:21:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAF2742D1D; Fri, 21 Apr 2023 09:21:16 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 1FE2441156; 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=1682061672; x=1713597672; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rBoMztJv/D4KvLyyT7WKZiNEYfaBJ6rb4N+pYsGSiSE=; b=Zw6r58j+WNZ0AHR0/9Fa6L7vyxtN/lzobpNANo6KxqLAqK6s+bTGIZWn 3axWsuMFvwGJbh3W2RWKeBoPK8IAo/pPM4wBPGLt8qZpKHfIKK5h4vBxz Itf2kfSt3UL+o0pRiUnpsHl67X5h9yRKFS4OjrHEKdu7wDHq0cwHVrsJj 2WfE9CKPJCLDOcoabr12WiiFXjx5erQOe0lPChEVJ4g0oY5+6IBXy0N8l ovMTzpeygHdhK5Pq0/YpXKA2yNRKu0PuflsfRE2d6CJUOrJuxQSlezTDn c/6kdzM43FOLALiwiMIrq8DpareI9aPmfURUkSNoxr0vvYCuysoOTZk/7 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="343425002" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="343425002" 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:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="756811915" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="756811915" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.239]) by fmsmga008.fm.intel.com with ESMTP; 21 Apr 2023 00:21:02 -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 3/7] net/cpfl: save main time by alarm Date: Fri, 21 Apr 2023 03:15:59 -0400 Message-Id: <20230421071603.55680-4-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/cpfl/cpfl_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index ede730fd50..82d8147494 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -767,6 +767,12 @@ cpfl_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"); @@ -816,6 +822,7 @@ static int cpfl_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; @@ -828,6 +835,11 @@ cpfl_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