diff options
author | qingli <qingli@FreeBSD.org> | 2006-02-08 23:32:57 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2006-02-08 23:32:57 +0000 |
commit | 5df75b3ab36e347dff07e968c555b420e14e35cd (patch) | |
tree | 237362726ecad8ceba61605b9e995293cc8b6611 /sys/netinet/tcp_syncache.c | |
parent | 40531c331d4f6e2525d4963e86be8b2a04dbe81e (diff) | |
download | FreeBSD-src-5df75b3ab36e347dff07e968c555b420e14e35cd.zip FreeBSD-src-5df75b3ab36e347dff07e968c555b420e14e35cd.tar.gz |
Redo the previous fix by setting the UMA_ZONE_ZINIT bit in the syncache
zone, eliminating the need to call bzero() after each syncache entry
allocation.
Suggested by: glebius
Reviewed by: andre
MFC after: 3 days
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r-- | sys/netinet/tcp_syncache.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 55e285a..9e161d03 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -255,7 +255,8 @@ syncache_init(void) * older one. */ tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, + UMA_ZONE_NOFREE | UMA_ZONE_ZINIT); uma_zone_set_max(tcp_syncache.zone, tcp_syncache.cache_limit); tcp_syncache.cache_limit -= 1; } @@ -915,7 +916,6 @@ syncache_add(inc, to, th, sop, m) /* * Fill in the syncache values. */ - bzero(sc, sizeof(*sc)); sc->sc_tp = tp; sc->sc_inp_gencnt = tp->t_inpcb->inp_gencnt; sc->sc_ipopts = ipopts; @@ -1386,7 +1386,6 @@ syncookie_lookup(inc, th, so) * Fill in the syncache values. * XXX duplicate code from syncache_add */ - bzero(sc, sizeof(*sc)); sc->sc_ipopts = NULL; sc->sc_inc.inc_fport = inc->inc_fport; sc->sc_inc.inc_lport = inc->inc_lport; |