linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmw_pvscsi: fixup tagging
@ 2014-10-02  7:21 Hannes Reinecke
  2014-10-17 13:16 ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Hannes Reinecke @ 2014-10-02  7:21 UTC (permalink / raw)
  To: Arvind Kumar
  Cc: pv-drivers, James Bottomley, Christoph Hellwig, linux-scsi,
	Hannes Reinecke

The request (and SCSI command) tag is the tag number assigned
by the generic block-tagging code, not the SCSI-II tag messages.
Those are represented by the device flags 'tagged_supported',
'simple_tags', and 'ordered_tags'.
(The SCSI midlayer doesn't use HEAD_OF_QUEUE tags).
So fixup vmw_pvscsi to assign the correct tag type.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/vmw_pvscsi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index 598f65e..d18df8c 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -724,9 +724,8 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
 
 	e->tag = SIMPLE_QUEUE_TAG;
 	if (sdev->tagged_supported &&
-	    (cmd->tag == HEAD_OF_QUEUE_TAG ||
-	     cmd->tag == ORDERED_QUEUE_TAG))
-		e->tag = cmd->tag;
+	    sdev->ordered_tags)
+		e->tag = ORDERED_QUEUE_TAG;
 
 	if (cmd->sc_data_direction == DMA_FROM_DEVICE)
 		e->flags = PVSCSI_FLAG_CMD_DIR_TOHOST;
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] vmw_pvscsi: fixup tagging
  2014-10-02  7:21 [PATCH] vmw_pvscsi: fixup tagging Hannes Reinecke
@ 2014-10-17 13:16 ` Christoph Hellwig
  2014-10-17 18:34   ` Arvind Kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2014-10-17 13:16 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: Arvind Kumar, pv-drivers, James Bottomley, linux-scsi

Can I get a review from VMWare for this one, please?

On Thu, Oct 02, 2014 at 09:21:41AM +0200, Hannes Reinecke wrote:
> The request (and SCSI command) tag is the tag number assigned
> by the generic block-tagging code, not the SCSI-II tag messages.
> Those are represented by the device flags 'tagged_supported',
> 'simple_tags', and 'ordered_tags'.
> (The SCSI midlayer doesn't use HEAD_OF_QUEUE tags).
> So fixup vmw_pvscsi to assign the correct tag type.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/scsi/vmw_pvscsi.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
> index 598f65e..d18df8c 100644
> --- a/drivers/scsi/vmw_pvscsi.c
> +++ b/drivers/scsi/vmw_pvscsi.c
> @@ -724,9 +724,8 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
>  
>  	e->tag = SIMPLE_QUEUE_TAG;
>  	if (sdev->tagged_supported &&
> -	    (cmd->tag == HEAD_OF_QUEUE_TAG ||
> -	     cmd->tag == ORDERED_QUEUE_TAG))
> -		e->tag = cmd->tag;
> +	    sdev->ordered_tags)
> +		e->tag = ORDERED_QUEUE_TAG;
>  
>  	if (cmd->sc_data_direction == DMA_FROM_DEVICE)
>  		e->flags = PVSCSI_FLAG_CMD_DIR_TOHOST;
> -- 
> 1.8.5.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
---end quoted text---

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] vmw_pvscsi: fixup tagging
  2014-10-17 13:16 ` Christoph Hellwig
@ 2014-10-17 18:34   ` Arvind Kumar
  2014-10-18 15:13     ` Christoph Hellwig
  2014-10-18 17:42     ` Hannes Reinecke
  0 siblings, 2 replies; 7+ messages in thread
From: Arvind Kumar @ 2014-10-17 18:34 UTC (permalink / raw)
  To: Christoph Hellwig, Hannes Reinecke
  Cc: pv-drivers@vmware.com, James Bottomley,
	linux-scsi@vger.kernel.org

Hi Christoph,

Thanks for the change. Sorry for the delay. The change looks fine to me. I just have a question.

The comment in include/scsi/scsi_cmnd.h says:

struct scsi_cmnd {
...
             unsigned char tag; /* SCSI-II queued command tag */
}

Is that comment not right? Should we update that too?

Thanks!
Arvind
________________________________________
From: Christoph Hellwig <hch@infradead.org>
Sent: Friday, October 17, 2014 6:16 AM
To: Hannes Reinecke
Cc: Arvind Kumar; pv-drivers@vmware.com; James Bottomley; linux-scsi@vger.kernel.org
Subject: Re: [PATCH] vmw_pvscsi: fixup tagging

Can I get a review from VMWare for this one, please?

On Thu, Oct 02, 2014 at 09:21:41AM +0200, Hannes Reinecke wrote:
> The request (and SCSI command) tag is the tag number assigned
> by the generic block-tagging code, not the SCSI-II tag messages.
> Those are represented by the device flags 'tagged_supported',
> 'simple_tags', and 'ordered_tags'.
> (The SCSI midlayer doesn't use HEAD_OF_QUEUE tags).
> So fixup vmw_pvscsi to assign the correct tag type.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/scsi/vmw_pvscsi.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
> index 598f65e..d18df8c 100644
> --- a/drivers/scsi/vmw_pvscsi.c
> +++ b/drivers/scsi/vmw_pvscsi.c
> @@ -724,9 +724,8 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
>
>       e->tag = SIMPLE_QUEUE_TAG;
>       if (sdev->tagged_supported &&
> -         (cmd->tag == HEAD_OF_QUEUE_TAG ||
> -          cmd->tag == ORDERED_QUEUE_TAG))
> -             e->tag = cmd->tag;
> +         sdev->ordered_tags)
> +             e->tag = ORDERED_QUEUE_TAG;
>
>       if (cmd->sc_data_direction == DMA_FROM_DEVICE)
>               e->flags = PVSCSI_FLAG_CMD_DIR_TOHOST;
> --
> 1.8.5.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  https://urldefense.proofpoint.com/v1/url?u=http://vger.kernel.org/majordomo-info.html&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=5bh61bBshOhAkuAAXcD9BERI%2F4iK5qLrSSxbaPeaJh4%3D%0A&m=3T3CxXvbfPAK%2FDIE7aWB7MFmojVqfTOyoVs1VP7639M%3D%0A&s=97965a758f2187327667f0a727748779fd8dcdd81eb2da9d33f694fe7893e5d3
---end quoted text---

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vmw_pvscsi: fixup tagging
  2014-10-17 18:34   ` Arvind Kumar
@ 2014-10-18 15:13     ` Christoph Hellwig
  2014-10-18 17:42     ` Hannes Reinecke
  1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2014-10-18 15:13 UTC (permalink / raw)
  To: Arvind Kumar
  Cc: Hannes Reinecke, pv-drivers@vmware.com, James Bottomley,
	linux-scsi@vger.kernel.org

On Fri, Oct 17, 2014 at 06:34:48PM +0000, Arvind Kumar wrote:
> Hi Christoph,
> 
> Thanks for the change. Sorry for the delay. The change looks fine to me. I just have a question.
> 
> The comment in include/scsi/scsi_cmnd.h says:
> 
> struct scsi_cmnd {
> ...
>              unsigned char tag; /* SCSI-II queued command tag */
> }
> 
> Is that comment not right? Should we update that too?

The comment looks very confusing and I'm fine with a patch that just
removes the comment.  That being said Hannes has patches to remove the
whole field which I'd like to merge once he fixes up the remaining
issues, so it might not worth the effort.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vmw_pvscsi: fixup tagging
  2014-10-17 18:34   ` Arvind Kumar
  2014-10-18 15:13     ` Christoph Hellwig
@ 2014-10-18 17:42     ` Hannes Reinecke
  2014-10-20 22:12       ` Arvind Kumar
  1 sibling, 1 reply; 7+ messages in thread
From: Hannes Reinecke @ 2014-10-18 17:42 UTC (permalink / raw)
  To: Arvind Kumar, Christoph Hellwig
  Cc: pv-drivers@vmware.com, James Bottomley,
	linux-scsi@vger.kernel.org

On 10/17/2014 08:34 PM, Arvind Kumar wrote:
> Hi Christoph,
>
> Thanks for the change. Sorry for the delay. The change looks fine to me. I just have a question.
>
> The comment in include/scsi/scsi_cmnd.h says:
>
> struct scsi_cmnd {
> ...
>               unsigned char tag; /* SCSI-II queued command tag */
> }
>
> Is that comment not right? Should we update that too?
>
The 'tag' field from the scsi_cmnd is indeed meant for the SCSI-II 
queued command tag. But due to recent changes 'struct request' also
contains a tag number which is used to implement a tag map.
So the 'tag; field from struct scsi_cmnd is basically obsolete,
and we're working on removing it.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] vmw_pvscsi: fixup tagging
  2014-10-18 17:42     ` Hannes Reinecke
@ 2014-10-20 22:12       ` Arvind Kumar
  2014-11-03 18:30         ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Arvind Kumar @ 2014-10-20 22:12 UTC (permalink / raw)
  To: Hannes Reinecke, Christoph Hellwig
  Cc: pv-drivers@vmware.com, James Bottomley,
	linux-scsi@vger.kernel.org

Thanks Hannes and Christoph for the answers. The patch to vmw_pvscsi.c looks fine to me.

Acked-by: Arvind Kumar <arvindkumar@vmware.com>

Thanks!
Arvind
________________________________________
From: Hannes Reinecke <hare@suse.de>
Sent: Saturday, October 18, 2014 10:42 AM
To: Arvind Kumar; Christoph Hellwig
Cc: pv-drivers@vmware.com; James Bottomley; linux-scsi@vger.kernel.org
Subject: Re: [PATCH] vmw_pvscsi: fixup tagging

On 10/17/2014 08:34 PM, Arvind Kumar wrote:
> Hi Christoph,
>
> Thanks for the change. Sorry for the delay. The change looks fine to me. I just have a question.
>
> The comment in include/scsi/scsi_cmnd.h says:
>
> struct scsi_cmnd {
> ...
>               unsigned char tag; /* SCSI-II queued command tag */
> }
>
> Is that comment not right? Should we update that too?
>
The 'tag' field from the scsi_cmnd is indeed meant for the SCSI-II
queued command tag. But due to recent changes 'struct request' also
contains a tag number which is used to implement a tag map.
So the 'tag; field from struct scsi_cmnd is basically obsolete,
and we're working on removing it.

Cheers,

Hannes
--
Dr. Hannes Reinecke                   zSeries & Storage
hare@suse.de                          +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] vmw_pvscsi: fixup tagging
  2014-10-20 22:12       ` Arvind Kumar
@ 2014-11-03 18:30         ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2014-11-03 18:30 UTC (permalink / raw)
  To: Arvind Kumar
  Cc: Hannes Reinecke, Christoph Hellwig, pv-drivers@vmware.com,
	James Bottomley, linux-scsi@vger.kernel.org

FYI, I've updated the patch a bit in my tree to always set  e->tag to
SIMPLE_QUEUE_TAG.  The rationale for that is that we actually never set
MSG_ORDERED_TAG for other drivers since 2010, and fixing this up
properly in this driver makes it conflict less with my patch series to
fix up more mess in this area.

Updated patch below:

---
From: Hannes Reinecke <hare@suse.de>
Subject: vmw_pvscsi: fixup tagging

The request (and SCSI command) tag is the tag number assigned
by the generic block-tagging code, not the SCSI-II tag messages.
Those are represented by the device flags 'tagged_supported',
'simple_tags', and 'ordered_tags'.
(The SCSI midlayer doesn't use HEAD_OF_QUEUE tags).
So fixup vmw_pvscsi to assign the correct tag type.

[hch: fixed up to never set MSG_ORDERED_TAG]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Arvind Kumar <arvindkumar@vmware.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/vmw_pvscsi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index 598f65e..7dd4d17 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -723,10 +723,6 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
 	memcpy(e->cdb, cmd->cmnd, e->cdbLen);
 
 	e->tag = SIMPLE_QUEUE_TAG;
-	if (sdev->tagged_supported &&
-	    (cmd->tag == HEAD_OF_QUEUE_TAG ||
-	     cmd->tag == ORDERED_QUEUE_TAG))
-		e->tag = cmd->tag;
 
 	if (cmd->sc_data_direction == DMA_FROM_DEVICE)
 		e->flags = PVSCSI_FLAG_CMD_DIR_TOHOST;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-03 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02  7:21 [PATCH] vmw_pvscsi: fixup tagging Hannes Reinecke
2014-10-17 13:16 ` Christoph Hellwig
2014-10-17 18:34   ` Arvind Kumar
2014-10-18 15:13     ` Christoph Hellwig
2014-10-18 17:42     ` Hannes Reinecke
2014-10-20 22:12       ` Arvind Kumar
2014-11-03 18:30         ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).