Page MenuHomeFreeBSD

Avoid calling CURVNET_[SET|RESTORE] up to twice per packet

Authored by shurd on Dec 4 2017, 8:37 PM.



The LRO possible test was calling CURVNET_SET once for IPv4
and once for IPv6 for each packet in a chain. Only call it once per
chain instead.

Test Plan

Check for improved performance

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

shurd created this revision.Dec 4 2017, 8:37 PM
sbruno accepted this revision.Dec 4 2017, 11:04 PM


This revision is now accepted and ready to land.Dec 4 2017, 11:04 PM
cem added inline comments.Dec 4 2017, 11:27 PM
2471 ↗(On Diff #36204)

I would call this kind of operation "get" rather than "set"

2475 ↗(On Diff #36204)

Also spelled *v6 = (VNET(ip6_forwarding) == 0);

ae added inline comments.Dec 5 2017, 7:31 AM
2474 ↗(On Diff #36204)

Both conditions should be guarded with #ifdef INET and #ifdef INET6.

shurd updated this revision to Diff 36250.Dec 5 2017, 6:48 PM

Integrate feedback from ae and cem

Rename functions and variables to better indicate what the represent
rather than what they're used for. Simplify logic, check INET and INET6

This revision now requires review to proceed.Dec 5 2017, 6:48 PM
shurd marked 3 inline comments as done.Dec 5 2017, 6:48 PM

Updated, thanks.

cem accepted this revision.Dec 5 2017, 7:01 PM

A static analyzer may reject passing uninitialized values to iflib_check_lro_possible in the case that one of INET or INET6 is disabled. But I don't think there is any real problem as the uninitialized value is unused.

This revision is now accepted and ready to land.Dec 5 2017, 7:01 PM
This revision was automatically updated to reflect the committed changes.