Skip to content

Commit 32c1b96

Browse files
Sunil Gouthamdavem330
authored andcommitted
net: thunderx: Fix RQ_DROP miscalculation
With earlier configured value sufficient number of CQEs are not being reserved for transmitted packets. Hence under heavy incoming traffic load, receive notifications will take away most of the CQ thus transmit notifications will be lost resulting in tx skbs not being freed. Finally SQ will be full and it will be stopped, watchdog timer will kick in. After this fix receive notifications will not take morethan half of CQ reserving the rest for transmit notifications. Also changed CQ & SQ sizes from 16k to 4k. This is also due to the receive notifications taking first half of CQ under heavy load and time taken by NAPI to clear transmit notifications will increase with higher queue sizes. Again results in SQ being stopped. Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: Aleksey Makarov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 143ceb0 commit 32c1b96

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/net/ethernet/cavium/thunder/nicvf_queues.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,18 @@
6262
#define SND_QUEUE_CNT 8
6363
#define CMP_QUEUE_CNT 8 /* Max of RCV and SND qcount */
6464

65-
#define SND_QSIZE SND_QUEUE_SIZE4
65+
#define SND_QSIZE SND_QUEUE_SIZE2
6666
#define SND_QUEUE_LEN (1ULL << (SND_QSIZE + 10))
6767
#define MAX_SND_QUEUE_LEN (1ULL << (SND_QUEUE_SIZE6 + 10))
6868
#define SND_QUEUE_THRESH 2ULL
6969
#define MIN_SQ_DESC_PER_PKT_XMIT 2
7070
/* Since timestamp not enabled, otherwise 2 */
7171
#define MAX_CQE_PER_PKT_XMIT 1
7272

73-
#define CMP_QSIZE CMP_QUEUE_SIZE4
73+
/* Keep CQ and SQ sizes same, if timestamping
74+
* is enabled this equation will change.
75+
*/
76+
#define CMP_QSIZE CMP_QUEUE_SIZE2
7477
#define CMP_QUEUE_LEN (1ULL << (CMP_QSIZE + 10))
7578
#define CMP_QUEUE_CQE_THRESH 0
7679
#define CMP_QUEUE_TIMER_THRESH 220 /* 10usec */
@@ -87,7 +90,12 @@
8790

8891
#define MAX_CQES_FOR_TX ((SND_QUEUE_LEN / MIN_SQ_DESC_PER_PKT_XMIT) * \
8992
MAX_CQE_PER_PKT_XMIT)
90-
#define RQ_CQ_DROP ((CMP_QUEUE_LEN - MAX_CQES_FOR_TX) / 256)
93+
/* Calculate number of CQEs to reserve for all SQEs.
94+
* Its 1/256th level of CQ size.
95+
* '+ 1' to account for pipelining
96+
*/
97+
#define RQ_CQ_DROP ((256 / (CMP_QUEUE_LEN / \
98+
(CMP_QUEUE_LEN - MAX_CQES_FOR_TX))) + 1)
9199

92100
/* Descriptor size in bytes */
93101
#define SND_QUEUE_DESC_SIZE 16

0 commit comments

Comments
 (0)