HomeFreeBSD

if_epair: refactor interface creation and enqueue code.

Description

if_epair: refactor interface creation and enqueue code.

  • Factor out queue selection (epair_select_queue()) and mbuf preparation (epair_prepare_mbuf()) from epair_menq(). It simplifies epair_menq() implementation and reduces the amount of dependencies on the neighbouring epair.
  • Use dedicated epair_set_state() instead of 2-lines copy-paste
  • Factor out unit selection code (epair_handle_unit()) from epair_clone_create(). It simplifies the clone creation logic.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D36689

Details

Provenance
melifaroAuthored on Sep 27 2022, 1:24 PM
Reviewer
kp
Differential Revision
D36689: if_epair: refactor interface creation and enqueue code.
Parents
rG0044bd90f239: pf: fix memory leak retrieving Ethernet rules
Branches
Unknown
Tags
Unknown