Page MenuHomeFreeBSD

mbuf: add a way to mark flowid as calculated from the internal headers
ClosedPublic

Authored by kib on Feb 18 2021, 2:10 PM.

Details

Summary

In some settings offload might calculate hash from decapsulated packet. Reserve a bit in packet header rsstype to indicate that.

Add m_adj_decap() that acts similarly to m_adj, but also either clear flowid if it is not marked as inner, or transfer it to the decapsulated header, clearing inner indicator. It depends on the internals of m_adj() that reuses the argument packet header for the result.

Use m_adj_decap() for decapsulating vxlan(4) and gif(4) input packets.

Sponsored by: Nvidia Networking / Mellanox Technologies

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Feb 18 2021, 2:10 PM
sys/sys/mbuf.h
560

M_HASHTYPE_GET(m) -> (m)->m_pkthdr.rsstype

Then you save an AND operation.

kib marked an inline comment as done.Feb 18 2021, 2:35 PM
kib added inline comments.
sys/sys/mbuf.h
560

I am sure that compiler does not generate to ands there, but ok.

kib marked an inline comment as done.

Hans suggestion, unwind one level of macro.

ae added inline comments.
sys/kern/uipc_mbuf.c
865

s/In/If/

This revision is now accepted and ready to land.Feb 18 2021, 2:46 PM
kib marked an inline comment as done.Feb 18 2021, 3:02 PM