NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/51037



The following reply was made to PR kern/51037; it has been noted by GNATS.

From: "Aaron J. Grier" <agrier%poofygoof.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/51037
Date: Thu, 18 Aug 2016 00:12:35 -0700

 I did a minimal back-port from -current to propagate tag information to
 pdu, and now FreeBSD target is happy, and I can newfs the drive.
 
 running bonnie++ locks up in biolock, but that's a different issue.  :)
 
 this bug can be closed.  (off to check -current.)
 
 Index: sys/dev/iscsi/iscsi_globals.h
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/iscsi/iscsi_globals.h,v
 retrieving revision 1.6
 diff -u -r1.6 iscsi_globals.h
 --- sys/dev/iscsi/iscsi_globals.h	29 Dec 2012 11:05:29 -0000	1.6
 +++ sys/dev/iscsi/iscsi_globals.h	18 Aug 2016 07:10:29 -0000
 @@ -49,6 +49,7 @@
  #include <sys/device.h>
  
  #include <dev/scsipi/scsi_all.h>
 +#include <dev/scsipi/scsi_message.h>
  #include <dev/scsipi/scsipi_all.h>
  #include <dev/scsipi/scsiconf.h>
  #include <dev/scsipi/scsipiconf.h>
 @@ -59,7 +60,7 @@
  
  /* ------------------------ Code selection constants ------------------------ */
  
 -/* #define ISCSI_DEBUG      1 */
 +#define ISCSI_DEBUG      0
  
  #include "iscsi_perf.h"
  #include "iscsi_test.h"
 @@ -295,6 +296,7 @@
  	/* length of text data so far */
  
  	uint64_t		lun; /* LUN */
 +	uint32_t		tag; /* Command tag */
  	uint8_t			*cmd; /* SCSI command block */
  	uint16_t		cmdlen; /* SCSI command block length */
  	bool			data_in; /* if this is a read request */
 Index: sys/dev/iscsi/iscsi_send.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/iscsi/iscsi_send.c,v
 retrieving revision 1.8.12.1
 diff -u -r1.8.12.1 iscsi_send.c
 --- sys/dev/iscsi/iscsi_send.c	29 Sep 2014 15:45:36 -0000	1.8.12.1
 +++ sys/dev/iscsi/iscsi_send.c	18 Aug 2016 07:10:29 -0000
 @@ -1431,6 +1431,7 @@
  
  	if (!totlen)
  		pdu->Flags |= FLAG_FINAL;
 +	pdu->Flags |= ccb->tag;
  
  	if (ccb->data_in)
  		init_sernum(&ccb->DataSN_buf);
 @@ -1524,6 +1525,21 @@
  	DEB(10, ("RunXfer: Periph_lun = %d, cmd[1] = %x, cmdlen = %d\n",
  			xs->xs_periph->periph_lun, ccb->cmd[1], xs->cmdlen));
  
 +	switch (xs->xs_tag_type) {
 +	case MSG_ORDERED_Q_TAG:
 +		ccb->tag = ATTR_ORDERED;
 +		break;
 +	case MSG_SIMPLE_Q_TAG:
 +		ccb->tag = ATTR_SIMPLE;
 +		break;
 +	case MSG_HEAD_OF_Q_TAG:
 +		ccb->tag = ATTR_HEAD_OF_QUEUE;
 +		break;
 +	default:
 +		ccb->tag = 0;
 +		break;
 +	}
 +
  #ifdef LUN_1
  	ccb->lun += 0x1000000000000LL;
  	ccb->cmd[1] += 0x10;
 
 -- 
   Aaron J. Grier | "Not your ordinary poofy goof." | agrier%poofygoof.com@localhost
 


Home | Main Index | Thread Index | Old Index