Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp158928pxu; Wed, 2 Dec 2020 18:12:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxku76mkqs1di891AuqG5RY0IvyPvb88+24TnNhIp0BBKdqHFOEJ3G7qjS42DtCdr+vdbV X-Received: by 2002:a17:906:3807:: with SMTP id v7mr597279ejc.441.1606961522739; Wed, 02 Dec 2020 18:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606961522; cv=none; d=google.com; s=arc-20160816; b=ekCiDHewB32z0ksDVW9Mvss0lg8NOnrwyIEnmns8lEqVrdkm1iYJ0lQ1q3UX4m2/w5 jcnCKBIQziYlVxlk433V4DOYd9+iQvtiltGVXBWg+MXwaG3uKiAZ99bXWLHXZip4I8/E XWALMJit50jLWFUrYmKYCHhPmyO7ltXpgnHgze5vdvIjcPOB7pA/6Agycm9Sj6QBxDfW k78D6VIBR18tz7h/UEJ5BUiE1LBxpgvvvLYcBDtKFRYaOhu5sL59ewrkmvNMqFLidpqw Sl68NB/9w5XT/cJ6omrVvA/gqBcB5wHZwUkRL0b4gds3alzL7z7FmZ37U1ivMrrH/D6+ W1KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hJZ276vi5JSiqzv/GyFJ3+qhFdPyz+aRaWI7hvpz5zY=; b=BeyADjYxD84iCubQt+G9AazZdN0K9KJ/TymtJosVoMP6BXpu8oZYPvFJIrX8xuAtg+ pwMdVSavJczPUCJjQ4ytCeFWzvWmQuFpM2i0ltQ4HURool46WJWYk0tDqnaiyHSdTejo 60ETQ+hHBuJjJ9NOOxR0ud3ILsj9n2cvOMUifBPDw7o2j8LILnGSOviA8NT7oTDcvah6 /3AemEDar7IiJ72BX+qXTr7qaTW5MiBnt2DYvGO2scudbnE9brZVC5FMC7sJNdF9WHpK aJNGkYkCxOCW6wmCtckQ1sxBamKB/EGMaWXQ7TZ61z10g7i/EKutG6WAY0OUUk4pwGq1 l3WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WEBsB40B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si124187edb.323.2020.12.02.18.11.40; Wed, 02 Dec 2020 18:12:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WEBsB40B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729539AbgLCCJH (ORCPT + 99 others); Wed, 2 Dec 2020 21:09:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43622 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729516AbgLCCJH (ORCPT ); Wed, 2 Dec 2020 21:09:07 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B321ids044296; Wed, 2 Dec 2020 21:08:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=hJZ276vi5JSiqzv/GyFJ3+qhFdPyz+aRaWI7hvpz5zY=; b=WEBsB40BVZCu5rtrpbrl3jredLdbu/YEhckpvAZKRjGnM4qmINrhr24nOHnTkjZRKjnJ DJZjCXMrX+hQ9ZZ8fw/ohXf+tUSTjl5Xrp9CJxmcG7wI2ZG82FTsdKnhYNJSG7OQTaY8 Z5rP0RShPRtPmO2CHRqR/b3akSnFYaSbMg7tOLDvb+knOak0LYgRso99P6u8o7/Lc3Vt l+rmXLXbLEg34/OVlXARtEVuya6nI9mRTkZqKJd2U3u4GUoN/5O3jeJ/iJ4YkeKCLrBh ksWdfHvnHvOlbWHPBlN2IySfYBTDmnDdkhgsHVJVlawUzwC4KWC/3pDOM6SzXj3454W7 rg== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 356jdx73pp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 21:08:19 -0500 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B31uTs2006224; Thu, 3 Dec 2020 02:08:19 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03dal.us.ibm.com with ESMTP id 353e69pd99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Dec 2020 02:08:19 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B328Hwp22610222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Dec 2020 02:08:17 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8DC817805C; Thu, 3 Dec 2020 02:08:17 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01F747806A; Thu, 3 Dec 2020 02:08:17 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 3 Dec 2020 02:08:16 +0000 (GMT) From: Tyrel Datwyler To: james.bottomley@hansenpartnership.com Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, brking@linux.ibm.com, Tyrel Datwyler , Brian King Subject: [PATCH v3 12/18] ibmvfc: send commands down HW Sub-CRQ when channelized Date: Wed, 2 Dec 2020 20:08:00 -0600 Message-Id: <20201203020806.14747-13-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201203020806.14747-1-tyreld@linux.ibm.com> References: <20201203020806.14747-1-tyreld@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-12-02_14:2020-11-30,2020-12-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=1 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012030006 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index b51ae17883b7..d94db73d4a15 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 @@ -1513,15 +1522,19 @@ static int ibmvfc_send_event(struct ibmvfc_event *evt, struct ibmvfc_host *vhost, unsigned long timeout) { __be64 *crq_as_u64 = (__be64 *) &evt->crq; + int channel_cmd = 0; int rc; /* Copy the IU into the transfer area */ *evt->xfer_iu = evt->iu; - if (evt->crq.format == IBMVFC_CMD_FORMAT) + if (evt->crq.format == IBMVFC_CMD_FORMAT) { evt->xfer_iu->cmd.tag = cpu_to_be64((u64)evt); - else if (evt->crq.format == IBMVFC_MAD_FORMAT) + channel_cmd = 1; + } else if (evt->crq.format == IBMVFC_MAD_FORMAT) { evt->xfer_iu->mad_common.tag = cpu_to_be64((u64)evt); - else + if (evt->xfer_iu->mad_common.opcode == IBMVFC_TMF_MAD) + channel_cmd = 1; + } else BUG(); list_add_tail(&evt->queue, &vhost->sent); @@ -1534,8 +1547,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 && channel_cmd) + 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