summaryrefslogtreecommitdiffstats
path: root/src/usr/ifmgmt.c
Commit message (Collapse)AuthorAgeFilesLines
* [ifmgmt] Include human-readable error message for configuration failureMichael Brown2016-03-081-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add a generic concept of a "blocked link"Michael Brown2015-06-251-1/+2
| | | | | | | | | | | | When Spanning Tree Protocol (STP) is used, there may be a substantial delay (tens of seconds) from the time that the link goes up to the time that the port starts forwarding packets. Add a generic concept of a "blocked link" (i.e. a link which is up but which is not expected to communicate successfully), and allow "ifstat" to indicate when a link is blocked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Do not sleep CPU while configuring network devicesMichael Brown2014-06-011-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | iPXE currently calls cpu_nap() while performing DHCP, in order to reduce CPU utilisation on virtual machines. Under mild broadcast load (~100 packets per second), this can cause received packets to be dropped because the receive descriptor ring is overrun before the next 18Hz timer interrupt wakes up the CPU. The result is that DHCP is likely to intermittently fail on networks with appreciable amounts of broadcast (or multicast) traffic. This behaviour was introduced in the series of commits which generalised the "dhcp" command to the "ifconf" command. The earlier code (which did not handle IPv6 configuration) had no call to cpu_nap() and so did not suffer from this problem. Fix by removing the call to cpu_nap() in ifpoller_progress(). This has the undesirable side effect that CPU utilisation will remain at 100% while waiting for DHCP to complete (which can take several seconds, if we have to wait around for potential ProxyDHCP offers to arrive). Reported-by: Alex Davies <adavies@jumptrading.com> Reported-by: Christoffer Stokbæk <christoffers@easyspeedy.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Add ifconf() to carry out network device configurationMichael Brown2013-11-051-2/+87
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Rewrite iflinkwait() to use monojob_wait()Michael Brown2013-11-051-36/+92
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow network device to update link state before checkingMichael Brown2012-04-211-0/+3
| | | | | | | | If the network interface has only just been opened (e.g. by the "dhcp" command) then we should allow at least one opportunity for the card to update the link state before testing it, to avoid false positives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [device] Make driver name a generic device propertyMichael Brown2011-04-081-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-091-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-4/+4
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add netdev_is_open() wrapper functionMichael Brown2010-03-231-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Separate out the concept of hardware and link-layer addressesMichael Brown2009-08-121-1/+1
| | | | | | | | | | | The hardware address is an intrinsic property of the hardware, while the link-layer address can be changed at runtime. This separation is exposed via APIs such as PXE and EFI, but is currently elided by gPXE. Expose the hardware and link-layer addresses as separate properties within a net device. Drivers should now fill in hw_addr, which will be used to initialise ll_addr at the time of calling register_netdev().
* [ifmgmt] Move link-up status messages from autoboot() to iflinkwait()Joshua Oreman2009-06-241-7/+27
| | | | | | | | | | | | With the addition of link status codes, we can now display a detailed error indication if iflinkwait() fails. Putting the error output in iflinkwait avoids code duplication, and gains symmetry with the other interface management routines; ifopen() already prints an error directly if it cannot open its interface. Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Add mechanism for reporting detailed link status codesMichael Brown2009-06-241-0/+4
| | | | | | | | Expand the NETDEV_LINK_UP bit into a link_rc status code field, allowing specific reasons for link failure to be reported via "ifstat". Originally-authored-by: Joshua Oreman <oremanj@rwcr.net>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [ui] Allow Ctrl-C to cancel wait for net device link-upMichael Brown2009-01-271-0/+9
| | | | | This really ought to be handled via monojob.c and the usual Ctrl-C mechanism that handles cancelling DHCP or file downloads.
* [netdevice] Retain and report detailed error breakdownsMichael Brown2008-11-081-2/+23
| | | | | | | | | | netdev_rx_err() and netdev_tx_complete_err() get passed the error code, but currently use it only in debug messages. Retain error numbers and frequencey counts for up to NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX. This allows the "ifstat" command to report the reasons for TX/RX errors in most cases, even in non-debug builds.
* [NETDEV] Add notion of link stateMichael Brown2008-04-221-1/+23
| | | | | | | | | | | Add ability for network devices to flag link up/down state to the networking core. Autobooting code will now wait for link-up before attempting DHCP. IPoIB reflects the Infiniband link state as the network device link state (which is not strictly correct; we also need a succesful IPoIB IPv4 broadcast group join), but is probably more informative.
* Allow recording of TX and RX errors to aid in end-user debugging.Michael Brown2007-07-051-2/+3
|
* Add trivial net device statistics (TX and RX packet count), reportedMichael Brown2007-07-031-2/+3
| | | | via UNDI API and also by ifstat command; may be useful for debugging.
* Use stdio.h instead of vsprintf.hMichael Brown2007-01-191-1/+1
|
* Add "name" field to struct device to allow human-readable hardware deviceMichael Brown2007-01-101-2/+3
| | | | | | | | | | | names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
* Added network interface management commandsMichael Brown2007-01-101-0/+66