diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-01-16 00:28:30 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-01-16 00:28:30 +0000 |
commit | c2f095f565461c2ee44073395c0ce9fdeafd7877 (patch) | |
tree | b0977c131da2fdafd418e89b13fc9cc4c5aa9274 /sys/dev/cxgb/cxgb_sge.c | |
parent | df0456225c90373f0b05d1ddc8a1bdb5699277c9 (diff) | |
download | FreeBSD-src-c2f095f565461c2ee44073395c0ce9fdeafd7877.zip FreeBSD-src-c2f095f565461c2ee44073395c0ce9fdeafd7877.tar.gz |
Fix mbuf leak caused by freeing packet zone clusters but not their associated mbufs
- Track packet zone mbufs separately from other mbufs
- free packet zone buffers via m_free rather than trying to manage the refcount
as with clusters - its refcount and management seems to be "special"
Diffstat (limited to 'sys/dev/cxgb/cxgb_sge.c')
-rw-r--r-- | sys/dev/cxgb/cxgb_sge.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index b758ac7..32c7ec7 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -1409,7 +1409,7 @@ t3_encap(struct sge_qset *qs, struct mbuf **m, int count) ((m0->m_flags & (M_EXT|M_NOFREE)) == M_EXT) && (m0->m_ext.ext_type != EXT_PACKET)) { m0->m_flags &= ~M_EXT ; - mbufs_outstanding--; + cxgb_mbufs_outstanding--; m_free(m0); } @@ -3223,8 +3223,12 @@ t3_add_attach_sysctls(adapter_t *sc) 0, "#times a cluster was freed through ext_free"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "mbufs_outstanding", - CTLFLAG_RD, &mbufs_outstanding, - 0, "#mbufs in flight in the driver"); + CTLFLAG_RD, &cxgb_mbufs_outstanding, + 0, "#mbufs in flight in the driver"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "pack_outstanding", + CTLFLAG_RD, &cxgb_pack_outstanding, + 0, "#packet in flight in the driver"); } |