Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Oct 2012 12:44:47 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241131 - head/sys/netpfil/pf
Message-ID:  <201210021244.q92CilaR039036@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Oct  2 12:44:46 2012
New Revision: 241131
URL: http://svn.freebsd.org/changeset/base/241131

Log:
  To reduce volume of pfsync traffic:
  - Scan request update queue to prevent doubles.
  - Do not push undersized daragram in pfsync_update_request().

Modified:
  head/sys/netpfil/pf/if_pfsync.c

Modified: head/sys/netpfil/pf/if_pfsync.c
==============================================================================
--- head/sys/netpfil/pf/if_pfsync.c	Tue Oct  2 12:25:30 2012	(r241130)
+++ head/sys/netpfil/pf/if_pfsync.c	Tue Oct  2 12:44:46 2012	(r241131)
@@ -1832,9 +1832,15 @@ pfsync_request_update(u_int32_t creatori
 	PFSYNC_LOCK_ASSERT(sc);
 
 	/*
-	 * This code does nothing to prevent multiple update requests for the
-	 * same state being generated.
+	 * This code does a bit to prevent multiple update requests for the
+	 * same state being generated. It searches current subheader queue,
+	 * but it doesn't lookup into queue of already packed datagrams.
 	 */
+	TAILQ_FOREACH(item, &sc->sc_upd_req_list, ur_entry)
+		if (item->ur_msg.id == id &&
+		    item->ur_msg.creatorid == creatorid)
+			return;
+
 	item = malloc(sizeof(*item), M_PFSYNC, M_NOWAIT);
 	if (item == NULL)
 		return; /* XXX stats */
@@ -1854,8 +1860,6 @@ pfsync_request_update(u_int32_t creatori
 
 	TAILQ_INSERT_TAIL(&sc->sc_upd_req_list, item, ur_entry);
 	sc->sc_len += nlen;
-
-	pfsync_push(sc);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210021244.q92CilaR039036>