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 8E8AA42995; Thu, 20 Apr 2023 11:26:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8179540E25; Thu, 20 Apr 2023 11:26:23 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id CCDB840A4B; Thu, 20 Apr 2023 11:26:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681982782; x=1713518782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZgyewUyCGlIZcSqFmtot+AxTyEDTdplEhxQ1C+Rgfoc=; b=MV2TVfXbqb4cEVk/dODKf+GU/yJ5Lj9f/937djgdjT6uPL232Asd0S5G FV2nypS2DGsgCH7t4Mod3LTnXzxpOiQFlENHNEsJctyL90jsUNqgnuABU Z/+HL1mhUZ69XF5R0lIfwIGItMv7GQHMt6e2WmUCpIHLJvyjcFYrpl6m9 WVk6rfTn0Qx2nC0ZPG5tBKp1Tlg7+MlU/5hH5B/jvDmAZyZK7Bmf3XSQ4 7g+19z6zCab8Ocp6rcyQvH88PI7GCnhVvxkN6x2PXAPmcBd07kovXQ1E+ Wp5MaXfS44euh+EDi/tyEGmCLBqS+gemH+L0Rt9DqIsnpcR4Ot8NC8YuM A==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="326011820" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="326011820" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 02:25:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="694416739" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="694416739" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.239]) by fmsmga007.fm.intel.com with ESMTP; 20 Apr 2023 02:25:51 -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 3/7] net/cpfl: save master time by alarm Date: Thu, 20 Apr 2023 05:19:31 -0400 Message-Id: <20230420091935.43116-4-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230420091935.43116-1-wenjing.qiao@intel.com> References: <20230420091935.43116-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 master 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