tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: IFQ_ENQUEUE argument refactor (was Re: RFC: ALTQ caller refactor)



On Tue, Apr 05, 2016 at 01:11:01PM +0900, Kengo NAKAHARA wrote:
> (Q2) How do I decide the data is too large or not?
> e.g. ALTQ case, the data is struct altq_pktattr whose members are void *,
> int, and void *.
>     http://nxr.netbsd.org/xref/src/sys/altq/if_altq.h#86
> Is this three member struct too large?
> another PACKET_TAG_PF m_tag case, the data is struct pf_mtag
>     http://nxr.netbsd.org/xref/src/sys/dist/pf/net/pf_mtag.h#46
> How about this pattern?

Look at struct pkthdr. It's currently 2 pointers and 4 ints in the first
mbuf of every packet. We want to avoid pushing too much into it as the
rest of the mbuf is used for data, so "reasonable" small packets, we
want to completely stay in the first mbuf. The total size of a mbuf is
currently either 256 or 512 Bytes, mbuf header is < 60 Bytes, so
assuming that reasonable small means < 80 Bytes, we have around 120
Bytes or so to spend on the packet header.

Joerg


Home | Main Index | Thread Index | Old Index