From: sunil.kovvuri@gmail.com (Sunil Goutham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] net: thunderx: Enable CQE count threshold interrupt
Date: Wed, 9 Dec 2015 17:08:01 +0530 [thread overview]
Message-ID: <1449661081-15435-3-git-send-email-sunil.kovvuri@gmail.com> (raw)
In-Reply-To: <y>
From: Sunil Goutham <sgoutham@cavium.com>
This feature is introduced in pass-2 chip and with this CQ interrupt
coalescing will work based on both timer and count.
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
---
drivers/net/ethernet/cavium/thunder/nic.h | 2 ++
drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +-
drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 5 ++++-
drivers/net/ethernet/cavium/thunder/nicvf_queues.h | 3 ++-
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h
index 02571f4..e782856 100644
--- a/drivers/net/ethernet/cavium/thunder/nic.h
+++ b/drivers/net/ethernet/cavium/thunder/nic.h
@@ -34,6 +34,8 @@
/* NIC priv flags */
#define NIC_SRIOV_ENABLED BIT(0)
+#define VNIC_NAPI_WEIGHT NAPI_POLL_WEIGHT
+
/* Min/Max packet size */
#define NIC_HW_MIN_FRS 64
#define NIC_HW_MAX_FRS 9200 /* 9216 max packet including FCS */
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index c24cb2a..e06a7f8 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -1155,7 +1155,7 @@ int nicvf_open(struct net_device *netdev)
cq_poll->cq_idx = qidx;
cq_poll->nicvf = nic;
netif_napi_add(netdev, &cq_poll->napi, nicvf_poll,
- NAPI_POLL_WEIGHT);
+ VNIC_NAPI_WEIGHT);
napi_enable(&cq_poll->napi);
nic->napi[qidx] = cq_poll;
}
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
index b11fc09..4e9709e 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
@@ -299,7 +299,10 @@ static int nicvf_init_cmp_queue(struct nicvf *nic,
return err;
cq->desc = cq->dmem.base;
- cq->thresh = CMP_QUEUE_CQE_THRESH;
+ if (!pass1_silicon(nic->pdev))
+ cq->thresh = CMP_QUEUE_CQE_THRESH;
+ else
+ cq->thresh = 0;
nic->cq_coalesce_usecs = (CMP_QUEUE_TIMER_THRESH * 0.05) - 1;
return 0;
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
index a4f6667..0fae6ad 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
@@ -10,6 +10,7 @@
#define NICVF_QUEUES_H
#include <linux/netdevice.h>
+#include "nic.h"
#include "q_struct.h"
#define MAX_QUEUE_SET 128
@@ -75,7 +76,7 @@
*/
#define CMP_QSIZE CMP_QUEUE_SIZE2
#define CMP_QUEUE_LEN (1ULL << (CMP_QSIZE + 10))
-#define CMP_QUEUE_CQE_THRESH 0
+#define CMP_QUEUE_CQE_THRESH (VNIC_NAPI_WEIGHT / 2)
#define CMP_QUEUE_TIMER_THRESH 80 /* ~2usec */
#define RBDR_SIZE RBDR_SIZE0
--
1.7.1
next prev reply other threads:[~2015-12-09 11:38 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <y@samsung.com>
2012-05-22 5:57 ` [PATCH v3 2/2] regulator: Add support for MAX77686 yadi.brar01 at gmail.com
2012-05-23 1:40 ` jonghwa3.lee at samsung.com
2012-05-23 4:16 ` Yadwinder Singh Brar
2012-05-23 4:40 ` jonghwa3.lee at samsung.com
2012-05-23 5:23 ` Yadwinder Singh Brar
2012-05-23 5:33 ` jonghwa3.lee at samsung.com
2012-05-23 10:18 ` Mark Brown
2012-05-23 13:02 ` Yadwinder Singh Brar
2012-05-23 6:08 ` Yadwinder Singh Brar
2012-05-23 1:50 ` jonghwa3.lee at samsung.com
2012-05-23 4:17 ` Yadwinder Singh Brar
2015-12-01 9:13 ` [PATCH 3/6] net: thunderx: Increase transmit queue length Sunil Goutham
2015-12-01 14:40 ` Pavel Fedin
2015-12-01 15:33 ` Eric Dumazet
2015-12-01 16:30 ` Sunil Kovvuri
2015-12-01 19:30 ` David Miller
2015-12-02 5:48 ` Sunil Kovvuri
2015-12-02 13:25 ` Eric Dumazet
2015-12-02 16:50 ` Sunil Kovvuri
2015-12-02 16:59 ` Eric Dumazet
2015-12-02 17:31 ` David Miller
2015-12-02 9:05 ` Pavel Fedin
2015-12-02 10:31 ` Pavel Fedin
2015-12-02 12:29 ` Pavel Fedin
2015-12-02 12:57 ` Sunil Kovvuri
2015-12-02 13:22 ` Pavel Fedin
2015-12-02 8:09 ` Pavel Fedin
2015-12-01 9:13 ` [PATCH 5/6] net: thunderx: Switchon carrier only upon interface link up Sunil Goutham
2015-12-01 15:32 ` Pavel Fedin
2015-12-01 16:39 ` Sunil Kovvuri
2015-12-07 5:00 ` [PATCH 0/2] net: thunderx: Miscellaneous cleanups Sunil Goutham
2015-12-07 10:33 ` Pavel Fedin
2015-12-07 18:40 ` David Miller
2015-12-09 11:38 ` [PATCH 1/2] net: thunderx: HW TSO support for pass-2 hardware Sunil Goutham
2015-12-09 12:05 ` Pavel Fedin
2015-12-09 12:24 ` Sunil Kovvuri
2015-12-09 20:26 ` David Miller
2015-12-09 11:38 ` Sunil Goutham [this message]
2015-12-09 12:07 ` [PATCH 2/2] net: thunderx: Enable CQE count threshold interrupt Pavel Fedin
2015-12-09 12:26 ` Sunil Kovvuri
2015-12-10 7:55 ` [PATCH v2 0/2] net: thunderx: Support for pass-2 hw features Sunil Goutham
2015-12-10 8:52 ` Pavel Fedin
2015-12-12 4:38 ` David Miller
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=1449661081-15435-3-git-send-email-sunil.kovvuri@gmail.com \
--to=sunil.kovvuri@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).