HomeFreeBSD

if_clone: rework cloning KPI

Description

if_clone: rework cloning KPI

The current cloning KPI does not provide a way of creating interfaces
with parameres from within kernel. The reason is that those parameters
are passed as an opaque pointer and it is not possible to specify whether
this pointer references kernel-space or user-space.
Instead of just adding a flag, generalise the KPI to simplify the
extension process. Unify current notion of SIMPLE and ADVANCED users
by leveraging newly-added IFC_C_AUTOUNIT flag to automatically pick
unit number, which is a primary feature of the "SIMPLE" KPI.
Use extendable structures everywhere instead of passing function
pointers or parameters.
Isolate all parts of the oldKPI under CLONE_COMPAT_13 so it can be safely
merged back to 13. Old KPI will be removed after the merge.

Differential Revision: https://reviews.freebsd.org/D36632
MFC after: 2 weeks

(cherry picked from commit 09ee0fc023c0c7ef90cb277afbb473abe4d95a9a)

Details

Provenance
melifaroAuthored on Sep 22 2022, 9:37 AM
Differential Revision
D36632: if_clone: rework cloning KPI
Parents
rG40c711523e3a: net: add if_allocdescr() to permit updating iface description from the kernel
Branches
Unknown
Tags
Unknown