Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2934264pxb; Tue, 12 Jan 2021 02:09:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJygOItaZTA1g6GaJf7+LlchzqZOtLQLhrHxu/pCk653NawFrwircB9Zqm0ooSay0zDuS/W7 X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr2704204edv.100.1610446172637; Tue, 12 Jan 2021 02:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610446172; cv=none; d=google.com; s=arc-20160816; b=C8jbxy8B2PNnO3i+Y0sopx7ZK3O3xVmo+j+f476c/zsBc3tEltF10YoVD7t2dJv2HX ObP+NkZPZHX9oaFIudF6FFSWS6e09zHAdQoCRUKzqtyMrHp6Tfa8xjcIU02GcdzRZHTz 46p3C9SNBnU6SFLwu8GEvFNw7D/98Kx/pOTEu8FN/eeOyBlu5/6N36VtyiZIyyir/bcy Y5AOWquuqK/OFGZqhox5XHFrwgGZ0vS8TaqfvXYDEPU5MuHQ3ADKntqLEvdlOSTrtuUg a49PMODS18MmU2SbK7FfV03yJZRWazGEn3pVHmyA6YiMJZmwYcCVl3JTgfWk0Ys4aGlb ZGgQ== 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=nLItLeTuMlDJB3G/lzt/ljE/4A0U0/fxclf93e4Nm4g=; b=p0lWJM/Gi+yj5x1shtMRSrM4EehFvyBPGemqhc7M0df1bJQSOuZhkVF4ThX27GIKw3 9J1Awc6IU+qvMgDh1xu0xW3q9Zoyz2OCX/AjLxDEUZis2YGzTrEnAuqlRiiFh/pdxblG +vDjXlqE1YqHCaDuFVpzFLv+ypbPO/K2UoBbKD3A9lRZBs6nPbPNipBuL/FUiZHyaBMB KJhFJ5eCYt7OI/mbKJp/R3LYVD8bdh0+Ihk7iuQH0E3NE8Twi6dXnCB1aJiakJTXbAvN xwyE1SYcY97Sf11hlwMPlHAPJU8atlifXCxUgrIEjW3gekM4DLT9h5KKnIHmRW3gRSHg VdDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=L3g27lSr; 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 t23si1091729edt.60.2021.01.12.02.09.09; Tue, 12 Jan 2021 02:09:32 -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=L3g27lSr; 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 S2404486AbhALAYx (ORCPT + 99 others); Mon, 11 Jan 2021 19:24:53 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:11588 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403871AbhAKXNV (ORCPT ); Mon, 11 Jan 2021 18:13:21 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 10BN3Isd109804; Mon, 11 Jan 2021 18:12:37 -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=nLItLeTuMlDJB3G/lzt/ljE/4A0U0/fxclf93e4Nm4g=; b=L3g27lSruPTGMLuJCTa2hgrOAQi14F95aHTXKNzWrYrgqiRf41wuolIVU358QFAPNL+i mLa7OGLenSzVLS0bzPuMQtwB0qm/BaM1JTM3l9AtP2DGoeLZrS5I6bSdeqsNI0xoYYmQ anedBgHOc9QpP7nqT2ZbxdEzeYicjlQfrnrnjbjlsl0RLrtm7+zTefjLqHgFqmAIc46K NvjR1qsnOHHJ+q1rbfseVWIyLThd5k8wRHzaNFY7/Q9jCjRH6uQhMuccVS3kfrYKPHlv blJ8syXsjBy8qOQtkbVHwS09AovLhkMulKpVpWnyAp0t9WE9V3mKfIx7ZVdRjD2keXVw Ig== Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 360y9ksbvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Jan 2021 18:12:37 -0500 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 10BN9s7R009902; Mon, 11 Jan 2021 23:12:36 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 35y448syaa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Jan 2021 23:12:35 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 10BNCYxF18940354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Jan 2021 23:12:34 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CCC978063; Mon, 11 Jan 2021 23:12:34 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B9557805C; Mon, 11 Jan 2021 23:12:34 +0000 (GMT) Received: from vios4361.aus.stglabs.ibm.com (unknown [9.3.43.61]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 11 Jan 2021 23:12:34 +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 Subject: [PATCH v4 14/21] ibmvfc: set and track hw queue in ibmvfc_event struct Date: Mon, 11 Jan 2021 17:12:18 -0600 Message-Id: <20210111231225.105347-15-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210111231225.105347-1-tyreld@linux.ibm.com> References: <20210111231225.105347-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.343,18.0.737 definitions=2021-01-11_32:2021-01-11,2021-01-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 adultscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101110130 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 --- 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 0653d52d4ea0..3f3cc37a263f 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -1483,6 +1483,7 @@ static void ibmvfc_init_event(struct ibmvfc_event *evt, evt->_done = done; evt->done = ibmvfc_locked_done; } + evt->hwq = 0; } /** @@ -1839,6 +1840,8 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, 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))) || @@ -1865,6 +1868,8 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) } vfc_cmd->correlation = cpu_to_be64((u64)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 3d76cd3c1fd9..2dbce7071409 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h @@ -753,6 +753,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