Commit a55667e6 authored by Prasad Kanneganti's avatar Prasad Kanneganti Committed by David S. Miller

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: default avatarPrasad Kanneganti <prasad.kanneganti@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d5c7d9b9
...@@ -1429,13 +1429,15 @@ int lio_get_device_id(void *dev) ...@@ -1429,13 +1429,15 @@ int lio_get_device_id(void *dev)
void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq) void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq)
{ {
u64 instr_cnt; u64 instr_cnt;
u32 pkts_pend;
struct octeon_device *oct = NULL; struct octeon_device *oct = NULL;
/* the whole thing needs to be atomic, ideally */ /* the whole thing needs to be atomic, ideally */
if (droq) { if (droq) {
pkts_pend = (u32)atomic_read(&droq->pkts_pending);
spin_lock_bh(&droq->lock); spin_lock_bh(&droq->lock);
writel(droq->pkt_count, droq->pkts_sent_reg); writel(droq->pkt_count - pkts_pend, droq->pkts_sent_reg);
droq->pkt_count = 0; droq->pkt_count = pkts_pend;
/* this write needs to be flushed before we release the lock */ /* this write needs to be flushed before we release the lock */
mmiowb(); mmiowb();
spin_unlock_bh(&droq->lock); spin_unlock_bh(&droq->lock);
......
...@@ -251,7 +251,7 @@ union octeon_instr_64B { ...@@ -251,7 +251,7 @@ union octeon_instr_64B {
/** The size of each buffer in soft command buffer pool /** The size of each buffer in soft command buffer pool
*/ */
#define SOFT_COMMAND_BUFFER_SIZE 1536 #define SOFT_COMMAND_BUFFER_SIZE 2048
struct octeon_soft_command { struct octeon_soft_command {
/** Soft command buffer info. */ /** Soft command buffer info. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment