> On 9 Feb 2016, at 9:12 PM, Mike Belopuhov <m...@belopuhov.com> wrote: > > On 9 February 2016 at 11:31, David Gwynne <da...@gwynne.id.au> wrote: >> On Mon, Feb 08, 2016 at 11:02:06PM +1000, David Gwynne wrote: >>> On Sat, Feb 06, 2016 at 04:43:28PM -0500, Anthony Eden wrote: >>>>> Synopsis: <alignment fault on armv7 (omap) using carp(4)> >>>> >>>> To me that behavior might suggest the problem is deeper than a >>>> bookkeeping mistake of aligning memory in mbuf. >>> >>> nope, you were right, it's a screwup with alignment. >>> >>> the problem is multicast packets that arent to a carp interfaces >>> mac address have to be duplicated and sent to all carp interfaces >>> on a parent. the duplication is done with m_copym2, which doesn't >>> respect the alignment requirements of the ip header inside the 14 >>> byte ethernet header. >>> >>> the following dups the packet inside carp, and makes sure the >>> ethernet payload is aligned properly. >>> >>> i was able to reproduce this on sparc64, and i believe this fixes >>> it. could you test it and see if it helps? >> >> mpi@ pointed out that bridge@ has a special function to do a deep >> copy of mbufs that get the ip payload alignment right, and that we >> should share. >> >> this moves the functionality in with the rest of the mbuf functions. >> >> could a bridge user test this to see if it still works? carp seems >> fine with this on sparc64 stil. >> >> ok? >> > > m_adj can be done as part of the m_copym2 as well.
you want to shove m_adj into m_copym2? or you want m_copym2 callers to m_prepend 2 bytes first? > In the long run I don't think that introducing a new function > makes sense, not sure about 5.9 and right now, though. im not sure using m_copym2 for a deep copy makes that much sense generally. it's not a great implementation, and the vast majority of the callers use it to copy everything.