aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/xengrant.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-04-14 16:33:41 +0100
committerMichael Brown <mcb30@ipxe.org>2021-04-14 16:33:41 +0100
commit85d179f2c65d0a2afe9122b844a90c011d551ae1 (patch)
tree4e28fe6260f2df4911089d7747408d9f0c359688 /src/include/ipxe/xengrant.h
parent8ca43ccbc1984d60e50711ea326ca59ac03985d2 (diff)
downloadipxe-85d179f2c65d0a2afe9122b844a90c011d551ae1.tar.gz
[xen] Support scatter-gather to allow for jumbo framesxen-sg
The use of jumbo frames for the Xen netfront virtual NIC requires the use of scatter-gather ("feature-sg"), with the receive descriptor ring becoming a list of page-sized buffers and the backend using as many page buffers as required for each packet. Since iPXE's abstraction of an I/O buffer does not include any sort of scatter-gather list, this requires an extra allocation and copy on the receive datapath for any packet that spans more than a single page. This support is required in order to successfully boot an AWS EC2 virtual machine (with non-enhanced networking) via iSCSI if jumbo frames are enabled, since the netback driver used in EC2 seems not to allow "feature-sg" to be renegotiated once the Linux kernel driver takes over. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/xengrant.h')
-rw-r--r--src/include/ipxe/xengrant.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/ipxe/xengrant.h b/src/include/ipxe/xengrant.h
index 451a3ceee..fcb7a7157 100644
--- a/src/include/ipxe/xengrant.h
+++ b/src/include/ipxe/xengrant.h
@@ -166,16 +166,17 @@ xengrant_invalidate ( struct xen_hypervisor *xen, grant_ref_t ref ) {
* @v ref Grant reference
* @v domid Domain ID
* @v subflags Additional flags
- * @v page Page start
+ * @v addr Physical address within page
* @ret rc Return status code
*/
static inline __attribute__ (( always_inline )) int
xengrant_permit_access ( struct xen_hypervisor *xen, grant_ref_t ref,
- domid_t domid, unsigned int subflags, void *page ) {
+ domid_t domid, unsigned int subflags,
+ physaddr_t addr ) {
struct grant_entry_header *hdr = xengrant_header ( xen, ref );
struct grant_entry_v1 *v1 = xengrant_v1 ( hdr );
union grant_entry_v2 *v2 = xengrant_v2 ( hdr );
- unsigned long frame = ( virt_to_phys ( page ) / PAGE_SIZE );
+ unsigned long frame = ( addr / PAGE_SIZE );
/* Fail (for test purposes) if applicable */
if ( ( XENGRANT_FAIL_RATE > 0 ) &&