summaryrefslogtreecommitdiffstats
path: root/sys/contrib
Commit message (Collapse)AuthorAgeFilesLines
* Allocate our mbuf with m_get2().glebius2012-01-171-24/+10
|
* Remove spurious 8bit chars, turning files into plain ASCII.uqs2012-01-153-3/+3
|
* Revert to the old behavior of allocating table/table entries usingcsjp2012-01-141-12/+4
| | | | | | | | | | M_NOWAIT. Currently, the code allows for sleeping in the ioctl path to guarantee allocation. However code also handles ENOMEM gracefully, so propagate this error back to user-space, rather than sleeping while holding the global pf mutex. Reviewed by: glebius Discussed with: bz
* - Do not enumerate PCIe bus on CN56XX Pass 1 devices to avoid hard hang.gonzo2012-01-131-0/+6
| | | | | | There is known issue with this hardware. Submitted by: Andrew Duane <aduane@juniper.net>
* Merge ACPICA 20120111.jkim2012-01-11252-413/+965
|\
* | Redo r226660:glebius2012-01-111-35/+27
| | | | | | | | | | | | | | | | | | - Define schednetisr() to swi_sched. - In the swi handler check if there is some data prepared, and if true, then call pfsync_sendout(), however tell it not to schedule swi again. - Since now we don't obtain the pfsync lock in the swi handler, don't use ifqueue mutex to synchronize queue access.
* | Fix some spacing in code under __FreeBSD__.glebius2012-01-111-10/+10
| |
* | Add necessary locking in pfsync_in_ureq().glebius2012-01-111-6/+7
| |
* | Move PF_LOCK_ASSERT() under __FreeBSD__.glebius2012-01-111-1/+1
| |
* | Merge from OpenBSD:glebius2012-01-111-4/+1
| | | | | | | | | | | | | | revision 1.128 date: 2009/08/16 13:01:57; author: jsg; state: Exp; lines: +1 -5 remove prototypes of a bunch of functions that had their implementations removed in pfsync v5.
* | When running with INVARIANTS the mutex(9) code does all necessaryglebius2012-01-111-9/+2
| | | | | | | | asserts for non-recursive mutexes.
* | Can't pass MSIZE to m_cljget(), an mbuf can't be attached as external storageglebius2012-01-091-2/+1
| | | | | | | | to another mbuf.
* | Backout of backout: we need SI_SUB_PROTO_DOMAIN for pfsync, sinceglebius2012-01-091-1/+1
| | | | | | | | it needs existing inetdomain on startup.
* | Revert sub argument of MODULE_DECLARE back to r226532.glebius2012-01-092-2/+2
| | | | | | | | Noticed by: bz
* | In FreeBSD we determine presence of pfsync(4) at run-time, notglebius2012-01-093-36/+4
| | | | | | | | | | at compile time, so define NPFSYNC to 1 always. While here, remove unused defines.
* | Bunch of fixes to pfsync(4) module load/unload:glebius2012-01-091-146/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Make the pfsync.ko actually usable. Before this change loading it didn't register protosw, so was a nop. However, a module /boot/kernel did confused users. o Rewrite the way we are joining multicast group: - Move multicast initialization/destruction to separate functions. - Don't allocate memory if we aren't going to join a multicast group. - Use modern API for joining/leaving multicast group. - Now the utterly wrong pfsync_ifdetach() isn't needed. o Move module initialization from SYSINIT(9) to moduledata_t method. o Refuse to unload module, unless asked forcibly. o Improve a bit some FreeBSD porting code: - Use separate malloc type. - Simplify swi sheduling. This change is probably wrong from VIMAGE viewpoint, however pfsync wasn't VIMAGE-correct before this change, too. Glanced at by: bz
* | o Fix panic on module unload, that happened due to mutex beingglebius2012-01-091-52/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | destroyed prior to pfsync_uninit(). To do this, move all the initialization to the module_t method, instead of SYSINIT(9). o Fix another panic after module unload, due to not clearing the m_addr_chg_pf_p pointer. o Refuse to unload module, unless being unloaded forcibly. o Revert the sub argument to MODULE_DECLARE, to the stable/8 value. This change probably isn't correct from viewpoint of VIMAGE, but the module wasn't VIMAGE-correct before the change, as well. Glanced at by: bz
* | Merge from OpenBSD:glebius2012-01-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | revision 1.170 date: 2011/10/30 23:04:38; author: mikeb; state: Exp; lines: +6 -7 Allow setting big MTU values on the pfsync interface but not larger than the syncdev MTU. Prompted by the discussion with and tested by Maxim Bourmistrov; ok dlg, mpf Consistently use sc_ifp->if_mtu in the MTU check throughout the module. This backs out r228813.
* | Fix indentation.glebius2012-01-071-4/+3
| |
* | In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the samedim2012-01-071-1/+1
| | | | | | | | | | | | | | | | value used in sys/ofed/include/linux/netdevice.h), so there will be no buffer overruns in the rest of the inline functions in this file. Reviewed by: kmacy MFC after: 1 week
* | Update contrib/xz-embedded to build with new GEOM_UNCOMPRESS module.ray2012-01-045-1/+162
| | | | | | | | Approved by: adrian (mentor)
* | Initial copy of xz-embedded to sys/contrib/.adrian2012-01-0123-0/+4758
| | | | | | | | | | The upcoming geom_compress module (a read-only gzip/ulzma translation layer, similar to what geom_uzip does) will leverage parts of this.
* | - Properly clean state structure in cvmx_usb_initializegonzo2011-12-311-1/+1
| |
* | - CAPK-0100 board's USB timer is 12MHzgonzo2011-12-311-0/+3
| |
* | Fix LINT-VIMAGE build after r228814: use virtualized pf_pool_limits.pluknet2011-12-241-1/+1
| |
* | Merge from OpenBSD:glebius2011-12-221-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | revision 1.122 date: 2009/05/13 01:01:34; author: dlg; state: Exp; lines: +6 -4 only keep track of the number of updates on tcp connections. state sync on all the other protocols is simply pushing the timeouts along which has a resolution of 1 second, so it isnt going to be hurt by pfsync taking up to a second to send it over. keep track of updates on tcp still though, their windows need constant attention.
* | Merge from OpenBSD:glebius2011-12-221-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | revision 1.120 date: 2009/04/04 13:09:29; author: dlg; state: Exp; lines: +5 -5 use time_uptime instead of time_second internally. time_uptime isnt affected by adjusting the clock. revision 1.175 date: 2011/11/25 12:52:10; author: dlg; state: Exp; lines: +3 -3 use time_uptime to set state creation values as time_second can be skewed at runtime by things like date(1) and ntpd. time_uptime is monotonic and therefore more useful to compare against.
* | Merge couple more fixes from OpenBSD to bulk processing:glebius2011-12-221-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | revision 1.118 date: 2009/03/23 06:19:59; author: dlg; state: Exp; lines: +8 -6 wait an appropriate amount of time before giving up on a bulk update, rather than giving up after a hardcoded 5 seconds (which is generally much too short an interval for a bulk update). pointed out by david@, eyeballed by mcbride@ revision 1.171 date: 2011/10/31 22:02:52; author: mikeb; state: Exp; lines: +2 -1 Don't forget to cancel bulk update failure timeout when destroying an interface. Problem report and fix from Erik Lax, thanks! Start a brief note of revisions merged from OpenBSD.
* | We really mean MTU of the real interface here, not of our pseudo.glebius2011-12-221-1/+1
| |
* | In FreeBSD we always have bpf(4) API, either real or stub. No needglebius2011-12-221-6/+1
| | | | | | | | in detecting presense of 'device bpf'.
* | Restore a feature that was present in 5.x and 6.x, and was cleared inglebius2011-12-201-39/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7.x, 8.x and 9.x with pf(4) imports: pfsync(4) should suppress CARP preemption, while it is running its bulk update. However, reimplement the feature in more elegant manner, that is partially inspired by newer OpenBSD: - Rename term "suppression" to "demotion", to match with OpenBSD. - Keep a global demotion factor, that can be raised by several conditions, for now these are: - interface goes down - carp(4) has problems with ip_output() or ip6_output() - pfsync performs bulk update - Unlike in OpenBSD the demotion factor isn't a counter, but is actual value added to advskew. The adjustment values for particular error conditions are also configurable, and their defaults are maximum advskew value, so a single failure bumps demotion to maximum. This is for POLA compatibility, and should satisfy most users. - Demotion factor is a writable sysctl, so user can do foot shooting, if he desires to.
* | - Cover pfsync callouts deletion with PF_LOCK().glebius2011-12-201-1/+9
| | | | | | | | - Cover setting up interface between pf and pfsync with PF_LOCK().
* | In sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way todim2011-12-151-41/+43
| | | | | | | | | | | | tell the compiler some parameters are purposefully unused. MFC after: 1 week
* | Return value should be conditional on return value of pfsync_defer_ptr()glebius2011-11-301-2/+2
| | | | | | | | | | PR: kern/162947 Submitted by: Matthieu Kraus <matthieu.kraus s2008.tu-chemnitz.de>
* | Merge ACPICA 20111123.jkim2011-11-28122-1536/+10445
|\ \ | |/
* | Adjust a few old checks to use __FreeBSD_version macro tormh2011-11-242-3/+3
| | | | | | | | | | | | determine which version of FreeBSD kernel we're compiling. Approved by: kib (mentor)
* | Add missing PF_UNLOCK in pf_testkevlo2011-10-301-1/+5
| | | | | | | | Reviewed by: bz
* | Utilize new IF_DEQUEUE_ALL(ifq, m) macro in pfsyncintr() to reduceglebius2011-10-271-5/+6
| | | | | | | | contention on ifqueue lock.
* | Merge several fixes to bulk update processing from OpenBSD. Mergedglebius2011-10-231-27/+44
| | | | | | | | | | revisions: 1.148, 1.149, 1.150. This makes number of states on master/slave to be of a sane value.
* | Fix indentation, no code changed.glebius2011-10-231-2/+2
| |
* | - Fix a bad typo (FreeBSD specific) in pfsync_bulk_update(). Insteadglebius2011-10-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | of scheduling next run pfsync_bulk_update(), pfsync_bulk_fail() was scheduled. This lead to instant 100% state leak after first bulk update request. - After above fix, it appeared that pfsync_bulk_update() lacks locking. To fix this, sc_bulk_tmo callout was converted to an mtx one. Eventually, all pf/pfsync callouts should be converted to mtx version, since it isn't possible to stop or drain a non-mtx callout without risk of race. - Add comment that callout_stop() in pfsync_clone_destroy() lacks locking. Since pfsync0 can't be destroyed (yet), let it be here.
* | Fix from r226623 is not sufficient to close all races in pfsync(4).glebius2011-10-231-40/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The root of problem is re-locking at the end of pfsync_sendout(). Several functions are calling pfsync_sendout() holding pointers to pf data on stack, and these functions expect this data to be consistent. To fix this, the following approach was taken: - The pfsync_sendout() doesn't call ip_output() directly, but enqueues the mbuf on sc->sc_ifp's interfaces queue, that is currently unused. Then pfsync netisr is scheduled. PF_LOCK isn't dropped in pfsync_sendout(). - The netisr runs through queue and ip_output()s packets on it. Apart from fixing race, this also decouples stack, fixing potential issues, that may happen, when sending pfsync(4) packets on input path. Reviewed by: eri (a quick review)
* | Absense of M_WAITOK in malloc flags for UMA doesn'tglebius2011-10-231-1/+1
| | | | | | | | | | | | equals presense of M_NOWAIT. Specify M_NOWAIT explicitly. This fixes sleeping with PF_LOCK().
* | Correct flag for uma_zalloc() is M_WAITOK. M_WAIT is an old andglebius2011-10-231-1/+1
| | | | | | | | | | | | deprecated flag from historical mbuf(9) allocator. This is style only change.
* | Fix a race: we should update sc_len before dropping the pf lock, otherwise aglebius2011-10-211-3/+1
| | | | | | | | | | | | number of packets can be queued on sc, while we are in ip_output(), and then we wipe the accumulated sc_len. On next pfsync_sendout() that would lead to writing beyond our mbuf cluster.
* | In FreeBSD ip_output() expects ip_len and ip_off in host byte orderglebius2011-10-211-0/+8
| | | | | | | | PR: kern/159029
* | Fix recursive pf locking leading to panics. Splatter PF_LOCK_ASSERT()sbz2011-10-191-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | to document where we are expecting to be called with a lock held to more easily catch unnoticed code paths. This does not neccessarily improve locking in pfsync, it just tries to avoid the panics reported. PR: kern/159390, kern/158873 Submitted by: pluknet (at least something that partly resembles my patch ignoring other cleanup, which I only saw too late on the 2nd PR) MFC After: 3 days
* | De-virtualize the pf_task_mtx lock. At the current state of pf lockingbz2011-10-192-20/+14
| | | | | | | | | | | | | | | | | | and virtualization it is not helpful but complicates things. Current state of art is to not virtualize these kinds of locks - inp_group/hash/info/.. are all not virtualized either. MFC after: 3 days
* | Adjust the PF_ASSERT() macro to what we usually use in the network stack:bz2011-10-194-16/+18
| | | | | | | | | | | | PF_LOCK_ASSERT() and PF_UNLOCK_ASSERT(). MFC after: 3 days
* | In the non-FreeBSD case we do not expect PF_LOCK and friends to do anything.bz2011-10-191-13/+4
| | | | | | | | MFC after: 3 days
OpenPOWER on IntegriCloud