Skip to content

Commit 88c991a

Browse files
dnlsndavem330
authored andcommitted
net: thunder: change q_len's type to handle max ring size
The Cavium thunder nicvf driver supports rx/tx rings of up to 65536 entries per. The number of entires are stored in the q_len member of struct q_desc_mem. The problem is that q_len being a u16, results in 65536 becoming 0. In getting pointers to descriptors in the rings, the driver uses q_len minus 1 as a mask after incrementing the pointer, in order to go back to the beginning and not go past the end of the ring. With the q_len set to 0 the mask is no longer correct and the driver does go beyond the end of the ring, causing various ills. Usually the first thing that shows up is a "NETDEV WATCHDOG: enP2p1s0f1 (nicvf): transmit queue 7 timed out" warning. This patch remedies the problem by changing q_len to a u32. Signed-off-by: Dean Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0c42c8 commit 88c991a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ struct rx_tx_queue_stats {
213213
struct q_desc_mem {
214214
dma_addr_t dma;
215215
u64 size;
216-
u16 q_len;
216+
u32 q_len;
217217
dma_addr_t phys_base;
218218
void *base;
219219
void *unalign_base;

0 commit comments

Comments
 (0)