Page MenuHomeFreeBSD

xen/netfront: Add 2 bytes padding in the rx mbuf
Needs ReviewPublic

Authored by julien.grall_citrix.com on Oct 5 2015, 5:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 2 2024, 8:19 PM
Unknown Object (File)
Dec 20 2023, 2:25 AM
Unknown Object (File)
Nov 24 2023, 3:50 PM
Unknown Object (File)
Nov 22 2023, 10:37 AM
Unknown Object (File)
Nov 11 2023, 2:09 PM
Unknown Object (File)
Nov 11 2023, 2:03 PM
Unknown Object (File)
Nov 9 2023, 12:53 PM
Unknown Object (File)
Nov 7 2023, 3:01 PM
Subscribers

Details

Reviewers
royger
Group Reviewers
network
Summary

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 reveice an alignement
fault. To avoid this case, we need to pull-up the data of ETHER_ALIGN bytes.

I'm not sure how this patch will impact x86, we need to do some benchmarking
without and with it.

Furthermore, I don't know if m_copyup is the rigth function to use here. Can
any expert to the network stack can tell me if there is a better solution?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 686
Build 686: arc lint + arc unit

Event Timeline

julien.grall_citrix.com retitled this revision from to xen/netfront: Add 2 bytes padding in the rx mbuf.
julien.grall_citrix.com updated this object.
julien.grall_citrix.com edited the test plan for this revision. (Show Details)
julien.grall_citrix.com added a reviewer: royger.

Adding the network review group and Colin Percival.

Performance on x86 with this patch doesn't seem to be affected. I wonder however how do other drivers deal with this, since m_copyup it's only used by the bridge code.

sys/dev/xen/netfront/netfront.c
91

Can't you use the ETHER_ALIGN already defined in net/ethernet.h?

cperciva removed a reviewer: cperciva.

Hi,

I'd do a check whether we need to do alignment at compile time. net80211 does something like this.

that way you don't take the penalty if you're compiling for x86, and you DTRT for our alignment-unhappy architectures if you need it.