bugGNU GRUB - Bugs: bug #45204, EFI PXE boot fails for some...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #45204: EFI PXE boot fails for some firmware

Submitter:  Mark Salter <msalter>
Submitted:  Thu 28 May 2015 03:11:54 PM UTC
   
 
Category:  Network Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  Mark Salter
Open/Closed:  Closed Release:  Git master
Release:  Reproducibility:  Every Time
Planned Release:  None

Jump to the original submission

Tue 16 Jun 2015 04:54:18 PM UTC, comment #8: 

Pushed as f348aee7b33dd85e7da62b497a96a7319a0bf9dd. Thanks!

Andrei Borzenkov <arvidjaar>
Group Member
Tue 16 Jun 2015 04:00:58 PM UTC, comment #7: 

Works for me. Thanks!

Mark Salter <msalter>
Fri 12 Jun 2015 05:36:34 PM UTC, comment #6: 

Could you test attached patch?

(file #34210)

Andrei Borzenkov <arvidjaar>
Group Member
Thu 28 May 2015 07:35:36 PM UTC, comment #5: 

I added code to dump the filter info:

+static void dump_snp_filter(grub_efi_simple_network_t *net)
+{
+ struct grub_efi_simple_network_mode *m = net->mode;
+ int i;
+
+ grub_dprintf("efi", "FilterMask[%x] FilterSetting[%x] McastCount[%x]\n",
+      m->receive_filter_mask,
+      m->receive_filter_setting,
+      m->mcast_filter_count
+ );
+ for (i = 0; i < m->mcast_filter_count; i++) {
+ grub_dprintf("efi", "    %d: %02x:%02x:%02x:%02x:%02x:%02x\n",
+      i,
+      m->mcast_filter[i][0],
+      m->mcast_filter[i][1],
+      m->mcast_filter[i][2],
+      m->mcast_filter[i][3],
+      m->mcast_filter[i][4],
+      m->mcast_filter[i][5]);
+
+ }
+}
+

Using my patch to save/restore values, I see:

From grub_efinet_findcards():
net/drivers/efi/efinet.c:42: FilterMask[1f] FilterSetting[7] McastCount[3]
net/drivers/efi/efinet.c:51:     0: 01:005e:00:00:01
net/drivers/efi/efinet.c:51:     1: 33:33:00:00:00:01
net/drivers/efi/efinet.c:51:     2: 33:33:ff:57:3f:62

After open exclusive, before calling receive_filters():
net/drivers/efi/efinet.c:42: FilterMask[1f] FilterSetting[0] McastCount[0]

net/drivers/efi/efinet.c:186: receive_filters returned 0

After receive_filters() using values saved in grub_efinet_findcards():
net/drivers/efi/efinet.c:42: FilterMask[1f] FilterSetting[7] McastCount[3]
net/drivers/efi/efinet.c:51:     0: 01:00:5e:00:00:01
net/drivers/efi/efinet.c:51:     1: 33:33:00:00:00:01
net/drivers/efi/efinet.c:51:     2: 33:33:ff:57:3f:62

Using your suggesting values:

From grub_efinet_findcards():
net/drivers/efi/efinet.c:42: FilterMask[1f] FilterSetting[7] McastCount[3]
net/drivers/efi/efinet.c:51:     0: 01:00:5e:00:00:01
net/drivers/efi/efinet.c:51:     1: 33:33:00:00:00:01
net/drivers/efi/efinet.c:51:     2: 33:33:ff:57:3f:62

After open exclusive, before calling receive_filters():
net/drivers/efi/efinet.c:42: FilterMask[1f] FilterSetting[0] McastCount[0]

After receive_filters() using your suggested values in grub_efinet_findcards():
net/drivers/efi/efinet.c:199: receive_filters returned 0
net/drivers/efi/efinet.c:42: FilterMask[1f] FilterSetting[15] McastCount[0]

The subsequent pxe boot worked fine both ways.

Mark Salter <msalter>
Thu 28 May 2015 06:22:51 PM UTC, comment #4: 

Could you dump existing filters for problem platform?

If we are forced to enter this territory I'd prefer to have explicit control over settings. I think we should do

if (snp->mode->receive_filter_mask)
 receive_filters(snp, UNICAST|BROADCAST|MULTICAST_PROMISCOUS & snp->mode->receive_filter_mask, MULTICAST|PROMISCOUS & snp->mode->receive_filter_mask, TRUE, 0, 0)

and completely ignore any error. IOW reset any existing multicast filters and promiscous and enable unicast, broadcast and receive of any multicast whatever is supported by driver.

Andrei Borzenkov <arvidjaar>
Group Member
Thu 28 May 2015 04:04:25 PM UTC, comment #3: 

I originally did explicitly add UNICAST/BROADCAST rather than previous settings. But I wasn't sure if MULTICAST would be needed since ipv6 was supported on the platform. MULTICAST was allowed for both ipv4 and ipv6, so I ended up saving/restoring everything since that seemed simplest thing to do. Maybe the thing to do would be to explicitly OR in UNICAST|BROADCAST flags with the saved settings?

I agree on not aborting on EFI_UNSUPPORTED.

Mark Salter <msalter>
Thu 28 May 2015 03:52:17 PM UTC, comment #2: 


We do not really know what settings filters had. May be we should just set them as we need - which I assume is at least EFI_SIMPLE_NETWORK_RECEIVE_UNICAST|EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST; probably specific multicast addresses for IPv6 autoconfiguration?

I do not think it should abort on EFI_UNSUPPORTED. May be print warning, but otherwise if hardware filtering is unsupported just assume we get everything and continue.


Andrei Borzenkov <arvidjaar>
Group Member
Thu 28 May 2015 03:26:52 PM UTC, comment #1: 

Your patch includes *.orig files; could you rediff without them?

Andrei Borzenkov <arvidjaar>
Group Member
Thu 28 May 2015 03:11:54 PM UTC, original submission:  

The patch for bug #41731 adds an exclusive open of simple network protocol to fix a problem where firmware would compete with grub for incoming packets. This has been working for me until I tested on a platform where the firmware clears the receive filter settings when the network driver is stopped by grub's exclusive open.

I used the attached patch to fix the problem by saving the original receive filter settings and restoring them after the exclusive open.

Mark Salter <msalter>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #34210:  45204.diff added by arvidjaar (4KiB - text/x-patch)
file #34116:  efinet-save-and-restore-SNP-rx-filters.patch added by msalter (3KiB - text/x-patch - Fixed patch to remove the inadvertant .orig files)
file #34114:  0001-efinet-save-and-restore-SNP-rx-filters.patch added by msalter (65KiB - text/x-patch - patch to save/restore efinet rx filters)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by msalter (Submitted the item)
  • -email is unavailable- added by msalter
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-16 arvidjaar StatusNone Fixed
        Open/ClosedOpen Closed
    2015-06-12 arvidjaar Attached File- Added 45204.diff, #34210
    2015-05-28 msalter Attached File- Added efinet-save-and-restore-SNP-rx-filters.patch, #34116
    2015-05-28 msalter Attached File- Added 0001-efinet-save-and-restore-SNP-rx-filters.patch, #34114
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code