summaryrefslogtreecommitdiffstats
path: root/src/core/iobuf.c
Commit message (Collapse)AuthorAgeFilesLines
* [iobuf] Improve robustness of I/O buffer allocationMichael Brown2016-02-111-9/+34
| | | | | | | | | | | | | Guard against various corner cases (such as zero-length buffers, zero alignments, and integer overflow when rounding up allocation lengths and alignments) and ensure that the struct io_buffer is correctly aligned even when the caller requests a non-zero alignment for the I/O buffer itself. Add self-tests to verify that the resulting alignments and lengths are correct for a range of allocations. 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>
* [iobuf] Add iob_split() to split an I/O buffer into portionsMichael Brown2014-12-181-0/+30
| | | | | | | | | | | RNDIS devices may provide multiple packets encapsulated into a single message. Provide an API to allow the RNDIS driver to split an I/O buffer into smaller portions. The current implementation will always copy the underlying data, rather than splitting the buffer in situ. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Concatenate received non-data records before processingMichael Brown2013-01-311-0/+42
| | | | | | | | | Allow non-data records to be split across multiple received I/O buffers, to accommodate large certificate chains. Reported-by: Nicola Volpini <Nicola.Volpini@kambi.com> Tested-by: Nicola Volpini <Nicola.Volpini@kambi.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Allow allocation of I/O buffers with a specified alignment offsetMichael Brown2012-08-311-15/+30
| | | | 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>
* [iobuf] Allocate I/O buffer descriptor separately to conserve aligned memoryMichael Brown2012-07-081-13/+53
| | | | | | | | | | | | | | | | | I/O buffers are allocated on aligned boundaries. The I/O buffer descriptor (the struct io_buffer) is currently attached to the end of the I/O buffer. When the size of the buffer is close to its alignment, this can waste large amounts of aligned memory. For example, a network card using 2048-byte receive buffers will end up allocating 2072 bytes on a 2048-byte boundary. This effectively wastes 50% of the available memory. Improve the situation by allocating the descriptor separately from the main I/O buffer if inline allocation would cause the total allocated size to cross the alignment boundary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Relax alignment requirement for small I/O buffersMichael Brown2012-06-291-5/+13
| | | | | | | | | | | | | iPXE currently aligns all I/O buffers on a 2kB boundary. This is overkill for transmitted packets, which are typically much smaller than 2kB. Align I/O buffers on their own size. This reduces the alignment requirement for small buffers, while preserving the guarantee that I/O buffers will never cross boundaries that might cause problems for some DMA engines. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-2/+2
| | | | | | | | | | | 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>
* [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.
* Add per-file error identifiersMichael Brown2007-07-241-0/+20
|
* Add alloc_iob() and free_iob(). (Direct search-and-replaceMichael Brown2007-05-181-0/+74
equivalents for alloc_pkb() and free_pkb(), which will be retired in due course).