mbox series

[0/3] efi_selftest: Update SIMPLE_NETWORK_PROTOCOL selftest

Message ID 163178239865.65790.17211919979018423637.stgit@localhost
Headers show
Series efi_selftest: Update SIMPLE_NETWORK_PROTOCOL selftest | expand

Message

Masami Hiramatsu Sept. 16, 2021, 8:53 a.m. UTC
Hello Heinrich,

Here is a series of patches to update the SIMPLE_NETWORK_PROTOCOL
according to the explanation in the previous thread [1].

[1] https://lists.denx.de/pipermail/u-boot/2021-September/460711.html

So basically this seires modifies the SNP testcase as I said
in the previous mail [1].

----
net->get_status();
if (!net->mode.MediaPresent) {
   error(no link up!)
   return;
}

submit_dhcp_discover()
for (;;) {
   wait_for_event(net)
   while (net->receive() != EFI_NOT_READY) {
      // check dhcp reply
   }
}
----

I removed EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT check because
that is just expectation what the received packet avaiability
is meaning that the EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT flag
bit is set. Of course U-Boot EFI SNP implementation does it,
but that is not ensured in the UEFI spec. The spec said that
the get_status() should update the MediaPresent flag (which
means the network link up or down). So I added the get_status()
test case before starting the network test so that it can
test the link status.

BTW, actually the mode->media_present is not supported yet.
Is there any way to get the network link status?

Thank you,

---

Masami Hiramatsu (3):
      efi_selftest: Use EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() for media check
      efi_selftest: Do not check EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT
      efi_selftest: Recieve the packets until the receive buffer is empty


 lib/efi_selftest/efi_selftest_snp.c |   90 +++++++++++++++++++----------------
 1 file changed, 49 insertions(+), 41 deletions(-)

--
Masami Hiramatsu <masami.hiramatsu@linaro.org>

Comments

Heinrich Schuchardt Sept. 17, 2021, 3:54 a.m. UTC | #1
On 9/16/21 10:53 AM, Masami Hiramatsu wrote:
> Hello Heinrich,

>

> Here is a series of patches to update the SIMPLE_NETWORK_PROTOCOL

> according to the explanation in the previous thread [1].

>

> [1] https://lists.denx.de/pipermail/u-boot/2021-September/460711.html

>

> So basically this seires modifies the SNP testcase as I said

> in the previous mail [1].

>

> ----

> net->get_status();

> if (!net->mode.MediaPresent) {

>     error(no link up!)

>     return;

> }

>

> submit_dhcp_discover()

> for (;;) {

>     wait_for_event(net)

>     while (net->receive() != EFI_NOT_READY) {

>        // check dhcp reply

>     }

> }

> ----

>

> I removed EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT check because

> that is just expectation what the received packet avaiability

> is meaning that the EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT flag

> bit is set. Of course U-Boot EFI SNP implementation does it,

> but that is not ensured in the UEFI spec. The spec said that


SN_GetStatus() in edk2-platforms
Drivers/ASIX/Bus/Usb/UsbNetworking/Ax88179/SimpleNetwork.c always
returns *InterruptStatus = 0.

> the get_status() should update the MediaPresent flag (which

> means the network link up or down). So I added the get_status()

> test case before starting the network test so that it can

> test the link status.

>

> BTW, actually the mode->media_present is not supported yet.

> Is there any way to get the network link status?


The driver interface struct eth_ops has no method for determining media
presence. We have to assume that it is always present.

Best regards

Heinrich

>

> Thank you,

>

> ---

>

> Masami Hiramatsu (3):

>        efi_selftest: Use EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() for media check

>        efi_selftest: Do not check EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT

>        efi_selftest: Recieve the packets until the receive buffer is empty

>

>

>   lib/efi_selftest/efi_selftest_snp.c |   90 +++++++++++++++++++----------------

>   1 file changed, 49 insertions(+), 41 deletions(-)

>

> --

> Masami Hiramatsu <masami.hiramatsu@linaro.org>

>
Masami Hiramatsu Sept. 17, 2021, 4:47 a.m. UTC | #2
Hi Heinrich,

2021年9月17日(金) 12:54 Heinrich Schuchardt <xypron.glpk@gmx.de>:
>

> On 9/16/21 10:53 AM, Masami Hiramatsu wrote:

> > Hello Heinrich,

> >

> > Here is a series of patches to update the SIMPLE_NETWORK_PROTOCOL

> > according to the explanation in the previous thread [1].

> >

> > [1] https://lists.denx.de/pipermail/u-boot/2021-September/460711.html

> >

> > So basically this seires modifies the SNP testcase as I said

> > in the previous mail [1].

> >

> > ----

> > net->get_status();

> > if (!net->mode.MediaPresent) {

> >     error(no link up!)

> >     return;

> > }

> >

> > submit_dhcp_discover()

> > for (;;) {

> >     wait_for_event(net)

> >     while (net->receive() != EFI_NOT_READY) {

> >        // check dhcp reply

> >     }

> > }

> > ----

> >

> > I removed EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT check because

> > that is just expectation what the received packet avaiability

> > is meaning that the EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT flag

> > bit is set. Of course U-Boot EFI SNP implementation does it,

> > but that is not ensured in the UEFI spec. The spec said that

>

> SN_GetStatus() in edk2-platforms

> Drivers/ASIX/Bus/Usb/UsbNetworking/Ax88179/SimpleNetwork.c always

> returns *InterruptStatus = 0.


Yes, it seems to depend on driver implementation.

>

> > the get_status() should update the MediaPresent flag (which

> > means the network link up or down). So I added the get_status()

> > test case before starting the network test so that it can

> > test the link status.

> >

> > BTW, actually the mode->media_present is not supported yet.

> > Is there any way to get the network link status?

>

> The driver interface struct eth_ops has no method for determining media

> presence. We have to assume that it is always present.


Hmm, OK. So we can not implement it...

Thank you,

>

> Best regards

>

> Heinrich

>

> >

> > Thank you,

> >

> > ---

> >

> > Masami Hiramatsu (3):

> >        efi_selftest: Use EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() for media check

> >        efi_selftest: Do not check EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT

> >        efi_selftest: Recieve the packets until the receive buffer is empty

> >

> >

> >   lib/efi_selftest/efi_selftest_snp.c |   90 +++++++++++++++++++----------------

> >   1 file changed, 49 insertions(+), 41 deletions(-)

> >

> > --

> > Masami Hiramatsu <masami.hiramatsu@linaro.org>

> >

>



-- 
Masami Hiramatsu
Masami Hiramatsu Oct. 4, 2021, 5:08 a.m. UTC | #3
Hi Heinrich,

What is the current status of this patch series?
Could you give me any comments?

Thank you,

2021年9月17日(金) 13:47 Masami Hiramatsu <masami.hiramatsu@linaro.org>:
>

> Hi Heinrich,

>

> 2021年9月17日(金) 12:54 Heinrich Schuchardt <xypron.glpk@gmx.de>:

> >

> > On 9/16/21 10:53 AM, Masami Hiramatsu wrote:

> > > Hello Heinrich,

> > >

> > > Here is a series of patches to update the SIMPLE_NETWORK_PROTOCOL

> > > according to the explanation in the previous thread [1].

> > >

> > > [1] https://lists.denx.de/pipermail/u-boot/2021-September/460711.html

> > >

> > > So basically this seires modifies the SNP testcase as I said

> > > in the previous mail [1].

> > >

> > > ----

> > > net->get_status();

> > > if (!net->mode.MediaPresent) {

> > >     error(no link up!)

> > >     return;

> > > }

> > >

> > > submit_dhcp_discover()

> > > for (;;) {

> > >     wait_for_event(net)

> > >     while (net->receive() != EFI_NOT_READY) {

> > >        // check dhcp reply

> > >     }

> > > }

> > > ----

> > >

> > > I removed EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT check because

> > > that is just expectation what the received packet avaiability

> > > is meaning that the EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT flag

> > > bit is set. Of course U-Boot EFI SNP implementation does it,

> > > but that is not ensured in the UEFI spec. The spec said that

> >

> > SN_GetStatus() in edk2-platforms

> > Drivers/ASIX/Bus/Usb/UsbNetworking/Ax88179/SimpleNetwork.c always

> > returns *InterruptStatus = 0.

>

> Yes, it seems to depend on driver implementation.

>

> >

> > > the get_status() should update the MediaPresent flag (which

> > > means the network link up or down). So I added the get_status()

> > > test case before starting the network test so that it can

> > > test the link status.

> > >

> > > BTW, actually the mode->media_present is not supported yet.

> > > Is there any way to get the network link status?

> >

> > The driver interface struct eth_ops has no method for determining media

> > presence. We have to assume that it is always present.

>

> Hmm, OK. So we can not implement it...

>

> Thank you,

>

> >

> > Best regards

> >

> > Heinrich

> >

> > >

> > > Thank you,

> > >

> > > ---

> > >

> > > Masami Hiramatsu (3):

> > >        efi_selftest: Use EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() for media check

> > >        efi_selftest: Do not check EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT

> > >        efi_selftest: Recieve the packets until the receive buffer is empty

> > >

> > >

> > >   lib/efi_selftest/efi_selftest_snp.c |   90 +++++++++++++++++++----------------

> > >   1 file changed, 49 insertions(+), 41 deletions(-)

> > >

> > > --

> > > Masami Hiramatsu <masami.hiramatsu@linaro.org>

> > >

> >

>

>

> --

> Masami Hiramatsu




-- 
Masami Hiramatsu