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

Re: [PATCH 2/4] xen/scsiback: use new command result macros


  • To: Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Thu, 21 Apr 2022 16:56:40 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DCAlBd4gJJ4mg164jNQlULsCgbg7QT4wMjEDmqu3oQU=; b=RWX8UlBVyAbIc9nC7XoxKL6FCvM5dUB0V/dsXkRD1AkbOpQUUusfabj48lGrqdZwPF+lqRdtrR1NDbyEK91Dt3h0cwIggar5hxikA+GzePPQ93oFPjC4kk8dbqiLM9Ub7Tj+Nwk7MQuj1Uim5qmrV06oYEdPcjYlvq2sC0SMELPM8nFmtvzzznkfZbaz3apdB6GBOkpWl9Ux/v7JigIh/UBgybmyVc/So2IUCasR15fQ4nrD7jTJIUQWKhnGzsxCSSqMmw6YR7BANLvnH0g4JRxGBsDdj05pQ0S4KemkKUU8cTyptCb/jUbNz8PMU/qBcIdz8NTc6hz14crAu1zNnw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QjPNhiTaEDzYuoK27u1DcoOWbVOEpRZGXtmqdM9h9TUtI+D624AuMTWx2Ro5jExZWlQ7asodiGSPdyLe2ZVKMTnnXf5sHMfTcLIZbR0Mk3C9ommUPjhT//V6fYJOYi2vKn1EAVmfXK2w35ypuRO4mS1yKdXdB85LXfyJ4DQlnKq0QuoIgfyQc/pafvrYPmTvPt8hIyCjDh6PYkhbobpv/1e7xuZ+V3IlO6Y4NHoktrjjEnPIWEMXLmn1a5QkxlV2ir7HKKrP6q6fVx0p62IIGUhloT296RpKULE6/aLlnN+zwnlZvao7a8kH58sB/ujFxdBXn4pqJFI5xcOOmfQ16g==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 21 Apr 2022 20:57:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 4/21/22 4:40 AM, Juergen Gross wrote:
On 20.04.22 18:12, Boris Ostrovsky wrote:

On 4/20/22 5:25 AM, Juergen Gross wrote:
@@ -569,7 +645,7 @@ static void scsiback_device_action(struct vscsibk_pend 
*pending_req,
      wait_for_completion(&pending_req->tmr_done);
      err = (se_cmd->se_tmr_req->response == TMR_FUNCTION_COMPLETE) ?
-        SUCCESS : FAILED;
+        XEN_VSCSIIF_RSLT_RESET_SUCCESS : XEN_VSCSIIF_RSLT_RESET_FAILED;
      scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
      transport_generic_free_cmd(&pending_req->se_cmd, 0);


You also want to initialize err to XEN_VSCSIIF_RSLT_RESET_FAILED.

I did that.


Yes you did. I don't know what I was was looking at.



And also looking at invocations of scsiback_do_resp_with_sense() I think those 
may need to be adjusted as well.

No, the invocations are fine, but scsiback_result() needs to pass through
the lowest 16 bits instead of only the lowest 8 bits of the result value.


What I was thinking was that this could use the reverse of 
XEN_VSCSIIF_RSLT_HOST(), i.e. something like

#define RSLT_HOST_TO_XEN_VSCSIIF(x)   ((x)<<16)

to be explicit about namespaces.


BTW, should scsiback_result() use XEN_VSCSIIF_RSLT_HOST() at the top?


-boris




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.