Skip to content

Commit a55667e

Browse files
Prasad Kannegantidavem330
authored andcommitted
liquidio: fix inaccurate count of napi-processed rx packets reported to Octeon
lio_enable_irq (called by napi poll) is reporting to Octeon an inaccurate count of processed rx packets causing Octeon to eventually stop forwarding packets to the host. Fix it by using this formula for an accurate count: processed rx packets = droq->pkt_count - droq->pkts_pending Also increase SOFT_COMMAND_BUFFER_SIZE to match what the firmware expects. Signed-off-by: Prasad Kanneganti <prasad.kanneganti@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d5c7d9b commit a55667e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/net/ethernet/cavium/liquidio/octeon_device.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,13 +1429,15 @@ int lio_get_device_id(void *dev)
14291429
void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq)
14301430
{
14311431
u64 instr_cnt;
1432+
u32 pkts_pend;
14321433
struct octeon_device *oct = NULL;
14331434

14341435
/* the whole thing needs to be atomic, ideally */
14351436
if (droq) {
1437+
pkts_pend = (u32)atomic_read(&droq->pkts_pending);
14361438
spin_lock_bh(&droq->lock);
1437-
writel(droq->pkt_count, droq->pkts_sent_reg);
1438-
droq->pkt_count = 0;
1439+
writel(droq->pkt_count - pkts_pend, droq->pkts_sent_reg);
1440+
droq->pkt_count = pkts_pend;
14391441
/* this write needs to be flushed before we release the lock */
14401442
mmiowb();
14411443
spin_unlock_bh(&droq->lock);

drivers/net/ethernet/cavium/liquidio/octeon_iq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ union octeon_instr_64B {
251251

252252
/** The size of each buffer in soft command buffer pool
253253
*/
254-
#define SOFT_COMMAND_BUFFER_SIZE 1536
254+
#define SOFT_COMMAND_BUFFER_SIZE 2048
255255

256256
struct octeon_soft_command {
257257
/** Soft command buffer info. */

0 commit comments

Comments
 (0)