Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177947
b: refs/heads/master
c: 8776193
h: refs/heads/master
i:
  177945: eb80957
  177943: 6a74237
v: v3
  • Loading branch information
Anil Veerabhadrappa authored and James Bottomley committed Dec 10, 2009
1 parent 94a7d9e commit 41717ba
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8c9abe797c54e798b4025b54d71e5d2054c929a
refs/heads/master: 8776193bc308553ac0011b3bb2dd1837e0c6ab28
1 change: 1 addition & 0 deletions trunk/drivers/scsi/bnx2i/bnx2i.h
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ extern unsigned int error_mask1, error_mask2;
extern u64 iscsi_error_mask;
extern unsigned int en_tcp_dack;
extern unsigned int event_coal_div;
extern unsigned int event_coal_min;

extern struct scsi_transport_template *bnx2i_scsi_xport_template;
extern struct iscsi_transport bnx2i_iscsi_transport;
Expand Down
34 changes: 26 additions & 8 deletions trunk/drivers/scsi/bnx2i/bnx2i_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,38 @@ void bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action)
{
struct bnx2i_5771x_cq_db *cq_db;
u16 cq_index;
u16 next_index;
u32 num_active_cmds;


/* Coalesce CQ entries only on 10G devices */
if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type))
return;

/* Do not update CQ DB multiple times before firmware writes
* '0xFFFF' to CQDB->SQN field. Deviation may cause spurious
* interrupts and other unwanted results
*/
cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt;
if (cq_db->sqn[0] && cq_db->sqn[0] != 0xFFFF)
return;

if (action == CNIC_ARM_CQE) {
cq_index = ep->qp.cqe_exp_seq_sn +
ep->num_active_cmds / event_coal_div;
cq_index %= (ep->qp.cqe_size * 2 + 1);
if (!cq_index) {
num_active_cmds = ep->num_active_cmds;
if (num_active_cmds <= event_coal_min)
next_index = 1;
else
next_index = event_coal_min +
(num_active_cmds - event_coal_min) / event_coal_div;
if (!next_index)
next_index = 1;
cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1;
if (cq_index > ep->qp.cqe_size * 2)
cq_index -= ep->qp.cqe_size * 2;
if (!cq_index)
cq_index = 1;
cq_db = (struct bnx2i_5771x_cq_db *)
ep->qp.cq_pgtbl_virt;
cq_db->sqn[0] = cq_index;
}

cq_db->sqn[0] = cq_index;
}
}

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/scsi/bnx2i/bnx2i_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ MODULE_VERSION(DRV_MODULE_VERSION);

static DEFINE_MUTEX(bnx2i_dev_lock);

unsigned int event_coal_min = 24;
module_param(event_coal_min, int, 0664);
MODULE_PARM_DESC(event_coal_min, "Event Coalescing Minimum Commands");

unsigned int event_coal_div = 1;
module_param(event_coal_div, int, 0664);
MODULE_PARM_DESC(event_coal_div, "Event Coalescing Divide Factor");
Expand Down

0 comments on commit 41717ba

Please sign in to comment.