From patchwork Wed Jun 9 03:39:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457262 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 549E3C48BD1 for ; Wed, 9 Jun 2021 03:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B4F360FEA for ; Wed, 9 Jun 2021 03:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236535AbhFIDlb (ORCPT ); Tue, 8 Jun 2021 23:41:31 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44672 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236511AbhFIDla (ORCPT ); Tue, 8 Jun 2021 23:41:30 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592g4H5083678 for ; Wed, 9 Jun 2021 03:39:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=nBjNA4GaXC26hV4+toUfuBaHi0z4T/z4uNwx2Qdj/x0=; b=lY64dealEFNJP2WXLl9Sw9nsFfbTcfET2o8gsmxc/LVgZjMCp0ID8iLpet0rg6HNLEC7 Sx0xO/0LBg3zS2R3h8OqZsiG6sPKWGk7HorN1O06Oq3XJ/xKN7qAbKlB2h0SvZFN3oWw YzwjTNq5ThiyZ5qOjqIZUooIfd2fMjYMQZ+Zg3LaGuoOTXdu8hJ4XWEx4RX/gCgeWi4v 30vnmT9mXn3z8KgaRxYgBKJFIcntQHDrlKfrkGRDvoNWNX7E3/BxoWpNNHSJa+3Gc4gN RzHZglaJ6eDywzYuh4ZJRt/QiKGYSuLPg3pE4/oTQDTXBnT9ZUFt/WR8PLx/6I762Gjb HQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfrdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:36 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3gw082802 for ; Wed, 9 Jun 2021 03:39:35 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1rhr0h-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKvQfX4//dItGnpZ7WlilxNWjO0ki73jZfgiIHLMhhPUqdTrfsj/I2wVhfnA4NKFiAXjSSuL7qmeXPOwsrNkc9D3T26EXVVC5bJnBOmR7b2eVS5yFMf6dNldQlcjAATGWOKGwlR3Oo3vSYyPEZes5/Sxu2aAH6nzAFh96a87O14irQWn3tGbehyJ9yo09iHh/+GZRC4OL3ziQvVWmjq8jPM0BuKLmS7IU5Fscolm5Vv6izIhkCCSV4EpFqfV1qQXB/8lNhVE1X+jvrM33pNRosgoa9Wtqv5KQ94ZMs9lWRfiGPEKouROrEGTApFr2LJ68U2fMFG2SaB58SbBwZp4FA== 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-SenderADCheck; bh=nBjNA4GaXC26hV4+toUfuBaHi0z4T/z4uNwx2Qdj/x0=; b=kuvxIAbRO4e2AGGF78QG+Nztw9O1i3lv3WxWkI2AmgifoM4hhrpzfaofbkJXTLZW7xQjq7V+HrReBNcoTijcHLCtspIGr9pNrlK1XO1QVbU8unVLLxzy0UrMx5uqK2jm0l0llxqWzPMx5773kuWzGX/4mP/XQJaJ1NIEFEYDdMmrtoAIOER1fSY60Ecq65YyYPbPxbZs+6W1BeORsFBuBWZHzGiAlG96q54AqhWWW5OwVMIuaRjvugIafOCzqkojcobRI3Og62LNOzVgtV7ZJ8wuN/Ly1NmddWu7DtP1lAsXTFPXZDJlrPZ8e8K2VJy6xwvAA85HECzrqdjT2dkjkg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nBjNA4GaXC26hV4+toUfuBaHi0z4T/z4uNwx2Qdj/x0=; b=ABGbQqdYUQm571zyuFW/vR5+5syc8Fpy1/Ei/BFYAoz1/KVyJOzf8h4ZkeB14C5WMnAIof4armasVPMS7R4B9BImKkuM7zXTDHvcfG5NEZjmvjbEpLvlmkIxN0QQH2y4vOb4CRkp3lsW43iM2YxXBZZoD7bhc2QLqCP7bqEBlzo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4422.namprd10.prod.outlook.com (2603:10b6:510:38::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:33 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:33 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 01/15] scsi: core: Add scsi_prot_ref_tag() helper Date: Tue, 8 Jun 2021 23:39:15 -0400 Message-Id: <20210609033929.3815-2-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e723e8cb-b6bc-4648-6fab-08d92af83200 X-MS-TrafficTypeDiagnostic: PH0PR10MB4422: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FFR9+psTFR+TlPezhQh8kMbKPaSmVi+0/oQdWF5thy42Tb5RF5JihBV+BFwxaxr+grT/tzXcWexs8BMF0PIsT7WDaqLixzriMdqO4mlCCEt28au/HL2Xfu3C2hhp/nWzaa+N4zPWgBpeIcAc8kmbfK71PEl72dslWz9NAbotSe6ESik4PsvsT236fpOQHlEEnOLrU7z0jL1LxXtdVR4XKHjc8P067qzOGSHOPYkA5vwHAHkWsFla393i6uzHsNzTvtcgEY93HLdT97O6EJ4Ggvukn0C/HIGbY50xs8Oh8tQUX7fMPzZbJU/y2/2rN3H0AVL/Mt3Nc1ZQLRgnU9kaBQh8QYbrGRlRpmHaK5ZamexCHqXWFp19Ku5OdT1AB53aiH3sFFVKt0K19HWNj9LKUj9xpRmR6F+KNlESA63mQWzYF8eSgd25Yg3u69FsxB4p3UgJH6vlGlKeBcKhFN7g+t5UAIfVRR35HQDuizbzKKSIgX0UcYt0Cz01xP9iJzvDZ7LIdqRtrVxaPzg4W1JpJgywr43y774VgLCI7Yat/LeNgWQa0n55EqrLC06CiRpGg+n3dqrXbxh4DzKoUcHwSyFLMJIs0zHCmmnWXolQ5NuR0Dct0ROxDtVVexZALfLB1fN2/LYhZV4x1JNV9CnJTA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(1076003)(4326008)(6486002)(316002)(8676002)(8936002)(66476007)(186003)(16526019)(107886003)(66946007)(38100700002)(4744005)(6916009)(26005)(5660300002)(52116002)(478600001)(956004)(2906002)(2616005)(7696005)(83380400001)(66556008)(6666004)(86362001)(38350700002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FKBeSI0eG7F5ZTN+z+NHQQfuyQ3bEEz87tdCh25/TQqq3KeozkuFPZHc9wScf/k+1qnmpS7CD+IIMXtS6dhRLI63R2b+nr5qsNISmOOwSK4aG+eLQRyk3fA5f7T0pramGvkaqpATHK17bv83cC+RpJxtOdP4SzOsJfjht5Xdhe3+2wLWD/q6/Nv6F8Z2sywIIgV6o3q3qIhCuxiiazEZ3TPC1suAbLh7V1Jya0tTkH1vUkU+iGUBxKli5W2IyvOlr3VmTsPCQbQ/O9uvwalHEQsCnoUwTsX6DCMt/P7ZTv9DmfLN/JTQxY92rSJ1GVgNTff2hWcmSFTZhljbzLSHyRoe702QpWU5QNADcSR98a12JsP1POq/N0flnHo2nmZL1oFh5dGQQuYW/fb6/z7zH4qMyNZlhBUVLzOJdD/kXEuyS7ZqMwnC3S6enXGqDziLWduccceZpgbdVs9/93lrdr5l46WVa225PmMce+t9EEB36RLz88o9JhyIE8RAzoa+U/jC7fgQBHGjAzmG+smyP74PHBBTgtTkPSJ7NPO1ReGhHQjuweyWFv5fnwBIkeSdq0rHcRz9SSOTKlQ94fWbhpaX7Q8oiv37ZlHaqZTb8tdd4UG3oi9Xc742HXGpbR5ks0XoxXlwT6CE63MI4wX1pHkO9BA+ueg8jUmE28rj5VPXAMELAtP9GcmgU3XtaLV/OvvgojSupxiZcMzq4CclP6N2N0z7LdgLHWX8iNLFFkmJ/1TGNL0mpWLov0FNT0PpadmrYVm19Lwvz2a7oTrs4Za4vS4rHHHIMFWxZplsFd4mWWTUU6WD+5NrPKEvmGy9VIO4eZRmwlisi69OAKKgujgjhOkLMqK+8sUSGFUsdIKCI9gQZ3NSUoYyYrC2NZmfMPeEXbk/TSqjOulGKb8NeReNWAH1VyjvgdrH01f5w35SIcyZWG+ix39N25jhZjZ3kEgyQIrdVrxwkJMwpYIYkak+s+eytw1+32eDVtvYb/w1CnISLSAvOemmX/5/9XJ+9wMZo+V//SfDURx45L+8AeXIrBNRB2dwqt+0i2B9AZIkkBqErM+RnWzlG+M02I5zthJHj7MajGB5RC3DlmojFTgFa0dWuEXsYYaY4M8H2tkFPsJzKP1S6/w+e168wu1lmDdFVHjQo4/2y8Dli1N0khrBDVKohUBK+eRu9lVnpB8s3lAMwFNLhtTyKN+dbz+aerzF5nAQXImScJvIleTSGqEB4r8pz00z4toFwzrGma4qiDrLU1vfI7g9rTc3R2+Xn/yi1hsrlrinXyGXDoL1ab24eGq05oBjB8NNbjDAZkLALTTGvwy5brybdLuAeXw3 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e723e8cb-b6bc-4648-6fab-08d92af83200 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:33.0473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N+KJlQ378awraft5kgMrmT8e4MvE1CNIXfO3v5++anqWT0sE8gv+zYXMoWD0XbQpDjmRcV/i7az2sa6Yh0GKgP0JVvedOJRePZLQj5fC4AQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4422 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: QqdOomG7KV_tX-MPvTSHME_jnTXmzPCP X-Proofpoint-ORIG-GUID: QqdOomG7KV_tX-MPvTSHME_jnTXmzPCP X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org We are about to remove the request pointer from struct scsi_cmnd and that will complicate getting to the ref_tag via t10_pi_ref_tag() in the various drivers. Introduce a helper function to retrieve the reference tag so drivers will not have to worry about the details. Signed-off-by: Martin K. Petersen Reviewed-by: Bart Van Assche Reviewed-by: Benjamin Block --- include/scsi/scsi_cmnd.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 779a59fe8676..301b9cd4ddd0 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -287,6 +287,13 @@ static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) return blk_rq_pos(scmd->request); } +static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) +{ + struct request *rq = blk_mq_rq_from_pdu(scmd); + + return t10_pi_ref_tag(rq); +} + static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) { return scmd->device->sector_size; From patchwork Wed Jun 9 03:39:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84F17C47095 for ; Wed, 9 Jun 2021 03:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 683C261263 for ; Wed, 9 Jun 2021 03:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236536AbhFIDlc (ORCPT ); Tue, 8 Jun 2021 23:41:32 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44684 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236530AbhFIDla (ORCPT ); Tue, 8 Jun 2021 23:41:30 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592gg1e083742 for ; Wed, 9 Jun 2021 03:39:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=TBDpIRgTPKOvL7dih0LhiNkY8Z/qM3S/CjRHvInPfHE=; b=CLav+OdeUNTSpj1t/XIoPM9+sL88VjI8fNfDT9PS1GcG4o+CPvyIuHAukhtEUxamV1Bf 4O/hTLK09HD+I9nQJ3M7FRg7cCcEDjEBpachkPWV8522elzbtX0OA2yGU5N0evo3rYsS OJtr/U+V2knhFxoVzV8pLcXeirBq5Nqb1ff7X+W4y/ouIZqAYoMaNKGGlA2dSjPxmvQA WSzgUKbtxDA1q1rb/xGUgeGtEz/py88e+Mr76VVZehU2e+TSouYbWA2VTnGmbwWiIm5Y T1/Yd6v5Iz/M+vbCqsW5mw+7LUg8cTYfeZhr3xYi7C1/NZg6tMHInJs+wnFr1AcHr42J Uw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfrdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:36 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3gx082802 for ; Wed, 9 Jun 2021 03:39:35 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1rhr0h-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lduwexcqxgNzfuh6Gy+lh7WIDEw5ptjHkzApQjlzd9rA3jHifrC3AnoPkSTGCBoXUFjO6sARhsoKPmi7U9iVwmd42IK5rHJfavI5nmrK7PrNgcaMAE+c87BQPNDyW5JSWLEKFpUTdzfK2KWSHZlu+rZXH5btK4D9rtycP2cY+lecO3dy6h6nL1oxZ4qkNViHqh76M5Lcz27IQFO4dJ2oPuTZ55JMy3mWw6jcpRVqQSBTpScNZskEIV9xoxWYUHHjpM2wy0cdwCGVkck5QiQ9XIKqlsZdhTJ/yUG/sbkmomOjwEBiIB9F5X88nGrKCxvID8KH/NubB/JK8WNd3yfNSw== 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-SenderADCheck; bh=TBDpIRgTPKOvL7dih0LhiNkY8Z/qM3S/CjRHvInPfHE=; b=iorrw77brlpm5AXEhLsmPCUoekR8MzsDoGafXQ5eKxs+dPezFw6pw1bwD2Hh3w1K1BPL9M658E6hguW3l5VuWxXptEfXcM6UwiS7iPgKTULthvzGd/2trhtRdQK5mMoXLv7fWyWvf9o0lUkF4inasDsmLTqWyKrz2WYg+1hlxmPonh62HEZN2I6K6oT/8WDB/cUosahJkgsZPUn4+fbido3u+Ev2RBev3XYac/r/nFbvR0utdmB/kUaKZ9l9S07AmY5/5QiAgCt3lz5FsF5o+YcySL2pJ8fPW4uZYGGK6rBecZwMAVuTqLFQjKPb7Tztzb3HQueIybr+9E8iC2HzEA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TBDpIRgTPKOvL7dih0LhiNkY8Z/qM3S/CjRHvInPfHE=; b=b9KeKGbCSX9ztLUxXUceK/r5pwlHkWYRjJ+8BWRDre8mLzRw+C90xu8VO9F27iShSTzYIgxHKT1Fpg8iHiN2CKFU4vKb4NU1fJhqs2EXrKHvjj3ChUXFdqCXYJjozsCAmGIvhWII9weDs3TOkBbUdSfPfzYwVv1TpCMzqzvpxGo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4422.namprd10.prod.outlook.com (2603:10b6:510:38::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:33 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:33 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 02/15] scsi: lpfc: Use the proper SCSI midlayer interfaces for PI Date: Tue, 8 Jun 2021 23:39:16 -0400 Message-Id: <20210609033929.3815-3-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c8976de-4d11-4fec-493b-08d92af83267 X-MS-TrafficTypeDiagnostic: PH0PR10MB4422: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E0r7v2SOXNfISoMJxr+rGous/rvkWyq7qrLQOcpXbfj7DH44LSlBZMrQimDan494cweei3uioJqhqeNi/Q5hSIPkg0/0w43miXF7QNYysIUKXtVNYS1QxJv1PON3+uViDzPNbU0+i78NnO1RklPs8hJDugdytC/W++1lDIJGxD5NJUgk9t8B2SC+1gcOhANUGaf+bxoDDZQTc1FHWHeZ3FAar+8f9KVJm2PuBNnClV9gxK9MmldYpYQBwz2hII18SOStHJ+FbwRiW9j8ApdV6Az9kDwwa6r46boprJ5MZR7s3/q3FM0M8gLsqkB3CoUXGvI8v84jAk+Yw2vwrvpdQ1QhoJLQIy8IwlR9KCD+nQyiS7DG0zk+J242088z/+Ph1/teH5vxs+qE1xg4d6rHYV1Sq3YHBCbIafCTyUR2IssiCuQFW6fL5RhBe2PS0OUJyzrJR/6BMy6VU0YP54p7wBGkYncmyiJF0UyeJbHOn2O+Q9AcMZZdW5xSZSnTgXUpQdLyS6nq/87fgppk08hHcfjFq3OH8GpocYHNLwPv6n+YZGm1L5eZcFI2ovo+nVNd0OUSfyA2obGKddhB2+CNDfqtsD4rRoEgcv955H8S77m05ybil2rXhcXdkUBD9mZ7eajOOdgvcQtN0Lk30cszNA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(1076003)(4326008)(6486002)(316002)(8676002)(8936002)(66476007)(186003)(16526019)(107886003)(66946007)(38100700002)(6916009)(26005)(5660300002)(52116002)(478600001)(956004)(2906002)(2616005)(7696005)(83380400001)(66556008)(30864003)(6666004)(86362001)(38350700002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3zi0Jnc3dNHtv0CVL/dLRf5tNuI5hzg+5DHynBZ0rv1Rlj/0Us5riNLIXqD0n3nZkNJ3cD2zf4aAOBgT3pdkfq4jtmt3waOBmtRzjoCMHUr955gUiS123omTr1Sx0kxrvCHAimWzUnKFbM7E4WCd0jHrgrwbOSwq0jryF+Zz48OVoNcafkbHVDPigdQ14mv4oTdxBBkLcNeCcWkW5VWi4nONzoFZ1eGWAc5zKj9Xf+a0pCaF1yCiXnKo+3/CbSG9EIugGrOyYszSXgxhzz4+KjgeezWxe0GRDik118TK4fGiQFRbEnWUrIwXUWF2Y9y9aZxaclL/OzIhf9JN5767ASSq4k9Ua9WIPRii7shVyNhP+NZlfb2ail6iFcdcvpJPG+X1VWU1SblF2Ggf0Ca0qGMdAVqs/8Gdv8UgwN5u0BfjBp2CZLPuB/GejVbNgJsAztlNBosUlRzY/bfjKvLLgq5xONemTPaviZyTuSM31vfoQYt2HSqS2jkten1FSnkmpzVWVP39rjLScZX57PCDXs7MflCwxC6e747m/ctvO5NUhpmk7tPC3AXpKf7K+IWB5rFPJt4Y7v/JhvlfkhShlaAznToduMVdHNM4UAdDW8w5LyxcfcXE3skpNEpCjOnyIleHZsn3ug4pYGeF6TEiXgKiEmPJihjKyiKeQP2+Nbj0G1oooE/9T/CUgD/C6C0wpRLAL78WDpKJYUaWWLRSwAXOQnAIaedy8Zts9PRi/rNX7kEPho8goFAspKhZHLstEWZp9PKql4cmTibaWS8Rtg3/LWEkYq5WdEKAnKcY/bThXQv5IzyQgHM0f60zc2KLSr6U7oUwiYoQdF7xPWvRNbxQI2vDjBGus90mTmsisMQC6uQHhbvDQNv8x79miKnHLp1nyW0dOx6TUwXa2+DaGa2h7li2MBH2wISnn9EOA1t9u8HmcDZL5xgurhnaaeywynioOQFGqQZ+K6atqoD3WJP+8n+r81PgW36uLRjFgWhCauu601C0yigksD07Symc+XpEwStHZPA+m4Hh8zmmvmT63n947PmiSSEGqpR+7c+NA0dqm1R2uwwQ4EaBrg2XcadWVM91HvG0/BlePpHFdCGb5czJx/om3Mlc5gwzIDlmaOLwW5vYMv3VbLw3s31Vbwm0v51gwGbTIGVK6pzNUPYiqwYePgq5KQqfHBaPIFkeuR2HPUjG/FWBZjTJuFzZ8iyZgK6o/qTDVzdP0BG2bl2m55rwiZmcY/aI81B+LONL416RfjzAxn5yMenD67CpvJAaui7j6RLCybZs16eRNx7XIkgmjQ6B6b/7SkZMh0U/OkCvTD5mx3QjFYL25uYg X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c8976de-4d11-4fec-493b-08d92af83267 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:33.7184 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UtTiUZpm54oMUO5oiRYvHr00tO6wJqZZL25qzNUOQGI+7rds0gJbfPfaU6PQOfEkI8pH605R+FH1GMyYcgAh+deQehx7iqH0yLaZfYAoz38= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4422 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: 1addyXBeyBwW4qPQGjTFXO2ZZW60T2pV X-Proofpoint-ORIG-GUID: 1addyXBeyBwW4qPQGjTFXO2ZZW60T2pV X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags. Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_scsi.c | 92 +++++++++++++---------------------- 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 503919b10a6d..ca2e00e512f4 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -87,30 +87,6 @@ lpfc_release_scsi_buf_s3(struct lpfc_hba *phba, struct lpfc_io_buf *psb); static int lpfc_prot_group_type(struct lpfc_hba *phba, struct scsi_cmnd *sc); -static inline unsigned -lpfc_cmd_blksize(struct scsi_cmnd *sc) -{ - return sc->device->sector_size; -} - -#define LPFC_CHECK_PROTECT_GUARD 1 -#define LPFC_CHECK_PROTECT_REF 2 -static inline unsigned -lpfc_cmd_protect(struct scsi_cmnd *sc, int flag) -{ - return 1; -} - -static inline unsigned -lpfc_cmd_guard_csum(struct scsi_cmnd *sc) -{ - if (lpfc_prot_group_type(NULL, sc) == LPFC_PG_TYPE_NO_DIF) - return 0; - if (scsi_host_get_guard(sc->device->host) == SHOST_DIX_GUARD_IP) - return 1; - return 0; -} - /** * lpfc_sli4_set_rsp_sgl_last - Set the last bit in the response sge. * @phba: Pointer to HBA object. @@ -1037,13 +1013,13 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, return 0; sgpe = scsi_prot_sglist(sc); - lba = t10_pi_ref_tag(sc->request); + lba = scsi_prot_ref_tag(sc); if (lba == LPFC_INVALID_REFTAG) return 0; /* First check if we need to match the LBA */ if (phba->lpfc_injerr_lba != LPFC_INJERR_LBA_OFF) { - blksize = lpfc_cmd_blksize(sc); + blksize = scsi_prot_interval(sc); numblks = (scsi_bufflen(sc) + blksize - 1) / blksize; /* Make sure we have the right LBA if one is specified */ @@ -1432,7 +1408,7 @@ lpfc_sc_to_bg_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, { uint8_t ret = 0; - if (lpfc_cmd_guard_csum(sc)) { + if (sc->prot_flags & SCSI_PROT_IP_CHECKSUM) { switch (scsi_get_prot_op(sc)) { case SCSI_PROT_READ_INSERT: case SCSI_PROT_WRITE_STRIP: @@ -1512,7 +1488,7 @@ lpfc_bg_err_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, { uint8_t ret = 0; - if (lpfc_cmd_guard_csum(sc)) { + if (sc->prot_flags & SCSI_PROT_IP_CHECKSUM) { switch (scsi_get_prot_op(sc)) { case SCSI_PROT_READ_INSERT: case SCSI_PROT_WRITE_STRIP: @@ -1620,7 +1596,7 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out; /* extract some info from the scsi command for pde*/ - reftag = t10_pi_ref_tag(sc->request); + reftag = scsi_prot_ref_tag(sc); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -1659,12 +1635,12 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, * protection data is automatically generated, not checked. */ if (datadir == DMA_FROM_DEVICE) { - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) + if (sc->prot_flags & SCSI_PROT_GUARD_CHECK) bf_set(pde6_ce, pde6, checking); else bf_set(pde6_ce, pde6, 0); - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) + if (sc->prot_flags & SCSI_PROT_REF_CHECK) bf_set(pde6_re, pde6, checking); else bf_set(pde6_re, pde6, 0); @@ -1782,8 +1758,8 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out; /* extract some info from the scsi command */ - blksize = lpfc_cmd_blksize(sc); - reftag = t10_pi_ref_tag(sc->request); + blksize = scsi_prot_interval(sc); + reftag = scsi_prot_ref_tag(sc); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -1823,12 +1799,12 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, bf_set(pde6_optx, pde6, txop); bf_set(pde6_oprx, pde6, rxop); - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) + if (sc->prot_flags & SCSI_PROT_GUARD_CHECK) bf_set(pde6_ce, pde6, checking); else bf_set(pde6_ce, pde6, 0); - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) + if (sc->prot_flags & SCSI_PROT_REF_CHECK) bf_set(pde6_re, pde6, checking); else bf_set(pde6_re, pde6, 0); @@ -2014,7 +1990,7 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out; /* extract some info from the scsi command for pde*/ - reftag = t10_pi_ref_tag(sc->request); + reftag = scsi_prot_ref_tag(sc); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -2042,12 +2018,12 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, * protection data is automatically generated, not checked. */ if (sc->sc_data_direction == DMA_FROM_DEVICE) { - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) + if (sc->prot_flags & SCSI_PROT_GUARD_CHECK) bf_set(lpfc_sli4_sge_dif_ce, diseed, checking); else bf_set(lpfc_sli4_sge_dif_ce, diseed, 0); - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) + if (sc->prot_flags & SCSI_PROT_REF_CHECK) bf_set(lpfc_sli4_sge_dif_re, diseed, checking); else bf_set(lpfc_sli4_sge_dif_re, diseed, 0); @@ -2214,8 +2190,8 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out; /* extract some info from the scsi command */ - blksize = lpfc_cmd_blksize(sc); - reftag = t10_pi_ref_tag(sc->request); + blksize = scsi_prot_interval(sc); + reftag = scsi_prot_ref_tag(sc); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -2272,9 +2248,8 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, diseed->ref_tag = cpu_to_le32(reftag); diseed->ref_tag_tran = diseed->ref_tag; - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) { + if (sc->prot_flags & SCSI_PROT_GUARD_CHECK) { bf_set(lpfc_sli4_sge_dif_ce, diseed, checking); - } else { bf_set(lpfc_sli4_sge_dif_ce, diseed, 0); /* @@ -2291,7 +2266,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, } - if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) + if (sc->prot_flags & SCSI_PROT_REF_CHECK) bf_set(lpfc_sli4_sge_dif_re, diseed, checking); else bf_set(lpfc_sli4_sge_dif_re, diseed, 0); @@ -2548,7 +2523,7 @@ lpfc_bg_scsi_adjust_dl(struct lpfc_hba *phba, * DIF (trailer) attached to it. Must ajust FCP data length * to account for the protection data. */ - fcpdl += (fcpdl / lpfc_cmd_blksize(sc)) * 8; + fcpdl += (fcpdl / scsi_prot_interval(sc)) * 8; return fcpdl; } @@ -2802,14 +2777,14 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) * data length is a multiple of the blksize. */ sgde = scsi_sglist(cmd); - blksize = lpfc_cmd_blksize(cmd); + blksize = scsi_prot_interval(cmd); data_src = (uint8_t *)sg_virt(sgde); data_len = sgde->length; if ((data_len & (blksize - 1)) == 0) chk_guard = 1; src = (struct scsi_dif_tuple *)sg_virt(sgpe); - start_ref_tag = t10_pi_ref_tag(cmd->request); + start_ref_tag = scsi_prot_ref_tag(cmd); if (start_ref_tag == LPFC_INVALID_REFTAG) goto out; start_app_tag = src->app_tag; @@ -2830,7 +2805,8 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) /* First Guard Tag checking */ if (chk_guard) { guard_tag = src->guard_tag; - if (lpfc_cmd_guard_csum(cmd)) + if (cmd->prot_flags + & SCSI_PROT_IP_CHECKSUM) sum = lpfc_bg_csum(data_src, blksize); else @@ -2901,7 +2877,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9069 BLKGRD: reftag %x grd_tag err %x != %x\n", - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), sum, guard_tag); } else if (err_type == BGS_REFTAG_ERR_MASK) { @@ -2911,7 +2887,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_reftag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9066 BLKGRD: reftag %x ref_tag err %x != %x\n", - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), ref_tag, start_ref_tag); } else if (err_type == BGS_APPTAG_ERR_MASK) { @@ -2921,7 +2897,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_apptag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9041 BLKGRD: reftag %x app_tag err %x != %x\n", - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), app_tag, start_app_tag); } } @@ -3094,7 +3070,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9072 BLKGRD: Invalid BG Profile in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), blk_rq_sectors(cmd->request), bgstat, bghm); ret = (-1); goto out; @@ -3106,7 +3082,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9073 BLKGRD: Invalid BG PDIF Block in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), blk_rq_sectors(cmd->request), bgstat, bghm); ret = (-1); goto out; @@ -3122,7 +3098,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9055 BLKGRD: Guard Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), blk_rq_sectors(cmd->request), bgstat, bghm); } @@ -3137,7 +3113,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9056 BLKGRD: Ref Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), blk_rq_sectors(cmd->request), bgstat, bghm); } @@ -3152,7 +3128,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9061 BLKGRD: App Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), blk_rq_sectors(cmd->request), bgstat, bghm); } @@ -3196,7 +3172,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9057 BLKGRD: Unknown error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), + scsi_prot_ref_tag(cmd), blk_rq_sectors(cmd->request), bgstat, bghm); /* Calcuate what type of error it was */ @@ -5284,7 +5260,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) "reftag x%x cnt %u pt %x\n", dif_op_str[scsi_get_prot_op(cmnd)], cmnd->cmnd[0], - t10_pi_ref_tag(cmnd->request), + scsi_prot_ref_tag(cmnd), blk_rq_sectors(cmnd->request), (cmnd->cmnd[1]>>5)); } @@ -5296,7 +5272,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) "9038 BLKGRD: rcvd PROT_NORMAL cmd: " "x%x reftag x%x cnt %u pt %x\n", cmnd->cmnd[0], - t10_pi_ref_tag(cmnd->request), + scsi_prot_ref_tag(cmnd), blk_rq_sectors(cmnd->request), (cmnd->cmnd[1]>>5)); } From patchwork Wed Jun 9 03:39:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20C77C48BCF for ; Wed, 9 Jun 2021 03:39:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0775E61263 for ; Wed, 9 Jun 2021 03:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236539AbhFIDlc (ORCPT ); Tue, 8 Jun 2021 23:41:32 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44688 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236531AbhFIDlb (ORCPT ); Tue, 8 Jun 2021 23:41:31 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592gxEh084157 for ; Wed, 9 Jun 2021 03:39:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=cSs+nux84mgTuqImBZ3h9xNH/2OU33wOmlcB3gqVfrY=; b=heJZVoyQG+QaRUTCJfG/Ei3Wck1hR0bsYaLE6xOffkP3OYGCbMoRuBCKVemqx7ZxhwSU H45x4YRpjUIZemYnMf4oQeMnRggisEc1bEzh+g0xxDPT+hD/tjjUkgf+sJk75drdH3VP gmzF71edkiaBcXZudPMvm1UKJAo44Lk9E/b5678asMgFMyZ4o+d2mtEXfF0SxQoFsRaC cQ/9JO2IAZyGAMpxqsVV2ps+vpJbxWKqlSA9RXGihlSlpn3mEuXwlEv8w4zYqB0Uy/QK 4mUN9iIxVMcNHXrUXJ8Uf3Hbq42ACT56YHVsx/AOFo74Fh1a5MRGLD/MmGvcQtN7+aAP TQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfrdp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:37 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3h0082802 for ; Wed, 9 Jun 2021 03:39:36 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1rhr0h-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=md5T36TJ1jFT44rrHkRkpsI0MsF5FuRfnwOztDyP+yLGxaXtoTrZveMUMJBwhsPvkUQ2rNEXxkeIp4n/rn+vbYSkmNlI9OCXVS6zwUM89KiCM2KI8/TZa94LZQou2nt7uLuRZgs1LAdkZT5+6/qrps4lumYk7bmla+BtM1It5qVQeK5L74n2ToCOUhq98skcixrCq7HYEUnFsHIMeGmbPq96uhkWHZGamnMCQEMT+uQLitqvEmxO5cFKZPO6pAIp/oWADZWHqziCZrGBkE5+T7qSkUcWuiiYVrv1FuhNl2/kc9Pv4AyjRHG6L+cKFvNU9X1z4dgAcPHU6onI47TOtA== 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-SenderADCheck; bh=cSs+nux84mgTuqImBZ3h9xNH/2OU33wOmlcB3gqVfrY=; b=gwTnwQmPAJr5M0AFij5VaMyvMMelJ56M7+87AvBwwKTNwx74okjPKVcgFgSetG7Oa0lAgZAcrqkpf8sLH0gcsuDs+sAgvqc4BCeEaZhBLFPIDSKmtmyxFf6A1g19gT8aUYW+rsjVH4bZFpbPU3BsVQQ0NAKhwYfoZtU2qBnOYw3bVet7aANeQu0zXKmmUMXr43ocYiSRWGzFnznwE/IG1tiML41X62x04LUfD1qdEOTvNyzLSfV1Jid2cmSIVUFx+ebNzoKz7jabQS3QCaGY+YX8NZv/ltfgfOKp77O/NSFhWrHJEOuz+vOimHbAMBIvpr/u0xNMPLFpl2j6pGZK7Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cSs+nux84mgTuqImBZ3h9xNH/2OU33wOmlcB3gqVfrY=; b=vkhsewWiy4n8GayHlG0CJSiE8cb/TYIgWJtGp40APvEc7qEOMgRfHiY5ZfxgqUv4tRJVd/GkJa5tt5G/dB8UuDHZH9t8KQUJO0SKfdl/mIRDggew7EAPq+L5upUWBf1xy2tKOGy+fYq8puA4YhUV1woc8iwChUdkcpo82Jrk7ek= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4422.namprd10.prod.outlook.com (2603:10b6:510:38::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:34 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:34 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 03/15] scsi: qla2xxx: Use the proper SCSI midlayer interfaces for PI Date: Tue, 8 Jun 2021 23:39:17 -0400 Message-Id: <20210609033929.3815-4-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6635824d-43b4-4fa4-9df5-08d92af832d8 X-MS-TrafficTypeDiagnostic: PH0PR10MB4422: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sb2vwzip6sGrBn/zKHhl+DXAw2Zf4E3MzvzsLka13hZQFtjVsdJalz5Fmc9KjUSzNOwV+pKq1VTZA4YY+MEOULIhgkqs1nQkeYJhkmXj3Vg1rB2QyVuVUq+JTJtGDHa+12317s+PWgaIqZd3Z9QngmWndD2FSDy5dxzKVF4+vidFtYXTVN2rpnvNwVHn/wwcbtkhgRs586zLCPaTx40mxNEXiFV/bQAYj5jeo0htmVj9sELM+reRC1UATn2QAXXjpzim8/cZvFNIrXWPUlAhCp54DIJkMnX6J2BwwdClO28kFunV6xqXgKR56XLV/Ovu9BxRtHpWq6uK+guNToRSysG4tTBsEOgutlyVF6M0ACHJmPRkuLnrVfz3fUE5F/7Zqm+M9iKbiQx3ZnHGhgJ4bMRbjMdLKfTJW6dETV5SaIYwdSECN6g2wW6XkzpTTD9lcslB1yMb/nCd+t7BCzyGKuHDKAhmOmiHmm34KBfPP1H8cIwY67xi51pDmvNwgR5d/yFXXVb9z8ustsqtyUoeFv9z3oJc2QEncVuLhl+aEMq8MTm5rplDppevyX+3koZ6Y28iZb2a5ROub/G+in1e7uDxusPQxdOZws1HYMp2l5AkucljM2JZJa+9V4luyAtB93nBKJnRrHuNNR2i0jB3WA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(1076003)(4326008)(6486002)(316002)(8676002)(8936002)(66476007)(186003)(16526019)(107886003)(66946007)(38100700002)(6916009)(26005)(5660300002)(52116002)(478600001)(956004)(2906002)(2616005)(7696005)(83380400001)(66556008)(6666004)(86362001)(38350700002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ib0r9zPv/xUyid1Lr6TSGmFwrEOS1hVdjM1wcgATFRweUc5Xsc6KvdOYFGfubBLPitKtbW3KqcvaNgcfDDTkYzwmmzq9yy6ECgEii6nU6U2JXqjOioq1NL4C+xZY7i/w781WZNtd/q8+eQRZE0f2uicS1Nj0isBTAxu903LIxhOeRQ4AB6FG2t9rs9VpxQqfTxoAQtMLgP+/4C5O9aZhJDyxol16AifbOu6x+WD/YhqBIm7Z8Zx/NC3RAF0v+Fs0tG3Ne0RPYtIdbKPSF4Dra8k9g4+nwCUliANZVIkKOii8obV+RyUyDoTdMzdfwi7CxzZeAMnKG6T/rQtUfbMzBY7WTW+hNuU3gt1Jk2Yb9VnBAFhiCxysjFWz6nbFkTErdmQHkAeXwj8+OkF9pASxQLQErI/2NHAYzQRSg8nkuIL/9HiZU/MTRH2jdTHNaBFivluV/e2iWDCy3i8H174zCNEcwKQo6NZN4J5oGFEhmVzeUmzXXVnzzzWYYcs8UZH+GVAqHc62dbfsu/LeC/5w32vcXu45+1HSm8hrDtdUa64sltefUn4enj9UXBSvSq0ZSsF8KYEnB31ZGFizMWWLvlhr5qJ7a9jUhOjcOMiMAa35vXK+GSME4NESAje78oFz/yXXLNp5Kt4Q1QRtZb0Qy115pJGRQGC6ccTrBaXmWS2SymTUz+V4vvII/0Hqcfm4vKLSxcxgW4AHhoKQeAOYR4pSxo2tQ19C3yFItVXThYoKYDSat0TUGml2esH2et+2m2HME2YWYPK3PfejvWZB6qJjeS/hg6aXYc58jE8cMQibFz8T5WPugbjt8n/ve8ZfGNvIoTEonB4XvOm3enMzdo2oJNFZiAuZCTh8r22+04hqqu2E54uMb2obK719kgS3xxvEqmERDWVZak5mVUzTlARVE0+SQYZn3gBG79xHHbUWdRkVB1qnAK7s0ht4QAdawD+GuQ6NP1U9QpWye2pPb7nZH7DStiicBIHFSclBXgqr92vZccmu9dHbFf8nzMonrrihrzZGZ7sDTxesAkouPV960KG98SX7MfRmdN5cFJdTId+zdqVwwdHVujhvOoY+RIgeHLkwEiaLfL5oX2/s4sibwBFILbWDSc7wclpkwoIGeWVTRD7CuOW6GwuC+YGXyD00FbEsj5BR8Q4QXHffT/GAS1MzgBg71djXsKGmjRO5q8AdWtrBMaXS5HXt0Ii4zg+6QxAM6NGTeSJteE1v8+vSfS2NB+ont2TyoVvBCbpfgPNMpjCnKOPPsvTXXl7hL/4FMDF9fekz8zc015dZOtcw2g9hiP+HP59OdmfvW+OzGsHp+uFVkpVCfpqYg55j X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6635824d-43b4-4fa4-9df5-08d92af832d8 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:34.4920 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: plcztDeC4BQBRrOK0tOh2CG9NAOJSpv9TUz3lhsL5XOmPL6qHsFIfVZ+PtgbWcMDQyfB0Swm3LwTzQ8CGuPV8sLBCARQvPbE8MBIK1Haq0Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4422 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: V5wctcKNIcmHVYSxT_3nflkq6lRXcRgS X-Proofpoint-ORIG-GUID: V5wctcKNIcmHVYSxT_3nflkq6lRXcRgS X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags. Signed-off-by: Martin K. Petersen Reviewed-by: Arun Easi --- drivers/scsi/qla2xxx/qla_iocb.c | 84 ++++++--------------------------- 1 file changed, 15 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 38b5bdde2405..42a6fbba7529 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -145,7 +145,6 @@ inline int qla24xx_configure_prot_mode(srb_t *sp, uint16_t *fw_prot_opts) { struct scsi_cmnd *cmd = GET_CMD_SP(sp); - uint8_t guard = scsi_host_get_guard(cmd->device->host); /* We always use DIFF Bundling for best performance */ *fw_prot_opts = 0; @@ -166,7 +165,7 @@ qla24xx_configure_prot_mode(srb_t *sp, uint16_t *fw_prot_opts) break; case SCSI_PROT_READ_PASS: case SCSI_PROT_WRITE_PASS: - if (guard & SHOST_DIX_GUARD_IP) + if (cmd->prot_flags & SCSI_PROT_IP_CHECKSUM) *fw_prot_opts |= PO_MODE_DIF_TCP_CKSUM; else *fw_prot_opts |= PO_MODE_DIF_PASS; @@ -176,6 +175,9 @@ qla24xx_configure_prot_mode(srb_t *sp, uint16_t *fw_prot_opts) break; } + if (!(cmd->prot_flags & SCSI_PROT_GUARD_CHECK)) + *fw_prot_opts |= PO_DISABLE_GUARD_CHECK; + return scsi_prot_sg_count(cmd); } @@ -772,74 +774,18 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt, { struct scsi_cmnd *cmd = GET_CMD_SP(sp); - switch (scsi_get_prot_type(cmd)) { - case SCSI_PROT_DIF_TYPE0: - /* - * No check for ql2xenablehba_err_chk, as it would be an - * I/O error if hba tag generation is not done. - */ - pkt->ref_tag = cpu_to_le32((uint32_t) - (0xffffffff & scsi_get_lba(cmd))); - - if (!qla2x00_hba_err_chk_enabled(sp)) - break; - - pkt->ref_tag_mask[0] = 0xff; - pkt->ref_tag_mask[1] = 0xff; - pkt->ref_tag_mask[2] = 0xff; - pkt->ref_tag_mask[3] = 0xff; - break; - - /* - * For TYPE 2 protection: 16 bit GUARD + 32 bit REF tag has to - * match LBA in CDB + N - */ - case SCSI_PROT_DIF_TYPE2: - pkt->app_tag = cpu_to_le16(0); - pkt->app_tag_mask[0] = 0x0; - pkt->app_tag_mask[1] = 0x0; - - pkt->ref_tag = cpu_to_le32((uint32_t) - (0xffffffff & scsi_get_lba(cmd))); + pkt->ref_tag = cpu_to_le32(scsi_prot_ref_tag(cmd)); - if (!qla2x00_hba_err_chk_enabled(sp)) - break; - - /* enable ALL bytes of the ref tag */ - pkt->ref_tag_mask[0] = 0xff; - pkt->ref_tag_mask[1] = 0xff; - pkt->ref_tag_mask[2] = 0xff; - pkt->ref_tag_mask[3] = 0xff; - break; - - /* For Type 3 protection: 16 bit GUARD only */ - case SCSI_PROT_DIF_TYPE3: - pkt->ref_tag_mask[0] = pkt->ref_tag_mask[1] = - pkt->ref_tag_mask[2] = pkt->ref_tag_mask[3] = - 0x00; - break; - - /* - * For TYpe 1 protection: 16 bit GUARD tag, 32 bit REF tag, and - * 16 bit app tag. - */ - case SCSI_PROT_DIF_TYPE1: - pkt->ref_tag = cpu_to_le32((uint32_t) - (0xffffffff & scsi_get_lba(cmd))); - pkt->app_tag = cpu_to_le16(0); - pkt->app_tag_mask[0] = 0x0; - pkt->app_tag_mask[1] = 0x0; - - if (!qla2x00_hba_err_chk_enabled(sp)) - break; - - /* enable ALL bytes of the ref tag */ - pkt->ref_tag_mask[0] = 0xff; - pkt->ref_tag_mask[1] = 0xff; - pkt->ref_tag_mask[2] = 0xff; - pkt->ref_tag_mask[3] = 0xff; - break; + if (cmd->prot_flags & SCSI_PROT_REF_CHECK) { + pkt->ref_tag_mask[0] = 0xff; + pkt->ref_tag_mask[1] = 0xff; + pkt->ref_tag_mask[2] = 0xff; + pkt->ref_tag_mask[3] = 0xff; } + + pkt->app_tag = __constant_cpu_to_le16(0); + pkt->app_tag_mask[0] = 0x0; + pkt->app_tag_mask[1] = 0x0; } int @@ -905,7 +851,7 @@ qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *ha, srb_t *sp, memset(&sgx, 0, sizeof(struct qla2_sgx)); if (sp) { cmd = GET_CMD_SP(sp); - prot_int = cmd->device->sector_size; + prot_int = scsi_prot_interval(cmd); sgx.tot_bytes = scsi_bufflen(cmd); sgx.cur_sg = scsi_sglist(cmd); From patchwork Wed Jun 9 03:39:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63292C47095 for ; Wed, 9 Jun 2021 03:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BBAA611BF for ; Wed, 9 Jun 2021 03:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236542AbhFIDld (ORCPT ); Tue, 8 Jun 2021 23:41:33 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:41958 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236534AbhFIDlb (ORCPT ); Tue, 8 Jun 2021 23:41:31 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592h03n020883 for ; Wed, 9 Jun 2021 03:39:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=+CpW+8c08hSAcaGetxa5uU7xX1IYUuITpf0aXaTzlwg=; b=JkfB4Baj3Dp5n2xb2HEg8npObkzJO5OiwiPuTSNoK0qfF+PNIfBK7P4z5mZTZ/P60Ops QaWYy+5y7LegMImSHUs84CFKxGS/18SXfQeTS/DFrY27pfY5FUQ8T5K6wu1U4BgO5AQS Yk/lwUKmLt2/DpHT30HfEVx28Dlt/3SRbc7nNZ7eUa3RGRY6e8tImRcSo9fn6niB2piV n2nxQKTVeq6cHT6WunRUb/lFKFGxAiwWorz/QBeJNIJOC6NfsyWRi987kCB/TJAIf6Qg sxzOw3r0JrEfZWzpyPgpeWyrD6ixVchqTuhXmjg40z878l0G8IWd6LNhe2i2jvc/4W2G oQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 3914qup8u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:37 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3h1082802 for ; Wed, 9 Jun 2021 03:39:36 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1rhr0h-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKn5dlP5QzGYDgjeNPE9qzvdUgiVPoO0wQvHnXqJgE7vVOitFD4UFwOkwbfxNP10uRdihz1bALyl12JlCXJu/zko7R+rTHXNq8OJShQgrTYFK6nyWy8/cd85X7sf30StZTmG5aKJt4zx43ZByklPwe25cuHBuv/JO0ChmeYHcozmIUqKB3y9ALhIoJJb15y8q1cwaUaLF7qFeVt1/p2efOg3RTBJc4XGla3vZAfpruZxxR7vyux+K1B/e9bhogyEpKn6ze0Wc0CDb6dDKKTCVffAyNGn5s98XVjAelTH30D6aK2XBzNz5c/5PW6mt+yVCGwrGyqOCfm/yUEaXHb9mA== 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-SenderADCheck; bh=+CpW+8c08hSAcaGetxa5uU7xX1IYUuITpf0aXaTzlwg=; b=kJ6tgeZ8DdaSeiqT+i4r99B5GOfVVj5VsPuMzGlBapflLFtr2ebmwIwjoufzIas+JYp3/uKbUgttxPhTEOo8mPtvwb7VDfPD4NUK+kYri01UuMGZQ+LyHWU9DzrF8Xjyb0x4jmqCSUxEL6wXmuMMaz7NIVwlT7D7l/YgOzMw+nxg2MtakGyCMbrmI3uoJfbcuudstB/CPVv1e/jsxLbXFOrdl7oXtHezmCmhqLjecz96MKmz7U8hEu1j4joH+pBShcB7OpJcldrfHJDw/xi31zu4+i0TBNCPQk4GeDWVhmSObVUjKvHPsG1k1iwUts+5Q/ehbVwRFsN0bjmBxRwi7g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+CpW+8c08hSAcaGetxa5uU7xX1IYUuITpf0aXaTzlwg=; b=D3PlsanaGhy162xsoDp69FhJrK9AGfaK7JN7fcdwrDtrWybX8LocTiEA4buZHAUNo5M5AXCHmi2gt4zdE+nCQjZeySpfDoOB9n40xvJNG9r/XkOF56wGJDbhxBaNy5Hmtf37YQPsXocxpy8SFdz5NFj7NVuyRHfqHk9VXoC90Ys= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4422.namprd10.prod.outlook.com (2603:10b6:510:38::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:35 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:35 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 04/15] scsi: mpt3sas: Use the proper SCSI midlayer interfaces for PI Date: Tue, 8 Jun 2021 23:39:18 -0400 Message-Id: <20210609033929.3815-5-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eec7c490-39b9-447d-43a0-08d92af83343 X-MS-TrafficTypeDiagnostic: PH0PR10MB4422: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yl2KW29rHU2sqcGMUxUBJCi/aX+QGGiofv9H4LQa2FS7qkFKAI0x0++6Dc6Gg+IoAUIdhmmgnDdjbXDsbNAI4OgM4xzi9qhWdlMOZ+YARnsQKyEWuTTU7tzsgkAw6zsYkkiY8hhHBVcAHZr9ntLGFQMF0BJsPQSXItId9aJTszp4WHSwX64mNUXQCZTCDWHc5KQG9vifQd2XK8rz1eh5hq4reoDDsk9dFD+V4Nvm33kLbvDnC2qQ19qbT2uix0ne9sMKOxJGpfk5WJ4778F5+vR3jELmd2QFeN/Z9WN5ALJm6iqbzpVQmGFTMJONJpgdq5trmfrLPduPOCEpN6jRFawycmoCgkO0eroRFRlXa5dO7qciLukZ2e4CfAn9d8cP0ci/xJO0cb8g/Apy/C1kfeG1A0ISXnurH8OynP+LhV214DoPIihQ6AdrYAGiW6FrbG3h0mzOGByPCP7zNA+m6cvjws/YsXO3g3qf/H2Rg1KAi0hEVbg2m+OAEus/PP2lXS40uqGCucsn/bImStybnwSmjX7L8OvexFyuhtHuTiTjSMcdf+hKi40MLltSWRgblPQAbci3xor9BKGI12Y0QWmkOERvnRkX+51K2RizN087wN2eNUWZVD5bpQkgD0xBHW4VJX5Px7McQwI4lcdm3BnhU/9UlGc6aNy/qaSXCtFAwxybLGbnn1HqtEkuL4r1 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(1076003)(4326008)(6486002)(316002)(8676002)(8936002)(66476007)(186003)(16526019)(107886003)(66946007)(38100700002)(6916009)(26005)(5660300002)(52116002)(478600001)(956004)(2906002)(2616005)(7696005)(83380400001)(66556008)(6666004)(86362001)(38350700002)(36756003)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f1GuNv7o0VjUUm55Kd76/G1fZZtZ1J0+4kI9FK29FBi6uu8vCYd8vBmJBPS97GRubzWOErT+qWqw74uiPNPRnxrkO2T9HVC5VRB1RiKf1lC7biDHmx0CuSr2DM1Z9SlQGlF0X9Ee5ywvSS41+02Bf3zCcgOqZ720RP7XfDC3flS5kXB6n5qVhRYrzDGa9rbors1c5ctyycTdA1pITYcXsytW30caeI4CDrK30rknQLt1JMQfNH70BS4847mmr8SFAwRLKFvXCq9xjni31/yCO/VjpBYUPfFokReUt7MiDSdljsfgGqpPCRdWMbqXl4sSvh35a3SA04CnTcM5fAo+2DipnIA+xwP1v4OSNIlyjP8b9RaY5j+vYHTOGU+UQ9VYBtk4emGNBUs2om/ILiJkbL31+72Ij8BGRsgDfUSNR1gsTHuaEhnW3k41oD+40r+a5m5ch/d2eYmpSJc9neVPpS7N9N3zXK0jXYj+8zMJLEqAf1ZKVzttxdUohKVz0TPFimI0KZHNn23APKmClijYR+5VSZ2yqQXTjD7tRHythYLA1d3NlD6uqsHseOpuKQi0iR9RJCn1qdQj3ivxUP8eu8hqFB9rfPeNVZVkp74qUiULgHOpvEDtHyrbQ212cThiNfd5BGV2syTdcgEa2hig5tzLAekYHhjKMhghqOC+5LwDeh6zm8IqWsgJec+UvGGo6OwYakMCXnk0914nvQlOjG6ErKJEInFSzbd71YyHWvZMntF8YECVmTIhlkrQeLeQobhcQiGejtHVySprdtTo1ERlUq0EtVfWcGS/abZkR+nDjTN9la454EahWoZhbgZWLnwzSdMHXEEW+CdYd1TxcR4I3KJ+LLUqBJGs/RgA+RupCmnUEby21QcSlFYkr9tMPF1U2QPlNSAJdc1zEBtYfkMgsuE5gKuy6sQ9WhpYduHAcrlUIkAuS3HZm67tTRNfKf9iUnq0NrA7/0d9gv6sRljGNIq6eD59RfyJogCtnh4FxS02oAayE7lrc64NdTCe/KdvIVzSmQEQ/DcmWSPX6puNtko9dVIl3P9GC6Ti9WyhJndIHUQrRdBOCp6Ipjkxvd0/AXSKzTdM/0BBho7owE/Mvy6Wh+WKJQB5NbHVRtQX/qAT5LVt0Nz7/q4dvgSxdjHDhQhQVZRtivZ+ozn0VGRFkLkQxqCjUbmj6jnz2wqKlDSY4MhCgP6w3qLO8XY6kwijd3m45IrBzVtatNmRmXE8Ry5rt4Jq2G40dMQSKQI8BICERHfeJ/PKRveCA2blZ7dx/t6Uzu+GoT/KadJfP+3bSX1Qr/sWiGk39pGCHDVSZh2qhq7dKgufGfFfgqow X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eec7c490-39b9-447d-43a0-08d92af83343 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:35.1929 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jMfmhZlrdVXYbiq9hKq3UENdA2hr41dUlFpyS/iRY6YQNGd/DZUWd8lFzoYjmNdPho/MmcAz2hv5eyi9Xirg8CaVdmjgJA5nWS/9OFWuYYo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4422 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-ORIG-GUID: 61qjjVi1GHZOPQuAqTKuLPlt7Jz_IthJ X-Proofpoint-GUID: 61qjjVi1GHZOPQuAqTKuLPlt7Jz_IthJ X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags. Signed-off-by: Martin K. Petersen --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index dc2aaaf645d3..322450800056 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -5062,33 +5062,17 @@ _scsih_setup_eedp(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, else return; - switch (prot_type) { - case SCSI_PROT_DIF_TYPE1: - case SCSI_PROT_DIF_TYPE2: + if (scmd->prot_op & SCSI_PROT_GUARD_CHECK) + eedp_flags |= MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; - /* - * enable ref/guard checking - * auto increment ref tag - */ + if (scmd->prot_op & SCSI_PROT_REF_CHECK) { eedp_flags |= MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | - MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | - MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; + MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG; mpi_request->CDB.EEDP32.PrimaryReferenceTag = - cpu_to_be32(t10_pi_ref_tag(scmd->request)); - break; - - case SCSI_PROT_DIF_TYPE3: - - /* - * enable guard checking - */ - eedp_flags |= MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; - - break; + cpu_to_be32(scsi_prot_ref_tag(scmd)); } - mpi_request_3v->EEDPBlockSize = - cpu_to_le16(scmd->device->sector_size); + mpi_request_3v->EEDPBlockSize = scsi_prot_interval(scmd); if (ioc->is_gen35_ioc) eedp_flags |= MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE; From patchwork Wed Jun 9 03:39:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457260 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2701C48BCF for ; Wed, 9 Jun 2021 03:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFB98611BF for ; Wed, 9 Jun 2021 03:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236550AbhFIDlg (ORCPT ); Tue, 8 Jun 2021 23:41:36 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:41962 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236451AbhFIDlb (ORCPT ); Tue, 8 Jun 2021 23:41:31 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1593JqRB101672 for ; Wed, 9 Jun 2021 03:39:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=7Geu24OZxdxioTwSOoUiBlFQOW7G5uY8a8mCOeSav/I=; b=xZxOrncGm2Y28/jGZcbZMIq59iCkP/g3sSMwhgCNn5eLFKAWG0/vlCmkcalQkj7rmtDZ 0rPclZC03LkgDxXGnWKwmqfqkJhqx4a+QosU9GAej1kqsAs2DBiQ/KwquQk+5qyFUIlI OI/1EubQOS1c6vpbhfwEHzPGoCbH20jzWOH7zXkWIyxdsNRO11LZxJk6DCvopRP3UgC7 9ZaGV+F/2RrMkQrmCZnVz7FZPv4woipTOHX7ROyEnHHy0d2GcKB/0GRjthxbm4x+2mCa aDmFN1YPnK9EspsxjVhP83IjkzBj5sQYvpl6025d0b3YwYV0o3D8N2qllK2kBW8xha9H 4w== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 3914qup8u8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:37 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3h2082802 for ; Wed, 9 Jun 2021 03:39:37 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 390k1rhr0h-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k5nNqKmtDppKu5OI51l/OOKwBSijoyvthZVMhTfNuds2WamxCX1u7KVRgGF/crU4opMJBnmfSkgBqiIEP1mWYCV+YEN3aNHzpa/nUuq+0SGoNxR/kuZqsJ9SDIYxhi0VKwf1DaXw4DqheR4nwzGawFHmtREC+bHigP9NtfoB0EbtvSs/6c7VvtzBRKpnjZYJJu/rn/2eBd+Lbq/sn6FiKGN9oF3zqgVmZtQgzLdylb9YZTw+WoKdGcnpDXtpOl5zPHaIt7+h3lPIVBXFIG4HpKzFOh3s0bPM41bsVOBllPMs98HcokvEcUY9H3qNMdo9Xdo4+1hGuIgg1QUIFr/GIw== 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-SenderADCheck; bh=7Geu24OZxdxioTwSOoUiBlFQOW7G5uY8a8mCOeSav/I=; b=fpZfgj84rQs5bVQzQCy9x/W8NXlqfLR131yixsALsND8jJWGRtY8efbkNGwJEcXZkeC2fgbry9j3hFZO5S6LKL+l1MmnKOz/LjfF3l2yVpydNeFMkA7ySXDqeSyS2mgB+/5+Fd2gHXY+fGrhrOwpGVNS4rMxvobG0cJP8Y/14dpPAiVjPOdYgHInfNoewtexIQ3eisUCzy02lNSniu0SJXgijSzVaVFlfJ192MTp64K8SZ+LrJPJXMJ0NI3jUvNnbRIOdFIEsdNUjozCOR4zA2q4hUgrvlMf2f8DmZ1ltiW6yf477Bc0Gs4DVCHLRSXIjl69DWq/6bo2cNtq83X7og== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Geu24OZxdxioTwSOoUiBlFQOW7G5uY8a8mCOeSav/I=; b=iunHVGEFvJztsZrs3SsKMl3cmXjJse1FsbY4eI566Q6MEETO7VG7oIyWDxrjQZqm0J1cNWowTry3+xwI6jo0VZ7r9wwBEF0gChAYaOpmbymcHW9LtJsGz3706hvLsw/MsMTFlv402WAl2hFYlQorduVOiiyexeIdwwbhMjKpQXE= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4422.namprd10.prod.outlook.com (2603:10b6:510:38::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:36 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:35 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 05/15] scsi: mpi3mr: Use the proper SCSI midlayer interfaces for PI Date: Tue, 8 Jun 2021 23:39:19 -0400 Message-Id: <20210609033929.3815-6-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4e511cf-fa89-43c9-7499-08d92af833ad X-MS-TrafficTypeDiagnostic: PH0PR10MB4422: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P7h9W80Ioeh1DtPduUql6Vr5JQ3uE37AxLW36t2Q9e/gy49t4mCF/OColT3TOf7wzW8kC+ZI1D2uVT76z0GdNH3VibhQvHlX47KkPFEc6QVuv16p/oAGsLkXRUpzsMAUWSM9U2w0yl0KRBwLahq2qZI1N8cuxX3N01dKRGu8aISJCEvlHxHo7GsfiGXfmfOTy5Q2ngiHHCcWa5upP4JZKIuNV5sD204XBKlz73xeOErxnSQJeC3vRnk8RdyhNWBysQHb7byNIWpzO/F1nw/F6QObNQS698eqbRz2zsF27MvjnKFsoXDU4tN4951cTfGPOe6+exHAaR1zd57Bhv2T6kut95un/7PcUF5HFBOAXKIkh0ZpwXuZXrYD+hS1ljqQbGO0vkI2Xanvf1o6d5ml79iMEE65lhwbT0FVQrmhC7+cykxVf5dcZJyUJXIAVvsI/aOP2+r6papffEsYR14+jMNRw0nJcCPWIoRaDRkCYXQUVnr+59O3j7fFy+VJF6ZHYCjyrUJyqgqcs6e3fDiAEdeWmTeEDh0mrEqAr5qnanvmfXbR+jdnHhTXlTlG5Hmi9eTPaLnlv686CRbynQvPUZiSfKED4au5EDcy7GDm5luVOdNSFoBJRNN585VNAQfOhJn54jVrjZRLdmscCmOgywVoV2uu8nBAylgdDZJqjC83KJda3u3CJ1JrzM9kTtWX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(1076003)(4326008)(6486002)(316002)(8676002)(8936002)(66476007)(186003)(16526019)(107886003)(66946007)(38100700002)(6916009)(26005)(5660300002)(52116002)(478600001)(956004)(2906002)(2616005)(7696005)(83380400001)(66556008)(6666004)(86362001)(38350700002)(36756003)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6Gox9GmxuePGWJc97O8yV329sYuq39C9wa0Pu35GsRdraCVvx+voBDtK1leO2cJAsFQ/nWSHZY8eOawLlgL5S6jDAOsVh4NEcYBsPtR8YW1FcsuvfDacRvbrvpxTwubZ4ejB5O3clrcHF51JTBi2+f2CaPQMFj9SJUcqBcNccK/4vOCFfMMGf5hsZ3pRvx5bv9ioQKeMkFFBWWFoDXuOBs5FNc0ZVgEUPPkaVsnjlu2+iooSsu1v7hIjsZCc7FWc8RaNRYGPbWiCa0ljBV2c1V3KChani6H92kJacfqyRktVhHkAts/GYnReVz7ZGtKdPOPOAoWeMLWBq3TUTDg36ryp2QYcvaxf84YmOGaaghcP4DR6RbuFYJRQl9EKHzE9wRx1goGOQhB2isvDvwWYVictQbA+70yQNaCqUWrqC34UsmajMrdmKKxSHb8Z0zSnX5ktl50n7dWNuDt5/rb9t8RWzrl5tOVQiNGiZsrPA9vY/f7wNZvvDgOpTt2m5ECxTMXrfY2JbGMGLkadlTMF/qDac7iWfryPJfFGzHownHpV+shxXcyLDG6Er1Gmj4XM/fpacehPN19XYUQTDPzrxWioZLd5K3shT7q8ir3lyl1DAn6nSgOttEwUWVFoSUQb/KIvEidmf9stpzgWZKCoamBjun8z3dtjAXkNej2oBgrmAaXvnjzotcOo25qP3Qj2EjgNfyY9yrkfTP5FP/3jRiOgD+/8HjbX00Ou08vf0PnI41ufjy7m1JNAuSSWO4oFp8RFC5XwF8j8vn3rLxeHl7grnDCMwonJ83QqyXk7SBAqdfn9rAPbAWcNpxLoBZzDdk98CsFdchQgX6JVcHa3dhg0a81J+/avqchRn0ZSsRyiE1JLZB762EpnO910BgwUfLeOT5sZdsw9tbQyewONhVCsgCtZeIX9yVD0IF6AfIo7fGDV6Bx6OS7bWnQMiSPY5fY8pTupODkNybRVsqFnKr5aZhmHpIBoM/dfjjFNuBmCKbcriXGtAAR7pd2gqoQq5OpXFg4abipWkxhIzPD+6q7gKqdBGp1llR128X2qnOyBolmtIfR3W8A5MoFTjzF9nyzfxOIdzW2db2UFEjZpRkZ8i9gJ1PH7NzOHICWHJh2CyvLfr1912ueRLsLC+9QfnUov3eBplx3whvgNcGk+AAPnl9bdZRJJ/UIbTtWlBzfNkL/63kzftSfxz+1QmGS5/dD8DLkgYJhlO9bcyY5s3V2H0nTZcF5/JKMDu8++WP4TfL7qfayX9b+TxR++PcQUEDKbOeVSDJJl8yMX52IYkJjQ5gzUOVcjhJO0Q32DgOr0vu/ullRkBXuI9fnvDth2 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4e511cf-fa89-43c9-7499-08d92af833ad X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:35.8609 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /ayIVxFquR4rCNM4+2rB9n6XgAW9YSCtXv3wNr7OWZumpnNd/Y5lcAPBJsg7mlaKevEXmRu7ULLbDkn/C4gXWA8DIFZ1nuled7pysIyF/Es= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4422 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-ORIG-GUID: iQtvgsuPJwbFPPoZb9jN14pIrKMppTXR X-Proofpoint-GUID: iQtvgsuPJwbFPPoZb9jN14pIrKMppTXR X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use the SCSI midlayer interfaces to query protection interval, reference tag, and per-command DIX flags Signed-off-by: Martin K. Petersen --- drivers/scsi/mpi3mr/mpi3mr_os.c | 59 +++++++++++---------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 4ab0609a1b94..11dcd6930215 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -1962,7 +1962,6 @@ static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc, { u16 eedp_flags = 0; unsigned char prot_op = scsi_get_prot_op(scmd); - unsigned char prot_type = scsi_get_prot_type(scmd); switch (prot_op) { case SCSI_PROT_NORMAL: @@ -1982,60 +1981,42 @@ static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc, scsiio_req->msg_flags |= MPI3_SCSIIO_MSGFLAGS_METASGL_VALID; break; case SCSI_PROT_READ_PASS: - eedp_flags = MPI3_EEDPFLAGS_EEDP_OP_CHECK | - MPI3_EEDPFLAGS_CHK_REF_TAG | MPI3_EEDPFLAGS_CHK_APP_TAG | - MPI3_EEDPFLAGS_CHK_GUARD; + eedp_flags = MPI3_EEDPFLAGS_EEDP_OP_CHECK; scsiio_req->msg_flags |= MPI3_SCSIIO_MSGFLAGS_METASGL_VALID; break; case SCSI_PROT_WRITE_PASS: - if (scsi_host_get_guard(scmd->device->host) - & SHOST_DIX_GUARD_IP) { - eedp_flags = MPI3_EEDPFLAGS_EEDP_OP_CHECK_REGEN | - MPI3_EEDPFLAGS_CHK_APP_TAG | - MPI3_EEDPFLAGS_CHK_GUARD | - MPI3_EEDPFLAGS_INCR_PRI_REF_TAG; + if (scmd->prot_flags & SCSI_PROT_IP_CHECKSUM) { + eedp_flags = MPI3_EEDPFLAGS_EEDP_OP_CHECK_REGEN; scsiio_req->sgl[0].eedp.application_tag_translation_mask = 0xffff; - } else { - eedp_flags = MPI3_EEDPFLAGS_EEDP_OP_CHECK | - MPI3_EEDPFLAGS_CHK_REF_TAG | - MPI3_EEDPFLAGS_CHK_APP_TAG | - MPI3_EEDPFLAGS_CHK_GUARD; - } + } else + eedp_flags = MPI3_EEDPFLAGS_EEDP_OP_CHECK; + scsiio_req->msg_flags |= MPI3_SCSIIO_MSGFLAGS_METASGL_VALID; break; default: return; } - if (scsi_host_get_guard(scmd->device->host) & SHOST_DIX_GUARD_IP) + if (scmd->prot_flags & SCSI_PROT_GUARD_CHECK) + eedp_flags |= MPI3_EEDPFLAGS_CHK_GUARD; + + if (scmd->prot_flags & SCSI_PROT_IP_CHECKSUM) eedp_flags |= MPI3_EEDPFLAGS_HOST_GUARD_IP_CHKSUM; - switch (prot_type) { - case SCSI_PROT_DIF_TYPE0: - eedp_flags |= MPI3_EEDPFLAGS_INCR_PRI_REF_TAG; + if (scmd->prot_flags & SCSI_PROT_REF_CHECK) { + eedp_flags |= MPI3_EEDPFLAGS_CHK_REF_TAG | + MPI3_EEDPFLAGS_INCR_PRI_REF_TAG; scsiio_req->cdb.eedp32.primary_reference_tag = - cpu_to_be32(t10_pi_ref_tag(scmd->request)); - break; - case SCSI_PROT_DIF_TYPE1: - case SCSI_PROT_DIF_TYPE2: - eedp_flags |= MPI3_EEDPFLAGS_INCR_PRI_REF_TAG | - MPI3_EEDPFLAGS_ESC_MODE_APPTAG_DISABLE | - MPI3_EEDPFLAGS_CHK_GUARD; - scsiio_req->cdb.eedp32.primary_reference_tag = - cpu_to_be32(t10_pi_ref_tag(scmd->request)); - break; - case SCSI_PROT_DIF_TYPE3: - eedp_flags |= MPI3_EEDPFLAGS_CHK_GUARD | - MPI3_EEDPFLAGS_ESC_MODE_APPTAG_DISABLE; - break; - - default: - scsiio_req->msg_flags &= ~(MPI3_SCSIIO_MSGFLAGS_METASGL_VALID); - return; + cpu_to_be32(scsi_prot_ref_tag(scmd)); } - switch (scmd->device->sector_size) { + if (scmd->prot_flags & SCSI_PROT_REF_INCREMENT) + eedp_flags |= MPI3_EEDPFLAGS_INCR_PRI_REF_TAG; + + eedp_flags |= MPI3_EEDPFLAGS_ESC_MODE_APPTAG_DISABLE; + + switch (scsi_prot_interval(scmd)) { case 512: scsiio_req->sgl[0].eedp.user_data_size = MPI3_EEDP_UDS_512; break; From patchwork Wed Jun 9 03:39:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 193F7C48BCD for ; Wed, 9 Jun 2021 03:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1C7960FEA for ; Wed, 9 Jun 2021 03:39:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236558AbhFIDlk (ORCPT ); Tue, 8 Jun 2021 23:41:40 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:41974 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236541AbhFIDld (ORCPT ); Tue, 8 Jun 2021 23:41:33 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592fQXY020270 for ; Wed, 9 Jun 2021 03:39:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=IXdz5hHDNm6Es04nsJLwjaVtabeiytPOEdJ5hAYApO8=; b=riAWP7WXFaeNUVEdp9QHQq9GZbano3KYPbcyh3Lo356SpXC/obke6WZT8fKcNU76b9Z2 EDMrrQepUzgurjk0vzq69L3Gzn2VuCS7ZC5+jbT3Cmt9/CaLgBH6HxqC3wigJ7HqsbYE bS8SY4CCjKsHNga5pqILCgoKcYU1qP4BIB0DODO1MMYJ0VT1HTxV95ivb+JJgddwjRPP NnyM0G3H4qa8MTHSDNLKyFwJZX/XOUWD1GA7CGgF0BsnP/sq7nYU/rayGcFi3y5qYMJx rKUBLezeCvcnOuOxl+cKMDs+hdqW4e3T/6q6tYXy/xoB1XwGX3hH313YRMpo5iyob7Do NA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 3914qup8ub-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3rf082718 for ; Wed, 9 Jun 2021 03:39:39 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBS3azoqHy80dw6RYbgRJhNxjV6JeTcoQIJE0YmzLwZVE/vprTFU9RHQV+bvlulhfRqpuy0gO2AA+I89g0wDp1dgALf7YHiaYHtxTWXllnesTi9AmNYr2T51rDLYz1OLvl45tlgEFY8asZeQm4oV+ZcIp99YSJbWSTiPVjdB2tZOLTc3EpAWA4szv+XbrWxxEFs4CziFJohlohtjjJ9oWx0SUABBTx/gCQ+mqQjFLGmNetYYJOFXxlXqbrJo96LJiZq7THjq0b1h263nAC1qjX9gnBXLqGIMbASgGVwxWhwas8jK3hc4QONd7iB0A1uy6eLW4rtmP6FJ6in5T/sAqA== 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-SenderADCheck; bh=IXdz5hHDNm6Es04nsJLwjaVtabeiytPOEdJ5hAYApO8=; b=a2ExwFYtaB8LKknUJoph4tzQ+xJYdm1WHVJpA6uownhL9UjNgAFTeYy63FCZaDLJ+YE93u5P7ZojOKZTazwD4d8YjRXsVCwqqBslgYDlitVMiWuNvoPYn4w7oITQAjpa/uLQ6xQmtmFuppiiozB8OMf1VqMF1Ctq/yOkkAGCb4350Yk4ispPWwP37u2+j7fhTIexcvamxu4IkeUBj57oA86yfRW4OZPzu/tE4adZA8b4CU1cbCN0r6hQg+hdmCKTwzDT9j9gV6qGlHowApxYDHKDCYkL9dWHBuDUcjWH+cFO1l99nDEUZSNzL8gkggRA4OYgD7fInUlSKSlVZrG+eA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IXdz5hHDNm6Es04nsJLwjaVtabeiytPOEdJ5hAYApO8=; b=h38K57xs7RFMApqptNnkRRAW6rz4W4reBBeaSkgQqvX/HEo5AI0/8B1uzIrag5EqmU5p9FXQGlX/HUGKQ7bA1yshHp/SZ9mwmV9222RpOZ5TQinXJE+vketdwGIF3rZpQV6fkNMjgHDO8nsyvms4Va/E77BVgTP7oKm/C0eOgg4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:36 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:36 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 06/15] scsi: zfcp: Use the proper SCSI midlayer interfaces for PI Date: Tue, 8 Jun 2021 23:39:20 -0400 Message-Id: <20210609033929.3815-7-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 27a8cc64-2f75-4cc7-bcb4-08d92af83422 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:265; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xaCgYUjjrETesdlKb05rc/xGtP2QJV3pSywl/AVwLfISnSuHCA5wn/04vqZXvMq+SMzCKyi2UhKDfhLKNq0o8hA/bXvv5gBsHCl8vyB9rRopOkw73sJW9SH9+5DQmhANUvRwpBBZ/7/58pWmG6se8KUgyYYGZIOKdlNy+CogCBhY4VGRnF95GueSc9zQSKKRS+lmx0L/z9RGETb2Tw9FHbyxuHSmvHUU7YTyAx5ax7EAYH+58j+czMwYJZMOAEZRAzHqq6MmFl5yA4H3cKyzd8euBp0Sb+HO/7VHesLfH9KJOak+KoxPcVRXVhEPHxFQn3MmjjIr4jeROb5v2YSJU6oti9zawuIChKh3AYctTrwjxA9l/Dh5ETF2mMwDSHUPdkTkSo33HLBbhmJOSIOd+BtM8frlW+Slipz7vnD0cbJVgDGvS/xZ46f6hdS1YueeO5CfU1vLrfTpawtlP0U3KGERTo1EqbumDTRA4m8pg7gaxNh427JhQzQ9gcnZiqQoI86a9Vy4gzoaAfyhIR0fAVqG3sURzJnBnK3N021Bz5TrW/lN9Nr7GovKzdxkOgwj0FmtVGOo687UQpbIQduVSqhiYpF8eD75ViXuWlPT9+5k883TM/Bl6HNP1slgXrdMvwA++kB3faR1DttBL3Mhgw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(4744005)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M30FYvX6jjvdwWF+hENNoeQUHSufg/Y8JTnzUlJMvnUgf6XzNPDu2hz8EzPAZ72wgg2NGXlxrQBddMFEXgIgx+geTe6TrMXsUoOqnzZm9I8vFxevsD326+eZNC+lBbNctNgAFyuop9SCaLbNLl/t42gXlO1ubbbw8plB+PZHzQmnWGDV/MKrFHKcutLUV7nXp1HWqFloTtSfpo4FamE4p2rCCfHpSsElKq99ngnIP+ZlexVRf4qF9rqdrUtPqd+DbGBgBJDA6VucaAXIqRJLviHHaOFVhCtLEGmc/uAM1D4IwND3efOFFQZoL/R+rT1T6Ggct/QUgWBzJa6Islfm7eI17WnGYa1nnKQJtWp4KbRExSsFEHDCY6DCcVJjPRxXAyAB0Z4KbJUSp4R3oO8oJ5DrIJAiT/FMQzi2PzQbmdFV+c/D+0drcH+QO02t1wtnxKQv0v8F3zciIj+1VzcWsPHljBwPas6yWdyRCNdKXtsK4vxymln0mSc0lMsEKY0z3srGaXeInrLQL9zVLjjXX9aKElu0Cwkh+WiUAzz41RlAlGr48wKytevaukbyFDSip4PdpxZSIAw0y0RstrS3bGd10Om3d17TTNqLndo4z4qYVxzyHZ9Wkh1MzvDpIOVrT4dmQZeEPfZpDswdfEuCr7OhOzsHiX7RK+hKWdEqS3MNGF8ZG3RY6lDq2t2S8mdRWM8y5OUlwx8o3gTKn9IAJi/CgpqJVXr2/4T4We2QGNJoW9TMW6cuc9rrgmbUhWI1UM4xXhL6WL1gjd4JffxD8ca1PgzTNjCeZQTtqT/WXi2eS/71jtOuILvQY/ylldlFYy1/zg2gzGnC2scjwAXZgqtLlSWfTKn8q2YGL6H30dZKr4iIOiwJOB/SUbUpzNVzxQbNj4K5E1wYOnr6cdiFBQF1xBTLhrtDDjAknwP4OZTltUgjOVP81/kENgUExc24IwrALV3jJQy3Wn+PFc22kNPJrP+NLHYttx8wqR2ezvUCS5WE9Tm9aHnj8NTV5S6P5tRiq4djZCwgvtY4H0955M1sIS708azgbms8uWgBhcmO1za05q7AsMnA2AiaIEQ4EG5R+yq6RixytA5OMQw4791bVN9LL1g3nGBG+8GoRQhkn/La4FW2LQIv2b7xjYg2VuVmp1n8bQj8UJOTZQQFSN0h3c0dvJfDFHwwy31aTYIu4stUNIJ0j1/w7fkojYhC8cwHK5pcd7udt3AQcoyomv+5bppOP7NroKiYqLnlXa0+HKPhQuCSTcae3F8RiQJizJdorkUER+muhb2zLaOlhR6OGYg36/IXqH2Yj/MFIKwv7mMB9hR56x/N7BgmciXH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27a8cc64-2f75-4cc7-bcb4-08d92af83422 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:36.7162 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6hOyWW2VDZSDesX26LfHQFKunGzJ5qDns62K6tTvkTzB97mAhzEaZo32lTGPUNlOdRLigyXFy3OsE82PKgtDKoGBwSRJ2/BTmUzhBOi3WN8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-ORIG-GUID: 9VpiXhVNuzbdTJrN4GJzKL8cv5Gak32M X-Proofpoint-GUID: 9VpiXhVNuzbdTJrN4GJzKL8cv5Gak32M X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use scsi_prot_ref_tag() and scsi_prot_interval() instead scsi_get_lba() and sector_size. Signed-off-by: Martin K. Petersen Reviewed-by: Benjamin Block --- drivers/s390/scsi/zfcp_fsf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 2e4804ef2fb9..1990216cf289 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -2599,8 +2599,8 @@ int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *scsi_cmnd) io->fcp_cmnd_length = FCP_CMND_LEN; if (scsi_get_prot_op(scsi_cmnd) != SCSI_PROT_NORMAL) { - io->data_block_length = scsi_cmnd->device->sector_size; - io->ref_tag_value = scsi_get_lba(scsi_cmnd) & 0xFFFFFFFF; + io->data_block_length = scsi_prot_interval(scsi_cmnd); + io->ref_tag_value = scsi_prot_ref_tag(scsi_cmnd); } if (zfcp_fsf_set_data_dir(scsi_cmnd, &io->data_direction)) From patchwork Wed Jun 9 03:39:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6339CC48BDF for ; Wed, 9 Jun 2021 03:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B6AC611BF for ; Wed, 9 Jun 2021 03:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236559AbhFIDlk (ORCPT ); Tue, 8 Jun 2021 23:41:40 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:50358 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236543AbhFIDlg (ORCPT ); Tue, 8 Jun 2021 23:41:36 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592gTUE180143 for ; Wed, 9 Jun 2021 03:39:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=TFcDVEIH4b+g1pEjoiW96kyt4PGXiX+/r5gFqcA9wGU=; b=aOSwrZobc7j/p2VHxMYwZ0OBy2KSNnBVRhbwkkHzcm+0JpOHkkJGCRobNzouKkkEK9lC +wlTYbNgsUNSAp9uZ/NQ86gm4vKol02sQ3oc98NApmtebphK2sSdaSarQ1Qh+GODUBcs tQkpovvikpzcHvVRDlrgXbZ8BYZnwq0L6ENEo+E/IMR1PvHc8gD614hpiL+Jr3NBt/sB cIgkrSKd1Mix0939oXavTHyQB+aEHtBLQKzlbZhM8mqAbeQJZuW3j8hxPoSYrC/vdNCU MzqQejAAMiPHovVLulhRe9KEbxzwxtV1I14uD8BnUifNmeUj2uglrWsxOrQFudRCesgR uQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 38yxscftdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:40 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3rh082718 for ; Wed, 9 Jun 2021 03:39:39 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr1d-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aJvd0rP3QRnD4NeA127LTeH7bYwprLI4YdcBxVnikAy+amXlt8jN5bSgGEqpcBJcvZD3HHomVJA9w7H6zGF+UiJyXzw+Aok4a65rnwAuiJSMN2aPbqYVTD8vLqV6ZaFShYi/aovSHakAe7f8alvDhh2HjuIqs6k7/WWr3DD+5+tWL2+h5F6feqz+rOg8itj1Ejtf9pJtU8MJ/BYs03qGs8zwUbu7LnVAuNt4IItJXz0Yoq/zmx79nzK2aKLByZhmZFXBdOYQTjemOQOytbXaBcXRExj2tTcFRBWAC+m6MoMu9pt/F1sHM+RQcNvSdqZinuiufdxkgI4ezhqjDL0Bjw== 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-SenderADCheck; bh=TFcDVEIH4b+g1pEjoiW96kyt4PGXiX+/r5gFqcA9wGU=; b=G7ypfUVjjQe0fpRn54eifG2IisOkdwTPHsCStWhQ5EJB6lAknIx3Mg9iQ6KCnxEupj9sD+yFZ+arYSB+2WBFGzk/FyO8Z7yieNicbP5ykZr7RSspAVdkPDEcwKQZ3p0kKpXeqJiqIMfXBorqD3NQT96PK0rC9DNeJ1P2ZM+Vd2V8icwxjZalYQrEjdC5UKuCJiLbV1Jfx3i7eG/HSJdScQg+/X69CbfusBY85hRceNbRYvqNIudogtOzTGMmf1LKhPGrMJZx3BEKvuH+50dYUzlQcj+hGe4ZGV6m/NeJMUww620hGyYmmhteoEKmEhZcXTPLP7S+g5zPLnhtytl4xw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TFcDVEIH4b+g1pEjoiW96kyt4PGXiX+/r5gFqcA9wGU=; b=up8smbluyP4Vpw0Hi4S5IGeUozpupM19aCKcMD6g37Gk9owmDlDJUpZtKf1UOAbM4AQMagyotgjpuYi1PWSTL8NivGRZRXdPT5kjsuXZ/njbyk68/8mPucLDfO5UAc+4n6jNsW47ZPG3Ygx4oRTL14drgon1INQf31Xprm8donQ= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:38 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:38 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 07/15] scsi: isci: Use the proper SCSI midlayer interfaces for PI Date: Tue, 8 Jun 2021 23:39:21 -0400 Message-Id: <20210609033929.3815-8-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a59e0967-2599-41ff-41c3-08d92af834e6 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SJr5X7uPkXVvy44vNVzN28hP/NgOx1MgpIHxY4wjwGLOrIgpjMep0/SeicVOCsZZnFVjlRstveJuNKH2xvj0ram8hLyxJlFpwMetT9EFsL54xy0tOAmmCbmp8gZewEF43bbj2xJ+jNq982rquRh1tVwP1XCXojvoCqt8Kf6NEjp1i2CmczyWEuxHCKWr5sQZy/gIzibJG9XUK8P99Z94zROjH5aW/HKw+WioGTsUWWDDsBBokqaVURrk+HfgBhCy3VyGJfcHcRUrKP6vSXTCzwgEXUPa4yhyMGTRtid5/Drcc1qvR4F6QaY7TbycrPcidCYAbtVUKwaD9LeT6pLbeNs05ceOSIxAWQNPupFFb3WAZIo3eMAUFQ5aGOaqdMiRW+Kl1i/w55AkiZdH0FO4fCM7oJJHzJahEDmXWFosObEdCO/3MOHcPZL4mWf2Ljr3EDaGr9kooSFg+GVWrvXT4iAmyx8sBYtw+bdasDTJ+Lf8oJH7Pwh6D1sxjMr2yyfQLOdtQ04oQv7NKJxYbYdrLPK961Fb4VvEsSB03Pjw5OXYmqcy8gfbEQDXgZgUkqLHoMuaj0Dgn3eqWHooq1x49w/1j0UPh1VuRaLKjETGzfwuGeRAsl4Jcml+sgfWsWR946ZyCrhCUwPArteRHlSqaw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lNo4cWFKEeJ2azs+tnwN2qFXGYFvxe/WwY6ZfVxGPCHuFOdCrjOqsgUK+hiThaRV8fBYDKaK5ui3U2t/eXoUshkGN3sfAnb31Og6SdChkPpTko8lkzFoRL9v9b/dvGRBWxi6cQtn2o+W/2VZ0iBCqPSKr5gCzcZ3clfIQRZPn4MD1rW/BGA6luq3qsvJHvvTY/XZ8bO3hhRXFdlXMKEljTtmNK9miwZIrBuTJf8MAwMeOkHjVzT4e4C/+8aAApTcKJPDgJQBcoMWOz6poo0LTTakBlR2z4m1WYy3UheNVkcRIUwaa4C021sPMV7cgal/VQYkYXAUh+5+uXfHtKss1ej1cUuqJySRcAbUvvgeXp1EbpA9250Bcv2bHMfwJm2MpPqxCLkG9svkrEDiwRcpy0xXSec2IN3OJO095HjSB9LqfK2h8mEN9TbZjBSdxKvuD30xtdikXx/oZ7NWBGccuJQ1QIoF9SgkUG1Mn2miiSFKGK1nIRe7dfwsi4ocy8DX3mA0VSk4jxvKuXgxG15R+w6FdlqY1ccWGI07XRd5PIVDX0sD45GHCWt/lQ7c4S2DCE9E+7CgfnBoDXUUspMvlse01CaYYa9/3+HSzWd+wvRzwCmy8lWOw+uuVWneScnGrLN/NRTjL6FTLDOlZE4J/601yuMFhDlhX69PkBoePbhLYtE8FxwnXDEoxbRu5gPK0wyzTC1hY0n1t5FoyBbN6SMQf06oEcPnyHcr4djGN0yVjyb9dLt2RhzCybVZPYZ30QrVhYkcwQs2fsGUR2k+BP78viibBYKtQO7KSRopcbZOL32eCNEqDCW3VrbCpOAZeTi+cu7ORLHCcDRcU58YO89ZGEkFUW/PPsFnzWeQqfl6rCHXY59BnR9yeQPQGoqOrr0H9l+z8fhKjctKPs6+kkNDRfvJ0/axAkTWsfQIJPt6mc+7sw4vmmFidm+jHHIjZ6w3QoNeH1/qZ5aj252BVS9zAz24khAh0yTma3PUauEji5XHdXWTmt5exAfkBonc7QJ4cVZKZqgK7hSvEtmSUBTa0LFUOEbZQ8W6bw+svh4y0o1BdAOEVTxbaFAJauyyGaDR7Y6gLhifdQgT0/BFst7NDnRfMKXHz/8vhFOl4/VVFL8r8Uk76jLeEfXh++2+VSUuQWfm44oeUh4zY4m7qBmLD0D3rOf6k9ApyzbRLI9ER4f82n4Mjty5lREgECykocuJ4eQmedborVfhdiVswFqQd5oOOlnMHI5RZ+//SdzbhTjdobsxxbAJ+zNhFCSKnF6SK9j0JkjauzNDNdDZAF4UVdnALWzFzvDstG35M0AzRs5Y15Xe65RlCjw7oT1+ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a59e0967-2599-41ff-41c3-08d92af834e6 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:38.0015 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B8QyLRWEow5XH6Ryr8qZbLQc457DX2tM+uEyt4Ozaj33qw0dezeD0I6I01sA2Wk2YHjC6EKty0F7ELpSDkTxwdUP25CtiuEp/dXZOQispGA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-ORIG-GUID: KdpEHmlfs9YX-YM1MI890XF6gE2FjBGh X-Proofpoint-GUID: KdpEHmlfs9YX-YM1MI890XF6gE2FjBGh X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use scsi_prot_ref_tag() instead of scsi_get_lba() to get the reference tag for a given I/O. Signed-off-by: Martin K. Petersen --- drivers/scsi/isci/request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index e1ff79464131..fcaa84a3c210 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c @@ -341,7 +341,7 @@ static void scu_ssp_ireq_dif_insert(struct isci_request *ireq, u8 type, u8 op) tc->reserved_E8_0 = 0; if ((type & SCSI_PROT_DIF_TYPE1) || (type & SCSI_PROT_DIF_TYPE2)) - tc->ref_tag_seed_gen = scsi_get_lba(scmd) & 0xffffffff; + tc->ref_tag_seed_gen = scsi_prot_ref_tag(scmd); else if (type & SCSI_PROT_DIF_TYPE3) tc->ref_tag_seed_gen = 0; } @@ -369,7 +369,7 @@ static void scu_ssp_ireq_dif_strip(struct isci_request *ireq, u8 type, u8 op) tc->app_tag_gen = 0; if ((type & SCSI_PROT_DIF_TYPE1) || (type & SCSI_PROT_DIF_TYPE2)) - tc->ref_tag_seed_verify = scsi_get_lba(scmd) & 0xffffffff; + tc->ref_tag_seed_verify = scsi_prot_ref_tag(scmd); else if (type & SCSI_PROT_DIF_TYPE3) tc->ref_tag_seed_verify = 0; From patchwork Wed Jun 9 03:39:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E71EFC48BD1 for ; Wed, 9 Jun 2021 03:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D118E611BF for ; Wed, 9 Jun 2021 03:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236563AbhFIDlm (ORCPT ); Tue, 8 Jun 2021 23:41:42 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35378 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236545AbhFIDlh (ORCPT ); Tue, 8 Jun 2021 23:41:37 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592ixkg049263 for ; Wed, 9 Jun 2021 03:39:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=mb/S5VQZGmIDU1fqPzA+lO6nch9lhr2u/nACT+dkCwA=; b=ICgqEDbYV8bVvoAoaMfVTkT4/kzPDspyLOoGF1Uyn+iA8kiga9SGvgqXHUgkny6pQvRM xYIDLRekBtrHDOjqdymn7yUBML1iWILKiIak4eoYxXWSO8SR/D82eu8e63fgljDrG/EP g8XHVlSkbU+Z2idma2Ivk9P4xTXK1VrO99Lmado65XxEM/mapvz+FurUm1x40zdKktYQ LW/N4iCEVvyx9qp6j/0sKcHT+A5EbcMSDa0PWDECdoxD0iuxEXshqIx3ZgiAzeb/gyq4 yspHq7TksaB3BG+kXJK5CZ6mmeUdgbEwJGahq2CN0tPJcEtdO5QYVzNImlGWeumMaw9i HA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 3900ps7rnv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:40 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3ri082718 for ; Wed, 9 Jun 2021 03:39:40 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr1d-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nnVLtal8oUMvS/Lhewapmv/NzVPSl1RvYnlsRc0YEfhuXQtjwMRDU/dAsbGZTgGf6G7v211RxkeMx6MwrZHdgpRN1hFAl1g4nMNiuhYFs+Ip/d9K1lUwzcsPJCBq+SmXNiZ5g5CHKIBMJSY3GW926NDPWsKnrdi69OcVNpzs+a67/ZkLI6XU2XSFnOZznxMoX19hAys0GXYw8RkjXGTujmEWJHLhEVobxY+cgufbuW9O+UDB7rkKkNay/qoBChLHk7bSMfBHgk+0INNoBbTxUDOYNqmRKqwhzLOkjEI/yeWr+Fi7cO0OdeAuC2Gu9IpSpb3gGqFS5ZEn68ksezyHTw== 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-SenderADCheck; bh=mb/S5VQZGmIDU1fqPzA+lO6nch9lhr2u/nACT+dkCwA=; b=ELuzHqFSkXjYs9nb+zavsrBKhyvtkLa/RzoOXQOw/EZgYxLuFV+F0jf+lohCdUYSore/iUIV5OHNoF6wL301yncFYVaG1ByXAlx5oNNzZJ1XhNzVlmpyfpq/EiW2RT6Ayji+TD2CAx0ACRDupZDdWF890v2ZrRSvvHYOcTKPyP+8ckZzNa2c0057rCXpzo4rAzkekMuccUQxMMGMg767lZSpMsXfhdIbt+ZStFZjeFT5sni+n39OlqS2h8xWJDWtGGaMpTeQ5c/N563NH9AbMHjQvI4nJl0OAHK12wuol8Q2i2v6fESr8xrEKOOfMxN6UYwswZ+Qft3phLV2IoGmGw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mb/S5VQZGmIDU1fqPzA+lO6nch9lhr2u/nACT+dkCwA=; b=FBM1dapE18LUb+nuDAMeMwb76bMV0yexIh41QRDZ9sFw5er940OovLT4gs1cZABaB8vPokEnE3fNJykGmF+RMQAAatWwBC6xbIhYeffyQ4jfhxR7wojRbXDPUJX8ZwGyNXonj2d6ALLU3lnyLNz9AkuDzAjj+PG/+j3Q3z5nBu4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:38 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:38 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 08/15] scsi: scsi_debug: Remove dump_sector() Date: Tue, 8 Jun 2021 23:39:22 -0400 Message-Id: <20210609033929.3815-9-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77c2010c-c8cc-4b1b-eeb5-08d92af83566 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OBZuwjjgT+afJfM6oHIWA2WIRjowJP29/GWGA6bQUCbZtmwLVp/+HqZGbl+uqSzNCHGnRf+YYY1Yrzu98Zl8LICj0TaF5sOg2V1rtyyXae9Zk7o3x3PiaPWRgQjyDprqrUf77T8Uhpmda+/jP+MZoDC/t6gTlRv2HLz/Avt6Rhvws/v5swHEf86alGgu+JDfz+pHqY/QwfTAe+38wFnSLTGt+SqUqPUIZGauzp/6K6Lr1T0coStM2b7OnmY9nO5ZRbKyZJj7a3yHsjBy3v2/sfQGAPFawaQ/a7zE7peS7by+jCpqTnL97/NiNEHwmXXqix5rJnJMJOfUJ5+AaVEzBfkHdyHWjwVkQsBZTF7rwnWVA7zoSpka+CMo4qiFvvGtSV5PqRhctbXZDOHvGGBIDSybw/OILFMnbVIW4hoJKs+kjFe46x13dCvuys4oF0nA0OuDivyBMxXBN32cAKbTn5/wDGCbEP9c4UdEFRCQLmnEl6lFtjaf4GZW6I5pAsLhQ9fgfuRs+e2GBv42PPhq3XFaN+K8ArC+gNkBh5NRciFja8njTJIWEz4oh0AGizB1O55gDDi81Jz6VRkpTkUWIctYEBtQh+8l6OD25WAin5xSLp37HWKng/lihtgallZ2NvU9E+F4w+lur4grxiR8pg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: viCl3k0udLWfvOKzF0q7B13XsWtDCFs1+cdyL6viLfrRtjyz2rgMaDWe3JVc66pvaDJVvIU9gdoPM8/6gYfdGeEE5mN8j7u2NxnjHccqnG1iAAajFQ3OxQJKURPXpzsvSLJcRqX+5ZyEw0WMZESKCJTRk7t/pzPPG6sGjIR9rlIEkO06uGklIR6vZdGHQXsgmUH6GHikjjIxXf3NUF0+fAtAjNI+QwLRzpFSkBOKe7wBchlAFco0JrxMVjIOLpD/J+HxjPzCQj8sF8kVEeSZKybBzaiv9lyxBSf3eQzX2rWp4ZL64QNIuieBpa7jtlvfTkTqzYED/RM4slOr0YQ69sgECS0ZJzjpNTmQZVT2oj6ATphXoxABn+az8uN26ZN80koTwslwVU0zNX/VDUsQZX/+PcIYKEsx6nllWIvZZQfBkfmstePMSxTtFQkJ83UYOuQDeRjJ/Mqpb1CCyCyAZc76YqZtfY50R3JUbP45w9O+Wo/ds9VIyyVivAE7Oe0IlJ7ThzZIxjPWhn8aZqMHM5+67PZsGVSg1I4ObI0QrkFZUvYW1nWr/bX+zF4O3Ov7OEqM1cFRgQ3HEkAv0hj6E8RnpU7rALh1v2wzrea5QZDjLxcDN1iyvWjc8JSIGj6T2irJETdEUkVmzXO73X2UjVJ7VtyprCvfnY6oA1t0I5akMTySClU9GhxYRiDRbtgUPpJ5bqQqmqANEEqMcmghNrn1Yuo1MHMqY7teBFfVopebc3qZITIQ7IqPrWkkP8GB+P6Ru6wRbqyb769BBDssidUN9ajzALbDvWyE9gFGk6kod3tXXzUT7hilqA04n2XtJoNMX1lmuyv5EkycCpuP5OoKEvW4cHS3xuwIiMJhflqvIxRL5+TMUDQheW8ljQxjRJozTGIuVLwpM2Z4CYqgNfnAIi18yyUTPDRJQY/gMkK/B5cnrgM4BR/xQgD1xibzObbh02N8QB40X8q7ZR3v05JmpW5CQY55j5jCIrjxJZJj9H1nA08iUCiqCaVCEWfr/3lkbt9qus0EFd82IpGvvQ/dG+68WMJ1Rzn7h/yahrR2EQnetfigItjgu8hqK0GCGc1BUbyVvg+Ayb89sDc3JgmvTFzbNKMq3pROQ3KKHFxg2nxEyiZiiDh7h2HacpD2zHTcnlnD51ssyfylFkdQn5JLvUfDnlDLN54C9Xi5Q9FSc2NpAGt2bAyoDtLB2quUUEAiRg1rlJHeQKx1X9SAJpu0XQxsDWkC9RURvoIbnUBwnirHyVMjBcJ6V2/XkN81+lwawarDGHLiP9wnZawvTIOze9kuApCSgjmyZw2H2uYReJtVePGjtvNfIgFcSMyu X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77c2010c-c8cc-4b1b-eeb5-08d92af83566 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:38.7363 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r2jyNtwCJJO5PYXCgN2qKpA6pce35dpemVFh/ENc3ODU/xD6IOB1DAhXi3Iug9TeCXy4yekb2EcC9Nem7Q0/WJ1IikK03PvkPpOk5Cgj+jE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: UbG9bzXxiXp1mFPiAFnp6U6wJf4rstkU X-Proofpoint-ORIG-GUID: UbG9bzXxiXp1mFPiAFnp6U6wJf4rstkU X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The function used to dump sectors containing protection information errors was useful during initial development over a decade ago. However, dump_sector() substantially slows down the system during testing due to writing an entire sector's worth of data to syslog on every error. We now log plenty of information about the nature of detected protection information errors throughout the stack. Dumping the entire contents of an offending sector is no longer needed. Signed-off-by: Martin K. Petersen Reviewed-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5b3a20a140f9..9033ab4911ba 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -3232,28 +3232,6 @@ static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) return 0; } -static void dump_sector(unsigned char *buf, int len) -{ - int i, j, n; - - pr_err(">>> Sector Dump <<<\n"); - for (i = 0 ; i < len ; i += 16) { - char b[128]; - - for (j = 0, n = 0; j < 16; j++) { - unsigned char c = buf[i+j]; - - if (c >= 0x20 && c < 0x7e) - n += scnprintf(b + n, sizeof(b) - n, - " %c ", buf[i+j]); - else - n += scnprintf(b + n, sizeof(b) - n, - "%02x ", buf[i+j]); - } - pr_err("%04d: %s\n", i, b); - } -} - static int prot_verify_write(struct scsi_cmnd *SCpnt, sector_t start_sec, unsigned int sectors, u32 ei_lba) { @@ -3300,10 +3278,8 @@ static int prot_verify_write(struct scsi_cmnd *SCpnt, sector_t start_sec, daddr = diter.addr + dpage_offset; ret = dif_verify(sdt, daddr, sector, ei_lba); - if (ret) { - dump_sector(daddr, sdebug_sector_size); + if (ret) goto out; - } sector++; ei_lba++; From patchwork Wed Jun 9 03:39:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86FF5C48BE0 for ; Wed, 9 Jun 2021 03:39:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DFA3611BF for ; Wed, 9 Jun 2021 03:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236565AbhFIDlm (ORCPT ); Tue, 8 Jun 2021 23:41:42 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35382 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236534AbhFIDlh (ORCPT ); Tue, 8 Jun 2021 23:41:37 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592frM9041511 for ; Wed, 9 Jun 2021 03:39:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=aSxqkFVUlBfmruBg3qE5hSrM7TsfEfakYCFOqR9F0d0=; b=IfFBBODPKX/FeEaqW0XhPMvhRS9BB5XnpWupE+molPN3FcmJKdh6kN3lpuf0GqaYiZa6 53Ke/VxZRa9SG+OVIM8bTO/9Hu1Xji6Q0VZtDvM4AwB6RNi/DpeKCtgq8Z+DEozq4q90 u9RDAs4owhtow4z8btgsDAdVI78lSFjNCuG9gxvQ2YAFI464JWmSOBx8qkEZMdAvJ78o LP3TGW9Nx2uq1ef6aUbYYjTGL1M+aD+kjEmhlAyUA03Y1O6DYzvvxOIe12Kcp526chX3 7oBmxQYn7cVLyPxLUIT+fFTt7QQgLryxC1k1eUcUo8ymx56GKib/wD/R7MX7tEk6rwaC 6g== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 3900ps7rnw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:41 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z3rj082718 for ; Wed, 9 Jun 2021 03:39:41 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr1d-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2rVpGqDvnGxZ/tRvlsKNdGVIsiwQYXYf/dG1HO1MbCm5LhgYnBFwEZcGzGy3H7AktkaWySUm4BXeMlRJHFMeDYZ7VYv6k3Z2WjlXZh6zKrGMYm6ey68bBf3k36wJTFxvJdpWzOciUv8N0CMj/EOfJz9QE4FTpOxid2WwgYJ+vjEav+NpDvojAKZi4tdQ4S9o2Rm0PmtxWxNxySAhnII3+LbLlGf/8DvOzKBnNO9vGkM25Tj03qIL0ILoCjazdUkVD+yupQLwGt//2GqBcMtBji8cxWkarfcqL1tC3dWW2P1wyRU9rOQ/B4Dh6hYYLQL+bZ+scKggwmnugnXll1y9g== 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-SenderADCheck; bh=aSxqkFVUlBfmruBg3qE5hSrM7TsfEfakYCFOqR9F0d0=; b=BQ6am9/Nlgwjy6r+XysUqxiKZzSYIwJa6DqO+TbUbrRW+gvCmnwKtGhK4AIqFMwQ/BmCLeFBWzFgadbPkou7iTBfaRuAMC7Y9a9ssT2P2Cj9ZaiLRqHDtOBaRkghntTx+rZ0x29D4VP2sIEYUQB/xR5Ym2hiYrubzrpB5URATW7J39jvNok5rdH5Z2RE63jyQaS4MJGbuRLCcfmDqGfg2aXhfR7Llg4BlYJysLgtFYdWbE8Rvb+D5oiJEM+HcJ09OBY20zaYBhNYojkgDsRO762Uaz4nx79UUSm+LJfUXEkL2XuIuuwAXjeZ6ch+1zuTkW0xm9FO1wGjCZnKEHuMng== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aSxqkFVUlBfmruBg3qE5hSrM7TsfEfakYCFOqR9F0d0=; b=WoZ4tYoarpN6Lsh5kbZY/zyQYMvTCn3fLQ2A+6TJX5PRalVTbwvCtTNB3c7tREJ89lyYuwr8sCqh2Vas7e8l9Iss56McsqKIRQCXLZdSDX4E8xINb5DYfH0Di6BywFkmD/EawAz15K1Kggr7IM43jnPZVyGdmTc2oeyevWpIrYE= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:39 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:39 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 09/15] scsi: scsi_debug: Improve RDPROTECT/WRPROTECT handling Date: Tue, 8 Jun 2021 23:39:23 -0400 Message-Id: <20210609033929.3815-10-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 683e08b5-27e4-4741-ae0b-08d92af835c9 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NeiDxUh2rKeB60jWAOIGwoobkshjYJpR2aiOPX2knNhNxr5FK3n4QtDkr5SSrkgmIZJnK5e4TL3vwLMDfsNo9wEv6+CrNeOxLBs/f4XnqKAxoWiQeQQTwBXOL78ZKcZpG3DdAs5pVNhHCFk0q/k9jcCZ/xS3HsvgvIO1lJLJx9VRGZPrNsaJjcXRMpO6C2fWPRH1WvhbBJIkUjWdvr/Ne/ZFeg7NfGjWF4ICCbjroo2VyxkTRNuFDwaO2lSbrWRWB+f7d/vb3cq7OPsCgBlARYjePyyby3AgGtiBfm7Me8FZeSbhb7hD6NOTw5pO5YUxJ81r3aPMCuvQ+aeQti46S60RtR88LLY8hYl+K8PWgnN347sGV4zrrwNfDyWjkokEHcgon2uWAIpx07XFrZsOLTbZOW53YF62tPLJDnGWMKJ/sD/0lYtWnmFVtNJFGavXUUu93iO7XXIZfWwEJJAvIfypWOXBnK7Bcf9bLRiYMrjwapOoPS7NHALmGOdWjLkxaIL8BlcWfS5laLxmF51NL7KkAtGOXIFul8IVq+HSDmd7KLxcurplBcWqPsWJJE8bfnBXSn6tCM654VP9YTpSWzlpFWXj5AUNa84QTt3ioIsIw29bZiaH7YCS6Rn6j97Cnk1UEbb1UP/xcxiujqu98Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8M3N9snkU7fEle4TSBXBA9Rz8j4967hAB/5lCKuW+xj3307nHK0pWNraY1NFdM01zt+1I0oO4VXvUa8zTyRObMEvJnttzooWN6vfoRqgMz80gUDYcvxiDBuIMzjf/hHEMVjjX+4xK2RmchsZi2BX1lLMpmM9SDdcW/QCy3WzO24fb3oTovAfjRqXPTDg2jc/f6hfF3k0lxMX8FHZPt3yaH7q8zrNPN2yncCXXS+xyIPIo0mBWAXsasR8njUa/rr5YqwnXny8et3NVVwONMWszQmHeP3zeoBT5QYm8c+ftY8qR6HaTVaCXX8ituUktJWt6tCJ/UbG47PpVQy/33askl+lmxppkY7+20N5wK4IrUJBtHudU5fJAdjqtoPKb19Alye72PxwXpsKiopGrsB4sZfIfH/q6mhNmJM4ULY/VOSvLuZR6dw8MtPQIv3nyGkYkkrc9JUUaSaGANquLKJCPIIU8h2RvSm+oEOZ1/ygMm30YzbZsIgONC7NYA3R9tvFTaCWe0vGnBux9PMgs1bNAlMO6WpBmUoiGOltUdIQi/TvaKijR2EJKuAHmEsYGvFsyfjK/vT2AH3vM62TgSb10AAtNnnY/0CM9kHIHxaEUra+EzaZ8brQiJ9ERvZdZWM+EvImI2CkAG89T/rJeshKVZzrNQcgSmTwreyOvpsSu99x7T569oBZNfzyQ++qEusjbzH+FGEyegrMdF/Xg9LobHDQ+Ma/H2qU1m5SScFNhcnbYSfURpBuQ1GClRl3xgU4lrt3cZTDBl0lCQY2FGjc02d2EZDHJv6JHj8bPC7rXLGFfHti1O2OH6uewBjA0oWzgk5L49nXiySoMueahwhwezqtku9hZrkfLm96szr01GgiuPYVOdv6kfcY9FgoY9c53VCbdnRP9ops6yGVgJkSePUytzBGb1TWPR78AoH3gG9zMi798eHkS3h/N694X2afAfJInVBVD1boL995r9kjgL3IBFa0wcUI+piMmu6ga5QAEv+Ly5B+CjMmxzdFQdiQL+w+9SrALlAzo8iMCnYnOZu9p0Q8HKKpF8TzgKPJL7wwFKuUbHQ6xUD9WdgBUTG3YeGswtd7xQhL7s2JXvHFrDZgyW7o/5T99/noHwl+rkkhH9YFpk4uT3fgSWL/83nIlQW/WxOX6eJLFdSVgc7Mr/fnibtLERq4SujJtjYF6yULEZRPI1Y6baM6YmpOs/zAa9B4sh7/XXELMlHlZ3yy/Z4K0DlM1KJFVeqIHdR3QaUnHKNgK6rxUc8pY4WuORSXyLRPjK0wONyVFaXXKb7vBJYkXM9+4Cre77vHTB8KFVwXLYBhYneaxAPU/vgHhxgW X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 683e08b5-27e4-4741-ae0b-08d92af835c9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:39.4143 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3WCNqzV+5t7Ur7xIu6P/Mk5/c0h41omSA3nNyjO1xw5xRE04AoNCy+StKuZWBG1GxDZE5yHv5MgV+iZJGLg7CMkrRDZe5EXSpxXQ5ELyXT0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: rphZFAbkdgxSUqfvLabCHsTSwrtZSYKI X-Proofpoint-ORIG-GUID: rphZFAbkdgxSUqfvLabCHsTSwrtZSYKI X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org It is useful for testing purposes to be able to inject errors by writing bad protection information to media with checking disabled and then attempting to read it back. Extend scsi_debug's PI verification logic to give the driver feature parity with commercially available drives. Almost all devices with PI capability support RDPROTECT and WRPROTECT values of 0, 1, and 3. Signed-off-by: Martin K. Petersen Reviewed-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 90 +++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 9033ab4911ba..25112b15ab14 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -3076,6 +3076,7 @@ static void dif_copy_prot(struct scsi_cmnd *scp, sector_t sector, static int prot_verify_read(struct scsi_cmnd *scp, sector_t start_sec, unsigned int sectors, u32 ei_lba) { + int ret = 0; unsigned int i; sector_t sector; struct sdeb_store_info *sip = devip2sip((struct sdebug_dev_info *) @@ -3083,26 +3084,33 @@ static int prot_verify_read(struct scsi_cmnd *scp, sector_t start_sec, struct t10_pi_tuple *sdt; for (i = 0; i < sectors; i++, ei_lba++) { - int ret; - sector = start_sec + i; sdt = dif_store(sip, sector); if (sdt->app_tag == cpu_to_be16(0xffff)) continue; - ret = dif_verify(sdt, lba2fake_store(sip, sector), sector, - ei_lba); - if (ret) { - dif_errors++; - return ret; + /* + * Because scsi_debug acts as both initiator and + * target we proceed to verify the PI even if + * RDPROTECT=3. This is done so the "initiator" knows + * which type of error to return. Otherwise we would + * have to iterate over the PI twice. + */ + if (scp->cmnd[1] >> 5) { /* RDPROTECT */ + ret = dif_verify(sdt, lba2fake_store(sip, sector), + sector, ei_lba); + if (ret) { + dif_errors++; + break; + } } } dif_copy_prot(scp, start_sec, sectors, true); dix_reads++; - return 0; + return ret; } static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) @@ -3196,12 +3204,29 @@ static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) /* DIX + T10 DIF */ if (unlikely(sdebug_dix && scsi_prot_sg_count(scp))) { - int prot_ret = prot_verify_read(scp, lba, num, ei_lba); - - if (prot_ret) { - read_unlock(macc_lckp); - mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, prot_ret); - return illegal_condition_result; + switch (prot_verify_read(scp, lba, num, ei_lba)) { + case 1: /* Guard tag error */ + if (cmd[1] >> 5 != 3) { /* RDPROTECT != 3 */ + read_unlock(macc_lckp); + mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 1); + return check_condition_result; + } else if (scp->prot_flags & SCSI_PROT_GUARD_CHECK) { + read_unlock(macc_lckp); + mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 1); + return illegal_condition_result; + } + break; + case 3: /* Reference tag error */ + if (cmd[1] >> 5 != 3) { /* RDPROTECT != 3 */ + read_unlock(macc_lckp); + mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 3); + return check_condition_result; + } else if (scp->prot_flags & SCSI_PROT_REF_CHECK) { + read_unlock(macc_lckp); + mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 3); + return illegal_condition_result; + } + break; } } @@ -3277,9 +3302,11 @@ static int prot_verify_write(struct scsi_cmnd *SCpnt, sector_t start_sec, sdt = piter.addr + ppage_offset; daddr = diter.addr + dpage_offset; - ret = dif_verify(sdt, daddr, sector, ei_lba); - if (ret) - goto out; + if (SCpnt->cmnd[1] >> 5 != 3) { /* WRPROTECT */ + ret = dif_verify(sdt, daddr, sector, ei_lba); + if (ret) + goto out; + } sector++; ei_lba++; @@ -3456,12 +3483,29 @@ static int resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) /* DIX + T10 DIF */ if (unlikely(sdebug_dix && scsi_prot_sg_count(scp))) { - int prot_ret = prot_verify_write(scp, lba, num, ei_lba); - - if (prot_ret) { - write_unlock(macc_lckp); - mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, prot_ret); - return illegal_condition_result; + switch (prot_verify_write(scp, lba, num, ei_lba)) { + case 1: /* Guard tag error */ + if (scp->prot_flags & SCSI_PROT_GUARD_CHECK) { + write_unlock(macc_lckp); + mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 1); + return illegal_condition_result; + } else if (scp->cmnd[1] >> 5 != 3) { /* WRPROTECT != 3 */ + write_unlock(macc_lckp); + mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 1); + return check_condition_result; + } + break; + case 3: /* Reference tag error */ + if (scp->prot_flags & SCSI_PROT_REF_CHECK) { + write_unlock(macc_lckp); + mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 3); + return illegal_condition_result; + } else if (scp->cmnd[1] >> 5 != 3) { /* WRPROTECT != 3 */ + write_unlock(macc_lckp); + mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 3); + return check_condition_result; + } + break; } } From patchwork Wed Jun 9 03:39:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A265C49361 for ; Wed, 9 Jun 2021 03:40:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD42E61263 for ; Wed, 9 Jun 2021 03:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236495AbhFIDly (ORCPT ); Tue, 8 Jun 2021 23:41:54 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:50444 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236570AbhFIDlv (ORCPT ); Tue, 8 Jun 2021 23:41:51 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592guuK180215; Wed, 9 Jun 2021 03:39:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=VICH3jqi8miJ598stLmYeJYUFUMz/3w5XWgr1BnarmY=; b=q5oDpFu2i47ncuLyQ6WcXemMhwPfFpw3lpPe9BZxQfKZBGwWAHG/gI4HgNW+lk8bW+iq A3XCjs5ycdvcRcPVxaM8UAI4lQ8qDE7IXg0hCMkPdm8ZnIjhRwXlF3VazsTzVB6g/85u HRDkOX8W5Ou86YACDWP2jw/QqRIp47s1LYGbL9zzbXiwZoB3CO8t0Y6w4yF6v4k5z8no NnKH/QJJaN6SpkjF/qWPX6E2XLMq4VkmbeZF5BrcQzQ0vp1NCaSJOY/auwvU30Ga4FVw TJnC9/eWqvKDXEiRBECw1uYIDUaqmUuE6lDDXVp431GckPYiKLq6HEPlNuCTiJ1TNDhV mg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 38yxscfte0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Jun 2021 03:39:43 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z2Pp082696; Wed, 9 Jun 2021 03:39:43 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr2k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Jun 2021 03:39:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ElgIKqJeY7IyksyIHBM60LuGZL4dizItDsC7rFsyLQqKE1CMffD+FdROoxOSvYg4zeWg4QQl9Qb4JxSo1Iiq7FououTPkiKHJL627CiJFw0Hsd0WO8u7IC2RHe0xPfLpO+f4zEKBnx1x8sI80oQ8+YTusL5opLFY95OO+AKeC5fxrGBblQTRvWBHtReIdtbF0Zq4Z0hGVKx40YzGmbJoT/9WMbzf9NyAqUDsMCat9jKDXex4HbUNBv6/avooZYDBCMeGPBCondMAFWmBsgBfDXcYaJliJvVBA0lfIU9B0rHULI0748iJclYy7/x71ak/8AX+a2iHs2p/SUvt5z603g== 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-SenderADCheck; bh=VICH3jqi8miJ598stLmYeJYUFUMz/3w5XWgr1BnarmY=; b=bxiowBwx7Yppo4VKNcOpsshifFKBD9uL+gvI4JZAt7p/0wGSDFiLjvUu2WN4+YrkaxXqmV6naOyUB1VeBVrEyQwa00DO3onkWVE/ae9Ff1sawa/YPkIFDiiMBOv2BU6ZhFJB84car/ATchqiCic8Z+0fnDbGf53p3xFoicoLJRU42EW9zU+VDNCoWp4MidBDjIBdbiZJcTN4qFtR2Q2e+azpOtc2RtJJy6lWZTGACieQIi9c8C+AC3r4lh4qZBUo7PEWzDuionPsnZjloubecWeBqJoKjJxnCvYFEuDwxNQoGFi1XsRQ4EJz6ecVjzNLSsjdIm7C7eosFVam7i6Rrg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VICH3jqi8miJ598stLmYeJYUFUMz/3w5XWgr1BnarmY=; b=eLetUYDZIDMMC8GsN4GqgLwUIihgWjb5W4Vvzy4oc15bHhKVAgNG/+Ls6xPh6nytQWS1EE+0xiakaSFGFzre0Xadcfk+TccqPGAqHmEctSJA6mtRUzuOw4jiAKhphOCC3wadzqhQcmXYTUDo8It5Fea1cpUSyOhispf1bTjq2r0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:40 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:40 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: Bart Van Assche , Christoph Hellwig , Ming Lei , Hannes Reinecke , Damien Le Moal , "Martin K . Petersen" Subject: [PATCH 10/15] scsi: core: Introduce scsi_get_sector() Date: Tue, 8 Jun 2021 23:39:24 -0400 Message-Id: <20210609033929.3815-11-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34d615b4-31b2-4b3b-2c48-08d92af83683 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MJnKz9tUCaRrX4SdbSqosEp6MNuQ0mMDlUPkvXa+T5IO1qlOT5QrrL5L48OJayo0CJFr800K+qUNjU5NPmXavTJZxzKRFwTyZT4sq4p9C1C0RlRdbHZEZnCf5N5gpVykAXHHWZy6PBfMCKNArTJ1uX1MWrEcp6O9+8+v1CSuEbXGarigRzoTSpNgSgK8XYpJfvUkY3UPazGmK2C2TUwqxSvrOEucqUGqsYv7EGjvq8w4R+guZROYRpY1oy+OkkMlG35mFwZbkhOtuFGCovq3uw8dCbozUoFri4/zjOhCiBYmsXSfjudpdKia88Nh2Pq/yr/z4P6mqqWRZkcmF+y+SqenvnlSUUpE4TI7LsNgznV1y3ZSs4B5q74EUywxUZWQ5/rA0o4jHNLbqRwV2ySCqlIy2ZVUPZXtS//BWEuLXggs/44hmHf+sj/C47B4kPpoMEB89d4NOu+maNvls5A6usRYl8jA4wql0S7B2mQwnPQwDmJ2Xmtv8dXO5+iWKtOZZ0YTTv2RaFMcVzJR9dhjRJxHRblS5WODQgoSk5mUiBZGie6mMUJON5scj3OmkbsD528fJywJ9DfvJxFh0s1u7sjY0RRI3fhSlsG6MScPnXrRZQra32/f8KIngTOHvz5XIowcwda5dRpIk+iq715ThoXMXka8fhxUVfhOSSV5wR2DeoylubgKkS3+QY0UFGKqN15ReMefJ/8Mhnjh/KTquG26VQYGL/RqpCfIYN9ge4WtAraQAFHcgNArmofs9b79wRcYNI/OO7p9KWvU4rwLNA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(966005)(54906003)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DCN1tiK39kYhEWzeu9YVBvPjUS5Jo5oslNDMRONDD3Q6l0R0nuHlGXrjybafoGq2BDjn7BcTkTyMGbI0Sy9G4jSqziChYz1bhlpfzeT1EIdeVillAJOGmb7Kk/WarObFBDss0AyA3h+ockDbHU/MnkwNeIiPN9onD1ILhv59U2/T+BjUJvNmd/dIgr0WCp96pw/Sx/KHWhBR/SpnL9CR3Z00zPKgqxvWqLg95GyKBVze2GEvXpCOuo424s+mO3N471h573dnSly1I4OFmrL7w1J2qydlyqndWb3bpdQv0cbEHTHzTgBcL/SyZAOHPlomX3FLzTty5R1164uMzIWEpciwXhBCe+mYZN+6CACjNfIZ4Sc7ZUCgcuUDCha2coppT4uZio1ceJWD5NPMZj0bOtIR2KA2gjB6UDkXOt2yf5IPl4OG1JqxBiKescORcWzTfQvbSswY4j5aAWKXcf2JRT6yliNJkQS1rzJUDIw9wztp6+mUxW6IxFPpSHhMfPkULElSw+rhRm3PTWvvkforiiLWMO7uA4G2fXRF/7Zp86GmuqMiPz5yI+rBOi329YpO8GiYfJA2KDhY7pZqVHgRhfAGcrw5uK79Bkh9+0PM5ewc3/Q+lYWrzzyL3xJKe4cCCNiKhwNgbnxrZ2DVkUj8zzGb6qFicScFwIVJqa8LVdpdR9b0FgxQIQPRL4N7bt7ncJegEspl8rZEE89YdXd5MNgtbH0zailauYU+oMUy6A8ulN9nlcqm/N6TYwCFx4QEiCf2RBbNN80QsFKWE29spRu1HI9Bkyy9sn1nmm91bEJNj8/lMhFIiUwj4ED9sxXBK6TqwJ10b/99t9Ifl4NFRPGijf+KtMEBv9uJ5coCDaIJZubp7QvhAy0aYhiLneWrDNKt/BeRuVGeMPuhAbU0ocjUNRVGcz7MsEdm59gfVfVO8xCuf89qHjmRPe/AUsXGOVqowAMtvfwQRH7ySKcCFHdNsYjfsTc2o2zo1W6GFXM5uq5oSCxBd1+y3mXD9vsVQJ0Cs3D+kYclzLw0GH0wDBpEsCUuyN2I+MMVq2z1wwormziIz4uTa22BjwDP9G+oB+Xip94HlQrPmxXW+5kOPlkUsMVm9fKkhAOZnKFkZ9jCtA/RUG+RM9tVfnjvDjlZCUHGpv/iR7WzXB3dQSZ+5iSNLY2e0aiZEvkWhey+uQQ8TRELpZuO0E3EKMBqam+M8jUIaXUQYPn6LR44XqSSbRhW3KbcA9X948aG19ItwQNoGnDR2A5DgVZYLoQf9laYInNQVjzGsummzXOzH0Jt47NjX2BPRE/xa/x7hL35g72iICd2vq2EJO5EEnKD2nSn X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34d615b4-31b2-4b3b-2c48-08d92af83683 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:40.8131 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 65BpcHtHACaDnEdDtHukJRYrrASwJ0SfXi4T9cHD8QGGtqcp4LOPDjfRm3hFBflIhnbDrhhU/jhnY9lrYYqM4BGorCERcjCBN25GYriyOVQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-ORIG-GUID: ZpCQfuz3r1vWcXVV6a0EcDFzYSIol2LM X-Proofpoint-GUID: ZpCQfuz3r1vWcXVV6a0EcDFzYSIol2LM X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bart Van Assche Since scsi_get_lba() returns a sector_t value instead of the LBA, the name of that function is confusing. Introduce an identical function scsi_get_sector(). Link: https://lore.kernel.org/r/20210513223757.3938-2-bvanassche@acm.org Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Reviewed-by: Benjamin Block --- include/scsi/scsi_cmnd.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 301b9cd4ddd0..cba63377d46a 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -220,6 +220,11 @@ static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd, buf, buflen); } +static inline sector_t scsi_get_sector(struct scsi_cmnd *scmd) +{ + return blk_rq_pos(scmd->request); +} + /* * The operations below are hints that tell the controller driver how * to handle I/Os with DIF or similar types of protection information. From patchwork Wed Jun 9 03:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54054C49360 for ; Wed, 9 Jun 2021 03:39:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E9ED60FEA for ; Wed, 9 Jun 2021 03:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236572AbhFIDlw (ORCPT ); Tue, 8 Jun 2021 23:41:52 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44786 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236574AbhFIDlq (ORCPT ); Tue, 8 Jun 2021 23:41:46 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592fjuw083382; Wed, 9 Jun 2021 03:39:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=EkGuDT9l75zkd89BCGj0nOxef1hAxJGQj6gBvkc+MDE=; b=LfujkX0jXr7/CV5XuZsXrreQO1HLN3IrvaxtHwF1b1AORMUsEqchkAz3zCjrURp8Ivzh DMrwthTTku8a1hg+kAvASoPkMwjYtUB9sZy5GrYWD1YcPrK3XPpH4BU/5TMAk4p+TeHB Gq5aURRBedjhfrYnKGMaAXaCIkckjWKwcM6MQ+b3H7fXI4gosRwgASEMXi7EiPgwMJpg Zn/VH5dbGkighpFTYaCbzGs3EPxPuk4kS8Hq9mPzlE/0lUEVabGzms49eyJtQ1kWHbIz YEuIzx9iqVdNXyyturRovmrQTWAg8Q7bIhd1q4VGb7kxUHuHXv82vgFNupjb7XHCoxC3 MQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfrdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Jun 2021 03:39:44 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z2Pq082696; Wed, 9 Jun 2021 03:39:43 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr2k-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Jun 2021 03:39:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i7kf/RgO2PqXJq9d7g3lGe9EOAZH2e36u3L+VyctqbiRdPBpCc6MKrhje44BmAqqJRlZ7VRTReiZiipIHzaFC2kuzIeeRGvsBhhgYP+sy+VzSJzuz0P0MJREjNdGnk7YOSgoygrlCZl6iIAE4OaQU2pH9CxRYBnjBOF72yvzXANKEBb7TU+tQO1bZimtPn7Hj5zg3StB051VN1f00NPe/dgwtXPLyS/tFBx2Tv6QkiVudK+F5+18r5cpKj1KRnDvRaxPjfZgF6Cn8fLwbhzLF2TbXmEkLLLbHLCo/gnlMb4QHqMPPaXO2YbDPtszvbFb5O5XjSP/9K6C0OqLOVC+fw== 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-SenderADCheck; bh=EkGuDT9l75zkd89BCGj0nOxef1hAxJGQj6gBvkc+MDE=; b=GJbEMTmtAiR4vCup2YU7++O2s/P6fbUlPb48io4WHBOq1UXBzbq0QqexfeYgOcZPG+e8x0YcyBvXZu+bx80v0LuaydZI5JpNW6kiuW/z2137NbuZyIf8AwrI7xmPKbTW0o/N3/PI/Vr8ZZgfpvXQWoZdMx6ZekBiwTfjupMDyxshcjzU0ChalIXoFGY5K18EPVD2u8kwW0n+qswexZktizXZbzNmSTyYR7SykJuakc1OuF+UTEmOdJtiBs9m3+pEjPBUIzz7cdWBtOAzWAeWnipGw2Yw8FJUk7KRLmqrzG+S05VQ9ZPrb2Fp+dQvXVqas5siBvpnvDHYuagZV8m9rA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EkGuDT9l75zkd89BCGj0nOxef1hAxJGQj6gBvkc+MDE=; b=D+swOHRGFRTIcWN1+SE7RTLsaInMrQfG8sZrKAJjlofQ2kIzNBdaaLpK+ebBa09RGoX69PNVjL/oc7gsVxQXe96OS/0ysd6BEbBnsoatoVMnTh5ptp5PkJYU17eE4uhZjaa666flyiaOtNeFmsMFuLcmNiAsembkNqeXDAYSGGc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:42 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:42 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: Bart Van Assche , Sagi Grimberg , Damien Le Moal , "Martin K . Petersen" Subject: [PATCH 11/15] scsi: iser: Use scsi_get_sector() instead of scsi_get_lba() Date: Tue, 8 Jun 2021 23:39:25 -0400 Message-Id: <20210609033929.3815-12-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15a544c4-db3f-4a8c-7647-08d92af8378f X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GB0SEmfJUKoheqsEN/GRWrFfwbz4mAR11WsCqxPT9plp21ZXTx8dtjJRbvMI9T5ZfWmws/LTomioGEaEqBjo0eWu3DgIG195k1WE3oM27dyp2LSJ/DSA4mN7xWU4rxeLxERdMLkWLsOkGuTuVsZcvACiZbEZLnK+zB7vpCMdZf4hgFBmIT++zz/J5BbG5uzvlEKljaLNs4YFmgYcW/7PqBpcMqlJaiXYWpxcDaMrxzFU1Z+nKd1K+0gWD2d0I3TjLtRYjD7dFYC30yjxnvjaAHywBS9arUglZU8+MMito/EAbryZlriVcPJPWZJHVyuWk/PwfvjpNg7doJEbbZK9r2kPGPQtf9hXPxwiJVR6Xn0Vt3wnPUerqmp8WcblQl2+CZOcZH+K51V156Q3Pc64VDav320VtuNUFAyiVvm+AoMDB26x+lENAyb15sSLB4tPAFCt2cbj3KbtXiTJ95XNi9fgVlJ7p5atqoiJdzGV8XIrdY8AMrEFq1eCxxVPRzd0lVM7OiNK5QlbpojBBchFwxmvpHullX2mRzhpCrnnJVTOvtvR+TMcIOMzR4hV70YrAUUGbWj3EM2+f9mhvY9V7b80wAfDx6oAvwthMQybZYRD4c8JmvVfou2UShB6naJ/tnqRMeIs0vYKuIsxR1YsvDtHzNHfUVsj166BT6vY7eqj4TtpLAHivoiq1Bp+vQYBorh0H5+QM3mfBFhmshDX/cHmOTW7DDGf22iIln3ERnBYJdMnaldR9lZ0ICDRr4APc/ZozjqZbkxtAt5UFvjBjA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(966005)(54906003)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fQXG46G6IGBEsoxfX/5tDY1c3zjvFDlm9jnEM59lfsElOxmbvJ4N4tMS8ntv3ZijykM7am3+JoV7gI0jD+SbPn6nTQ5XkCmak/tBasATtV6A2kOzWXcBIfrH3ebfIPuT4O55kkQsAx79h7aosVksqJHqgRlWDZY4dfkXLaejNrcNCLjiPJzAgTyH4eMtO87Wugmcfx5zFvfuUui+WIs8eqbl181vYF2Ztm66D9PIptsZYTnZ/eUztp879TRf++3iUbM7nG7OJ9n0fmQkdrrl9aPlpm/09Ia9dNJbb2FL5eh5mDd0FUjPKjB28Ouus2VBGFs5TljFxiKQzh3dJHwFBLJwWhaFuqtiB4HKgz9RiBiOuTXZ7e5sBeH69QzLQ7BSrdfZllbPJ78oin7tY9kX3vEktm3wraarbY704SKoz8lavwP3Upk6NrNvg0TIler3Fmccn2KRlbmeD4H+ONjQy3JK6eHKjtIMl3aF2ux/nwJUM1JUeDgQoC1544QiGtLNtmiD/pkk3onQ3xhWyaq7t929+Bth7caY4jfLXoJSWjjLqJrAcPTlwem+aPTNBxjbc4mArZGEAHhjP2wIf41N8HJDfh0fddATG5yLpMpKyaPkbR8OqTiRAz/4MiGhXbQ/StxCfvrCl3mDmlvVha0+4f9JeGAOn2VZJgT8dZO+yi4IWd7sThyjQtmbgvkhmH60TKxksAbrQuPFXEpP1CoR8JzdLT8xVKo0rs+fpCqQXJd8d0Fcp4O6pGR8KF56XNkmPkbh8uzEh8zmdT52ae/Loy6/r+FIFRFTv2KpRtLwp0iv67RQE1KXA383jgnv9pRLW49pXTLW2w++sHxASJiVLFlNOh+x7tYBhyGbOScm+zfOHx5733ZO8QhYza46zYHEyDMppGF4TnPWl51bofF9wOn8k3Q9PZ4f0KL/1JMAR29wETwjnvYCtaLLjbpwRJqFQOmaDTewmSOGFZJvRx8vAylT3Ch7cmAzEusFeZeg/UC68pirBvm4Ym3SmIG4ZYiLT7zOu+UqjAhyaooHkKWI1dRSv2xS+KCmZqoo+f2THihzApXUrmCPolpnFSKEMsZ1Rbw/C/DXXvGPJBv+UCuRMU5zRL1QMbaZZxUKDg5mbElWb/WYZ1CqVB3cqkiQmvs8GzEQ8nrT2qNcNTQ/arw9O2to2rw5BNREJaIMu6P4nER7rD72m43jcBI2oiKv+6muQaFuifBr1VwdbCH5fL5u1oTEf6SjeedLWxun/mn/ukM2p9TQN074sHUtwQ8VYvmg24Ci6zvhZcBt3OWCvFi0bdwlIdn7AnGOsBi3nW0r5FU3t3XMAo6l/nGmgVDoCszk X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15a544c4-db3f-4a8c-7647-08d92af8378f X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:42.3663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fR7z/vX9UC3U8JIJFMyX4ObU693cR5dFJkysMWv0btPXjypXF0V1hbXo3OHi7FeMX1hpxZFOKr1MTw+CHtH4/zpXI3m2XuGCq+mw4TspW44= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: geoNjraMaqjBm0cEB0KF6N_TnSc-L_go X-Proofpoint-ORIG-GUID: geoNjraMaqjBm0cEB0KF6N_TnSc-L_go X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bart Van Assche Use scsi_get_sector() instead of scsi_get_lba() since the name of the latter is confusing. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210513223757.3938-3-bvanassche@acm.org Reviewed-by: Sagi Grimberg Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- drivers/infiniband/ulp/iser/iser_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 136f6c4492e0..d6bbf1bf428c 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -949,7 +949,7 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, sector_t sector_off = mr_status.sig_err.sig_err_offset; sector_div(sector_off, sector_size + 8); - *sector = scsi_get_lba(iser_task->sc) + sector_off; + *sector = scsi_get_sector(iser_task->sc) + sector_off; iser_err("PI error found type %d at sector %llx " "expected %x vs actual %x\n", From patchwork Wed Jun 9 03:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B176C48BE6 for ; Wed, 9 Jun 2021 03:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52DD4611BF for ; Wed, 9 Jun 2021 03:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236554AbhFIDlr (ORCPT ); Tue, 8 Jun 2021 23:41:47 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44740 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236552AbhFIDlj (ORCPT ); Tue, 8 Jun 2021 23:41:39 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1592gxEi084157 for ; Wed, 9 Jun 2021 03:39:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=+kQyJ6w0S37LEA/5nrmj/v6ACmMO3nxPu2b2CgWMunQ=; b=c3l/1NqX6H5Y45Sc0o7sT7ui9EksBO0klc7ULkOMikYCPx3B7KO2icXz6acvKWkmgVSf p8XEpBIB1KB6MVawhpY4LBT3FlcOAdmtgqiI/SqInGREqY3mVJNin7exNnXnI0/s6/OQ LRPo77n4TUAumRNw2/FFVStP2/W7UFU3LajcKTxtW26ogOqa8bPNYJm9QDMqWHMicn4Q pYC2WVSrQpYWdUrn1wDfHZn/CioI8kZlKqz9uRXGUnxDVYyjXGtPKzZJcwOVhDNTFyDF UyDdHSy+G/dIfWikqCTt2kfSitTa6OkH3mLGVerkl8NHh3k27pFYHNa91PfD4T7drYGM Vg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfrdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:45 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z2Pr082696 for ; Wed, 9 Jun 2021 03:39:44 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr2k-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EX6LSg/zUZUHTItQtG/CYtj8PZmJS3gO14n2bXipCB5SVLuoHLWJF4C+INceWkT7Qtlm/QVlN/gl9IIFWaNIFeSbsrvM551Eij/mMNKCooV/Xlumohwe0U0uNrmYGdBs/nMBOcCedq7JO6IxkNiq+6Pcj2jQ+iasmoO1G2kiOLXXJfP65EI300K0LCDHzkxyKeD/UODiDFNeoKds2OFTfgQ7DoriapGhX44rNWz8CaiArW1N56aQRwtJLE3AaeWCT6TXpIqjT1MA4xnwpX3PIsDH6cJhTFDbodPEiwUxCuivYisd/SiNZHZImv1+V/jyIRgZld5qSOyBSM5Ixto8Zg== 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-SenderADCheck; bh=+kQyJ6w0S37LEA/5nrmj/v6ACmMO3nxPu2b2CgWMunQ=; b=j0D7Z1lRhNUHUGmLk9kc4rNix1vv2Q40W0Qz6LvxyzqSW3qz8aBCktIhRnnK8ax9YD27KRdit6wNqbhl2H31LtC2woBL0OzLQb4HskuBbysJzAK1uB4eB2KKy499HJMaOVFCpH53fMjAIgxnQEEGHmvS98Ad65Ewm1QOs8g7uLT0FCzVE569F2hEPK5pMLLk0NsMRGbl0Hw3TSNlwCkrwld5zp6NMTaJnNK+w9Jy6qPsBJVCxXOZubF4qOqHujAq2tq/Jkpeau2gwquF7HWvP4D/yKQmJahgO9svlhPZfQvNWDjvlO5JG0OtqXMb9+5H5r2ShSAWaaza8+U3dExvVQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+kQyJ6w0S37LEA/5nrmj/v6ACmMO3nxPu2b2CgWMunQ=; b=G7HD2xtbLB5+jfr0beeMS5vuve971kor8Or9v9I56hqNtrgcp/wEgKebzY1Leee6L0bqs+LLual+2RoJPObbLjPy6dv7EjZm34HEz2LBG2GiGPemgR3UI0IIDRg4u1gVaA2rgX7wITgFuaYBjAprwSemzQKYnuNi4Bwpi9r6Vkc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:43 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:43 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 12/15] scsi: core: Make scsi_get_lba() return the LBA Date: Tue, 8 Jun 2021 23:39:26 -0400 Message-Id: <20210609033929.3815-13-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 097dd27d-3ab3-4727-9ad7-08d92af83809 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6BUWcesAWjZFKXwYtLh48RMK+HZQEVZZ4S4upCYhr7lNPEUdAtNCLy2vDYloywQ+es5vFenPCkdz7qwU2Nb0OsZeJ7ZksBhkOyZb9AAkCXnpQZu3W6ojWuUohHzG6grRcTjfCNpIGWxrtdO7pYAEuAc8tnBYYUH9fEE5ekoQ4YGrcHqVroc8lBPpAqHpndFbMCk79qUflGRXJHta0PmOskxuZiUOL8q8mXO8X5hTMffSZ6V5N6wtUqHIrHGdlKH43hbEpe7LNeFKPvxLqz0A2cESeaB13Ric7a/ACZ1j72D+EiUwETxTBHHsjyQcyuvkPZyuzBQmQdzT3rsCGFO0ud7bdAunbA1pV3asTWogGROHphPxnWGanssZB3J+2u1i451DUEUyQrKn6zMEK28oJqfjEBvSmK+zs3XjsjuH7k6JXN6CjO1xneK0k5PB1OHOnUo7okjCU1Xzpe7GwCB0N/9+JQZwNZGzSeuR/lEMM6U2+2ldUNQSht2LSHws8bgwk69bD0MaNlz5oOwTayDCLHBzpWNy8oVZVW8MyUOrJSZyqhcL0C/7QK0+cA1xKHmH25LqTdCW3jnt9c/rbZFX6RGF64wLpZ9MBIQH9oteFypz9QfJKu4wR7lhhkL8AKWJE4s47iLwY2sG1Of/jbSSBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YlFW0dA5oSxws29LfKwDdbwv+abuqZ4ctLgWzXHYzub4Uv7d2d13nyVbyaZ2u788tyy9wh0dWLwBnfQ8Q96trI/P7sN72xUtySA0x9tkeA8fWrtng9thVbeaqlPOEU6L0Tiu1OWaqR3BJiSGEmqhjFdVWpVvbsoOgKg82pEETBUsf08ZcUdk46O8/U7n1YB6RctUaTjMswrvvQYApMW/r/tHFpCZhAA81jNBT4pzVstWx982CyNw9FPYDVBK6mfMhb3rCm5EM6u47B/Jeri/ngaaT/LTImKRPY1MgF97w3un+buGR45dbiiKWgBadG2Gfm90W7gJcIq8eOfZD3eglBL5de1M/Yrj6kdPQZFyAyGcCWuCuiqAiCiKnkbhnDRLJVjjmu/csqG9FY+Hpb9mdOnjHKJRKntqxmteqm1nyYr8sQnB4jbTmBQuPLlARGGdAY/rIJorGhy/D5tac+enkZv2S1GXYFwQASeeZb73Zq6TgcFW1dXZDNFmI6ys/rZlr23lj2+3PvzoKNNTtIYNbc3Y7AABD/jTONSK3s5UJImpxj1hdgfseiWUsz8325PEVETgNjgWaQ9G0iLdtd1bZYTrxrRHteG9vJX/xjku5GSyXiQHUJwbnjtDsCOVGL/G6pQq2p/kayC70sK73y7r9DgfadrCcVq3OzJTBVnf2JCY3HUuSkon9h9UTHqVfbqlQEvwOYR81QaBilBcEA2mg7rU9eOq6YifRjgf3ZZ/7eTF84t2Vnn/G5oA0ir9p5AizgdUkBQDFtWYOKofGuIwjRQbfKmDMVbLd25sL9GFj0S0mn+b3wuAMiFasbtnV7Eb4OXWM5MysuVvkB7vgsyA/v+N/OEBIGHJYXT32hXcz7jt41EQgkC9230FaYFy4L9+e7AL235hMjWW5s6RgANYcyj0jqvp1nyJtANKsBK1Vec+R4lVu9ltvZCOIYaCi07vrTjK1VkLW2jRn698K/Gw+LY9MyZGF3hBUg+Cc0y7JU0NEvu4naZh3lxTAbMKKuEEV5yCYnhlVHVTG399u8PvZNrOWpq1Vs/j0X+HfHuCnJDHUSGVkCpHtnlSe/5b7Vd9k2CiISkq206dY+Gbb/exKKkRAJBRUeSfsB39xW+OUNGiq8xq7UnyhgfkJp2h2MOxiZ9p37M+1j9rww67jIHwRkFFfrISZmWRx+hx/F0u76OWBkDjT8qKYhR2sTekmlOCtty82Q0c/cBLFPFhYGfpLb1oY5fi6g0Lp6/L/6bfhtrRE7JQ32CKXDxH1CBxzgPxLrmoBlXofP/Bz4OD/BKvcisVc1WNTRBYkzeWRtk1PZcKcKuQAsPjmePzWh7KgkuC X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 097dd27d-3ab3-4727-9ad7-08d92af83809 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:43.1777 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ks3rfnEOH/Do09gQ34Wm3Tqsoxz0iKw+5YvzrEPXoIzDUrVoQoqNdaTgDUkpm6wWlbHu+i/J7Pr8fyfNuuqegB0S8PpKK7JffWD4Y2KyJx4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: FYv8rn-ZP71BydYnhsIxhP0SmQ7ezAQQ X-Proofpoint-ORIG-GUID: FYv8rn-ZP71BydYnhsIxhP0SmQ7ezAQQ X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_get_lba() confusingly returned the block layer sector number expressed in units of 512 bytes. Now that we have a more aptly named scsi_get_sector() function, make scsi_get_lba() return the actual LBA. Signed-off-by: Martin K. Petersen Reviewed-by: Bart Van Assche Reviewed-by: Benjamin Block --- include/scsi/scsi_cmnd.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index cba63377d46a..90da9617d28a 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -225,6 +225,13 @@ static inline sector_t scsi_get_sector(struct scsi_cmnd *scmd) return blk_rq_pos(scmd->request); } +static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) +{ + unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; + + return blk_rq_pos(scmd->request) >> shift; +} + /* * The operations below are hints that tell the controller driver how * to handle I/Os with DIF or similar types of protection information. @@ -287,11 +294,6 @@ static inline unsigned char scsi_get_prot_type(struct scsi_cmnd *scmd) return scmd->prot_type; } -static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) -{ - return blk_rq_pos(scmd->request); -} - static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) { struct request *rq = blk_mq_rq_from_pdu(scmd); From patchwork Wed Jun 9 03:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457256 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01D00C48BE5 for ; Wed, 9 Jun 2021 03:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1AB661263 for ; Wed, 9 Jun 2021 03:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236552AbhFIDls (ORCPT ); Tue, 8 Jun 2021 23:41:48 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44746 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236538AbhFIDlj (ORCPT ); Tue, 8 Jun 2021 23:41:39 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1593C914147476 for ; Wed, 9 Jun 2021 03:39:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=ASIcYKM2snx67b8AE5XDXbZBb7vWyRvLgJiSNPLlz+4=; b=XObSlaUynGe2eHrzz+0xgwNW+5FYscoxGuepC13avxG5yQBkJ89tIAAIRHAQ8N2SKEWz iU4T7WD/crlD09IyrIRxtanSjnkmxT9+y30Wbn9ab7L3vWi7Vf+X/YDn1yyZdO7abbp2 Anju/LBlexcfw5j0h11RvyZm8WZxMp9LVxXKr7yxTot/2A5A2Ede1WA2H1O5el0h7VSd 7E/3JdgEutjjdqBgmQ+wf0eFYF/LI773wDSAplaB3zO37QUiUhijDyKseWOdtf8jcwTw MDRj8L31o1ESnR9Tuy0wYukkzmMWDyh30VEbp2WWg0ZzqChjHM+ARuJ7rNaajDgrzb/F 4A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfrdx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:45 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z2Ps082696 for ; Wed, 9 Jun 2021 03:39:44 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by userp3020.oracle.com with ESMTP id 390k1rhr2k-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A2chyyt3X07Z5llxHjhKIjghYKX2LvX8OdHlIwUP4043BBpfWI+eJJ8GVfFhdyQDbxw2IcQXOr9qMvBUAwtP3Q/HmGRK2w7FWJ2gOHqBzqNu5KoSvu0tcR2vDgmwvxBt1TG9AP9MRyaMoF+3IBI6UGDYHwARJOC1xvU1O5RgdRzduJ7mgmiM4R/qn8IWUG8x3USPzgEunOxI0pbC/6D7pxb8H887x6/SRgWJanYuKyxLjDZ5ZN6bNMpbKzM7vkiPKOxtDUIpVgkBt3v/2flgnoL3NrHWLKfg+NVBbHkybBA5wLQblzYQ0GoHpWDzt0Q5HC+1S3N9iNmLcccNzkrf5Q== 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-SenderADCheck; bh=ASIcYKM2snx67b8AE5XDXbZBb7vWyRvLgJiSNPLlz+4=; b=bIDk+GkOOL52tCYtmIlMZg4o7+TIe17ZGbrr06v86r8EE5cAHpLJY7N26VtiGxzHE6iqh5g1dl5VFteT9EC/pcCt735OxnuwRZ9XiMWwAeK3yhIRJO74fdmk9BBcssbA+TXBhr7eAnYs9DRS1ONmzi8+U1Lf+t5ZInMWhFQm0PLc6VV/0KhaOLSHLOBTqK0M77Htbh8KTPB+TeLXjyng4FQ/fscSfkC6dL6NTIbGBLr1FuN9JszpYFhptCPj7bQb53YZRvkrSDYxiW/H0u6GqfMC+XDr4nAlltN941qSTHDYCUswfKzbuC0KXRcq6248NE0EwxdjRHCo1jxpnphGhQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ASIcYKM2snx67b8AE5XDXbZBb7vWyRvLgJiSNPLlz+4=; b=jsZZV7QDoyyPZYP6klW069CcSi04KXuNWtkTewmKyGWPA7UkjSRDYtDpqZtPoPafa//26iV9C0bBm3P58eug4qy1+NFS3eho1L390b5nvMupqhC8mZ/XZV3hyUvXD5Au+EVckmdVMPYRYYzFh/+wrEWyC0JXWo1xpUvdW3U8r78= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:44 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:44 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 13/15] scsi: core: Add helper to return number of logical blocks in a request Date: Tue, 8 Jun 2021 23:39:27 -0400 Message-Id: <20210609033929.3815-14-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49facd89-b9f0-4ced-206e-08d92af8387e X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:561; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Tb+fqdhxFwJb6iR1kcLJcOAxo4Jezb6Pbhs1jZ5QsGxde+ZojgsA69ZOhXsRH5HgYGBWxqRLXltsUZEOGqde4ukavQXQqmv71vkyCg6Q9VhaHL21YGur9/diKemkQiWLG0AHRu72KDSPcMlGb+fLTzhMynbe3PLuJT70KhJHVByFo/SPCpyHluih+tCq50J+h17a81fDd+UB0+nC/+imxW/QSpLjBousKvwd5/JbK4XVxp5D9GDzgVnzGP8TmhetCpFdaXrSvfCoC24wFHea5p4/g3LgZjgoWgWrdFWQ35vRC7DNZqIUpWM1p32aXmw7zLJO41TUzwGajf8cA8Cbux2ZcMeNPqehbnqg0HvzkBDUK8epNcPLieXF30y9e7hHw7kjkK/PQ+p+G6U61py0OEnKPD9GC3C9IhGuc8UL081udiD/HYglDFsBVLIhKmVgzX5vEcK7EOZXvSOZ29zRCVFOa0Am0xn6RihzW4lAXcmBaJuLAvvGaPKY6eFPMKDBUwlj5cAMWjIlDxX541vEsPJDwJFIu9LdG47rSWTm84piN/SEX7CekBhMf03ybmYTaEL0zlSzymEBhdD3qf7Nq8hDC0PuvkDO3siTjGqVXjiqKQWTG8mVx8uLvqAnLVjnF20NeJqSU8WsnCOJKrqaw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(4744005)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GGkW06hPaHlJthn67IGfPxak1XApLbLcYb4y8BXip197s7Xmccv499tKWOPrZE9dCTz2CZ2t0eZuOZJ14dUDRghsXf4InEwionCZUZFuM3B7vp3+GvqBx0IfHMXpJi8uQMbIJRf7eNKgviHSAXXOZMVlIPIbUjoFhYSsV22NeINZPnVZsYnnbknY/cTGGPXyYTUdpqgQRKk5uqKZ5FH5xIePoXQ/KLjQLJWz7LKX1d2iFYHTvs65jxV58AyJhwRQtlDLP+LJnnF9WlxlT3UYsovv4iAQfErgwcSiBwhIzfDJ+hy/eYS/291+AuLdndzJH1IW/lAVe2iNtoNY/LXg/U5IZ09Mf9i0rLDByzqZP5kpqDIfDmcSJ1v720stPwftuU4FiI+gHnpVpp/rea1hfD+RZBVeG2dgPx8vC9lW7GBID/y2m1XQV2nb0foarnhWQikh9l9aUJ8iFXiIPk5t2RMrNHQqlD1zA4g1+R1pK6EW2ycpKjSYtxgfB7Gh70O7uWXGa8F3xf+quh+DDSJPnwLciWhWjzSEh/TWGZ6csVamrmjhcdpdRvUaete189As/FrYk7RABuNOzOAAmpZhNAkcwELvXfvzqTLzfvbkLEj9LDpUTYTnzXTjpbzPb2PZj3wXbSlQbjxNf3pCotAhzx0DQOzAfPNM5o7LoE4ks/qK/G0w1YvpyPth5Lgyjd61FcE9yS3NKl3tqlebfWozvHWsRWrQS6TzGLFaAJsTJ93ldrMyj64UI9/ynN4Tozc4x08cTwH81iMgXhqW4ShHraSkKgLiqD31c3PJgFavPaXn5dmChWcqXtDs/BMQj7UDj+qyM7/6P+KncJbFtkaMu401bFZbZkqAcyTP4bihj/e845v5fI9UTzSxcGeEOB1xen0ScCh7PZeEZA+/mgJSIBqAJ9V26BNzDQ1V4Vc/3+y4aPnfMJv4eTp1uShFM5Fr5lQ7b59Vhk9zet+IkVGUgWhHEqBr1PJv/OxYKcDqkK+I7BaJTX9HVHksppOS8roPeg/J1XV6dA159CLdBFMBH0uenB8bomjjPhgi//lUEA98CXie3UvZMkeWbCYhZdAY2tDhHrqQQSbXXxWHnqsBjRuhaNLOTQqAZwkZLgVYBKSM+teSn1B7E1Fsl3+FDQ/Muh0N/19LjsGNWDYg9BG6Aah6DFLHa5bklyQH3MbnSC1wBPY7oyNDIWAGUPovkw3Lzl/MTs9JXStIHsLSi82rYIOJTCEeYE43ksA1Las2Lu4upXuXSjzWig2EviC++fCfYJhHq8LHHWTXBnv5YcNIlDw31+BeYNDzKgqDq6CVUZQvvxyZ9kSkgTHm0dxdMbHn X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49facd89-b9f0-4ced-206e-08d92af8387e X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:44.0350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KXKXfao1FvuZCqvbl0ZR3AvtO9agADTwGkcljoJQLJBuvvVWagz6zAf4ZwZaXcRY0NGQY8moL/2G6DMoE/UunpaUJVo03ckUpHSciy+jJik= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: DWLQQdP-6rnIehQqjUi5yk3kX-Y-bu0t X-Proofpoint-ORIG-GUID: DWLQQdP-6rnIehQqjUi5yk3kX-Y-bu0t X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Signed-off-by: Martin K. Petersen --- include/scsi/scsi_cmnd.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 90da9617d28a..570719237f23 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -232,6 +232,13 @@ static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) return blk_rq_pos(scmd->request) >> shift; } +static inline unsigned int scsi_get_block_count(struct scsi_cmnd *scmd) +{ + unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; + + return blk_rq_bytes(scmd->request) >> shift; +} + /* * The operations below are hints that tell the controller driver how * to handle I/Os with DIF or similar types of protection information. From patchwork Wed Jun 9 03:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 457255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA64CC48BE8 for ; Wed, 9 Jun 2021 03:39:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA58B611BF for ; Wed, 9 Jun 2021 03:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236568AbhFIDlt (ORCPT ); Tue, 8 Jun 2021 23:41:49 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44764 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236562AbhFIDlm (ORCPT ); Tue, 8 Jun 2021 23:41:42 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1593AE2Q140897 for ; Wed, 9 Jun 2021 03:39:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=9RDTU9+TyZ1wZaHBJSVtCQTa+r4NYuzMW5Fo3sW2uDY=; b=ylxM4HZmAsdwkzn6ILKXQso63NibAjkDaUBY8CMVV/lgEXd3rVWqbRyDa0MheJCGQvam v00wuGQ/61VLy9XptaGArcY6Rh6YuWNBSl6tTzd+WyqC28sqrCpgc0uTirCEl2rvQ0y6 tsj1zOxGghHQ0y1uiBaeBUQ5sJjp89SONS4J/iQCULHc7kSUCDeFDlDlHMmIxiFABD7e WgMT4IpTfwMZRy84QHkkZ/VkyikY+BiuEULCnPxZfyaxABotlP0kC/F4dbkNNi8zhBj8 +MdlcSIE4jkgAbDA6b0IbJhi7Yzt3XifJT7U55TjGlmSDqPvf5Sz7yLRxF3nIBgCzs0k 9Q== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 39017nfre3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:48 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z2Ka082667 for ; Wed, 9 Jun 2021 03:39:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by userp3020.oracle.com with ESMTP id 390k1rhr3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XReBLZ6lyViRt7o4dNHjVE9PdxetOMSQJZFyE3Lz2r3i1DUqMXZMLOA4nrKkqmcEy83fW+CcM86S1WjqN1d/Q5D3XTwdahM9y1xGI1F8rcffLvZ8MoeXIJuDOAd0Wql6p+riWjJ18GFpOjY1ZIRTr4HIw6kcSGlOLj0UUgI7V23gAKtw4PdYuwV6cOaJ7bP2BccQTNlgcAz8f4/ZeH1qlerd11XuQF4+3q2pPDhpULCr5YVYknJKgSRyTmDyHgtl/qpj9+XbEoBTX1+GvooPtHvOSVAShjWlymPgSVX8R2fsIFwIVohGGxEe4YCgne41+GwLrl803Y2N5YAadgTUjQ== 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-SenderADCheck; bh=9RDTU9+TyZ1wZaHBJSVtCQTa+r4NYuzMW5Fo3sW2uDY=; b=V/xDLauXYMENzBvfMThEK9puLbZ88Bma+PJZdV6sXA+/Rk1bTJF+NbIS/VSNvtq/2sslL9vWTwzRVfkpWZ3VGQo9LHGRnZWXJe99OAPKY17FKy+HpyHu+TTd0fi73PxkxGu6CiLLI4GNXA89T88lCyjSjCZ24GZrZyIWgt+KKsCuAJRVV7VKpnvUENcgg8qvTHZni74adDW9PNDA78TlBMw0I0MtaQTddxGdYa1roo9qVrVWsfuMhIFmojrlUKc+z7Rg3vTNjZaie23XXPNk2+q5aLkddh1MSxplf8lRxgseF+zd3C3NTR+0D586tHODt7n9eaIYb6nISw9AVM2k6Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9RDTU9+TyZ1wZaHBJSVtCQTa+r4NYuzMW5Fo3sW2uDY=; b=gdrN7W+k5anSGWIE95wJJZkpDdCaJ1nCA6w76Bip/ycbsbZ1EYO7TnMtToEUj8kTZRl/gR6y20sDWcffECeClbRudnVY4rV6FTqSPWO1VCeOASibiNKp2/+hjBM7tmsDtw2i6ZtdByU4PxKJ6fFbQJZ5jcGfVV5aXJTx1k6HejM= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:45 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:45 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 14/15] scsi: lpfc: Switch to scsi_get_block_count() Date: Tue, 8 Jun 2021 23:39:28 -0400 Message-Id: <20210609033929.3815-15-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f2eff0f-673a-4dfb-f747-08d92af838f7 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +OPtDIT23oD1OOrmUKEaB5a+YcBJg/0tN3cg/ehvOqSs6qH4ZesLNGTyIAZ5mI5QnTgVQyAUHSGGMKT1IHSLJTkwhJ5s6ysfLOUVcfBvXVTETFD996Oo7twZ1HrG0+Roq2NfFoBxBceV5PEEUH305coxjU+klSRFp9gM91rKLzQh24kGgVlY5ZaSBvtXJr8PZ3wVCeJc0Dl9JwtVahh3T55ZAQjqSPn12yVmOjfHEUMYKYSsIZBzDTVSpeCvr/60LSZVQh9bhwhq8AvgC+HbL0qJsNMbE5icaJkjM5w7aByqx2qlpPRvoAwR+thMBOqZ/C8anEvIXtr3DI9OJxSXpzkFmhlaeWbDSJm6N15RA6MYwAyyIUxJjjCi+H3gt+5eREesYWO3wtRDWgslnxKsuzfSCg3+k+KWln9HDyFojGtwlI4SD/nt1uGPZpvMMyEVDNXjBnBl+Fe1zIyZmfSInUQhlu0GxX9k5WHl1eOWJjdJihGMPcVrH+q0Y9pG/7BocDaKULmUP+ZX9a/pK7QliETQOammYc9UJdM6zUR23hhlGhqUox7qROIj2Z9acjIzdEVTsmUvRLG5hvSO3xKEOI9/xT6IUx8UhDpiFJKZmlN7wsmVGwNTZalpgahyyTWfhciCmVzcHzVmduOnxdoRWA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NgNCBEukSPtsQtybtxLMMnsNkA1NkxJtxQ75P6cP2xgjVouW+Icn7mhmL2hmbRcGfLITKqg46C5XPMk+/6GaLJwaw/zyv5sZmFBesOjI0zkB8Cfawzx/ej8qxk42qipTl9FT4AHTdYcHD69fY4RAZDo8cPFt2zpSD91XO6eFq2Xs3f2KS/PQovp/4j4iChGlrfqXENn0Gl4HTBvDT1QjAUOdDoYMJvISH1lQ3AUoncDlF5CsCDor7bWs/fmG2Q8f4OztsL75CmITfif5wTYUBYpPeT9UjGGQdOU78AGaVaOeOYImt2Fimn4jN0bImGxcp+B4ixg0g7SN/q9fTrl8bfcstQCTX0pE0Ln2rv0hml3mNYZ5b4RC94OKqmqMSHNlJKYuLr2eWmOfyPoSK/P8+Hni9qnamv/4C+yKujWEeg4Flf6xIaElYFAIFwkwAkhDpwDe0IB12X3jtGREGlohQfUDChLf1+ZzmCUtMMSo7d93Yq7bB+aobso0/LK5PWoWzm5iZvau5B8xW88UTxZRhIt0x5b/T9hAY8gITzu5oCpisUWwNTtsu6sefUYlSXs2yYyY4EVmQcf/SGwwHqp1N63Oss1KcDl1FIt1ZlgSCXbjJ6YfldfsDoWjg1sdVuArdZlvvBsVmIcevBw9limnPpgJ9J/ln651aGaQBScWsENcKEPvMnqbO7HVkDPpp/rW2rpIlfM9KmwvSBvlqa4m8S3uUobcGZojJ8A+6bqVIc77p1Nol0gg+nvscvHeyKC0UAmEUp/qamYxPj80wpFlo/mzCVwYmZWRHvrtAExkynLHVvItzCoJwtTiua7W/jUqd6O8zyBhLLhAfRf8/i/91/Bs+ufCKGhvwf4DzUZP1vsajmSAJIq8j68spCriJceroE1IfBoaq3qEBiOLcPvqHvpu48gfzNrpNdHwBMojZXNNViwhfLQHv1ZxodNY8sO1sCgpIaEV6c/7wnlcVJiGQEbM8fz5aTVfwmfv5ff2eiPTAv3X1QgGGzTV1JbyiG9b4+ksJ3ScoZyVW1f3cHqALuwdi/GIt9h36lthgCZ5DND3Gp5un3qxvXhLpkDRybxU4wXIKsYDcUIUL1G3t7P/FvKEVZ11oaNhU9uWgUHVOTWrT2nivzxb0Qw+v+qPOQ7Z/opVjN6gvhUr48D3hth4/3U3vJHmiPw6y1OG4S/NtEC+3oeIdXv8/X7prUhsfwxYMtQdBTwC3QYAsgHSn1NhrS0DTXAAMHgbKdFgxPXtPKHiKmnXID6CuVLCctfJl2o65qAy/kAltJxINmbFd3NBXUXgtEUJrm4/ZtmKgoMR81lL5a9iDNSmvELk/e0DL133 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f2eff0f-673a-4dfb-f747-08d92af838f7 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:44.8603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: olDmVcTjrgpxz+tacJfjdbVzGwgfXOaRk3ejhnojXQ7ZjaJ7JzTycnb08XW3ZGxw3u4mkZXWQfWTPyh+Nc31pqEIj99+eIZXC8vP1FP+LOM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-GUID: gkoMexcF13M47nkx8dP3v59kFVMM8lHW X-Proofpoint-ORIG-GUID: gkoMexcF13M47nkx8dP3v59kFVMM8lHW X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use scsi_get_block_count() for places where the I/O size needs to be expressed in units of the logical block size. Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_scsi.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index ca2e00e512f4..5f19eccaad24 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -2959,7 +2959,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); } if (lpfc_bgs_get_reftag_err(bgstat)) { @@ -2974,7 +2974,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); } if (lpfc_bgs_get_apptag_err(bgstat)) { @@ -2989,7 +2989,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); } if (lpfc_bgs_get_hi_water_mark_present(bgstat)) { @@ -3033,7 +3033,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); /* Calcuate what type of error it was */ lpfc_calc_bg_err(phba, lpfc_cmd); @@ -3071,7 +3071,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], scsi_prot_ref_tag(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); ret = (-1); goto out; } @@ -3083,7 +3083,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], scsi_prot_ref_tag(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); ret = (-1); goto out; } @@ -3099,7 +3099,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], scsi_prot_ref_tag(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); } if (lpfc_bgs_get_reftag_err(bgstat)) { @@ -3114,7 +3114,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], scsi_prot_ref_tag(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); } if (lpfc_bgs_get_apptag_err(bgstat)) { @@ -3129,7 +3129,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], scsi_prot_ref_tag(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); } if (lpfc_bgs_get_hi_water_mark_present(bgstat)) { @@ -3173,7 +3173,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], scsi_prot_ref_tag(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + scsi_get_block_count(cmd), bgstat, bghm); /* Calcuate what type of error it was */ lpfc_calc_bg_err(phba, lpfc_cmd); @@ -5261,7 +5261,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) dif_op_str[scsi_get_prot_op(cmnd)], cmnd->cmnd[0], scsi_prot_ref_tag(cmnd), - blk_rq_sectors(cmnd->request), + scsi_get_block_count(cmnd), (cmnd->cmnd[1]>>5)); } err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd); @@ -5273,7 +5273,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) "x%x reftag x%x cnt %u pt %x\n", cmnd->cmnd[0], scsi_prot_ref_tag(cmnd), - blk_rq_sectors(cmnd->request), + scsi_get_block_count(cmnd), (cmnd->cmnd[1]>>5)); } err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd); From patchwork Wed Jun 9 03:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 458224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A6B2C47095 for ; Wed, 9 Jun 2021 03:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80EEE61263 for ; Wed, 9 Jun 2021 03:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236555AbhFIDls (ORCPT ); Tue, 8 Jun 2021 23:41:48 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:50394 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236534AbhFIDlm (ORCPT ); Tue, 8 Jun 2021 23:41:42 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1593AEFM041117 for ; Wed, 9 Jun 2021 03:39:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=3BLOlMMVPfGobjjqcD6snRjxLO0iG1eCeDb7vauw1Pk=; b=qUyJqEPuNqQ30y6QhWUmaUlUut8dOAtNtxrAivzjv3vcP8+sAQ9EjfYO12QjjJ9FH/l1 SvRUD9jV9A9W3TF+9UwHAFX3kBsxRTwFPp9H5IxOpZKeyf/+qYLh5lOuv0aJwI3RqbBK r9qXVE3TJmO0EekSC7nvJIny9PfJYdcPMyO+Qp7jyymScL0hAKhM32/qvQ6yfXv4m951 PzrWjCerNURBR/z3o+EfBZZtEUDQQptlGzdp9uE+R/VcupF3MD1lNHTIG4wGs7Pem0wi 8VYp3fmXUbovfkhVDNkIOlj2LWYpBMqwK6ZhjxnhRXPE1J4tKSyBD+zGRoqrjAXbIZQT mA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 38yxscfte5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:48 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1590Z2Kb082667 for ; Wed, 9 Jun 2021 03:39:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by userp3020.oracle.com with ESMTP id 390k1rhr3f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 09 Jun 2021 03:39:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTfxK+MSl36oZopwKOvKZmzNY8Z9pfDAEcuZbPUtDV0C5puwgf1/WdXFa1w1eWKiU/vyDjkWZsY3ReUvrimHfAQElrUgQgjkH6O91letetQmcOF0v6hhr3/rQdKC6VkPxLU0TzTjxMTO8gWx53ahUCeT3XowCIXQVBXMgsE3r30kR5HluKvNDiEptoN0UPqfvMFZcTTGDu3XKYxHDw2NiFeHBk1L4FAvSb3Ion5IeJ82lRETH6dTfVbpowzsQHJg3CviRig1wgQUcmfDk6gY66udQrUD1iDfarerwBqvwPgsqHgstrug39yisnEUXhJoOPDxMPTnzuskGAR9hoRu8A== 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-SenderADCheck; bh=3BLOlMMVPfGobjjqcD6snRjxLO0iG1eCeDb7vauw1Pk=; b=Rc28tRO1E621fevN/wMyrFpE68Q/Pzi1xe9wLiKz5N/KaCMLShPmGvG3qz6GxDMjIdbAxDd69HAmYKlKyqBmF6bLdemY0waJp8pZwn1NwZcVg65D+cMDDhYOn1Apwto9iHp2EoWY3vg8ImJQ3bu4Aawuwxxhi0HTya53gbDUlwg34KmyxqfNL4mzGUHkBkp2Ox0RbsHVpHgYPO814E5ycmbe9+QgNKEwUlaClehVzIlCTuJhUqxjnUowmYkBi/YwgJ93TJlGtV7lPq6WE2mYsJ9Fmb1KgUs01k0jUb2DGPWTqwUHDiF2u8eD0oRQhWOgNbHHeAX/uyPqQ9y9Zg+hpw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3BLOlMMVPfGobjjqcD6snRjxLO0iG1eCeDb7vauw1Pk=; b=IPLHWL/Mw4UbUFIKD4fntm8IUEdp7fnip8ax/KVhiko+rxTGyDS7/MB7POjxFLZ6VFtXlHm6wUepApStA7Yfi1yw2qeSNQKrEeEU0DfME91GlmqR2QapI0sXjJJHnFiZqIZmj5qicaq6pRrCwlRtpqW5hSiVSV7RlA7YSfdQuIg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) by PH0PR10MB4421.namprd10.prod.outlook.com (2603:10b6:510:33::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Wed, 9 Jun 2021 03:39:46 +0000 Received: from PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796]) by PH0PR10MB4759.namprd10.prod.outlook.com ([fe80::4c61:9532:4af0:8796%7]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 03:39:46 +0000 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org Cc: "Martin K. Petersen" Subject: [PATCH 15/15] scsi: ufs: core: Use scsi_get_lba() to get LBA Date: Tue, 8 Jun 2021 23:39:29 -0400 Message-Id: <20210609033929.3815-16-martin.petersen@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com> References: <20210609033929.3815-1-martin.petersen@oracle.com> X-Originating-IP: [138.3.201.9] X-ClientProxiedBy: SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) To PH0PR10MB4759.namprd10.prod.outlook.com (2603:10b6:510:3d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ca-mkp.mkp.ca.oracle.com (138.3.201.9) by SN7PR04CA0034.namprd04.prod.outlook.com (2603:10b6:806:120::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 03:39:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5adef228-ac58-4566-1114-08d92af839b2 X-MS-TrafficTypeDiagnostic: PH0PR10MB4421: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FKkFJkrIArAAysWm44G4gM9xU2rwvZdqmjNitJ+scMzaplU4tYPsf/+qNu3dU0bx1NiFpNEbbdDB5C53C/5iGNhkg7DokUhwk2vHqBi3gP7J0Z6rpbbE0gnNjdkqakhm5Vj2oExdE70oEGGTwfP6Sxo0k8GwJyCU1cTkF0RXVLMbxNsR2Rn9yApahnmTl+tJgiaRrRsj5qAYeutHikCz1tbgjy3AIfwweRNmmND26mbKFnkBQPIhN62+KmVCT0X0vHzdkm19D8Z58q2nGC9/gnc3hKsp/xB0p59HZyPj7lOpsssz1Nrl5ZSSlGWXScv5xhtnylK/FxLO6pJLb54AVFhrD+1HvdcV3o5dqQpXHmqdCRXoM13u7ohDPryB5WP5s08JpaYpqRGB5/9zfHrQrJJWC44SU1WzlyrS+PZZDNYNbBEN36WhGRukSQdUHLLwFMjN99dVXLm7+/UaI06xCgRl0QHCaAzyUpeLggUTESx+1R405vImQ7XiydaGg9VQiIappY2Iu43EUbhxwaWDSWdJe/dwCdz+SW9K4k5GDh8QuW8jckLBiDSlBdbtnTHO3Pm+lJO6mXgfYAGr22Y2ebj8IVJ4+Smhb3aBY7L+PJTgTx3mK62JlG2Feh/yuMANHiUOrBO3iGsDTmmiQhZLsg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB4759.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(376002)(396003)(39860400002)(366004)(136003)(8676002)(956004)(2616005)(8936002)(2906002)(6486002)(107886003)(4744005)(86362001)(66946007)(52116002)(16526019)(66556008)(6666004)(66476007)(6916009)(83380400001)(478600001)(26005)(186003)(38100700002)(7696005)(38350700002)(1076003)(5660300002)(36756003)(316002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tROskTFAJQ8n9zk5DnjhNMTz8BAUL8jQUHdUC25ClDzloCm6yITca3AyPibHSdM4fzwkjq27QyVgRakLwR/pZx/PUuyM/9w/42MY7XgrXuQj7Ofp7rvsAsn7i4SaCfK1Da/KOt222/Cdn9Cz7bvNjfgAvgJE4itRGEqIBrfE9Os8DSA6MeWrWCHK/veCR3c/ViWq7J6HI/L0F+jTNz7ar8u56qm7b3mqla+fMIuJ9fKDFnZ8p4adFwlmNAVbkzvE7PIB8EU5B0a9y9QFa9goF8mfNftBkx5hYJqxAbUMW5hfHUIMt/+Ydp4Fs/GQU7HjWxifUdnyK/hlmzjf6TiQ1/lmy2XPPip9IhpsJiCy/Mv85deBj2++vBtmNFemfA3xfSQ+bMY3Xrydodjr2gIa3Dk9x8rgdGoBbs3NX/irkGcUivZ4GrpcGTlLuPkl91EnXbHtT75E9Ku6ArQiXF0W1B+7KZ7pJxo0KkJOhtRJtvQsItSR943LGlJISVEvWMhWC3pGjQfRnPMbpqrXAdUMRsDR0DKxYYu4ymJweo+YgNBxx0wbxgfJsgbplZzymx7yPAegOZ/wYenQbv30ZClx3y1nQnr+B1S6LXCrAkoN+0X0AV6MckUk01s5KgM7vwUH/aqUcxoO6OCe+aTdruqQSchYhk5XmReCbzoTHcWZaKD197Gy9HkOQJ/IxUKA6udeD5ARsV68M6fWYga05IG9eJqwes36R1zMsgWHQZBhkNACdgDZaV/jpvjXMqKhGtqnFkR/4pSIhkaZdXO7/S5z1hN7hF9bAX2WJI8fsIf6GTfD/nd+OqTViKqOrHvUt/MpPxW6uxMAehLCrLbM4156pTAOjNlEIBbAmXvZEmP4j1UwLHWY3+rbfsuqQneh5/vYiR+bEWZgCr5qc1pyDR0Zo+cITcRGxds6rVe+vwjyFsHS26UnZeT1JWRbRRvHEu6TvBr3BKotQ1xYytAl7hJ/3yWxVI3GNgtEDqIhJAlRLWlR8mAwOznLrSyaNCWRyFXfUvjwdzpxMh1qtEs7M3m0n4KcL8npXBsSrnIjYgDmIyg0Xo2lJXR41gIoedpr87SHTh4ErqN4LyW0sQvhPfxMgKMiYAcXBb+AB79kYPhz4iy1aqK2veNAp9k5KB8pWU7H5lOmWSBSH/u1z64CSKiUDJQO0fHjZDVjQushjUL+SLWB9PVtyZbD9TZ13oMXMmNxwWDah/ez95+2UAjSvDe/roMM/1IMoh0BBlibIo062BIcPPpDLK5U9UYv1+lkHTVbs2AiKV4jFF+CSipto4FcQ+7+QAi1XeEknvRy1RA3snsTK8bA9svFnRnPlQ4SHsJE X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5adef228-ac58-4566-1114-08d92af839b2 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4759.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 03:39:46.0869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xNcuRj0s7yXD5ggILoHs0TXkAqtz8RxGG0XApJtDOplpY3UP3JY19bkcrtmyXeDar6MQWWvjI+FM/EjwbwoPz9o/qpBcDVyHS2P8cHE+EeY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4421 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 X-Proofpoint-ORIG-GUID: jdAYCRiToxvNYHFCHWYghVuaB7IvhPw5 X-Proofpoint-GUID: jdAYCRiToxvNYHFCHWYghVuaB7IvhPw5 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10009 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106090001 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use the scsi_get_lba() helper instead of a function internal to the SCSI disk driver. Remove #include "sd.h". Signed-off-by: Martin K. Petersen --- drivers/scsi/ufs/ufshcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index fe1b5f4b586a..beb52245554f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -25,7 +25,6 @@ #include "ufs_bsg.h" #include "ufshcd-crypto.h" #include -#include "../sd.h" #define CREATE_TRACE_POINTS #include @@ -390,7 +389,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, /* trace UPIU also */ ufshcd_add_cmd_upiu_trace(hba, tag, str_t); opcode = cmd->cmnd[0]; - lba = sectors_to_logical(cmd->device, blk_rq_pos(cmd->request)); + lba = scsi_get_lba(cmd); if (opcode == READ_10 || opcode == WRITE_10) { /*