From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: eric.jin@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Fri, 06 Sep 2019 00:26:47 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 00:26:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,472,1559545200"; d="scan'208";a="177561151" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 06 Sep 2019 00:26:46 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 6 Sep 2019 00:26:46 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 6 Sep 2019 00:06:10 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.140]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Fri, 6 Sep 2019 15:06:09 +0800 From: "Eric Jin" To: Heinrich Schuchardt , EDK II Development CC: Supreeth Venkatesh , Stephano Cetola Subject: Re: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: SNP Statistics may be unsupported Thread-Topic: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: SNP Statistics may be unsupported Thread-Index: AQHVYwLN9ivAziHPmkqbQ1oFFXvmyqceOYyQ Date: Fri, 6 Sep 2019 07:06:08 +0000 Message-ID: References: <20190904092554.10090-1-xypron.glpk@gmx.de> In-Reply-To: <20190904092554.10090-1-xypron.glpk@gmx.de> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDZjZTVhYjAtMGExMS00MDY2LWFmNTktNDYxYzBhY2RjMmYzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidzBzK1l3bHo5Y3kzV1VNREhDV1BDMytvMldpdGJxZ2hYdWVTUHgyQ1laUmpydENSMUJKUjBaeU9PVEF4RWhtNSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.jin@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Heinrich, 2 comments embedded below. Other is ok to me. Open a new ticket in Bugzilla is better.=20 Best Regards Eric > -----Original Message----- > From: Heinrich Schuchardt > Sent: Wednesday, September 4, 2019 5:26 PM > To: EDK II Development > Cc: Jin, Eric ; Supreeth Venkatesh > ; Stephano Cetola > ; Heinrich Schuchardt > > Subject: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: SNP Statistics may be > unsupported >=20 > If EFI_SIMPLE_NETWORK.Statistics() is not supported, it will return > EFI_UNSUPPORTED. In this case do not expect input parameters to be > checked for conformance. >=20 > Signed-off-by: Heinrich Schuchardt > --- > .../SimpleNetworkBBTestConformance.c | 112 +++++++++++------- > 1 file changed, 72 insertions(+), 40 deletions(-) >=20 > diff --git a/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simpl > eNetworkBBTestConformance.c b/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simpl > eNetworkBBTestConformance.c > index 9d5bec18..ea4a806b 100644 > --- a/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simpl > eNetworkBBTestConformance.c > +++ b/uefi- > sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxT > +++ est/SimpleNetworkBBTestConformance.c > @@ -1015,10 +1015,19 @@ BBTestStatisticsConformanceTest ( > // Call Statistics() function if network interface not start. // S= tatusBuf[0] =3D > SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, > &StatisticsTable);- if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (SnpInt= erface- > >Mode->State =3D=3D EfiSimpleNetworkStopped)) {- AssertionType[0] =3D > EFI_TEST_ASSERTION_PASSED;+ if (StatusBuf[0] =3D=3D EFI_UNSUPPORTED) {+ > StandardLib->RecordMessage(+ StandardLib,+ > EFI_VERBOSE_LEVEL_QUIET,+ L"Statistics isn't supported,= Status - > %r\n",+ StatusBuf[0]+ ); } else {-= AssertionType[0] =3D > EFI_TEST_ASSERTION_FAILED;+ if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) = && > (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkStopped)) {+ > AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED;+ } else {+ > AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED;+ } } //@@ -1031,1= 0 > +1040,19 @@ BBTestStatisticsConformanceTest ( > } StatusBuf[1] =3D SnpInterface->Statistics (SnpInterface, FALSE, > &StatisticsSize, &StatisticsTable);- if (StatusBuf[1] =3D=3D EFI_DEVICE_= ERROR) {- > AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED;+ if (StatusBuf[1] =3D=3D > EFI_UNSUPPORTED) {+ StandardLib->RecordMessage(+ > StandardLib,+ EFI_VERBOSE_LEVEL_QUIET,+ = L"Statistics > isn't supported, Status - %r\n",+ StatusBuf[1]+ = ); } else {- > AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED;+ if (StatusBuf[1] =3D= =3D > EFI_DEVICE_ERROR) {+ AssertionType[1] =3D > EFI_TEST_ASSERTION_PASSED;+ } else {+ AssertionType[1] =3D > EFI_TEST_ASSERTION_FAILED;+ } } @@ -1054,45 +1072,59 @@ > BBTestStatisticsConformanceTest ( > StatisticsSize =3D 0; StatusBuf[2] =3D SnpInterface->Statistics (Sn= pInterface, > FALSE, &StatisticsSize, &StatisticsTable);- if (StatusBuf[2] =3D=3D > EFI_BUFFER_TOO_SMALL || Status =3D=3D EFI_UNSUPPORTED) {- > AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED;+ if (StatusBuf[2] =3D=3D > EFI_UNSUPPORTED) {+ StandardLib->RecordMessage(+ > StandardLib,+ EFI_VERBOSE_LEVEL_QUIET,+ = L"Statistics > isn't supported, Status - %r\n",+ StatusBuf[2]+ = ); } else {- > AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED;+ if (StatusBuf[2] =3D= =3D > EFI_BUFFER_TOO_SMALL || Status =3D=3D EFI_UNSUPPORTED) {+ Status =3D=3D EFI_UNSUPPORTED could be removed from here.=20 > AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED;+ } else {+ > AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED;+ } }=20 Had better move RecordAssertion as early as possible, because=20 SnpInterface->Initialize() may cause return early. + if (StatusBuf[0] !=3D > EFI_UNSUPPORTED) {+ StandardLib->RecordAssertion (+ > StandardLib,+ AssertionType[0],+ > gSimpleNetworkBBTestConformanceAssertionGuid014,+ > L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() when > network interface not start.",+ L"%a:%d:Status - %r",+ > __FILE__,+ (UINTN)__LINE__,+ StatusBu= f[0]+ );+ } > - StandardLib->RecordAssertion (- StandardLib,- > AssertionType[0],- > gSimpleNetworkBBTestConformanceAssertionGuid014,- > L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() when > network interface not start.",- L"%a:%d:Status - %r",- > __FILE__,- (UINTN)__LINE__,- StatusBuf[0]= - );- - > StandardLib->RecordAssertion (- StandardLib,- > AssertionType[1],- > gSimpleNetworkBBTestConformanceAssertionGuid015,- > L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() when > network interface not initialized.",- L"%a:%d:Status - %r= ",- > __FILE__,- (UINTN)__LINE__,- StatusBuf[1]= - );+ if > (StatusBuf[1] !=3D EFI_UNSUPPORTED) {+ StandardLib->RecordAssertion (+ > StandardLib,+ AssertionType[1],+ > gSimpleNetworkBBTestConformanceAssertionGuid015,+ > L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() when > network interface not initialized.",+ L"%a:%d:Status - = %r",+ > __FILE__,+ (UINTN)__LINE__,+ StatusBu= f[1]+ );+ } > - StandardLib->RecordAssertion (- StandardLib,- > AssertionType[2],- > gSimpleNetworkBBTestConformanceAssertionGuid017,- > L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() with small > buffer.",- L"%a:%d:Status - %r",- __FILE_= _,- > (UINTN)__LINE__,- StatusBuf[2]- );+ if (= StatusBuf[2] !=3D > EFI_UNSUPPORTED) {+ StandardLib->RecordAssertion (+ > StandardLib,+ AssertionType[2],+ > gSimpleNetworkBBTestConformanceAssertionGuid017,+ > L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Statistics() with small > buffer.",+ L"%a:%d:Status - %r",+ __F= ILE__,+ > (UINTN)__LINE__,+ StatusBuf[2]+ );+ = } // // Restore > SNP State-- > 2.23.0.rc1