]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
inmates: e1000-demo: Ensure ring alignment requirements on newer NICs
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 2 Feb 2016 20:27:46 +0000 (21:27 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Wed, 3 Feb 2016 14:05:48 +0000 (15:05 +0100)
The Intel 82575 and newer NICs require 128-byte alignment of the RX and
TX rings.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
inmates/demos/x86/e1000-demo.c

index d7c2a662fba14786860473bc35e0953750b8fa81..7273f36c49eeeee1c5da9292941de920a36ae75a 100644 (file)
@@ -136,8 +136,8 @@ static const char *speed_info[] = { "10", "100", "1000", "1000" };
 
 static void *mmiobar;
 static u8 buffer[RX_DESCRIPTORS * RX_BUFFER_SIZE];
-static struct e1000_rxd rx_ring[RX_DESCRIPTORS];
-static struct e1000_txd tx_ring[TX_DESCRIPTORS];
+static struct e1000_rxd rx_ring[RX_DESCRIPTORS] __attribute__((aligned(128)));
+static struct e1000_txd tx_ring[TX_DESCRIPTORS] __attribute__((aligned(128)));
 static unsigned int rx_idx, tx_idx;
 static struct eth_header tx_packet;
 static unsigned int phyadd;