Skip to contentSkip to conversation

Allocation of small packets on Rx

DISCUSSION Benjamin Herrenschmidt 1 participant 1 message Dec 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi folks !

For a driver that gets small packets "inline" in the rx descriptors, I allocate the skb in the rx poll and copy the data to it.

Should I allocate an skb of the just the right size for the packet (+ eventual alignment) or is there any benefit to allocating all skb's the same size ?

The max size of those "inline" packets is 256 bytes and the driver today always allocate that. Does that "help" the allocator some way or should I just allocate what is needed for each packet ?

Cheers,
Ben.