DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: surendra@chelsio.com, shaguna@chelsio.com, indranil@chelsio.com,
	nirranjan@chelsio.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 4/5] net/cxgbe: fix Rx channel map and queue type
Date: Sat, 30 Jun 2018 00:53:54 +0530	[thread overview]
Message-ID: <41ccf6375f0c888226b103d856e26766a39dae88.1530300158.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <cover.1530300158.git.rahul.lakkireddy@chelsio.com>
In-Reply-To: <cover.1530300158.git.rahul.lakkireddy@chelsio.com>

Set the Rx channel map and ingress queue type properly to allow firmware
to manage the internal mapping correctly.

Fixes: 6c2809628cd5 ("net/cxgbe: improve latency for slow traffic")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/t4fw_interface.h |  8 ++++++++
 drivers/net/cxgbe/cxgbe_compat.h        |  9 ---------
 drivers/net/cxgbe/sge.c                 | 10 +++++++---
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/net/cxgbe/base/t4fw_interface.h b/drivers/net/cxgbe/base/t4fw_interface.h
index 9dc6d8123..5ddde6b59 100644
--- a/drivers/net/cxgbe/base/t4fw_interface.h
+++ b/drivers/net/cxgbe/base/t4fw_interface.h
@@ -794,6 +794,11 @@ enum fw_iq_type {
 	FW_IQ_TYPE_FL_INT_CAP,
 };
 
+enum fw_iq_iqtype {
+	FW_IQ_IQTYPE_NIC = 1,
+	FW_IQ_IQTYPE_OFLD,
+};
+
 struct fw_iq_cmd {
 	__be32 op_to_vfn;
 	__be32 alloc_to_len16;
@@ -927,6 +932,9 @@ struct fw_iq_cmd {
 	(((x) >> S_FW_IQ_CMD_IQFLINTCONGEN) & M_FW_IQ_CMD_IQFLINTCONGEN)
 #define F_FW_IQ_CMD_IQFLINTCONGEN	V_FW_IQ_CMD_IQFLINTCONGEN(1U)
 
+#define S_FW_IQ_CMD_IQTYPE	24
+#define V_FW_IQ_CMD_IQTYPE(x)	((x) << S_FW_IQ_CMD_IQTYPE)
+
 #define S_FW_IQ_CMD_FL0CNGCHMAP		20
 #define M_FW_IQ_CMD_FL0CNGCHMAP		0xf
 #define V_FW_IQ_CMD_FL0CNGCHMAP(x)	((x) << S_FW_IQ_CMD_FL0CNGCHMAP)
diff --git a/drivers/net/cxgbe/cxgbe_compat.h b/drivers/net/cxgbe/cxgbe_compat.h
index 779bcf165..d33452861 100644
--- a/drivers/net/cxgbe/cxgbe_compat.h
+++ b/drivers/net/cxgbe/cxgbe_compat.h
@@ -198,15 +198,6 @@ static inline int cxgbe_fls(int x)
 	return x ? sizeof(x) * 8 - __builtin_clz(x) : 0;
 }
 
-/**
- * cxgbe_ffs - find first bit set
- * @x: the word to search
- */
-static inline int cxgbe_ffs(int x)
-{
-	return x ? __builtin_ffs(x) : 0;
-}
-
 static inline unsigned long ilog2(unsigned long n)
 {
 	unsigned int e = 0;
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 357b4856d..4ea40d191 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -1889,12 +1889,16 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
 			    F_FW_CMD_WRITE | F_FW_CMD_EXEC);
 
 	if (is_pf4(adap)) {
-		pciechan = cong > 0 ? cxgbe_ffs(cong) - 1 : pi->tx_chan;
+		pciechan = pi->tx_chan;
 		c.op_to_vfn |= htonl(V_FW_IQ_CMD_PFN(adap->pf) |
 				     V_FW_IQ_CMD_VFN(0));
 		if (cong >= 0)
-			c.iqns_to_fl0congen = htonl(F_FW_IQ_CMD_IQFLINTCONGEN |
-						    F_FW_IQ_CMD_IQRO);
+			c.iqns_to_fl0congen =
+				htonl(F_FW_IQ_CMD_IQFLINTCONGEN |
+				      V_FW_IQ_CMD_IQTYPE(cong ?
+							 FW_IQ_IQTYPE_NIC :
+							 FW_IQ_IQTYPE_OFLD) |
+				      F_FW_IQ_CMD_IQRO);
 	} else {
 		pciechan = pi->port_id;
 	}
-- 
2.14.1

  parent reply	other threads:[~2018-06-29 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 19:23 [dpdk-dev] [PATCH 0/5] net/cxgbe: feature updates and bug fixes Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 1/5] net/cxgbe: add link up and down ops Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 2/5] net/cxgbe: enable more RSS hash functions Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 3/5] net/cxgbe: query firmware for max queues available Rahul Lakkireddy
2018-06-29 19:23 ` Rahul Lakkireddy [this message]
2018-06-29 19:23 ` [dpdk-dev] [PATCH 5/5] net/cxgbevf: add missing Tx byte counters Rahul Lakkireddy
2018-07-04 20:02 ` [dpdk-dev] [PATCH 0/5] net/cxgbe: feature updates and bug fixes Ferruh Yigit

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=41ccf6375f0c888226b103d856e26766a39dae88.1530300158.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=indranil@chelsio.com \
    --cc=nirranjan@chelsio.com \
    --cc=shaguna@chelsio.com \
    --cc=stable@dpdk.org \
    --cc=surendra@chelsio.com \
    /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).