Author: glebius
Date: Thu Dec 22 18:56:27 2011
New Revision: 228814
URL: http://svn.freebsd.org/changeset/base/228814

Log:
  Merge couple more fixes from OpenBSD to bulk processing:
  
    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.

Modified:
  head/sys/contrib/pf/net/if_pfsync.c

Modified: head/sys/contrib/pf/net/if_pfsync.c
==============================================================================
--- head/sys/contrib/pf/net/if_pfsync.c Thu Dec 22 18:51:35 2011        
(r228813)
+++ head/sys/contrib/pf/net/if_pfsync.c Thu Dec 22 18:56:27 2011        
(r228814)
@@ -42,6 +42,11 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+/*
+ * Revisions picked from OpenBSD after revision 1.110 import:
+ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates
+ */
+
 #ifdef __FreeBSD__
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -536,6 +541,7 @@ pfsync_clone_destroy(struct ifnet *ifp)
        EVENTHANDLER_DEREGISTER(ifnet_departure_event, sc->sc_detachtag);
        PF_LOCK();
 #endif
+       timeout_del(&sc->sc_bulkfail_tmo);
        timeout_del(&sc->sc_bulk_tmo);
        timeout_del(&sc->sc_tmo);
 #ifdef __FreeBSD__
@@ -1604,14 +1610,16 @@ pfsync_in_bus(struct pfsync_pkt *pkt, st
        switch (bus->status) {
        case PFSYNC_BUS_START:
 #ifdef __FreeBSD__
-               callout_reset(&sc->sc_bulkfail_tmo, 5 * hz, pfsync_bulk_fail,
-                   V_pfsyncif);
+               callout_reset(&sc->sc_bulkfail_tmo, 4 * hz +
+                   pf_pool_limits[PF_LIMIT_STATES].limit /
+                   ((sc->sc_sync_if->if_mtu - PFSYNC_MINPKT) /
+                   sizeof(struct pfsync_state)),
+                   pfsync_bulk_fail, V_pfsyncif);
 #else
-               timeout_add_sec(&sc->sc_bulkfail_tmo, 5); /* XXX magic */
-#endif
-#ifdef XXX
+               timeout_add(&sc->sc_bulkfail_tmo, 4 * hz +
                    pf_pool_limits[PF_LIMIT_STATES].limit /
-                   (PFSYNC_BULKPACKETS * sc->sc_maxcount));
+                   ((sc->sc_if.if_mtu - PFSYNC_MINPKT) /
+                   sizeof(struct pfsync_state)));
 #endif
 #ifdef __FreeBSD__
                if (V_pf_status.debug >= PF_DEBUG_MISC)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to