From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.11502.1582881420607611761 for ; Fri, 28 Feb 2020 01:17:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DOdVR7sn; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582881419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w4JO4KVHJ1TfUlOmG0E7XrBSObDHEZAaIOIfveO2PDo=; b=DOdVR7snihSE8RA4GZYPTa22GXgFVENHatqwEnhwDZfafDxOJPTZkwMWmF1K4/vmWtOguM ZCZ/9Fm+ranHGSvlrgoFHNT5X37GlCzXx8hZv34vhODV/7WqzKGBZK+fnZn/gVCRBikByE tPq7cZYPHoNCaWMbcP4+Oeyy6D9WCOY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-4yCsNXg4PJGrzEjZdY-mvA-1; Fri, 28 Feb 2020 04:16:55 -0500 X-MC-Unique: 4yCsNXg4PJGrzEjZdY-mvA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 996E0DBA3; Fri, 28 Feb 2020 09:16:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21D4487B08; Fri, 28 Feb 2020 09:16:52 +0000 (UTC) Subject: Re: [PATCH v2 08/13] OvmfPkg/MptScsiDxe: Implement GetTargetLun To: Nikita Leshenko , devel@edk2.groups.io Cc: liran.alon@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org References: <20200226164151.125182-1-nikita.leshchenko@oracle.com> <20200226164151.125182-9-nikita.leshchenko@oracle.com> From: "Laszlo Ersek" Message-ID: <1ab58093-2ac9-f71e-0f0a-4dac0713c997@redhat.com> Date: Fri, 28 Feb 2020 10:16:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200226164151.125182-9-nikita.leshchenko@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 02/26/20 17:41, Nikita Leshenko wrote: > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Nikita Leshenko > Reviewed-by: Konrad Rzeszutek Wilk > Reviewed-by: Aaron Young > Reviewed-by: Liran Alon (1) Please add at least one sentence to the commit message body. > --- > OvmfPkg/MptScsiDxe/MptScsi.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c > index 593cf30f6b..d72af2b3f7 100644 > --- a/OvmfPkg/MptScsiDxe/MptScsi.c > +++ b/OvmfPkg/MptScsiDxe/MptScsi.c > @@ -156,7 +156,18 @@ MptScsiGetTargetLun ( > OUT UINT64 *Lun > ) > { > - return EFI_UNSUPPORTED; > + SCSI_DEVICE_PATH *ScsiDevicePath; > + > + if (DevicePath->Type != MESSAGING_DEVICE_PATH || > + DevicePath->SubType != MSG_SCSI_DP) { > + return EFI_UNSUPPORTED; > + } > + > + ScsiDevicePath = (SCSI_DEVICE_PATH *)DevicePath; > + **Target = ScsiDevicePath->Pun; > + *Lun = ScsiDevicePath->Lun; > + > + return EFI_SUCCESS; > } > > STATIC > (2) Same comment with regard to EFI_NOT_FOUND as under the previous patch: - in this patch, you should return EFI_NOT_FOUND unless both **Target and *Lun end up being 0 - in patch "OvmfPkg/MptScsiDxe: Report multiple targets", the **Target check should be relaxed to permit values up to "Dev->MaxTarget". Thanks Laszlo