diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index 537b21ee7..caefea89b 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -482,10 +482,9 @@ const struct file_operations ctr_fops = { }; #ifdef CONFIG_SCST_DEBUG -static void iscsi_dump_char(int ch) +static void iscsi_dump_char(int ch, unsigned char *text, int *pos) { - static unsigned char text[16]; - static int i; + int i = *pos; if (ch < 0) { while ((i % 16) != 0) { @@ -498,7 +497,7 @@ static void iscsi_dump_char(int ch) printk(KERN_CONT " |"); } i = 0; - return; + goto out; } text[i] = (ch < 0x20 || (ch >= 0x80 && ch <= 0xa0)) ? ' ' : ch; @@ -509,10 +508,17 @@ static void iscsi_dump_char(int ch) i = 0; } else if ((i % 4) == 0) printk(KERN_CONT " |"); + +out: + *pos = i; + return; } void iscsi_dump_pdu(struct iscsi_pdu *pdu) { + unsigned char text[16]; + int pos = 0; + if (trace_flag & TRACE_D_DUMP_PDU) { unsigned char *buf; int i; @@ -520,14 +526,14 @@ void iscsi_dump_pdu(struct iscsi_pdu *pdu) buf = (void *)&pdu->bhs; printk(KERN_DEBUG "BHS: (%p,%zd)\n", buf, sizeof(pdu->bhs)); for (i = 0; i < sizeof(pdu->bhs); i++) - iscsi_dump_char(*buf++); - iscsi_dump_char(-1); + iscsi_dump_char(*buf++, text, &pos); + iscsi_dump_char(-1, text, &pos); buf = (void *)pdu->ahs; printk(KERN_DEBUG "AHS: (%p,%d)\n", buf, pdu->ahssize); for (i = 0; i < pdu->ahssize; i++) - iscsi_dump_char(*buf++); - iscsi_dump_char(-1); + iscsi_dump_char(*buf++, text, &pos); + iscsi_dump_char(-1, text, &pos); printk(KERN_DEBUG "Data: (%d)\n", pdu->datasize); } diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index e3e459f10..da557ec03 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -824,8 +824,12 @@ static int recv(struct iscsi_conn *conn) break; case RX_CHECK_DDIGEST: conn->read_state = RX_END; - if (cmnd->pdu.datasize <= 256*1024) { - /* It's cache hot, so let's compute it inline */ + if (cmnd->pdu.datasize <= 16*1024) { + /* + * It's cache hot, so let's compute it inline. The + * choice here about what will expose more latency: + * possible cache misses or the digest calculation. + */ TRACE_DBG("cmnd %p, opcode %x: checking RX " "ddigest inline", cmnd, cmnd_opcode(cmnd)); cmnd->ddigest_checked = 1;