Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp485695pxu; Tue, 1 Dec 2020 16:57:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJRD2I9NBYV+iuqwJ9al517S8z2RrcR/A1jh81mCWJugVJWKGDt7uVqOx5ESSECMvmU2Ok X-Received: by 2002:a50:e68b:: with SMTP id z11mr272572edm.25.1606870632024; Tue, 01 Dec 2020 16:57:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606870632; cv=none; d=google.com; s=arc-20160816; b=kOPbXpbAqUilyAfE8ePZlW6AZJ/SyKSJNsONPxljxhpMQWXa45mQiU/JObetTyE3mQ c/qou9pjOnb82hJZytZZdd5SBoXgAnOzDIl4aLENmEFpLh9VOo0f0DMmXKcwKnpwoKc1 NXhKRQ0Z6rNEY/boh2SYtuccBZ3I1V8UEwfsWiCQsaE01pca1STT00ZfowFiMo0OCiGq nhWk/m3/uVvW5/Mrc/06dBJZ6ULowYXjvS7akh4+PruIzIfn3BXX3nysLxmJsQaR7F2t oZOHCmltOhUNAlK1Sr+pUpztVNYwwHvh9/XJScDaJkYTMjsaD/WpRHtn2menWksPwd0y B/nQ== 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=YEMrdE+VXD5h/il1OoherijXy1Gq3nfbWuBFK/lUquI=; b=G2b6sP5Th/rnTxz7EFCT4wLoSHxGoV/rkIJa49PrMIgxtJDwGgQN8F2iLQH6nq91KS nTmfdYspBN8qm502C5L5Mgycwr/Dqi3VZ5BbaQ6vsDXRTL4D0oBa1vJy7o3avFXpxVN0 0WVMIgrxEsHYK1OGJs7N2CejCZWChxWaQvdT4sLdgsELz90hg/BIt7q5G0YJ19He/Bcv ncVycJnGvtYnYFi7d/pcK6JDC+ZWAM8sZh6le8AJjyMvDOouPLXXe8eUgvBXDA9+HpNQ KwtNJMsZEMc4YKtgK25eQLINF92PH9ELqEUpp8BLFlIIwGr08WEVVGE62fQm7VmWPzvG R5kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=MNGdGsXR; 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 e17si59117edr.527.2020.12.01.16.56.49; Tue, 01 Dec 2020 16:57:12 -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=MNGdGsXR; 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 S1727694AbgLBAyb (ORCPT + 99 others); Tue, 1 Dec 2020 19:54:31 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:2578 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727605AbgLBAy3 (ORCPT ); Tue, 1 Dec 2020 19:54:29 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B202t1f040479; Tue, 1 Dec 2020 19:53:39 -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=YEMrdE+VXD5h/il1OoherijXy1Gq3nfbWuBFK/lUquI=; b=MNGdGsXRZEJ+eBNtdA72ZlHh7O3NYED5hbwne0BXODuV5InN3QWKI6naZj6Xp+snNUf6 uYXX3091d8N/MnLo0dNwLD3vu2buLRt8Z0nkdYkOCfR/xnRT64h7EQNso9qD05hXPyaU QoW0GmTeyRRmlzb+u9YjvYbZIJ0Yt5l9+GGDbDWAT2U3g7b2k9X3bIGD4ZtY4mbYAvWj D65oYOf3GsSL8yQgVZTVklp+sGPmFUddzFDd/qaHcHitXV82WCXlV/F+r2Iq/f1kYCpO M5h8iiX1uFf+KYocD+aKkLR/9m1VpA5d0Y5XqEpZ62oaG/oNGJ2AHacWhsI719uo3BFI eQ== Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 355h8d6xqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Dec 2020 19:53:39 -0500 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B20chel020119; Wed, 2 Dec 2020 00:53:38 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma04dal.us.ibm.com with ESMTP id 353e69bga3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 00:53:38 +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 0B20rblY15597906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Dec 2020 00:53:37 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E61DB78060; Wed, 2 Dec 2020 00:53:36 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 802F77805E; Wed, 2 Dec 2020 00:53:36 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 2 Dec 2020 00:53:36 +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 v2 11/17] ibmvfc: set and track hw queue in ibmvfc_event struct Date: Tue, 1 Dec 2020 18:53:23 -0600 Message-Id: <20201202005329.4538-12-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201202005329.4538-1-tyreld@linux.ibm.com> References: <20201202005329.4538-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-01_12:2020-11-30,2020-12-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012010142 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Extract the hwq id from a SCSI command and store it in the ibmvfc_event structure to identify which Sub-CRQ to send the command down when channels are being utilized. Signed-off-by: Tyrel Datwyler Reviewed-by: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 5 +++++ drivers/scsi/ibmvscsi/ibmvfc.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 0e6c9e55a221..4555775ea74b 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -1397,6 +1397,7 @@ static void ibmvfc_init_event(struct ibmvfc_event *evt, evt->crq.format = format; evt->done = done; evt->eh_comp = NULL; + evt->hwq = 0; } /** @@ -1748,6 +1749,8 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, struct ibmvfc_cmd *vfc_cmd; struct ibmvfc_fcp_cmd_iu *iu; struct ibmvfc_event *evt; + u32 tag_and_hwq = blk_mq_unique_tag(cmnd->request); + u16 hwq = blk_mq_unique_tag_to_hwq(tag_and_hwq); int rc; if (unlikely((rc = fc_remote_port_chkready(rport))) || @@ -1775,6 +1778,8 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, } vfc_cmd->correlation = cpu_to_be64(evt); + if (vhost->using_channels) + evt->hwq = hwq % vhost->scsi_scrqs.active_queues; if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev)))) return ibmvfc_send_event(evt, vhost, 0); diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index dff26dbd912c..e0ffb0416223 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h @@ -781,6 +781,7 @@ struct ibmvfc_event { struct completion comp; struct completion *eh_comp; struct timer_list timer; + u16 hwq; }; /* a pool of event structs for use */ -- 2.27.0