Subject: Some observations about DMA segment count
To: None <>
From: Jason R Thorpe <>
List: tech-net
Date: 07/24/2001 20:32:41
swinger:thorpej 19$ vmstat -e
event                               total     rate type
stge1 txdmaintr                     20504       30 intr
stge1 rxintr                       282943      422 intr
stge1 txseg1                        48384       72 misc
stge1 txseg2                       279768      417 misc
stge1 txseg3                            8        0 misc
stge1 rxipsum                      283442      423 misc
stge1 rxtcpsum                     283414      423 misc
stge1 txipsum                      234827      350 misc
stge1 txtcpsum                     234826      350 misc
swinger:thorpej 20$  

During my writing of the "stge" driver, I discovered that the vast majority
of our TCP packets that are sent out are comprised of 2 DMA segments.

This is probably because tcp_output() allocates an mbuf cluster for the
data, but the link header has to be prepended .. the prepend allocates
a new mbuf and sticks it in front because M_EXT is set (thus it is assumed
that it is not safe to scribble into the m->m_data area).

Thoughts on what to do about this?  There should certainly be room in front
of the packet for the link header, and we should try to avoid allocating
the extra mbuf.

        -- Jason R. Thorpe <>