From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E5FBA04DD; Fri, 23 Oct 2020 22:22:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D4BC55AAA; Fri, 23 Oct 2020 22:22:14 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8A2525A49 for ; Fri, 23 Oct 2020 22:22:10 +0200 (CEST) IronPort-SDR: g0YeoI5iZadKOsktAP8TlX9BS9mNBcuqMl7hzJxKmX6mmlESxKLq3/92KgddvKdLlWL3WeKpM8 AU+cctUvVnKw== X-IronPort-AV: E=McAfee;i="6000,8403,9783"; a="185434293" X-IronPort-AV: E=Sophos;i="5.77,409,1596524400"; d="scan'208";a="185434293" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 13:22:08 -0700 IronPort-SDR: 7HNetM/owYe4eddyaB4608y+ltg7UrybbUNz7XAle8SMcV+qH4/d2TzudOQAhtphw1HiQKZ3OY r0jcfeTHy++g== X-IronPort-AV: E=Sophos;i="5.77,409,1596524400"; d="scan'208";a="423518846" Received: from jbrandeb-desk.jf.intel.com ([10.166.244.152]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 13:22:08 -0700 From: Jesse Brandeburg To: brian.johnson@intel.com, thomas@monjalon.net, david.marchand@redhat.com Cc: Jesse Brandeburg , dev@dpdk.org, qi.z.zhang@intel.com Date: Fri, 23 Oct 2020 13:21:59 -0700 Message-Id: <20201023202200.1909832-2-jesse.brandeburg@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201023202200.1909832-1-jesse.brandeburg@intel.com> References: <20201023202200.1909832-1-jesse.brandeburg@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/2] iavf: Fix performance with writeback policy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The iavf driver was trying to use writeback on ITR, but was never setting an ITR, so it didn't work. This caused performance to be limited due to too much PCIe traffic and partial writes during most benchmarking workloads. Set the ITR during queue setup, which can be checked at runtime by reading register 0x2800. Setting the value to 2us allows for generally good streaming packet performance while keeping latency down. Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt") Reported-by: Brian Johnson Signed-off-by: Jesse Brandeburg --- drivers/net/iavf/iavf_ethdev.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 0ef023c0aee4..44372294066f 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -383,10 +383,19 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { /* If WB_ON_ITR supports, enable it */ vf->msix_base = IAVF_RX_VEC_START; + /* Set the ITR for index zero, to 2us to make sure that + * we leave time for aggregation to occur, but don't + * increase latency dramatically. + */ IAVF_WRITE_REG(hw, IAVF_VFINT_DYN_CTLN1(vf->msix_base - 1), - IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | - IAVF_VFINT_DYN_CTLN1_WB_ON_ITR_MASK); + (0 << IAVF_VFINT_DYN_CTLN1_ITR_INDX_SHIFT) | + IAVF_VFINT_DYN_CTLN1_WB_ON_ITR_MASK | + (2UL << IAVF_VFINT_DYN_CTLN1_INTERVAL_SHIFT)); + /* debug - check for success! the return value + * should be 2, offset is 0x2800 + */ + /* IAVF_READ_REG(hw, IAVF_VFINT_ITRN1(0, 0)); */ } else { /* If no WB_ON_ITR offload flags, need to set * interrupt for descriptor write back. -- 2.25.4