Skip to contentSkip to conversation

efinet SNP issue affects iscsi boot

DISCUSSION Micah Parrish 3 participants 5 messages Sep 14, 2018 – Sep 27, 2018

lore
Share & tools
lore
#0 lore raw

Hi, new subscriber here.  We have a problem with Grub 2 and its use of SNP instead of MNP.  Our UEFI driver for a network card parses the relevant DHCP options for iSCSI boot, generates an iBFT table, then gets closed by Grub when it opens the SNP interface. The driver removes the iBFT table as part of normal unload cleanup.  I think this should happen with the Tianocore UEFI reference driver as well.  The problem is often masked or does not occur when there are multiple network ports enabled.  It occurs with several different vendors NICs.

Possible solutions I see:

1. Grub parses the DHCP options and creates its own iBFT.

2. Grub copies the already generated iBFT before destroying the interface.

3. Grub opens the network interface MNP instead of SNP.

Although I am a neophyte at grub and UEFI development, I would like to start a discussion on possible solutions.  Has anyone else seen this?

Micah Parrish
[email protected]
Linux OS Engineer
Hewlett-Packard Enterprise

#1 lore raw
Quoted 11 lines · Micah Parrish

Hi, new subscriber here.  We have a problem with Grub 2 and its use of SNP instead of MNP.  Our UEFI driver for a network card parses the relevant DHCP options for iSCSI boot, generates an iBFT table, then gets closed by Grub when it opens the SNP interface. The driver removes the iBFT table as part of normal unload cleanup.  I think this should happen with the Tianocore UEFI reference driver as well.  The problem is often masked or does not occur when there are multiple network ports enabled.  It occurs with several different vendors NICs.

Possible solutions I see:

Quoted 8 lines

1. Grub parses the DHCP options and creates its own iBFT.

2. Grub copies the already generated iBFT before destroying the interface.

3. Grub opens the network interface MNP instead of SNP.

Although I am a neophyte at grub and UEFI development, I would like to start a discussion on possible solutions.  Has anyone else seen this?

For possible solution 3, I managed to work out patch to use MNP but is not polished, although it survived my testing. If you don't mind and willing to give it go I will post it here as RFC patch for review.

Thanks,
Michael

Quoted 12 lines

Micah Parrish
[email protected]
Linux OS Engineer
Hewlett-Packard Enterprise

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
Quoted 16 lines · Michael Chang
Quoted 15 lines · Micah Parrish

Hi, new subscriber here.? We have a problem with Grub 2 and its use of SNP instead of MNP.? Our UEFI driver for a network card parses the relevant DHCP options for iSCSI boot, generates an iBFT table, then gets closed by Grub when it opens the SNP interface. The driver removes the iBFT table as part of normal unload cleanup.? I think this should happen with the Tianocore UEFI reference driver as well.? The problem is often masked or does not occur when there are multiple network ports enabled.? It occurs with several different vendors NICs.

Possible solutions I see:

1. Grub parses the DHCP options and creates its own iBFT.

2. Grub copies the already generated iBFT before destroying the interface.

Quoted 8 lines
Quoted 4 lines

3. Grub opens the network interface MNP instead of SNP.

Although I am a neophyte at grub and UEFI development, I would like to start a discussion on possible solutions.? Has anyone else seen this?

For possible solution 3, I managed to work out patch to use MNP but is not polished, although it survived my testing. If you don't mind and willing to give it go I will post it here as RFC patch for review.

That would be perfect. However, there are a few things worth mentioning here.

The issue is never ending story. So, please look for relevant discussions in grub-devel archives and take them into account if it is possible/make sense. If you have any difficulties with finding them drop me a line.

Please do not drop SNP driver. I think that we should make MNP driver a new default and SNP should stay as a backup. Just in case.

Additionally, a few days ago I have started looking for people interested in the project. There are some. Hence, if you are going to take a stab at it I will ask them to do some reviews of your work. I will drop you their emails if they are happy to do so.

Daniel

#3 lore raw
Quoted 26 lines · Daniel Kiper
Quoted 16 lines · Michael Chang
Quoted 15 lines · Micah Parrish

Hi, new subscriber here.? We have a problem with Grub 2 and its use of SNP instead of MNP.? Our UEFI driver for a network card parses the relevant DHCP options for iSCSI boot, generates an iBFT table, then gets closed by Grub when it opens the SNP interface. The driver removes the iBFT table as part of normal unload cleanup.? I think this should happen with the Tianocore UEFI reference driver as well.? The problem is often masked or does not occur when there are multiple network ports enabled.? It occurs with several different vendors NICs.

Possible solutions I see:

1. Grub parses the DHCP options and creates its own iBFT.

2. Grub copies the already generated iBFT before destroying the interface.

Quoted 8 lines
Quoted 4 lines

3. Grub opens the network interface MNP instead of SNP.

Although I am a neophyte at grub and UEFI development, I would like to start a discussion on possible solutions.? Has anyone else seen this?

For possible solution 3, I managed to work out patch to use MNP but is not polished, although it survived my testing. If you don't mind and willing to give it go I will post it here as RFC patch for review.

Quoted 5 lines

That would be perfect. However, there are a few things worth mentioning here.

The issue is never ending story. So, please look for relevant discussions in grub-devel archives and take them into account if it is possible/make sense. If you have any difficulties with finding them drop me a line.

Thanks. I'm able to find those discussions in my mailbox. They are indeed very helpful for me in catching up the problems.

Moreover I found that Laszlo Ersek <[email protected]> already proposed an approach which is very close to what I was working on,

- identify NIC handles the same way you do now (I guess by enumerating SNP interfaces)
- for each handle found, look for MNPSB *first*.
- If there is no MNPSB, then stick with the current strategy -- open the SNP with exclusive access
- However, if there *is* an MNPSB, call the CreateChild() function to extract a new MNP instance
- Use this MNP instance to send and receive packets. This MNP instance will peacefully coexist with other (sibling) MNP clients.

Quoted 2 lines

Please do not drop SNP driver. I think that we should make MNP driver a new default and SNP should stay as a backup. Just in case.

Yes. The patch has been worked the way you asked.

Quoted 4 lines

Additionally, a few days ago I have started looking for people interested in the project. There are some. Hence, if you are going to take a stab at it I will ask them to do some reviews of your work. I will drop you their emails if they are happy to do so.

Please feel free to CC them to the discussion.

Thanks,
Michael

Quoted 2 lines

Daniel

#4 lore raw
Quoted 39 lines · Michael Chang
Quoted 26 lines · Daniel Kiper
Quoted 16 lines · Michael Chang
Quoted 15 lines · Micah Parrish

Hi, new subscriber here.? We have a problem with Grub 2 and its use of SNP instead of MNP.? Our UEFI driver for a network card parses the relevant DHCP options for iSCSI boot, generates an iBFT table, then gets closed by Grub when it opens the SNP interface. The driver removes the iBFT table as part of normal unload cleanup.? I think this should happen with the Tianocore UEFI reference driver as well.? The problem is often masked or does not occur when there are multiple network ports enabled.? It occurs with several different vendors NICs.

Possible solutions I see:

1. Grub parses the DHCP options and creates its own iBFT.

2. Grub copies the already generated iBFT before destroying the interface.

Quoted 8 lines
Quoted 4 lines

3. Grub opens the network interface MNP instead of SNP.

Although I am a neophyte at grub and UEFI development, I would like to start a discussion on possible solutions.? Has anyone else seen this?

For possible solution 3, I managed to work out patch to use MNP but is not polished, although it survived my testing. If you don't mind and willing to give it go I will post it here as RFC patch for review.

Quoted 5 lines

That would be perfect. However, there are a few things worth mentioning here.

The issue is never ending story. So, please look for relevant discussions in grub-devel archives and take them into account if it is possible/make sense. If you have any difficulties with finding them drop me a line.

Thanks. I'm able to find those discussions in my mailbox. They are indeed very helpful for me in catching up the problems.

Moreover I found that Laszlo Ersek <[email protected]> already proposed an approach which is very close to what I was working on,

Quoted 9 lines

- identify NIC handles the same way you do now (I guess by enumerating SNP interfaces)
- for each handle found, look for MNPSB *first*.
- If there is no MNPSB, then stick with the current strategy -- open the SNP with exclusive access
- However, if there *is* an MNPSB, call the CreateChild() function to extract a new MNP instance
- Use this MNP instance to send and receive packets. This MNP instance will peacefully coexist with other (sibling) MNP clients.

More or less LGTM.

Quoted 4 lines
Quoted 2 lines

Please do not drop SNP driver. I think that we should make MNP driver a new default and SNP should stay as a backup. Just in case.

Yes. The patch has been worked the way you asked.

I will try to take a look at it next week.

Quoted 6 lines
Quoted 4 lines

Additionally, a few days ago I have started looking for people interested in the project. There are some. Hence, if you are going to take a stab at it I will ask them to do some reviews of your work. I will drop you their emails if they are happy to do so.

Please feel free to CC them to the discussion.

Will do.

Daniel