aboutsummaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* MFS r366395: Fix Typo in ng_hci_le_connection_complete_ep struct.Kyle Evans2020-10-041-1/+1
| | | | | | | Approved by: re (gjb) Notes: svn path=/releng/12.2/; revision=366419
* MFS r366220:Mark Johnston2020-09-281-5/+7
| | | | | | | | | | | MFC r366167: ng_l2tp: Fix callout synchronization in the rexmit timeout handler PR: 241133 Approved by: re (gjb) Notes: svn path=/releng/12.2/; revision=366223
* MFC: 364430:Warner Losh2020-09-091-0/+2
| | | | | | | | | | | | | r364430 | imp | 2020-08-20 11:19:40 -0600 (Thu, 20 Aug 2020) | 6 lines Tag pccard drivers with gone in 13. MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Notes: svn path=/stable/12/; revision=365539
* MFC r364509:Mark Johnston2020-08-301-0/+1
| | | | | | | | | ng_ubt: Add a device ID. PR: 248838 Notes: svn path=/stable/12/; revision=364972
* MFC r363736:Mark Johnston2020-08-072-4/+0
| | | | | | | ng_iface(4): Remove unsupported protocols. Notes: svn path=/stable/12/; revision=364015
* MFC r363735:Mark Johnston2020-08-071-0/+2
| | | | | | | | | ng_iface(4): Set the current VNET before calling netisr_dispatch(). PR: 242406 Notes: svn path=/stable/12/; revision=364014
* MFC r361582:Hans Petter Selasky2020-06-081-3/+4
| | | | | | | | | | Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=361914
* MFC r360116:Hans Petter Selasky2020-05-182-5/+5
| | | | | | | | | | | | Substitute le_read_supported_status with le_read_supported_states. Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27. PR: 245763 Submitted by: Marc Veldman <marc@bumblingdork.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=361164
* MFC r360092:Hans Petter Selasky2020-05-181-1/+29
| | | | | | | | | | | | Bring HCI error messages up-to-date. See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes. Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245737 Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=361155
* MFC r360051: tty: convert tty_lock_assert to tty_assert_lockedKyle Evans2020-04-241-2/+2
| | | | | | | | | | | | | | | A later change, currently being iterated on in D24459, will in-fact change the lock type to an sx so that TTY drivers can sleep on it if they need to. Committing this ahead of time to make the review in question a little more palatable. tty_lock_assert() is unfortunately still needed for now in two places to make sure that the tty lock has not been recursed upon, for those scenarios where it's supplied by the TTY driver and possibly a mutex that is allowed to recurse. Notes: svn path=/stable/12/; revision=360258
* MFC r357053 by markj: ng_nat: Pass IPv6 packets through.Eugene Grosbein2020-04-071-1/+0
| | | | | | | | | | | | | | | | | ng_nat implements NAT for IPv4 traffic only. When connected to an ng_ether node it erroneously handled IPv6 packets as well. This change is not sufficient: ng_nat does not do any validation of IP packets in this mode, even though they have not yet passed through ip_input(). PR: 243096 Reported by: Robert James Hernandez <rob@sarcasticadmin.com> Reviewed by: julian Differential Revision: https://reviews.freebsd.org/D23080 Notes: svn path=/stable/12/; revision=359707
* MFC r342168,357786: Allow ng_nat to be attached to a ethernet interfaceEugene Grosbein2020-04-072-8/+86
| | | | | | | | | | | | | | Allow ng_nat to be attached to a ethernet interface directly via ng_ether(4) or the likes. Add new control message types: setdlt and getdlt to switch from default DLT_RAW (no encapsulation) to DLT_EN10MB (ethernet). Submitted by: sobomax Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D18535 Relnotes: yes Notes: svn path=/stable/12/; revision=359697
* MFC r353026,353030,354244 (glebius), r356386:Bjoern A. Zeeb2020-01-282-232/+333
| | | | | | | | | | | | | | Remove the compile time limit for number of links a ng_bridge node can handle. Instead using an array on node private data, use per-hook private data. Reestablish old ABI. PR: 240787 Submitted by: Lutz Donnerhacke (lutz donnerhacke.de) Notes: svn path=/stable/12/; revision=357206
* Merge r353027:Gleb Smirnoff2019-11-071-1/+4
| | | | | | | Protect access to seq->xwin[] with the seq mutex. Notes: svn path=/stable/12/; revision=354424
* MFC r351196, r351324, r351326:Vladimir Kondratyev2019-09-093-2/+322
| | | | | | | | | | | | | | | | | | | | | | | ng_ubt(4): do not attach Intel Wireless 8260/8265 in bootloader mode. Add helper function for synchronous execution of HCI commands at probe stage and use this function to check firmware state of Intel Wireless 8260/8265 bluetooth devices found in many post 2016 year laptops. Attempt to initialize FreeBSD bluetooth stack while such a device is in bootloader mode locks the adapter hardly so it requires power on/off cycle to restore. This change blocks ng_ubt attachment unless operational firmware is loaded thus preventing the lock up. PR: 237083 Reviewed by: hps, emax MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21071 Notes: svn path=/stable/12/; revision=352101
* Merge r343895:Gleb Smirnoff2019-02-151-1/+10
| | | | | | | | | Allow some nesting of ng_iface(4) interfaces and add a configuration knob. PR: 235500 Notes: svn path=/stable/12/; revision=344139
* MFC r340617,341006: unbreak ng_source(4) for 64-bit platformsEugene Grosbein2019-01-141-0/+8
| | | | Notes: svn path=/stable/12/; revision=343021
* MFC r340135: Make ng_pptpgre(8) netgraph node be able to restore orderEugene Grosbein2018-12-042-37/+346
| | | | | | | | | | | | | | | | | | | | | for packets reordered in transit instead of dropping them altogether. It uses sequence numbers of PPtPGRE packets. A set of new sysctl(8) added to control this ability or disable it: net.graph.pptpgre.reorder_max (1) defines maximum length of node's private reorder queue used to keep data waiting for late packets. Zero value disables reordering. Default value 1 allows the node to restore the order for two packets swapped in transit. Greater values allow the node to deliver packets being late after more packets in sequence at cost of increased kernel memory usage. net.graph.pptpgre.reorder_timeout (1) defines time value in miliseconds used to wait for late packets. It may be useful to increase this if reordering spot is distant. Notes: svn path=/stable/12/; revision=341459
* Remove the Yarrow PRNG algorithm option in accordance with due noticeMark Murray2018-08-261-1/+1
| | | | | | | | | | | | | | | | | | | given in random(4). This includes updating of the relevant man pages, and no-longer-used harvesting parameters. Ensure that the pseudo-unit-test still does something useful, now also with the "other" algorithm instead of Yarrow. PR: 230870 Reviewed by: cem Approved by: so(delphij,gtetlow) Approved by: re(marius) Differential Revision: https://reviews.freebsd.org/D16898 Notes: svn path=/head/; revision=338324
* Remove extra M_ZERO from NG_MKRESPONSE() argument.Alexander Motin2018-08-201-1/+1
| | | | | | | | | | NG_MKRESPONSE() sets M_ZERO by itself. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=338105
* The interface name must be sanitized before the search to match the existingLuiz Otavio O Souza2018-08-151-2/+2
| | | | | | | | | | | | netgraph node. Fixes the search (and use) of VLANs with dot notation. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=337844
* Use if_tunnel_check_nesting() for ng_iface(4).Gleb Smirnoff2018-08-032-18/+3
| | | | Notes: svn path=/head/; revision=337278
* Use the new VNET_DEFINE_STATIC macro when we are defining static VNETAndrew Turner2018-07-243-9/+9
| | | | | | | | | | | variables. Reviewed by: bz Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16147 Notes: svn path=/head/; revision=336676
* Catch up two more places to the V_ifnet change to a CK_STAILQ.John Baldwin2018-05-242-2/+2
| | | | Notes: svn path=/head/; revision=334123
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
* Correct pseudo misspelling in sys/ commentsEd Maste2018-02-231-1/+1
| | | | | | | contrib code and #define in intel_ata.h unchanged. Notes: svn path=/head/; revision=329873
* ng_pppoe(8): add support for user-supplied Host-Uniq tag.Eugene Grosbein2018-02-142-40/+303
| | | | | | | | | | | | | | | | | | | | | A few ISP filter PADI requests based on such tag, to force the use of their own routers. The custom Host-Uniq tag is passed in the NGM_PPPOE_CONNECT control message, so it can be used with FreeBSD ppp(8) and mpd without any other change. Add support to send and receive PADM messages, HURL and MOTM, often used by service providers to provide ACS information and other configuration settings to the user CPE. Submitted by: ale Approved by: mav (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9270 Notes: svn path=/head/; revision=329279
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-213-4/+3
| | | | | | | | | | | | | | | | | | Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
* netgraph: make some use of mallocarray(9).Pedro F. Giffuni2018-01-153-3/+4
| | | | | | | | | | | | | | | | Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Notes: svn path=/head/; revision=328024
* sys: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-27105-0/+208
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326272
* Correction after r323873: #include <sys/lock.h> in addition to <sys/rmlock.h>Eugene Grosbein2017-09-281-0/+1
| | | | | | | | | PR: 220076 Approved by: mav (mentor) MFC after: 3 days Notes: svn path=/head/; revision=324081
* Unprotected modification of ng_iface(4) private data leads to kernel panic.Eugene Grosbein2017-09-211-4/+33
| | | | | | | | | | | | | | Fix a race with per-node read-mostly lock and refcounting for a hook. PR: 220076 Tested by: peixoto.cassiano Approved by: avg (mentor), mav (mentor) MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12435 Notes: svn path=/head/; revision=323873
* Check return value from soaccept().Gleb Smirnoff2017-06-141-1/+2
| | | | | | | Coverity: 1376209 Notes: svn path=/head/; revision=319944
* Listening sockets improvements.Gleb Smirnoff2017-06-084-119/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Separate fields of struct socket that belong to listening from fields that belong to normal dataflow, and unionize them. This shrinks the structure a bit. - Take out selinfo's from the socket buffers into the socket. The first reason is to support braindamaged scenario when a socket is added to kevent(2) and then listen(2) is cast on it. The second reason is that there is future plan to make socket buffers pluggable, so that for a dataflow socket a socket buffer can be changed, and in this case we also want to keep same selinfos through the lifetime of a socket. - Remove struct struct so_accf. Since now listening stuff no longer affects struct socket size, just move its fields into listening part of the union. - Provide sol_upcall field and enforce that so_upcall_set() may be called only on a dataflow socket, which has buffers, and for listening sockets provide solisten_upcall_set(). o Remove ACCEPT_LOCK() global. - Add a mutex to socket, to be used instead of socket buffer lock to lock fields of struct socket that don't belong to a socket buffer. - Allow to acquire two socket locks, but the first one must belong to a listening socket. - Make soref()/sorele() to use atomic(9). This allows in some situations to do soref() without owning socket lock. There is place for improvement here, it is possible to make sorele() also to lock optionally. - Most protocols aren't touched by this change, except UNIX local sockets. See below for more information. o Reduce copy-and-paste in kernel modules that accept connections from listening sockets: provide function solisten_dequeue(), and use it in the following modules: ctl(4), iscsi(4), ng_btsocket(4), ng_ksocket(4), infiniband, rpc. o UNIX local sockets. - Removal of ACCEPT_LOCK() global uncovered several races in the UNIX local sockets. Most races exist around spawning a new socket, when we are connecting to a local listening socket. To cover them, we need to hold locks on both PCBs when spawning a third one. This means holding them across sonewconn(). This creates a LOR between pcb locks and unp_list_lock. - To fix the new LOR, abandon the global unp_list_lock in favor of global unp_link_lock. Indeed, separating these two locks didn't provide us any extra parralelism in the UNIX sockets. - Now call into uipc_attach() may happen with unp_link_lock hold if, we are accepting, or without unp_link_lock in case if we are just creating a socket. - Another problem in UNIX sockets is that uipc_close() basicly did nothing for a listening socket. The vnode remained opened for connections. This is fixed by removing vnode in uipc_close(). Maybe the right way would be to do it for all sockets (not only listening), simply move the vnode teardown from uipc_detach() to uipc_close()? Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D9770 Notes: svn path=/head/; revision=319722
* Make cached Bluetooth LE host advertise information visible from userland.Takanori Watanabe2017-04-276-15/+53
| | | | | | | Differential Revision: https://reviews.freebsd.org/D10362 Notes: svn path=/head/; revision=317506
* Remove the NATM framework including the en(4), fatm(4), hatm(4), andBrooks Davis2017-04-243-1697/+12
| | | | | | | | | | | | | | | | | | | | | | | | patm(4) devices. Maintaining an address family and framework has real costs when we make infrastructure improvements. In the case of NATM we support no devices manufactured in the last 20 years and some will not even work in modern motherboards (some newer devices that patm(4) could be updated to support apparently exist, but we do not currently have support). With this change, support remains for some netgraph modules that don't require NATM support code. It is unclear if all these should remain, though ng_atmllc certainly stands alone. Note well: FreeBSD 11 supports NATM and will continue to do so until at least September 30, 2021. Improvements to the code in FreeBSD 11 are certainly welcome. Reviewed by: philip Approved by: harti Notes: svn path=/head/; revision=317383
* mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION.Pedro F. Giffuni2017-01-201-4/+3
| | | | | | | | | | | | | | There were several places where reference to compression were left unfinished. Furthermore, KASSERTs contained references to MPPC_INVALID which is not defined in the tree and therefore were sure to break with INVARIANTS: comment them out. Reported by: Eugene Grosbein PR: 216265 MFC after: 3 days Notes: svn path=/head/; revision=312443
* Changes to allow the patching of packets with an offset (and other changes.. ↵Julian Elischer2016-12-022-344/+486
| | | | | | | | | | | | see man page) PR: 206185 Submitted by: Dmitry Vagin <daemon-hammer@ya.ru> MFC after: 1 week Relnotes: yes (also ng_checksum node) Notes: svn path=/head/; revision=309408
* Fix return value from ng_uncallout().Hans Petter Selasky2016-12-021-1/+5
| | | | | | | | | | | | | callout_stop() recently started returning -1 when the callout is already stopped, which is not handled by the netgraph code. Properly filter the return value. Netgraph callers only want to know if the callout was cancelled and not draining or already stopped. Discussed with: julian, glebius MFC after: 2 weeks Notes: svn path=/head/; revision=309404
* Writing out the L2TP control packet requires 12 bytes ofBjoern A. Zeeb2016-11-171-0/+10
| | | | | | | | | | | | contiguous memory but in one path we did not always guarantee this, thus do a m_pullup() there. PR: 214385 Submitted by: Joe Jones (joeknockando googlemail.com) MFC after: 3 days Notes: svn path=/head/; revision=308748
* Fix improper use of "its".Bryan Drewery2016-11-081-3/+3
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308457
* Avoid panic from ng_uncallout when unpluggin ethernet cable with activeSean Bruno2016-08-081-1/+1
| | | | | | | | | | | | PPTP VPN connection. Submitted by: Michael Zhilin <mizhka@gmail.com> Reviewed by: ngie MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7209 Notes: svn path=/head/; revision=303848
* netgraph module for reconstructing checksumsJulian Elischer2016-08-012-0/+817
| | | | | | | | | PR: 206108 Submitted by: Dmitry Vagin daemon.hammer@ya.ru MFC after: 1 month Notes: svn path=/head/; revision=303612
* slite style changes. There is an incoming patch that rewrites aJulian Elischer2016-08-012-25/+28
| | | | | | | | | | | | lot of this module and I want to get the style and whitespace changes in a separate commit (or maybe more). PR: 206185 Submitted by: Dmitry Vagin MFC after: 1 month Notes: svn path=/head/; revision=303611
* Get closer to a VIMAGE network stack teardown from top to bottom ratherBjoern A. Zeeb2016-06-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than removing the network interfaces first. This change is rather larger and convoluted as the ordering requirements cannot be separated. Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and related modules to their own SI_SUB_PROTO_FIREWALL. Move initialization of "physical" interfaces to SI_SUB_DRIVERS, move virtual (cloned) interfaces to SI_SUB_PSEUDO. Move Multicast to SI_SUB_PROTO_MC. Re-work parts of multicast initialisation and teardown, not taking the huge amount of memory into account if used as a module yet. For interface teardown we try to do as many of them as we can on SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling over a higher layer protocol such as IP. In that case the interface has to go along (or before) the higher layer protocol is shutdown. Kernel hhooks need to go last on teardown as they may be used at various higher layers and we cannot remove them before we cleaned up the higher layers. For interface teardown there are multiple paths: (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), (b) any interface is moved from a virtual network stack to a different network stack ("vmove"), or (c) a virtual network stack is being shut down. All code paths go through if_detach_internal() where we, depending on the vmove flag or the vnet state, make a decision on how much to shut down; in case we are destroying a VNET the individual protocol layers will cleanup their own parts thus we cannot do so again for each interface as we end up with, e.g., double-frees, destroying locks twice or acquiring already destroyed locks. When calling into protocol cleanups we equally have to tell them whether they need to detach upper layer protocols ("ulp") or not (e.g., in6_ifdetach()). Provide or enahnce helper functions to do proper cleanup at a protocol rather than at an interface level. Approved by: re (hrs) Obtained from: projects/vnet Reviewed by: gnn, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6747 Notes: svn path=/head/; revision=302054
* Disconnect LE socket when the HCI connection associated is disconnected.Takanori Watanabe2016-06-073-3/+10
| | | | Notes: svn path=/head/; revision=301558
* Fix style(9).Jung-uk Kim2016-05-261-2/+4
| | | | Notes: svn path=/head/; revision=300772
* Use bit_count(3) instead of four bitcount32() calls.Jung-uk Kim2016-05-261-18/+17
| | | | | | | | Reviewed by: asomers, ngie Differential Revision: https://reviews.freebsd.org/D6543 Notes: svn path=/head/; revision=300771
* sys/netgraph: spelling fixes in comments.Pedro F. Giffuni2016-04-2938-73/+73
| | | | | | | No functional change. Notes: svn path=/head/; revision=298813
* sys: extend use of the howmany() macro when available.Pedro F. Giffuni2016-04-261-2/+2
| | | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298649