summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/liquidio/request_manager.c
diff options
context:
space:
mode:
authorRick Farrington2018-08-28 20:32:55 +0200
committerDavid S. Miller2018-08-30 04:47:52 +0200
commitb943f17e06493fd2c7fd00743093ad5dcdb90e7f (patch)
treec11e87c4f0720b3b86a99c01a19b24b58f162606 /drivers/net/ethernet/cavium/liquidio/request_manager.c
parentliquidio: remove unnecessary delay when processing IQ responses (diff)
downloadkernel-qcow2-linux-b943f17e06493fd2c7fd00743093ad5dcdb90e7f.tar.gz
kernel-qcow2-linux-b943f17e06493fd2c7fd00743093ad5dcdb90e7f.tar.xz
kernel-qcow2-linux-b943f17e06493fd2c7fd00743093ad5dcdb90e7f.zip
liquidio: fix race condition in instruction completion processing
In lio_enable_irq, the pkt_in_done count register was being cleared to zero. However, there could be some completed instructions which were not yet processed due to budget and limit constraints. So, only write this register with the number of actual completions that were processed. Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio/request_manager.c')
-rw-r--r--drivers/net/ethernet/cavium/liquidio/request_manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c
index 0a06fbb4ff8a..5de5ce9a8f54 100644
--- a/drivers/net/ethernet/cavium/liquidio/request_manager.c
+++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c
@@ -123,6 +123,7 @@ int octeon_init_instr_queue(struct octeon_device *oct,
iq->do_auto_flush = 1;
iq->db_timeout = (u32)conf->db_timeout;
atomic_set(&iq->instr_pending, 0);
+ iq->pkts_processed = 0;
/* Initialize the spinlock for this instruction queue */
spin_lock_init(&iq->lock);
@@ -495,6 +496,7 @@ octeon_flush_iq(struct octeon_device *oct, struct octeon_instr_queue *iq,
lio_process_iq_request_list(oct, iq, 0);
if (inst_processed) {
+ iq->pkts_processed += inst_processed;
atomic_sub(inst_processed, &iq->instr_pending);
iq->stats.instr_processed += inst_processed;
}