em(4) patch for ENOBUFS

Pyun YongHyeon pyunyh at gmail.com
Sat Jul 29 07:01:34 UTC 2006


Hi,

Whilst reading em(4) code to fix jb's sun4v issue I noticed em(4) is
very vulnerable to ENOBUFS situation on receive path.
If em(4) encounter an ENOBUFS it just breaks receive loop and then
try to process the packet next time. However it didn't update the Rx
descriptor status so it never process receive path again(em_handle_rxtx
task runs but it couldn't complete its job and the task takes up all
your CPU).

I've revised receive path to cope with the ENOBUFS situation more
gracefully. It also contains a fix to handle DMA map loading failure
case on receive path by allocating a spare DMA map.

If you have em(4) and experienced ENOBUFS problem please try the
following patch and let me know the result.
http://people.freebsd.org/~yongari/em.ENOBUFS.patch

You can reproduce current issue by lowering number of mbuf clusters
in /boot/loader.conf. For example, add
kern.ipc.nmbclusters="1000" to limit number of mbuf clusters.

-- 
Regards,
Pyun YongHyeon


More information about the freebsd-current mailing list