Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148331073
D3818.1786330217.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1003 B
Referenced Files
None
Subscribers
None
D3818.1786330217.diff
View Options
Index: sys/dev/xen/netfront/netfront.c
===================================================================
--- sys/dev/xen/netfront/netfront.c
+++ sys/dev/xen/netfront/netfront.c
@@ -88,6 +88,8 @@
#include "xenbus_if.h"
+#define ETHER_ALIGN 2
+
/* Features supported by all backends. TSO and LRO can be negotiated */
#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP)
@@ -1357,6 +1359,22 @@
ref_cons = *cons + frags;
frags++;
}
+
+ if (err == 0) {
+ /*
+ * The ethernet header size is not word aligned. Therefore,
+ * the IP packet and so on won't be align. On some architecture
+ * (such as ARM) unaligned access may be slower and/or not
+ * supported. Therefore we might receive an alignment fault.
+ * To avoid this case, we need to pull-up the data of
+ * ETHER_ALIGN bytes.
+ */
+ m0 = m_copyup(m0, min(m0->m_pkthdr.len, max_protohdr),
+ ETHER_ALIGN);
+ if (m0 == 0)
+ err = ENOMEM;
+ }
+
*list = m0;
*cons += frags;
*pages_flipped_p = pages_flipped;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 10, 2:50 AM (2 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29383134
Default Alt Text
D3818.1786330217.diff (1003 B)
Attached To
Mode
D3818: xen/netfront: Add 2 bytes padding in the rx mbuf
Attached
Detach File
Event Timeline
Log In to Comment