HomeFreeBSD

inpcb: immediately return matching pcb on lookup

Description

inpcb: immediately return matching pcb on lookup

This saves a lot of CPU cycles if you got large connection table.

The code removed originates from 413628a7e3d, a very large changeset.
Discussed that with Bjoern, Jamie we can't recover why would we ever
have identical 4-tuples in the hash, even in the presence of jails.
Bjoern did a test that confirms that it is impossible to allocate an
identical connection from a jail to a host. Code review also confirms
that system shouldn't allow for such connections to exist.

With a lack of proper test suite we decided to take a risk and go
forward with removing that code.

Reviewed by: gallatin, bz, markj
Differential Revision: https://reviews.freebsd.org/D38015

Details

Provenance
glebiusAuthored on Feb 7 2023, 5:21 PM
Reviewer
gallatin
Differential Revision
D38015: inpcb: immediately return matching pcb on lookup
Parents
rGdfc4d218ce5d: tcp: use straight in_pcbconnect() in tcp_connect()
Branches
Unknown
Tags
Unknown