Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5762585ioo; Wed, 1 Jun 2022 12:03:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJBP3mk8+bov8N0+uwYxYolsqH1VhtWAuL+OF64UhQK3Wr5dnAElWurLymFQjVAWcmId8U X-Received: by 2002:a17:90b:4c4c:b0:1df:bab5:4f56 with SMTP id np12-20020a17090b4c4c00b001dfbab54f56mr35841067pjb.202.1654110185967; Wed, 01 Jun 2022 12:03:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654110185; cv=pass; d=google.com; s=arc-20160816; b=VKNUoJLvkzb/y7i/BYKj7pVMyqX2u67LVf7j/Q0lS95l104tI4aVBXyMPxgtCM/zya HEfMM3Rpn1AhJzonFPtlNaJP+LCEa64cALqzxZjkW5GsnAIQcujIw8hBnuGybA2dWvS7 iaGeFh2Oct5lYUtzNKFpVQ2Am1ZeKZO07MNkA4UK1rqo9EiLpYBFRGnLleAAGslZYwxg bBpNO3as5wkGhp9BSz3eYIDJZYYYufMtD8TMSinhyQzQuwRB1gPgqy16OaZ4XR94m6BI KQXZLKsa+uzC617L02Diml3RNmWkKJyA5Je6XwCNe8s4IFAwytonPtg0OjRE3rY84m12 FUkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:to:from :dkim-signature; bh=PPNoozL+JmKsOTlwFirh7mmjVy6Tb4a+sfC3MudL7yw=; b=mhcLzyaEN7GZt8lkQaBV5tep82AGtpdwL1ViHuJIKVlwJ8zjB+LbtqnIYWP6HgUCKT YfrrnzS2fttAl4Kz/I1utcG/J/n40x6XwffbZZHqhMxEscQAQqx+C/K2K3ZFRWuthaUo bqtKFvjEEDFTB5fEIhEwP1bSCt8KF/Vyj+ENorKiTfolrO+mIQ7A0rLGF+2P0dCwGoFX DhKnn4+3FrD8kf0/kGeqwKVsttIzVaXLk7sl0CvwSMA//jKc7O7YuuoDmRTqAIP5sBH9 3tY02qCrhJUuTP7+Rm7aW7p503Tjyz5Y/NySUqMTXY0qsc0CUZrgNgonpDln7cYx+KaX xAjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=bk88YXyj; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lw6-20020a17090b180600b001e06a33e061si3740526pjb.63.2022.06.01.12.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:03:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=bk88YXyj; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 025FA63ED; Wed, 1 Jun 2022 11:46:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344672AbiEaNZo (ORCPT + 99 others); Tue, 31 May 2022 09:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236113AbiEaNZm (ORCPT ); Tue, 31 May 2022 09:25:42 -0400 Received: from na01-obe.outbound.protection.outlook.com (unknown [52.101.57.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D91C62A2F; Tue, 31 May 2022 06:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EIWNphwQ3ZglPdXdrXuAKvAzDSAsnqt9dr5AzwHaClekCjawGZu/Z5fqy8/8iVdeE7XkHmPS69L/p9kAFUopqBS24TIU6Fp/Neb+/lfhCwUAntEXChvSxvPv933hboejtzE+nkNMuFoTpc0YM0QElB4W1LtLiypebgsYvYZooJDII+Jb61Us3tCBCLN+dDBhfiWom1qFGl/gt9FAdT1S6DXo0Gelt3bMJHeEAPnIHpXUblzGZMItR54eZR7raKWZfUPAhqGHk6GZ7f7SRyU+0cvfTiaUjsadyEkTcLvT/mQRm2YVCoW4clrZXYtJh6K6BpOV3GofgFKx6PUCaHyWUw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PPNoozL+JmKsOTlwFirh7mmjVy6Tb4a+sfC3MudL7yw=; b=Ob1xGa3u5OZ70K2jd2Hsvp0I6fqgGDJ5QzV7plQIKu0Cf/eutpzBXwu3sc7A2Oo+PQQ4bfUjVbv1aPQ2zAH+hAKXhS4rvTncxLcNhbTRPxMwHSCERMvgZthQJGOiw6U03DDC+J1VH4Glaiv5CJ0YS76GK5jv50N6ar1SG+SO5t0WLpNL9yUOSuhHcetO1rbqxjeYUlR7xdkYg56rh57NRibroskUFk2oU6DJmV6lcqN7ueezF390fW2V8yTu1EeYvgiQNpQ+UJQjcBfKm5b4nLE5RRLl/vgVDyAGCmI/QumZftEAEMY9E8vqMvCVX9EFGdZOfhqG/BlS99x6JD1uHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PPNoozL+JmKsOTlwFirh7mmjVy6Tb4a+sfC3MudL7yw=; b=bk88YXyjC++bLmywsbqxCJCNHlUEPOxwr+FJbt3yWytQ2PyyCEmm41vGqA7Xxj/AXQjb9yyNNAJXE+b2z6PMDel3xVwUmBA3e0Nv7TMGHaEGchxe5Bzt8/1wjC/G8wdnMkYfj+urV0jQc1MQseEwNAve2guafBHmWfz+BHPWaD8= Received: from PH0PR21MB3025.namprd21.prod.outlook.com (2603:10b6:510:d2::21) by SA1PR21MB1287.namprd21.prod.outlook.com (2603:10b6:806:1e6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.3; Tue, 31 May 2022 13:18:50 +0000 Received: from PH0PR21MB3025.namprd21.prod.outlook.com ([fe80::8061:e9da:aa0f:a013]) by PH0PR21MB3025.namprd21.prod.outlook.com ([fe80::8061:e9da:aa0f:a013%9]) with mapi id 15.20.5332.003; Tue, 31 May 2022 13:18:50 +0000 From: "Michael Kelley (LINUX)" To: Saurabh Sengar , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "wei.liu@kernel.org" , Dexuan Cui , "martin.petersen@oracle.com" , "jejb@linux.ibm.com" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Saurabh Singh Sengar Subject: RE: [PATCH] scsi: storvsc: Enabling WRITE_SAME Thread-Topic: [PATCH] scsi: storvsc: Enabling WRITE_SAME Thread-Index: AQHYdADOB8LAKpigiEW+vIrVrker9604+MyA Date: Tue, 31 May 2022 13:18:50 +0000 Message-ID: References: <1653899973-21039-1-git-send-email-ssengar@linux.microsoft.com> In-Reply-To: <1653899973-21039-1-git-send-email-ssengar@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=6d18a6c4-360e-4eb8-bb8e-3a30d09e3190;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-05-31T13:14:47Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 200510fc-8b58-4628-0a63-08da430819f3 x-ms-traffictypediagnostic: SA1PR21MB1287:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2G29UMgdiiA/9vFA1RsjDXSQWtEjpvFL6Mq3qqlT+u/nac5G7SOcjT0snFlrpekyMlGYasQhT39w4iuDKkwIa+/JkreHQ6J/H92a29qgrXarCKTzhruPkOSU3DO113g9SS4mc6/7aRlOTehOrfxye2DdYlI25qX+vBmYxUhS/joyTIB+oa/1hYnfTnvZiHTTfC/ODOH0w6coH2p9A5W41TCB413oCi+Gt+5JAhPUf4E+OpdN64I8a3zg7U+LFBZqsziKEC5O3yz+FWaJ+VQlcJTPrQ8z7S77i/8a/BxVkcAgQp1queDtO+j1NN/H3p1OkdJXeErh4WtCwTEW/Ea+AzQomZziPTmd8GvBofbrBJeI4ExgN6ghnTo23j6snG1Jc1SAPEjAYY5T3sff0sWLkMfC2GffwjlC8HYiAie3Sm48NiDWaTtJtK+l4C9Mz7qUSF9mKaLme08WkXnIhnO/wtI4MwfTmZzD4pgutcurQ4dcZxT9RItS1NbxC5BTMuFYxnnZbWq8beIHD2iLtMUABseVVRqsNyZTjF5YIf0vAgv7H/34MrUpf9nZ5mG3Ph900m6SLOhX7+zhixKL+HaeH1gRZMO6XipzjA70jnuAUpgpCcp4svIVl7ZUqwyi3attjZOef8skyY6ZbSX2rqmjkLNTWsA/Eszh/GJY6yyznXlZUyN1lQ5i7HvD4n4/u0LpLOgPxfWfkCO/sWT60syI2cwZ2xw8SVzyVtRudZSiNQtB0Ql+Hu8BGmgHy+dt2C+Nw/fJjAFnS97wkdjfV6L+TA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR21MB3025.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(451199009)(26005)(9686003)(7696005)(6506007)(110136005)(508600001)(316002)(6636002)(10290500003)(71200400001)(8990500004)(86362001)(83380400001)(8936002)(186003)(5660300002)(66556008)(921005)(38100700002)(52536014)(8676002)(122000001)(38070700005)(2906002)(82960400001)(33656002)(64756008)(82950400001)(55016003)(66446008)(76116006)(66946007)(66476007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eYXhSUZCEm0gxcnPw5Nx9sQwduloOCt3BCU8Vd4yEgKKdMB/9F+uExBmjnRL?= =?us-ascii?Q?pYacvk8dyjHubRSI6mKFL3e2uM+Z3xr46Zo9yVT1P80wlf7W37BKCRH44zWZ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/yhJmdgzpA5V4kTy8lRHEf?= =?us-ascii?Q?P+ewKP6kHnA1Dys1izX4cN1yTmwUhOvx2g0beSIJJa8idoet/EZ4nAQmJ4JN?= =?us-ascii?Q?hBsiFRYhlNmcMVt7A+5hwxVpC+FImMj/nOj/KHokRtFV+TJQDaCzY6TVWCSx?= =?us-ascii?Q?mFPBFkCdYBa6Yqxq335fa7LgfCu/IaN10V7sXkwZXIDy5yzKxgpGtLgwaIt2?= =?us-ascii?Q?3j7Qemdfz+H2ZaLEgmtNQ7JofyMO6F8cqrRXnhVD4NMFUAHfreDf7U8Ov4ci?= =?us-ascii?Q?q/yR3xhsJaYxrLsjq++4ox1ycaGTGUZv2PCNSbgHWCPR1PcUZeTHT2DnXBR2?= =?us-ascii?Q?hcb8BgMXW2xqSrh482janG3UoOb07gtwXLL3O9BOmbRxmQCb98IsN66mqCKK?= =?us-ascii?Q?wSW9/lOYwwlb5uUncCNUppjgAAOhoW+H0HRCJk4426PC4ZE7S9aRg6t+6OKv?= =?us-ascii?Q?6tum3f9mn8SRjeK5iwXXejjwHBgo7lMyi8H+QYXExQx+Ig19M8GzEBt10qWL?= =?us-ascii?Q?XQlaJZ/Zax0CaK6p275HlvJV8gKphssZ/TpbQ5zC6hConDQMnx4NoEKbFlGn?= =?us-ascii?Q?7SgtzGTFbVOYBH3oFvQ51OYw/sK5Cufvak2TOYiN/dfE9aX37tqLHFi6CQhV?= =?us-ascii?Q?JTYPF6KRpIEMFgw51k/J+3bdON3XguYYUIJO78N4rWNMhBn49Gy+WwacD6V+?= =?us-ascii?Q?iVlDUL6FYF8WVAu9ntzETHsq64JvpvzjUMuDg3ToKOR7sF82g+tNYWzjpCJo?= =?us-ascii?Q?nz7rDXm9UNaljc7wMSyBFAxr9BcWVvI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR21MB3025.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 200510fc-8b58-4628-0a63-08da430819f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2022 13:18:50.0347 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZZhDt690gphqVc2ArNe1wAZvRq+bGW202hJwZ7lzl8P4kKJHDKvnOjo+0RFPWUGch+PeAZxqWTuJ3O4ir7amRqF2KPhjLG4wDCTJToiE5c4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR21MB1287 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Saurabh Sengar >=20 > This driver already has code logic for WRITE_SAME, but was never working > because of a bug where WRITE_SAME is disabled at scsi controller level. > Apparently if WRITE_SAME is disabled at scsi controller level it takes > precedence over disk level setting. This patch fixes this bug, and enable= s > this feature only for VMSTOR protocol version 10.0 and above. >=20 > Signed-off-by: Saurabh Sengar > --- > drivers/scsi/storvsc_drv.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c > index ca35309..3e55687 100644 > --- a/drivers/scsi/storvsc_drv.c > +++ b/drivers/scsi/storvsc_drv.c > @@ -50,6 +50,7 @@ > * Win8: 5.1 > * Win8.1: 6.0 > * Win10: 6.2 > + * Win10.1: 10.0 > */ >=20 > #define VMSTOR_PROTO_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) |= \ > @@ -59,6 +60,7 @@ > #define VMSTOR_PROTO_VERSION_WIN8 VMSTOR_PROTO_VERSION(5, 1) > #define VMSTOR_PROTO_VERSION_WIN8_1 VMSTOR_PROTO_VERSION(6, 0) > #define VMSTOR_PROTO_VERSION_WIN10 VMSTOR_PROTO_VERSION(6, 2) > +#define VMSTOR_PROTO_VERSION_WIN10_1 VMSTOR_PROTO_VERSION(10, 0) As you and I discussed offline, it's a bit weird that Hyper-V is using vers= ion 10.0 here instead of the expected 6.3, or even 7.0. I'd like to hold off on thi= s patch until we can clarify with the Hyper-V team whether this is as expected. Michael >=20 > /* Packet structure describing virtual storage requests. */ > enum vstor_packet_operation { > @@ -205,6 +207,7 @@ struct vmscsi_request { > */ >=20 > static const int protocol_version[] =3D { > + VMSTOR_PROTO_VERSION_WIN10_1, > VMSTOR_PROTO_VERSION_WIN10, > VMSTOR_PROTO_VERSION_WIN8_1, > VMSTOR_PROTO_VERSION_WIN8, > @@ -1558,7 +1561,7 @@ static int storvsc_device_configure(struct scsi_dev= ice *sdevice) > break; > } >=20 > - if (vmstor_proto_version >=3D VMSTOR_PROTO_VERSION_WIN10) > + if (vmstor_proto_version >=3D VMSTOR_PROTO_VERSION_WIN10_1) > sdevice->no_write_same =3D 0; > } >=20 > @@ -1845,7 +1848,6 @@ static int storvsc_queuecommand(struct Scsi_Host *h= ost, struct scsi_cmnd *scmnd) > .this_id =3D -1, > /* Ensure there are no gaps in presented sgls */ > .virt_boundary_mask =3D PAGE_SIZE-1, > - .no_write_same =3D 1, > .track_queue_depth =3D 1, > .change_queue_depth =3D storvsc_change_queue_depth, > }; > -- > 1.8.3.1