Skip to contentSkip to conversation

virtio-net: restrict build_skb() use to some arches

PATCH Guenter Roeck 1 participant 1 message Apr 20, 2021

Subsystems (3)
lore
Share & tools
lore

Guenter Roeck

author Tested-by
#0 lore raw
Quoted 12 lines · Eric Dumazet

From: Eric Dumazet <[email protected]>

build_skb() is supposed to be followed by
skb_reserve(skb, NET_IP_ALIGN), so that IP headers are word-aligned. (Best practice is to reserve NET_IP_ALIGN+NET_SKB_PAD, but the NET_SKB_PAD part is only a performance optimization if tunnel encaps are added.)

Unfortunately virtio_net has not provisioned this reserve. We can only use build_skb() for arches where NET_IP_ALIGN == 0

We might refine this later, with enough testing.

Quoted 7 lines
Fixes fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom")
Cc Xuan Zhuo <[email protected]>
Cc Jason Wang <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>

on alpha, sh4 (little endian).

Thanks!

Guenter