summaryrefslogtreecommitdiffstats
path: root/src/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [tlan] Guard against failure to identify chipMichael Brown2017-03-221-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ath] Add missing break statementsMichael Brown2017-03-221-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Return status code from ib_create_cq() and ib_create_qp()Michael Brown2017-03-222-22/+17Star
| | | | | | | | | | | | Any underlying errors arising during ib_create_cq() or ib_create_qp() are lost since the functions simply return NULL on error. This makes debugging harder, since a debug-enabled build is required to discover the root cause of the error. Fix by returning a status code from these functions, thereby allowing any underlying errors to be propagated. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Avoid passing a NULL I/O buffer to netdev_tx_complete_err()Michael Brown2017-03-211-1/+2
| | | | | | | | | Report errors in eoib_duplicate() via netdev_tx_err() rather than netdev_tx_complete_err(), since netdev_tx_complete_err() accepts only valid I/O buffers that are currently in the network device's transmit queue. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sis900] Remove extraneous memset() with incorrect lengthMichael Brown2017-03-211-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Skip cable detection at initialisation where possibleMichael Brown2017-03-191-23/+19Star
| | | | | | | | | | | | | | | | | | We currently request cable detection in PXE_OPCODE_INITIALIZE to work around buggy Emulex drivers (see commit c0b61ba ("[efi] Work around bugs in Emulex NII driver")). This causes problems with some other NII drivers (e.g. Mellanox), which may time out if the underlying link is intrinsically slow to come up. Attempt to work around both problems simultaneously by requesting cable detection only if the underlying NII driver does not support link status reporting via PXE_OPCODE_GET_STATUS. (This is based on a potentially incorrect assumption that the buggy Emulex drivers do not claim to report link status via PXE_OPCODE_GET_STATUS.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Provide common ARRAY_SIZE() definitionMichael Brown2017-03-108-19/+2Star
| | | | | | | Several files define the ARRAY_SIZE() macro as used in Linux. Provide a common definition for this in include/compiler.h. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Reset all virtual function settingsVishvananda Ishaya2017-03-094-13/+91
| | | | | | | | | | | Some VF data is not cleared with reset, so make sure to return all the settings to default before configuring the VF. This fixes an issue where network packets would fail to be received if the VF was previously used by the linux ixgbevf driver. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Don't disable NIC when exiting from iPXEKonrad Adamczyk2017-02-071-3/+0Star
| | | | | | | | | According to ThunderX Errata G-17560, NIC_PF_CFG[ENA] bit should not be cleared at exit. This allows other drivers to access the NIC regs correctly. Signed-off-by: Konrad Adamczyk <konrad.adamczyk@cavium.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Fix hardware deinitializationBartosz Szczepanek2017-02-071-0/+7
| | | | | | | | | | | | It is required to reset BGX context state for the LMAC using BGX_CMR_CONFIG register. This solves problem with network connectivity in Linux booted from iPXE. Signed-off-by: Bartosz Szczepanek <bartosz.szczepanek@cavium.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add INTEL_NO_PHY_RST for I219-LM (2)Christian Nilsson2017-01-261-1/+1
| | | | | | | | Originally-implemented-by: Malte zu Klampen <malte@pclab.ifg.uni-kiel.de> Originally-implemented-by: Richard Moore <rich@richud.com> Tested-by: Esben Storgaard Nielsen <esn@solar.dk> Signed-off-by: Christian Nilsson <nikize@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Allow timer to be selected at runtimeMichael Brown2017-01-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Use host-specified MTU when availableMichael Brown2017-01-232-13/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Use separate RX and TX empty header buffersMichael Brown2017-01-231-7/+12
| | | | | | | | | | | | | | | Some host implementations (notably Google Compute Platform) are known to unconditionally write back VIRTIO_NET_HDR_F_DATA_VALID to header->flags for received packets, regardless of the features negotiated by the driver. This breaks the transmit datapath by effectively setting an illegal flag for all subsequent transmitted packets. Work around this problem by using separate empty header buffers for the receive and transmit queues. Debugged-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Remove queue size limit in legacy virtioLadi Prosek2017-01-221-0/+1
| | | | | | | | | | | | | | | | Virtio 0.9 implementation was limited to the maximum virtqueue size of MAX_QUEUE_NUM and the virtio-net driver would fail to initialize on hosts exceeding this limit. This commit lifts the restriction by allocating the queue memory based on the actual queue size instead of using a fixed maximum. Note that virtio 1.0 still uses the MAX_QUEUE_NUM constant to cap the size (unfortunately this functionality is not available in virtio 0.9). Signed-off-by: Ladi Prosek <lprosek@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Simplify virtqueue shutdownLadi Prosek2017-01-221-11/+19
| | | | | | | | | | | | This commit introduces virtnet_free_virtqueues called on all virtqueue error and shutdown paths. vpm_find_vqs no longer cleans up after itself and instead expects virtnet_free_virtqueues to be always called to undo its effect. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Remove duplicate intelvf_mbox_queues() functionMichael Brown2016-07-141-41/+0Star
| | | | | | | | Commit db34436 ("[intel] Strip spurious VLAN tags received by virtual function NICs") accidentally introduced two copies of the intel[x]vf_mbox_queues() function. Remove the unintended copy. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Strip spurious VLAN tags received by virtual function NICsMichael Brown2016-07-124-0/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The physical function may be configured to transparently insert a VLAN tag into all transmitted packets. Unfortunately, it does not equivalently strip this same VLAN tag from all received packets. This behaviour may be observed in some Amazon EC2 instances with Enhanced Networking enabled: transmissions work as expected but all packets received by iPXE appear to have a spurious VLAN tag. We can configure the receive queue to strip VLAN tags via the RXDCTL.VME bit. We need to find out from the PF driver whether or not we should do so. There exists a "get queue configuration" mailbox message which contains a field labelled IXGBE_VF_TRANS_VLAN in the Linux driver. A comment in the Linux PF driver describes this field as "notify VF of need for VLAN tag stripping, and correct queue". It will be filled with a non-zero value if the PF is enforcing the use of a single VLAN tag. It will also be filled with a non-zero value if the PF is using multiple traffic classes. The Linux VF driver seems to treat this field as being simply the number of traffic classes, and gives it no VLAN-related interpretation. The Linux VF driver instead handles the VLAN tag stripping by simply assuming that any unrecognised VLAN tag ought to be silently dropped. We choose to strip and ignore the VLAN tag if the IXGBE_VF_TRANS_VLAN field has a non-zero value. Reported-by: Leonid Vasetsky <leonidv@velostrata.com> Tested-by: Leonid Vasetsky <leonidv@velostrata.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add PCI device ID for I219-V/LMLukas Grossar2016-07-121-0/+2
| | | | | Signed-off-by: Lukas Grossar <lukas.grossar@adfinis-sygroup.ch> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Fix compilation with older versions of gccMichael Brown2016-06-221-2/+2
| | | | | | | Remove redundant duplicate typedef which causes a build failure on older gcc versions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smsc75xx] Allow up to 100ms for reset to completeMichael Brown2016-06-202-11/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Retrieve base MAC address via EFI_THUNDER_CONFIG_PROTOCOLMichael Brown2016-06-182-1/+250
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add PCI device ID for another I219-LMChristian Nilsson2016-06-161-0/+1
| | | | | Tested-by: Kuniyasu Suzaki <k.suzaki@aist.go.jp> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Fix channel configuration for VNICs 1-7Michael Brown2016-06-151-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [thunderx] Add driver for Cavium ThunderX SoC NICsMichael Brown2016-06-132-0/+2617
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Add missing memory barrierLeendert van Doorn2016-06-131-0/+2
| | | | | | | | | ARM64 has a weaker memory order model than x86. The missing memory barrier caused phy initialization notification to be delayed beyond the link-wait timeout (15 secs). Signed-off-by: Leendert van Doorn <leendert@paramecium.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix address truncation bug on 64-bit machinesLeendert van Doorn2016-06-102-2/+2
| | | | | Signed-off-by: Leendert van Doorn <leendert@paramecium.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Support systems with multiple PCI root bridgesMichael Brown2016-06-091-5/+7
| | | | | | | | | Extend the 16-bit PCI bus:dev.fn address to a 32-bit seg:bus:dev.fn address, assuming a segment value of zero in contexts where multiple segments are unsupported by the underlying data structures (e.g. in the iBFT or BOFM tables). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [axge] Add driver for ASIX 10/100/1000 USB Ethernet NICsMichael Brown2016-05-262-0/+972
| | | | | | | Add driver for the AX88178A (USB2) and AX88179 (USB3) 10/100/1000 Ethernet NICs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ath9k] Fix buffer overrun for ar9287Christian Hesse2016-05-121-4/+3Star
| | | | | | | | This backport is from linux kernel upstream commit 83d6f1f ("ath9k: fix buffer overrun for ar9287"). Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Guard against GetStatus() failing to return a NULL TX bufferMichael Brown2016-05-121-0/+1
| | | | | | | | | | | | | | | The UEFI specification requires the EFI_SIMPLE_NETWORK_PROTOCOL GetStatus() method to set TxBuf to NULL if there are no transmit buffers to recycle. Some implementations (observed with Lan9118Dxe in EDK2) fill in TxBuf only when there is a transmit buffer to recycle, which leads to large numbers of "spurious TX completion" errors. Work around this problem by initialising TxBuf to NULL before calling the GetStatus() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ath] Fix building with GCC 6Michael Brown2016-05-049-150/+101Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [skge] Fix building with GCC 6Michael Brown2016-05-041-5/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sis190] Fix building with GCC 6Michael Brown2016-05-042-13/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix _tg3_flag() for 64-bit buildsMichael Brown2016-05-021-1/+1
| | | | | | | | | | | Commit 86f96a4 ("[tg3] Remove x86-specific inline assembly") introduced a regression in _tg3_flag() in 64-bit builds, since any flags in the upper 32 bits of a 64-bit unsigned long would be discarded when truncating to a 32-bit int. Debugged-by: Shane Thompson <shane.thompson@aeontech.com.au> Tested-by: Shane Thompson <shane.thompson@aeontech.com.au> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Add virtio-net 1.0 supportLadi Prosek2016-04-151-11/+251
| | | | | | | | | | | | | | This commit makes virtio-net support devices with VEN 0x1af4 and DEV 0x1041, which is how non-transitional (modern-only) virtio-net devices are exposed on the PCI bus. Transitional devices supporting both the old 0.9.5 and new 1.0 version of the virtio spec are driven using the new protocol. Legacy devices are driven using the old protocol, same as before this commit. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Add virtio 1.0 PCI supportLadi Prosek2016-04-151-2/+3
| | | | | | | | | | | | This commit adds support for driving virtio 1.0 PCI devices. In addition to various helpers, a number of vpm_ functions are introduced to be used instead of their legacy vp_ counterparts when accessing virtio 1.0 (aka modern) devices. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Add virtio 1.0 constants and data structuresLadi Prosek2016-04-151-0/+16
| | | | | | | | | | Virtio 1.0 introduces new constants and data structures, common to all devices as well as specific to virtio-net. This commit adds a subset of these to be able to drive the virtio-net 1.0 network device. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add PCI device ID for another I219-VChristian Nilsson2016-03-291-0/+1
| | | | | Signed-off-by: Christian Nilsson <nikize@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [etherfabric] Avoid use of sleep() in driver codeMichael Brown2016-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [3c5x9] Avoid use of sleep() in driver codeMichael Brown2016-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow drivers to override the eIPoIB LEMACMichael Brown2016-03-211-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Allow external code to identify IPoIB network devicesMichael Brown2016-03-201-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Remove x86-specific inline assemblyMichael Brown2016-03-121-27/+9Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [3c595] Fix compilation when "char" is unsigned by defaultMichael Brown2016-03-121-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Support non-FullMember gateway devicesMichael Brown2016-03-091-2/+98
| | | | | | | | | | | | | Some EoIB implementations utilise an EoIB-to-Ethernet gateway device that does not perform a FullMember join to the multicast group for the EoIB broadcast domain. This has various exciting side-effects, such as requiring every EoIB node to send every broadcast packet twice. As an added bonus, the gateway may also break the EoIB MAC address to GID mapping protocol by sending Ethernet-sourced packets from the wrong QPN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Allow the multicast group to be forcefully createdMichael Brown2016-03-091-2/+2
| | | | | | | | | | | | | Some EoIB implementations require each individual EoIB node to create the multicast group for the EoIB broadcast domain. It is left as an exercise for the interested reader to determine how such an implementation might ever allow the parameters of such a multicast group to be changed without requiring a simultaneous upgrade of every driver on every operating system on every machine currently attached to the fabric. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Silently ignore EoIB heartbeat packetsMichael Brown2016-03-091-0/+45
| | | | | | | | | | | Some EoIB implementations transmit a vendor-proprietary heartbeat packet on the same multicast group used to provide the EoIB broadcast domain. Silently ignore these heartbeat packets, to avoid cluttering up the network interface error statistics. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Add Ethernet over Infiniband (EoIB) driverMichael Brown2016-03-091-0/+754
| | | | | | | | | | | | | | | | | | | | EoIB is a fairly simple protocol in which raw Ethernet frames (excluding the CRC) are encapsulated within Infiniband Unreliable Datagrams, with a four-byte fixed EoIB header (which conveys no actual information). The Ethernet broadcast domain is provided by a multicast group, similar to the IPoIB IPv4 multicast group. The mapping from Ethernet MAC addresses to Infiniband address vectors is achieved by snooping incoming traffic and building a peer cache which can then be used to map a MAC address into a port GID. The address vector is completed using a path record lookup, as for IPoIB. Note that this requires every packet to include a GRH. Add basic support for EoIB devices. This driver is substantially derived from the IPoIB driver. There is currently no mechanism for automatically creating EoIB devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Increase number of transmit work queue entriesMichael Brown2016-03-081-2/+2
| | | | | | Avoid running out of transmit work queue entries under heavy load. Signed-off-by: Michael Brown <mcb30@ipxe.org>