Page MenuHomeFreeBSD

llan: byte swap the receive queue entries
ClosedPublic

Authored by pkubaj on Wed, Sep 23, 1:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 30, 2:39 AM
Unknown Object (File)
Wed, Sep 30, 12:08 AM
Unknown Object (File)
Tue, Sep 29, 9:01 PM
Unknown Object (File)
Tue, Sep 29, 7:48 PM
Unknown Object (File)
Tue, Sep 29, 10:47 AM
Unknown Object (File)
Tue, Sep 29, 3:48 AM
Unknown Object (File)
Tue, Sep 29, 2:43 AM
Unknown Object (File)
Mon, Sep 28, 5:33 AM
Subscribers

Details

Summary

The receive queue of a PAPR logical LAN is filled in by the hypervisor, so
its fields are big endian, but llan_intr() read the offset and the length of
each frame natively. On a little endian kernel the length of a 134 byte
frame reads as 0x86000000, and ether_input() discards the mbuf because m_len
is not even large enough to hold an ethernet header. No frame is ever
received: the interface attaches, transmits, and counts every inbound packet
as an error.

Transmit is unaffected because that path passes the buffer descriptors to
the hypervisor in hcall registers rather than through memory.

MFC after: 1 week

Test Plan

POWER9 pseries guest, powerpc64le, with a spapr-vlan interface.

Before: "llan0: discard frame w/o leading ethernet header (len -2046820352)"
for every inbound frame (-2046820352 is 0x86000000, byte swapped 134);
netstat -ibn shows 118 input errors out of 123 packets; dhclient(8) never
completes and ping(8) loses 100% while Opkts increases.

After: DHCP gets a lease, ping reports no loss, no discard messages and no
input errors.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable