From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=supreeth.venkatesh@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 8751121B02822 for ; Tue, 16 Oct 2018 02:48:38 -0700 (PDT) Received: by usa-sjc-mx-foss1.foss.arm.com (Postfix, from userid 105) id B674A3632; Tue, 16 Oct 2018 03:03:34 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7F02734FD; Sun, 14 Oct 2018 19:30:26 -0700 (PDT) Received: from [10.6.43.238] (bc-c3-3-14.eu.iaas.arm.com [10.6.43.238]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3EA433F5B1; Sun, 14 Oct 2018 19:30:05 -0700 (PDT) To: Eric Jin , edk2-devel@lists.01.org Cc: Jiaxin Wu References: <20181014020649.1612-1-eric.jin@intel.com> From: Supreeth Venkatesh Message-ID: <7d32f351-888f-d0a3-f134-7bf9aca96eb3@arm.com> Date: Mon, 15 Oct 2018 03:30:03 +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: <20181014020649.1612-1-eric.jin@intel.com> Subject: Re: [PATCH] uefi-sct/SctPkg:Enhance the SimpleNetwork Test X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 09:48:38 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US On 10/14/2018 03:06 AM, Eric Jin wrote: > Add the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit in the Enable parameter > Add one checkpoint to MCastFilterCount is zero > > Cc: Supreeth Venkatesh > Cc: Jiaxin Wu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Jin > --- > .../SimpleNetwork/BlackBoxTest/Guid.c | 4 +- > .../SimpleNetwork/BlackBoxTest/Guid.h | 7 +- > .../SimpleNetworkBBTestConformance.c | 66 +++++++++++++------ > .../SimpleNetwork/BlackBoxTest/Guid.c | 4 +- > .../SimpleNetwork/BlackBoxTest/Guid.h | 7 +- > .../SimpleNetworkBBTestConformance.c | 66 +++++++++++++------ > 6 files changed, 110 insertions(+), 44 deletions(-) > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c > index 6ea6c4cb..72343236 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c > @@ -1,7 +1,7 @@ > /** @file > > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -112,6 +112,8 @@ EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041 = EFI_TEST_SIMPLENETWOR > > EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_042_GUID; > > +EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID; > + > EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid001 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID; > > EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid002 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_002_GUID; > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h > index 281d893a..bf909d1c 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h > @@ -1,7 +1,7 @@ > /** @file > > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -235,6 +235,11 @@ extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041; > > extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042; > > +#define EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID \ > +{ 0x8cec0b86, 0x7773, 0x4d3c, {0x84, 0x13, 0x26, 0x37, 0xfb, 0xd0, 0x8e, 0x1b }} > + > +extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043; > + > #define EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID \ > { 0xf58651fe, 0x0538, 0x4407, {0x88, 0xe0, 0x88, 0xb8, 0xda, 0x18, 0x38, 0x3a }} > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c > index ccbbad08..b65d7d3b 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c > @@ -1,7 +1,7 @@ > /** @file > > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -581,11 +581,12 @@ BBTestReceiveFilterConformanceTest ( > { > EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; > EFI_STATUS Status; > - EFI_STATUS StatusBuf[5]; > - EFI_TEST_ASSERTION AssertionType[5]; > + EFI_STATUS StatusBuf[6]; Magic Number 6. > + EFI_TEST_ASSERTION AssertionType[6]; Magic number 6. > EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; > EFI_SIMPLE_NETWORK_STATE State1, State2; > - > + EFI_MAC_ADDRESS MAC; > + > // > // Get the Standard Library Interface > // > @@ -673,23 +674,37 @@ BBTestReceiveFilterConformanceTest ( > // > // Call ReceiveFilters with invalide MCastFilterCnt > // > - StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, NULL); > - if (StatusBuf[3] == EFI_INVALID_PARAMETER) { > - AssertionType[3] = EFI_TEST_ASSERTION_PASSED; > - } else { > - AssertionType[3] = EFI_TEST_ASSERTION_FAILED; > - } > + if ((SnpInterface->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) { > + SctSetMem (&MAC, sizeof (MAC), 0x00); > + MAC.Addr[0] = 0x01; > + MAC.Addr[1] = 0x00; > + MAC.Addr[2] = 0x5e; > + MAC.Addr[3] = 0x00; > + MAC.Addr[4] = 0x00; > + MAC.Addr[5] = 0x02; > > - // > - // Call ReceiveFilters with MCastFilterCnt not match MCastFilter > - // > - StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 1, NULL); > - if (StatusBuf[4] == EFI_INVALID_PARAMETER) { > - AssertionType[4] = EFI_TEST_ASSERTION_PASSED; > - } else { > - AssertionType[4] = EFI_TEST_ASSERTION_FAILED; > - } > + StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, &MAC); Magic Number 3. > + if (StatusBuf[3] == EFI_INVALID_PARAMETER) { > + AssertionType[3] = EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType[3] = EFI_TEST_ASSERTION_FAILED; > + } Magic Number 3 in above block. > > + StatusBuf[5] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 0, &MAC); > + if (StatusBuf[5] == EFI_INVALID_PARAMETER) { > + AssertionType[5] = EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType[5] = EFI_TEST_ASSERTION_FAILED; > + } Magic Number 5 in above block. > + > + StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 1, NULL); > + if (StatusBuf[4] == EFI_INVALID_PARAMETER) { > + AssertionType[4] = EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType[4] = EFI_TEST_ASSERTION_FAILED; > + } > + > + } Magic Number 4 in above block. > > StandardLib->RecordAssertion ( > StandardLib, > @@ -728,7 +743,7 @@ BBTestReceiveFilterConformanceTest ( > StandardLib, > AssertionType[3], > gSimpleNetworkBBTestConformanceAssertionGuid009, > - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt.", > + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode->MaxMCastFilterCount.", > L"%a:%d:Status - %r", > __FILE__, > (UINTN)__LINE__, > @@ -746,6 +761,17 @@ BBTestReceiveFilterConformanceTest ( > StatusBuf[4] > ); > > + StandardLib->RecordAssertion ( > + StandardLib, > + AssertionType[5], > + gSimpleNetworkBBTestConformanceAssertionGuid043, > + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is 0.", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + StatusBuf[5] Magic Number 5. > + ); > + > // > // Restore SNP State > // > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c > index 6ea6c4cb..72343236 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.c > @@ -1,7 +1,7 @@ > /** @file > > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -112,6 +112,8 @@ EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041 = EFI_TEST_SIMPLENETWOR > > EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_042_GUID; > > +EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043 = EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID; > + > EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid001 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID; > > EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid002 = EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_002_GUID; > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h > index 27728964..1a6b8880 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h > +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/Guid.h > @@ -1,7 +1,7 @@ > /** @file > > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -235,6 +235,11 @@ extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041; > > extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042; > > +#define EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID \ > +{ 0x8cec0b86, 0x7773, 0x4d3c, {0x84, 0x13, 0x26, 0x37, 0xfb, 0xd0, 0x8e, 0x1b }} > + > +extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043; > + > #define EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID \ > { 0xf58651fe, 0x0538, 0x4407, 0x88, 0xe0, 0x88, 0xb8, 0xda, 0x18, 0x38, 0x3a } > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c > index ccbbad08..b65d7d3b 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c > @@ -1,7 +1,7 @@ > /** @file > > Copyright 2006 - 2016 Unified EFI, Inc.
> - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -581,11 +581,12 @@ BBTestReceiveFilterConformanceTest ( > { > EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; > EFI_STATUS Status; > - EFI_STATUS StatusBuf[5]; > - EFI_TEST_ASSERTION AssertionType[5]; > + EFI_STATUS StatusBuf[6]; > + EFI_TEST_ASSERTION AssertionType[6]; Magic Number 6. > EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; > EFI_SIMPLE_NETWORK_STATE State1, State2; > - > + EFI_MAC_ADDRESS MAC; > + > // > // Get the Standard Library Interface > // > @@ -673,23 +674,37 @@ BBTestReceiveFilterConformanceTest ( > // > // Call ReceiveFilters with invalide MCastFilterCnt > // > - StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, NULL); > - if (StatusBuf[3] == EFI_INVALID_PARAMETER) { > - AssertionType[3] = EFI_TEST_ASSERTION_PASSED; > - } else { > - AssertionType[3] = EFI_TEST_ASSERTION_FAILED; > - } > + if ((SnpInterface->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) { > + SctSetMem (&MAC, sizeof (MAC), 0x00); > + MAC.Addr[0] = 0x01; > + MAC.Addr[1] = 0x00; > + MAC.Addr[2] = 0x5e; > + MAC.Addr[3] = 0x00; > + MAC.Addr[4] = 0x00; > + MAC.Addr[5] = 0x02; Why this Value? > > > - // > - // Call ReceiveFilters with MCastFilterCnt not match MCastFilter > - // > - StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 1, NULL); > - if (StatusBuf[4] == EFI_INVALID_PARAMETER) { > - AssertionType[4] = EFI_TEST_ASSERTION_PASSED; > - } else { > - AssertionType[4] = EFI_TEST_ASSERTION_FAILED; > - } > + StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCount + 1, &MAC); > + if (StatusBuf[3] == EFI_INVALID_PARAMETER) { > + AssertionType[3] = EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType[3] = EFI_TEST_ASSERTION_FAILED; > + } Magic Number 3 in above block. > > + StatusBuf[5] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 0, &MAC); > + if (StatusBuf[5] == EFI_INVALID_PARAMETER) { > + AssertionType[5] = EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType[5] = EFI_TEST_ASSERTION_FAILED; > + } Magic Number 5 in above block. > + > + StatusBuf[4] = SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, 0, FALSE, 1, NULL); > + if (StatusBuf[4] == EFI_INVALID_PARAMETER) { > + AssertionType[4] = EFI_TEST_ASSERTION_PASSED; > + } else { > + AssertionType[4] = EFI_TEST_ASSERTION_FAILED; > + } > + > + } Magic Number 4 in above block. > > StandardLib->RecordAssertion ( > StandardLib, > @@ -728,7 +743,7 @@ BBTestReceiveFilterConformanceTest ( > StandardLib, > AssertionType[3], > gSimpleNetworkBBTestConformanceAssertionGuid009, > - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt.", > + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode->MaxMCastFilterCount.", > L"%a:%d:Status - %r", > __FILE__, > (UINTN)__LINE__, > @@ -746,6 +761,17 @@ BBTestReceiveFilterConformanceTest ( > StatusBuf[4] > ); > > + StandardLib->RecordAssertion ( > + StandardLib, > + AssertionType[5], Magic Number 5. > + gSimpleNetworkBBTestConformanceAssertionGuid043, > + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() with invalid MCastFilterCnt is 0.", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + StatusBuf[5] Magic Number 5. > + ); > + > // > // Restore SNP State > //