aboutsummaryrefslogtreecommitdiff
path: root/sys/net/iflib_clone.c
Commit message (Collapse)AuthorAgeFilesLines
* iflib(9): Remove support for cloning pseudo interfacesMarius Strobl2023-08-031-303/+0
| | | | | | | | | | | | | | | | This code was used by the first incarnation of wg(4) and is dead ever since f187d6dfbf633665ba6740fe22742aec60ce02a2 has removed the latter again. Moreover, this code matched iflib(4) like a square peg fits in a round hole, was incomplete and despite some hacks still tailored to VPC and wg(4) but not generic. In effect, this reverts the following: 09f6ff4f1a47c3009dc16fdc609a44f2341bc7ac (w/ its "ancillary changes") 9aeca21324f481f57f2ecb7009f461f4f51b62b3 1f93e931d9f0c688f43f98ef777e04636a325526 0f9544d03e89d180f94a7a84b110ec7d2b6c625a 0dd691b41276ce13d25ffb1443af27f85038aa3f Reviewed by: erj, kbowling Differential Revision: <https://reviews.freebsd.org/D41196>
* ifnet/API: Move struct ifnet definition to a <net/if_private.h>Justin Hibbits2023-01-241-0/+1
| | | | | | | | | | | Hide the ifnet structure definition, no user serviceable parts inside, it's a netstack implementation detail. Include it temporarily in <net/if_var.h> until all drivers are updated to use the accessors exclusively. Reviewed by: glebius Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38046
* Create wrapper for Giant taken for newbusWarner Losh2021-12-101-6/+6
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* iflib: allow clone detach if not yet initKyle Evans2021-03-091-1/+2
| | | | | | | | | | | | | If we hit an error during init, then we'll unwind our state and attempt to detach the device -- don't block it. This was discovered by creating a wg0 with missing parameters; said failure ended up leaving this orphaned device in place and ended up panicking the system upon enumeration of the dev.* sysctl space. Reviewed by: gallatin, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29145
* iflib: Fix detach of pseudo interfacesMark Johnston2021-02-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | In commit 38bfc6dee33b we added an IFDI_DETACH() call to iflib_pseudo_deregister() since it looked like it was missing. One is present in the error-handling path of iflib_pseudo_register(). However, the detach actually comes from the DEVICE_DETACH() method for the above-mentioned device_t, so now we're calling IFDI_DETACH() twice when destroying a pseudo interface. Fix the problem by not calling IFDI_DETACH() from the device detach routine. This way we can ensure that iflib de-initialization always happens in a consistent order. It also ensures that you can't do silly things like "devctl detach <pseudo ifnet>", which would previously detach the driver without tearing down the corresponding ifnet. PR: 253541 Reviewed by: erj MFC after: 1 week Fixes: 38bfc6dee33b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28774
* Import kernel WireGuard supportMatt Macy2020-11-291-1/+0
| | | | | | | | | | | | | Data path largely shared with the OpenBSD implementation by Matt Dunwoodie <ncon@nconroy.net> Reviewed by: grehan@freebsd.org MFC after: 1 month Sponsored by: Rubicon LLC, (Netgate) Differential Revision: https://reviews.freebsd.org/D26137 Notes: svn path=/head/; revision=368163
* net: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365071
* - Remove the unused ifc_link_irq and ifc_mtx_name members of struct iflib_ctx.Marius Strobl2019-05-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | - Remove the only ever written to ift_db_mtx_name member of struct iflib_txq. - Remove the unused or only ever written to ifr_size, ifr_cq_pidx, ifr_cq_gen and ifr_lro_enabled members of struct iflib_rxq. - Consistently spell DMA, RX and TX uppercase in comments, messages etc. instead of mixing with some lowercase variants. - Consistently use if_t instead of a mix of if_t and struct ifnet pointers. - Bring the function comments of _iflib_fl_refill(), iflib_rx_sds_free() and iflib_fl_setup() in line with reality. - Judging problem reports, people are wondering what on earth messages like: "TX(0) desc avail = 1024, pidx = 0" are trying to indicate. Thus, extend this string to be more like that of non-iflib(4) Ethernet MAC drivers, notifying about a watchdog timeout due to which the interface will be reset. - Take advantage of the M_HAS_VLANTAG macro. - Use false/true rather than FALSE/TRUE for variables of type bool. - Use FALLTHROUGH as advocated by style(9). Notes: svn path=/head/; revision=347211
* iflib(9): Add support for cloning pseudo interfacesMatt Macy2018-05-111-0/+303
Part 3 of many ... The VPC framework relies heavily on cloning pseudo interfaces (vmnics, vpc switch, vcpswitch port, hostif, vxlan if, etc). This pulls in that piece. Some ancillary changes get pulled in as a side effect. Reviewed by: shurd@ Approved by: sbruno@ Sponsored by: Joyent, Inc. Differential Revision: https://reviews.freebsd.org/D15347 Notes: svn path=/head/; revision=333502