From 4c8dc98c5354a59fae239cbf116759ad0769c03b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 30 2021 19:46:06 +0000 Subject: import ipxe-20181214-8.git133f4c47.el8 --- diff --git a/SOURCES/0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP.patch b/SOURCES/0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP.patch new file mode 100644 index 0000000..91385f1 --- /dev/null +++ b/SOURCES/0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP.patch @@ -0,0 +1,119 @@ +From 2de005e9ac399f7064968a2611f266dc86a96700 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Fri, 24 Jul 2020 19:15:28 +0200 +Subject: [PATCH] [efi] perform cable detection at NII initialization on HPE + 557SFP+ + +Commit c0b61bad99ba ("[efi] Work around bugs in Emulex NII driver", +2015-08-17) added PXE_OPFLAGS_INITIALIZE_DETECT_CABLE to nii_open() for +working around Emulex NII driver bugs. + +That broke some Mellanox drivers, so commit 6324227dcaa8 ("[efi] Skip +cable detection at initialisation where possible", 2017-03-19) predicated +PXE_OPFLAGS_INITIALIZE_DETECT_CABLE on the NII driver's *inability* to +report link status. + +This in turn breaks the NII driver on (some?) HPE 557SFP+ cards, as those +drivers are capable of reporting link status, but they still need cable +detection. + +So check for this card (through PCI vendor / device / subsys vendor / +subsys device identifiers), and opt for cable detection regardless of link +status reporting. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1740827 +Signed-off-by: Laszlo Ersek +--- + src/drivers/net/efi/nii.c | 43 ++++++++++++++++++++++++++++++++++++--- + 1 file changed, 40 insertions(+), 3 deletions(-) + +diff --git a/src/drivers/net/efi/nii.c b/src/drivers/net/efi/nii.c +index 2d87e0c63f14..0cf065e0818f 100644 +--- a/src/drivers/net/efi/nii.c ++++ b/src/drivers/net/efi/nii.c +@@ -193,6 +193,9 @@ struct nii_nic { + + /** Mapping list */ + struct list_head mappings; ++ ++ /** quirk needed for HPE 557SFP+ */ ++ int quirk_hpe557sfpp; + }; + + /** Maximum number of received packets per poll */ +@@ -219,6 +222,7 @@ static int nii_pci_open ( struct nii_nic *nii ) { + int bar; + EFI_STATUS efirc; + int rc; ++ uint16_t vid, did, subsys_vid, subsys_did; + + /* Locate PCI I/O protocol */ + if ( ( rc = efi_locate_device ( device, &efi_pci_io_protocol_guid, +@@ -255,7 +259,7 @@ static int nii_pci_open ( struct nii_nic *nii ) { + rc = -EEFI ( efirc ); + DBGC ( nii, "NII %s could not get BAR %d attributes: " + "%s\n", nii->dev.name, bar, strerror ( rc ) ); +- goto err_get_bar_attributes; ++ goto err_pci; + } + if ( desc.acpi->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM ) { + nii->mem_bar = bar; +@@ -276,9 +280,36 @@ static int nii_pci_open ( struct nii_nic *nii ) { + DBGC ( nii, "no I/O BAR\n" ); + } + ++ /* Check if HPE 557SFP+ quirk is needed */ ++ if ( ( efirc = nii->pci_io->Pci.Read ( nii->pci_io, ++ EfiPciIoWidthUint16, ++ PCI_VENDOR_ID, 1, ++ &vid ) ) != 0 || ++ ( efirc = nii->pci_io->Pci.Read ( nii->pci_io, ++ EfiPciIoWidthUint16, ++ PCI_DEVICE_ID, 1, ++ &did ) ) != 0 || ++ ( efirc = nii->pci_io->Pci.Read ( nii->pci_io, ++ EfiPciIoWidthUint16, ++ PCI_SUBSYSTEM_VENDOR_ID, 1, ++ &subsys_vid ) ) != 0 || ++ ( efirc = nii->pci_io->Pci.Read ( nii->pci_io, ++ EfiPciIoWidthUint16, ++ PCI_SUBSYSTEM_ID, 1, ++ &subsys_did ) ) != 0 ) { ++ rc = -EEFI ( efirc ); ++ DBGC ( nii, "NII %s could not read PCI config space: %s\n", ++ nii->dev.name, strerror ( rc ) ); ++ goto err_pci; ++ } ++ ++ nii->quirk_hpe557sfpp = ( vid == 0x10df && ++ did == 0x0720 && ++ subsys_vid == 0x103c && ++ subsys_did == 0x803f ); + return 0; + +- err_get_bar_attributes: ++ err_pci: + bs->CloseProtocol ( pci_device, &efi_pci_io_protocol_guid, + efi_image_handle, device ); + err_open: +@@ -1144,8 +1175,14 @@ static int nii_open ( struct net_device *netdev ) { + * cable detection at this point if any only if the driver is + * not capable of reporting link status changes at runtime via + * PXE_OPCODE_GET_STATUS. ++ * ++ * HPE 557SFP+ seems to break with ++ * PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE, but works with ++ * PXE_OPFLAGS_INITIALIZE_DETECT_CABLE, so ignore link status reporting ++ * for that NIC, and always request cable detection. + */ +- flags = ( nii->media ? PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE ++ flags = ( ( ! nii->quirk_hpe557sfpp ) && nii->media ++ ? PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE + : PXE_OPFLAGS_INITIALIZE_DETECT_CABLE ); + if ( ( rc = nii_initialise_flags ( nii, flags ) ) != 0 ) + goto err_initialise; + +base-commit: b76052335788d0ad2c4b0bded116c3b02dd4bbc2 +-- +2.19.1.3.g30247aa5d201 + diff --git a/SOURCES/ipxe-ping-cmd.patch b/SOURCES/ipxe-ping-cmd.patch new file mode 100644 index 0000000..edbcbef --- /dev/null +++ b/SOURCES/ipxe-ping-cmd.patch @@ -0,0 +1,11 @@ +--- ./src/config/general.h.orig 2021-01-26 19:47:08.940559209 -0500 ++++ ./src/config/general.h 2021-01-26 19:47:15.739526567 -0500 +@@ -148,7 +148,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + //#define PCI_CMD /* PCI commands */ + //#define PARAM_CMD /* Form parameter commands */ + //#define NEIGHBOUR_CMD /* Neighbour management commands */ +-//#define PING_CMD /* Ping command */ ++#define PING_CMD /* Ping command */ + //#define CONSOLE_CMD /* Console command */ + //#define IPSTAT_CMD /* IP statistics commands */ + //#define PROFSTAT_CMD /* Profiling commands */ diff --git a/SPECS/ipxe.spec b/SPECS/ipxe.spec index 50ccf7d..72671c4 100644 --- a/SPECS/ipxe.spec +++ b/SPECS/ipxe.spec @@ -49,7 +49,7 @@ Name: ipxe Version: %{date} -Release: 5.git%{hash}%{?dist} +Release: 8.git%{hash}%{?dist} Summary: A network boot loader Group: System Environment/Base @@ -65,6 +65,8 @@ Patch0001: 0001-build-customize-configuration.patch Patch0002: 0002-Use-spec-compliant-timeouts.patch Patch0003: 0003-Strip-802.1Q-VLAN-0-priority-tags.patch Patch0004: ipxe-vlan-cmds.patch +Patch0005: 0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP.patch +Patch0006: ipxe-ping-cmd.patch %ifarch %{buildarches} BuildRequires: perl-interpreter @@ -182,9 +184,12 @@ for rom in %{qemuroms}; do vid="0x${rom%%????}" did="0x${rom#????}" EfiRom -f "$vid" -i "$did" --pci23 \ - -b bin/${rom}.rom \ -ec bin-x86_64-efi/${rom}.efidrv \ - -o bin-combined/${rom}.rom + -o bin-combined/${rom}.eficrom + util/catrom.pl \ + bin/${rom}.rom \ + bin-combined/${rom}.eficrom \ + > bin-combined/${rom}.rom EfiRom -d bin-combined/${rom}.rom # truncate to at least 256KiB truncate -s \>256K bin-combined/${rom}.rom @@ -259,6 +264,15 @@ done %endif %changelog +* Fri Feb 19 2021 Jarod Wilson - 20181210-8.git133f4c47 +- combine BIOS and EFI roms using utils/catrom.pl [lersek] (bz 1926561) + +* Tue Jan 26 2021 Jarod Wilson - 20181210-7.git133f4c47 +- Build ping command (bz 1913719) + +* Mon Jul 27 2020 Neil Horman - 20181210-6.git133f4c47 +- Add quirk for link detect on HP 557SFP cards (bz 1740827) + * Tue Jan 7 2020 Neil Horman - 20181210-5.git133f4c47 - Add rhcert subpackage (bz 1756012)