Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-26 Thread Michael Brown

On 26/08/2020 09:31, 丰立波 wrote:

Thank for the support.

I skip the bs->DisconnectController in the function of 
efi_driver_connect, and my all protocols installed on a NIC controller 
can be kept. When bs->ConnectController is called, there already exist 
the SNP protocol, a new SNP protocol can't be installed. by this way, my 
own SNP protocol can keep on and serve others.


You seem to be ignoring what I am telling you.

Again:

* Your custom UEFI driver stack has the incorrect hierarchy of handles.

* Your SNP driver should bind to a hardware device handle and then 
install EFI_SIMPLE_NETWORK_PROTOCOL onto a new handle.


You must first fix your own SNP driver as I have described.

Your SNP driver will then work with iPXE as expected, without any hacks 
such as skipping the call to bs->DisconnectController.


Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-26 Thread 丰立波
Hello, Michael,


Thank for the support.


I skip the bs->DisconnectController in the function of efi_driver_connect, and 
my all protocols installed on a NIC controller can be kept. When 
bs->ConnectController is called, there already exist the SNP protocol, a new 
SNP protocol can't be installed. by this way, my own SNP protocol can keep on 
and serve others.


Thanks 


--

Best Regards


Feng Libo
ZD Technology (Beijing) Co., Ltd



发件人:"Michael Brown" 
发送日期:2020-08-25 21:27:11
收件人:"丰立波" 
抄送人:"Christian Nilsson" ,iPXE 
主题:Re: [ipxe-devel] can snponly.efi run without NII protocol installed?>On 
25/08/2020 07:35, 丰立波 wrote:
>> MAC(3C6A2CB0886A, 0x1) is a hardware device, but not on a PCIe bus. Can 
>> iPxe install its own SNP protocol on this kind of device? or iPxe just 
>> use the original SNP protocol on the hardware device?
>
>As I stated in my previous message:
>
>It looks as though your custom UEFI driver stack has the incorrect 
>hierarchy of handles.  My guess is that you may have some 
>platform-specific driver providing the MAC(3C6A2CB0866A,0x1) handle as 
>though it were a hardware device, and that your SNP driver then binds to 
>this existing handle and installs EFI_SIMPLE_NETWORK_PROTOCOL as an 
>additional protocol.
>
>This would be incorrect behaviour: the SNP driver should bind to a 
>hardware device handle and then install EFI_SIMPLE_NETWORK_PROTOCOL onto 
>a new handle.
>
>Try building with DEBUG=efi_driver:3 (which will dump additional 
>information about the handle before and after disconnection).
>
>Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-25 Thread Michael Brown

On 25/08/2020 07:35, 丰立波 wrote:
MAC(3C6A2CB0886A, 0x1) is a hardware device, but not on a PCIe bus. Can 
iPxe install its own SNP protocol on this kind of device? or iPxe just 
use the original SNP protocol on the hardware device?


As I stated in my previous message:

It looks as though your custom UEFI driver stack has the incorrect 
hierarchy of handles.  My guess is that you may have some 
platform-specific driver providing the MAC(3C6A2CB0866A,0x1) handle as 
though it were a hardware device, and that your SNP driver then binds to 
this existing handle and installs EFI_SIMPLE_NETWORK_PROTOCOL as an 
additional protocol.


This would be incorrect behaviour: the SNP driver should bind to a 
hardware device handle and then install EFI_SIMPLE_NETWORK_PROTOCOL onto 
a new handle.


Try building with DEBUG=efi_driver:3 (which will dump additional 
information about the handle before and after disconnection).


Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-24 Thread 丰立波
Hello, Michael,


MAC(3C6A2CB0886A, 0x1) is a hardware device, but not on a PCIe bus. Can iPxe 
install its own SNP protocol on this kind of device? or iPxe just use the 
original SNP protocol on the hardware device?


Thanks


--

Best Regards


Feng Libo
ZD Technology (Beijing) Co., Ltd



发件人:"Michael Brown" 
发送日期:2020-08-24 18:52:45
收件人:"丰立波" ,"Christian Nilsson" 
抄送人:iPXE 
主题:Re: [ipxe-devel] can snponly.efi run without NII protocol installed?>On 
20/08/2020 10:28, 丰立波 wrote:
>> I get a screenshot for debugging:
>> I think iPxe tried to replace the SNP protocol of my UEFI land with its 
>> own SNP driver(the driver code is in the directory of 
>> ipxe/src/drivers/net/efi/), first ipxe disconnect the my uefi driver, 
>> then connect its own driver, but at this point, connection failed.
>> 
>> There are two questions:
>> 1. why the new connection failed?
>> 2. Why iPXE try to replace my uefi driver, could iPxe just use the 
>> original driver? Thanks.
>
>iPXE needs to disconnect other drivers (e.g. MnpDxe) from the SNP 
>handle, so that it can have exclusive access to the network device.
>
> From the screenshot it looks as though your custom UEFI driver stack 
>has the incorrect hierarchy of handles.  My guess is that you may have 
>some platform-specific driver providing the MAC(3C6A2CB0866A,0x1) handle 
>as though it were a hardware device, and that your SNP driver then binds 
>to this existing handle and installs EFI_SIMPLE_NETWORK_PROTOCOL as an 
>additional protocol.
>
>This would be incorrect behaviour: the SNP driver should bind to a 
>hardware device handle and then install EFI_SIMPLE_NETWORK_PROTOCOL onto 
>a new handle.  You can see this in action on a standard x86 UEFI system: 
>the hardware device handle will be e.g.
>
>   PciRoot(0x0)/Pci(0x3,0x0)
>
>and the SNP device handle will then be e.g.
>
>   PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1).
>
>Try building with DEBUG=efi_driver:3 (which will dump additional 
>information about the handle before and after disconnection).
>
>Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-24 Thread Michael Brown

On 24/08/2020 10:34, 丰立波 wrote:
I get more trace, please take a look at the screenshot attached. In the 
function of efi_set_autoboot, a SNP protocol can be found on my NIC 
device handle, the local SNP protocol. Then, in the function of 
chained_supported, the SNP procotocol can still be found on my NIC 
device handle. However, later, in the function of startup in the file of 
init.c, the function of snpnet_start isn't listed in the startup 
function table, snpnet_start is not called. so, what wrong with it?


snpnet_start is unrelated to the startup functions handled by init.c. 
"git grep snpnet_start" will show you that snpnet_start is used as the 
.start method for struct efi_driver snp_driver in snp.c.


See my other email for suggested next debugging steps.

Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-24 Thread Michael Brown

On 20/08/2020 10:28, 丰立波 wrote:

I get a screenshot for debugging:
I think iPxe tried to replace the SNP protocol of my UEFI land with its 
own SNP driver(the driver code is in the directory of 
ipxe/src/drivers/net/efi/), first ipxe disconnect the my uefi driver, 
then connect its own driver, but at this point, connection failed.


There are two questions:
1. why the new connection failed?
2. Why iPXE try to replace my uefi driver, could iPxe just use the 
original driver? Thanks.


iPXE needs to disconnect other drivers (e.g. MnpDxe) from the SNP 
handle, so that it can have exclusive access to the network device.


From the screenshot it looks as though your custom UEFI driver stack 
has the incorrect hierarchy of handles.  My guess is that you may have 
some platform-specific driver providing the MAC(3C6A2CB0866A,0x1) handle 
as though it were a hardware device, and that your SNP driver then binds 
to this existing handle and installs EFI_SIMPLE_NETWORK_PROTOCOL as an 
additional protocol.


This would be incorrect behaviour: the SNP driver should bind to a 
hardware device handle and then install EFI_SIMPLE_NETWORK_PROTOCOL onto 
a new handle.  You can see this in action on a standard x86 UEFI system: 
the hardware device handle will be e.g.


  PciRoot(0x0)/Pci(0x3,0x0)

and the SNP device handle will then be e.g.

  PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1).

Try building with DEBUG=efi_driver:3 (which will dump additional 
information about the handle before and after disconnection).


Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-24 Thread 丰立波
Hello, everyone,
I get more trace, please take a look at the screenshot attached. In the 
function of efi_set_autoboot, a SNP protocol can be found on my NIC device 
handle, the local SNP protocol. Then, in the function of chained_supported, the 
SNP procotocol can still be found on my NIC device handle. However, later, in 
the function of startup in the file of init.c, the function of snpnet_start 
isn't listed in the startup function table, snpnet_start is not called. so, 
what wrong with it? 

Thanks.___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-24 Thread 丰立波
Hello, everyone,


I get more trace, please take a look at the screenshot attached. In the 
function of efi_set_autoboot, a SNP protocol can be found on my NIC device 
handle, the local SNP protocol. Then, in the function of chained_supported, the 
SNP procotocol can still be found on my NIC device handle. However, later, in 
the function of startup in the file of init.c, the function of snpnet_start 
isn't listed in the startup function table, snpnet_start is not called. so, 
what wrong with it? 


Thanks.


--

Best Regards


Feng Libo
ZD Technology (Beijing) Co., Ltd___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-19 Thread Christian Nilsson
On Wed, 19 Aug 2020 at 15:26, Michael Brown  wrote:

> On 19/08/2020 11:48, 丰立波 wrote:
> > The network interface controller in our platform only installs the SNP
> > protocol, not install NII protocol. Is snponly.efi dependent on NII
> > porotocol? now after chainloading snponly.efi, the function of autoboot
> > can't find any network device in our platform, and then enter the shell.
> > Is NII protocol necessary for the snponly.efi?
>
> No, you do not need an NII protocol.  iPXE will work with your
> platform's SNP protocol.
>
> You can build iPXE with DEBUG=efi_driver,snpnet to see any errors
> arising during detection of the NIC.
>
> Michael
>

Could it be a case of snponly not being chained via the nic, as such it
will not try to initialize the device with snponly (or is that not an
issue, and only relevant for undi)?
If that is the case snp should work just fine. (but detect all nics instead)
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


Re: [ipxe-devel] can snponly.efi run without NII protocol installed?

2020-08-19 Thread Michael Brown

On 19/08/2020 11:48, 丰立波 wrote:
The network interface controller in our platform only installs the SNP 
protocol, not install NII protocol. Is snponly.efi dependent on NII 
porotocol? now after chainloading snponly.efi, the function of autoboot 
can't find any network device in our platform, and then enter the shell. 
Is NII protocol necessary for the snponly.efi?


No, you do not need an NII protocol.  iPXE will work with your 
platform's SNP protocol.


You can build iPXE with DEBUG=efi_driver,snpnet to see any errors 
arising during detection of the NIC.


Michael
___
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel