From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@seagate.com header.s=proofpoint header.b=GoDFwQQh; spf=pass (domain: seagate.com, ip: 67.231.144.15, mailfrom: tyler.j.erickson@seagate.com) Received: from mx0a-00003501.pphosted.com (mx0a-00003501.pphosted.com [67.231.144.15]) by groups.io with SMTP; Wed, 04 Sep 2019 08:03:32 -0700 Received: from pps.filterd (m0075554.ppops.net [127.0.0.1]) by mx0a-000cda01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x84F3VUw029838 for ; Wed, 4 Sep 2019 11:03:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seagate.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=proofpoint; bh=IKwr4XV3X908YF2By3EfXlXDppt772bFl9j5m7+/qz4=; b=GoDFwQQhhKpUgM6yZEWVgnDowEI2C2IOhN+xfgF6ltAC0sY4N2lxks9ZIA+m3QRcm5ow scxfjGGkpfMh+X1ktHh4TGX9EkhE6LM/4tK3EEjeg3J4OF4LiVt24IUCdp0aXlad8EQf x4tKyqGH9FPCbW3S4UQSloRuryQcaMl4fSqrk5VPf9HxWsU7WfhkuC+2wmfxPFwUFZXU GdXrS+WZCE8+8/Brcy5BuKSpvuPW9qMoxBbwxOx66et+7L0FF3rmKuxMQhV4X15LjT3/ jmQ07iovxzLyn/oRzy5sLedAFu8dZAtd1AnsgM/aNMwH/kws3VURD1PP2Ucw+jZOPdsp 2Q== Authentication-Results: seagate.com; dkim=pass header.d=seagate.com header.s=google Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by mx0a-000cda01.pphosted.com with ESMTP id 2uqk7j0uvr-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 04 Sep 2019 11:03:31 -0400 Received: by mail-lj1-f199.google.com with SMTP id s17so3119264ljj.5 for ; Wed, 04 Sep 2019 08:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seagate.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IKwr4XV3X908YF2By3EfXlXDppt772bFl9j5m7+/qz4=; b=SFYsHZAHVZ390VYOZyMAziVoWtmV6oLnnIhTKWuyL7GbbivmzOKblQFzc9hoyuv8F0 24Rbz9u7vouN+fIMTOwpjaJtnNoqUv/cIV6fsLKM3y6AvbwGQEmAEXU/0YYwkyNBxC5Y alfdDgkv2YHi8UObXXsylCbZbLf51Nv8f6PTZChV6fR33/0E80BV+Yi6ny6ozwO/plb8 F+zs6sjd+s4wUYPShTW6v1vtyAhxhDcRcz39i6CRc7pZhS4Ns5E/LjGVrlQ8tpL9z9UC KXC4vPRJxWNBR1VCeRBsDUs7kVQqjef4iq2T4b1jEdZ2i3nWnOSEPXTrmr42V/7bIvEH X3Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IKwr4XV3X908YF2By3EfXlXDppt772bFl9j5m7+/qz4=; b=fv8Fkipjf5KYjMToOentFMiyAqTdfUe8LjF4XCf/P4MjKIo/1PYSYkPJY/YIx3a41X fQx3UKRFjRpKUubSGazMsw3rUyT2+RkLoJOPU1pq7ZoshSk5SpvRweDc9Wjpelg1QlHA 1ljpGtDVNKtpLaeP9g3sCkC/WfULNviOszveMFSvbpV/Vu8Ib5+0Vi1S6OsQRykfFmbl EqpR3jpsJC0TArWWWjonupRyGBInkkaqJlsX1t0V1a+nVT6i75hTJ7lPa3yyELtH/ruH SXWdz8AS8G2HehSkxaJmd5fp27j5jV5nothmcmDAfwmtiD78erMxlygQERv55rKhXRjr 4s0w== X-Gm-Message-State: APjAAAX/ZzSHMz6I1UdscR666Eo+cv1BuWf+/MdCTBouTDT3rci8TyDD wOoXY0sIZAx3oQiDnMeDWZGAHFRwqMZNDRxfd/2tsIxO9ywAYuadF3T+liUoW9bs0fYDqNpe1Xn nKTbZXhYyEeGQY47mEjlo9TrVsGEE9IpeZszhlXUY9OirJQnxqIAhpjE= X-Received: by 2002:ac2:54a9:: with SMTP id w9mr6899501lfk.49.1567609403778; Wed, 04 Sep 2019 08:03:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUbLLScqigEKzcAoT2BSnAytm4Y35Fcw9EONz/az/x1A0wRPoVBwCVRB+T//9vvlgziJxpisDmZPdSq9IUvlE= X-Received: by 2002:ac2:54a9:: with SMTP id w9mr6899488lfk.49.1567609403502; Wed, 04 Sep 2019 08:03:23 -0700 (PDT) MIME-Version: 1.0 References: <20190903135457.26560-1-tyler.j.erickson@seagate.com> <20190903135457.26560-2-tyler.j.erickson@seagate.com> In-Reply-To: From: tyler.j.erickson@seagate.com Date: Wed, 4 Sep 2019 09:06:31 -0600 Message-ID: Subject: Re: [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Allow other NSIDs for Admin commands To: "Wu, Hao A" Cc: "devel@edk2.groups.io" , "Ni, Ray" X-Proofpoint-PolicyRoute: Outbound X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-04_04:2019-09-04,2019-09-04 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 clxscore=1011 suspectscore=1 priorityscore=1501 impostorscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1909040148 X-Proofpoint-Spam-Policy: Default Domain Policy Content-Type: multipart/alternative; boundary="000000000000a48d560591bb8106" --000000000000a48d560591bb8106 Content-Type: text/plain; charset="UTF-8" Hi Hao, I tried making both the NamespaceID and NSID values the same when calling the passthru function for these admin commands and it didn't work. I think that is due to another place in the passthru code filtering the NamespaceId input values on line 517-520. The NamespaceId parameter is being checked to make sure it isn't greater than the number of supported namespaces by the controller and it makes sure it isn't set to (UINT32)-1 (All F's). I think this is correct since the NamespaceId input is what is discovered when calling the EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE function. This is what I used to get the available namespaces available in the system. In my case I'm sending some commands in my application with the NSID set to UINT32_MAX in order to request controller wide SMART/Health log data among other things. There are some commands where setting the NSID to another value may also be useful. For example, DST can use the NSID in the command to change between testing only the controller (0), testing all namespaces (UINT32_MAX), and a specific namespace. The modification I made was done where the passthru command's NSID was actually being checked, which seemed like the best place to add this exception for admin commands. -Tyler On Tue, Sep 3, 2019 at 9:39 PM Wu, Hao A wrote: > > -----Original Message----- > > From: Wu, Hao A > > Sent: Wednesday, September 04, 2019 11:39 AM > > To: devel@edk2.groups.io; Tyler Erickson > > Cc: Wu, Hao A; Ni, Ray > > Subject: [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Allow other NSIDs > > for Admin commands > > > > Repost the mail to the list. > > > > Best Regards, > > Hao Wu > > > > -----Original Message----- > > From: Tyler Erickson [mailto:tyler.j.erickson@seagate.com] > > Sent: Tuesday, September 03, 2019 9:55 PM > > To: edk2-devel@lists.01.org > > Cc: Wu, Hao A; Ni, Ray > > Subject: [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Allow other NSIDs > > for Admin commands > > > > Cc: Hao A Wu > > Cc: Ray Ni > > Signed-off-by: Tyler Erickson > > --- > > MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > > b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > > index 8e721379466a..78a3c663ded4 100644 > > --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > > +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > > @@ -561,7 +561,7 @@ NvmExpressPassThru ( > > Sq = Private->SqBuffer[QueueId] + Private->SqTdbl[QueueId].Sqt; > > Cq = Private->CqBuffer[QueueId] + Private->CqHdbl[QueueId].Cqh; > > > > - if (Packet->NvmeCmd->Nsid != NamespaceId) { > > + if (Packet->QueueType != NVME_ADMIN_QUEUE && Packet->NvmeCmd- > > >Nsid != NamespaceId) { > > > Hello, > > Per my understanding to the codes, I think the: > > * Input parameter 'NamespaceId' for the PassThru() service > * The 'Nsid' field of the EFI_NVM_EXPRESS_COMMAND > > are of the same meaning. > > Do you think setting these 2 values identical when calling the PassThru() > service can resolve the issue you met? > > Best Regards, > Hao Wu > > > > return EFI_INVALID_PARAMETER; > > } > > > > -- > > 2.17.1 > > --000000000000a48d560591bb8106 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Hao,

I tried making both the Namespa= ceID and NSID values the same when calling the passthru function for these = admin commands and it didn't work. I think that is due to another place= in the passthru code filtering the NamespaceId input values on line 517-52= 0.
The NamespaceId parameter is being checked to make sure it= isn't greater than the number of supported namespaces by the controlle= r and it makes sure it isn't set to (UINT32)-1 (All F's).=C2=A0
I think this is correct since the NamespaceId input is what is = discovered when calling the=C2=A0EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPA= CE function. This is what I used to get the available namespaces available = in the system.

In my case I'm sending some commands in my application with the NSID = set to UINT32_MAX in order to request controller wide SMART/Health log data= among other things. There are some commands where setting the NSID to anot= her value may also be useful. For example, DST can use the NSID in the comm= and to change between testing only the controller (0), testing all namespac= es (UINT32_MAX), and a specific namespace.

The mod= ification I made was done where the passthru command's NSID was actuall= y being checked, which seemed like the best place to add this exception for= admin commands.

-Tyle= r


On Tue, Sep 3, 2019 at 9:39 PM Wu, Hao A &= lt;hao.a.wu@intel.com> wrote:<= br>
> -----Origin= al Message-----
> From: Wu, Hao A
> Sent: Wednesday, September 04, 2019 11:39 AM
> To: devel@ed= k2.groups.io; Tyler Erickson
> Cc: Wu, Hao A; Ni, Ray
> Subject: [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Allow other NSIDs<= br> > for Admin commands
>
> Repost the mail to the list.
>
> Best Regards,
> Hao Wu
>
> -----Original Message-----
> From: Tyler Erickson [mailto:tyler.j.erickson@seagate.com]
> Sent: Tuesday, September 03, 2019 9:55 PM
> To: edk2-= devel@lists.01.org
> Cc: Wu, Hao A; Ni, Ray
> Subject: [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Allow other NSIDs<= br> > for Admin commands
>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <r= ay.ni@intel.com>
> Signed-off-by: Tyler Erickson <tyler.j.erickson@seagate.com>
> ---
>=C2=A0 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 2 +- >=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> index 8e721379466a..78a3c663ded4 100644
> --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> @@ -561,7 +561,7 @@ NvmExpressPassThru (
>=C2=A0 =C2=A0 Sq=C2=A0 =3D Private->SqBuffer[QueueId] + Private->= SqTdbl[QueueId].Sqt;
>=C2=A0 =C2=A0 Cq=C2=A0 =3D Private->CqBuffer[QueueId] + Private->= CqHdbl[QueueId].Cqh;
>
> -=C2=A0 if (Packet->NvmeCmd->Nsid !=3D NamespaceId) {
> +=C2=A0 if (Packet->QueueType !=3D NVME_ADMIN_QUEUE && Pack= et->NvmeCmd-
> >Nsid !=3D NamespaceId) {


Hello,

Per my understanding to the codes, I think the:

* Input parameter 'NamespaceId' for the PassThru() service
* The 'Nsid' field of the EFI_NVM_EXPRESS_COMMAND

are of the same meaning.

Do you think setting these 2 values identical when calling the PassThru() service can resolve the issue you met?

Best Regards,
Hao Wu


>=C2=A0 =C2=A0 =C2=A0 return EFI_INVALID_PARAMETER;
>=C2=A0 =C2=A0 }
>
> --
> 2.17.1

--000000000000a48d560591bb8106--