kern/75794: em driver alignment problems

Sten Spans sten at blinkenlights.nl
Tue Jan 4 14:00:45 GMT 2005


>Number:         75794
>Category:       kern
>Synopsis:       em driver alignment problems
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 04 14:00:44 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Sten Spans
>Release:        5.3-STABLE
>Organization:
Blinkenlights
>Environment:
FreeBSD deepthought.blinkenlights.nl 5.3-STABLE FreeBSD 5.3-STABLE #15: Tue Dec 21 03:05:04 CET 2004     root at deepthought.blinkenlights.nl:/usr/obj/usr/src/sys/DEEPTHOUGHT  alpha

>Description:
The mbufs created by the em driver aren't aligned properly. This causes
problems on alpha which crashes on non-aligned pointers to ip adresses.
For ethernet mtu packets the mbufs are alinged by the following section
of code:

   2517         if (ifp->if_mtu <= ETHERMTU) {
   2518                 m_adj(mp, ETHER_ALIGN);
   2519         }

However when one uses jumbo frames this solution doesn't work 
( ethermtu ) and I guess that packets in multiple mbufs wouldn't
be fixed with this code.  
>How-To-Repeat:

ifconfig em0 mtu 1501.
>Fix:
There are quite a few ways to solve this problem. Sadly I don't know
enough about coding device drivers to suggest the corrent one.

Openbsd has a quite complex mbuf shifting trick, which is quite
crufty imho, but does solve the problem.
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/if_em.c.diff?r1=1.22&r2=1.23

In freebsd it might be possible to do the same mbuf shift in a bit
more elegant fashion. It might also be possible to correct the alignment
problem in the busdma code, which would be the ideal solution.

The problem is clear, how and who is going to solve it sadly isn't.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list