Commit 4b1cc7e7 authored by John Lacombe's avatar John Lacombe Committed by Roland Dreier

RDMA/nes: Fix interrupt moderation low threshold

Interrupt moderation low threshold value was incorrectly triggering,
indicating that the threshold should be lowered.

The impact was the timer was likely to become 40usecs and get stuck
there.  The biggest side effect was too many interrupts and nonoptimal
performance.
Signed-off-by: default avatarJohn Lacombe <jlacombe@neteffect.com>
Signed-off-by: default avatarGlenn Streiff <gstreiff@neteffect.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 30da7cff
...@@ -156,15 +156,14 @@ static void nes_nic_tune_timer(struct nes_device *nesdev) ...@@ -156,15 +156,14 @@ static void nes_nic_tune_timer(struct nes_device *nesdev)
spin_lock_irqsave(&nesadapter->periodic_timer_lock, flags); spin_lock_irqsave(&nesadapter->periodic_timer_lock, flags);
if (shared_timer->cq_count_old < cq_count) { if (shared_timer->cq_count_old <= cq_count)
if (cq_count > shared_timer->threshold_low) shared_timer->cq_direction_downward = 0;
shared_timer->cq_direction_downward=0; else
}
if (shared_timer->cq_count_old >= cq_count)
shared_timer->cq_direction_downward++; shared_timer->cq_direction_downward++;
shared_timer->cq_count_old = cq_count; shared_timer->cq_count_old = cq_count;
if (shared_timer->cq_direction_downward > NES_NIC_CQ_DOWNWARD_TREND) { if (shared_timer->cq_direction_downward > NES_NIC_CQ_DOWNWARD_TREND) {
if (cq_count <= shared_timer->threshold_low) { if (cq_count <= shared_timer->threshold_low &&
shared_timer->threshold_low > 4) {
shared_timer->threshold_low = shared_timer->threshold_low/2; shared_timer->threshold_low = shared_timer->threshold_low/2;
shared_timer->cq_direction_downward=0; shared_timer->cq_direction_downward=0;
nesdev->currcq_count = 0; nesdev->currcq_count = 0;
...@@ -1728,7 +1727,6 @@ int nes_napi_isr(struct nes_device *nesdev) ...@@ -1728,7 +1727,6 @@ int nes_napi_isr(struct nes_device *nesdev)
nesdev->int_req &= ~NES_INT_TIMER; nesdev->int_req &= ~NES_INT_TIMER;
nes_write32(nesdev->regs+NES_INTF_INT_MASK, ~(nesdev->intf_int_req)); nes_write32(nesdev->regs+NES_INTF_INT_MASK, ~(nesdev->intf_int_req));
nes_write32(nesdev->regs+NES_INT_MASK, ~nesdev->int_req); nes_write32(nesdev->regs+NES_INT_MASK, ~nesdev->int_req);
nesadapter->tune_timer.timer_in_use_old = 0;
} }
nesdev->deepcq_count = 0; nesdev->deepcq_count = 0;
return 1; return 1;
...@@ -1867,7 +1865,6 @@ void nes_dpc(unsigned long param) ...@@ -1867,7 +1865,6 @@ void nes_dpc(unsigned long param)
nesdev->int_req &= ~NES_INT_TIMER; nesdev->int_req &= ~NES_INT_TIMER;
nes_write32(nesdev->regs + NES_INTF_INT_MASK, ~(nesdev->intf_int_req)); nes_write32(nesdev->regs + NES_INTF_INT_MASK, ~(nesdev->intf_int_req));
nes_write32(nesdev->regs+NES_INT_MASK, ~nesdev->int_req); nes_write32(nesdev->regs+NES_INT_MASK, ~nesdev->int_req);
nesdev->nesadapter->tune_timer.timer_in_use_old = 0;
} else { } else {
nes_write32(nesdev->regs+NES_INT_MASK, 0x0000ffff|(~nesdev->int_req)); nes_write32(nesdev->regs+NES_INT_MASK, 0x0000ffff|(~nesdev->int_req));
} }
......
...@@ -962,7 +962,7 @@ struct nes_arp_entry { ...@@ -962,7 +962,7 @@ struct nes_arp_entry {
#define DEFAULT_JUMBO_NES_QL_LOW 12 #define DEFAULT_JUMBO_NES_QL_LOW 12
#define DEFAULT_JUMBO_NES_QL_TARGET 40 #define DEFAULT_JUMBO_NES_QL_TARGET 40
#define DEFAULT_JUMBO_NES_QL_HIGH 128 #define DEFAULT_JUMBO_NES_QL_HIGH 128
#define NES_NIC_CQ_DOWNWARD_TREND 8 #define NES_NIC_CQ_DOWNWARD_TREND 16
struct nes_hw_tune_timer { struct nes_hw_tune_timer {
//u16 cq_count; //u16 cq_count;
......
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