When the client has negotiated the use of channels all vfcFrames are
required to go down a Sub-CRQ channel or it is a protocoal violation. If
the adapter state is channelized submit vfcFrames to the appropriate
Sub-CRQ via the h_send_sub_crq() helper.

Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com>
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index f686c2cb0de2..897e3236534d 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -701,6 +701,15 @@ static int ibmvfc_send_crq(struct ibmvfc_host *vhost, u64 
word1, u64 word2)
        return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2);
 }
 
+static int ibmvfc_send_sub_crq(struct ibmvfc_host *vhost, u64 cookie, u64 
word1,
+                              u64 word2, u64 word3, u64 word4)
+{
+       struct vio_dev *vdev = to_vio_dev(vhost->dev);
+
+       return plpar_hcall_norets(H_SEND_SUB_CRQ, vdev->unit_address, cookie,
+                                 word1, word2, word3, word4);
+}
+
 /**
  * ibmvfc_send_crq_init - Send a CRQ init message
  * @vhost:     ibmvfc host struct
@@ -1524,8 +1533,17 @@ static int ibmvfc_send_event(struct ibmvfc_event *evt,
 
        mb();
 
-       if ((rc = ibmvfc_send_crq(vhost, be64_to_cpu(crq_as_u64[0]),
-                                 be64_to_cpu(crq_as_u64[1])))) {
+       if (vhost->using_channels && evt->crq.format == IBMVFC_CMD_FORMAT)
+               rc = ibmvfc_send_sub_crq(vhost,
+                                        
vhost->scsi_scrqs.scrqs[evt->hwq].vios_cookie,
+                                        be64_to_cpu(crq_as_u64[0]),
+                                        be64_to_cpu(crq_as_u64[1]),
+                                        0, 0);
+       else
+               rc = ibmvfc_send_crq(vhost, be64_to_cpu(crq_as_u64[0]),
+                                    be64_to_cpu(crq_as_u64[1]));
+
+       if (rc) {
                list_del(&evt->queue);
                del_timer(&evt->timer);
 
-- 
2.27.0

Reply via email to