DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
To: brian.johnson@intel.com, thomas@monjalon.net, david.marchand@redhat.com
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	dev@dpdk.org, qi.z.zhang@intel.com
Subject: [dpdk-dev] [PATCH v2 1/2] iavf: Fix performance with writeback policy
Date: Fri, 23 Oct 2020 13:21:59 -0700	[thread overview]
Message-ID: <20201023202200.1909832-2-jesse.brandeburg@intel.com> (raw)
In-Reply-To: <20201023202200.1909832-1-jesse.brandeburg@intel.com>

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 <brian.johnson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
 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


  reply	other threads:[~2020-10-23 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 20:21 [dpdk-dev] [PATCH v2 0/2] intel: fix writeback Jesse Brandeburg
2020-10-23 20:21 ` Jesse Brandeburg [this message]
2020-10-23 20:22 ` [dpdk-dev] [PATCH v2 2/2] ice: update writeback policy to reduce latency Jesse Brandeburg
2020-10-26  1:11 ` [dpdk-dev] [PATCH v2 0/2] intel: fix writeback Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201023202200.1909832-2-jesse.brandeburg@intel.com \
    --to=jesse.brandeburg@intel.com \
    --cc=brian.johnson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).