- Data digest SMP scalability imcreased

- Iscsi_dump_char() made thread safe



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@841 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-05-11 17:24:51 +00:00
parent 9414a771d6
commit 1c304091f4
2 changed files with 20 additions and 10 deletions

View File

@@ -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);
}

View File

@@ -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;