Subject: RE: Need your help to debug mbuf leaks
To: Andy Ruhl <acruhl@gmail.com>
From: Mirla, Pavan Kumar <pavan@riverstonenet.com>
List: netbsd-help
Date: 07/06/2005 05:51:48
Hi Andy
Thanks for your reply.Here are the details.My host PC is linux, on this =
I have installed vmware to simulate  netBSD PC's.

I have

pc1----(virtual net1)---pc2 ---connected to ( virtual net 3)
pc3----(virtual net2)---pc4-- connected to  ( virtual net 3)

My need is to have pc2 interfaces to be in promiscuous mode.ifconfig =
doesn't seem to have the option to=20
set interface to promisc. So I enabled tcpdump to make it promisc =
mode.This interface receives lot of traffic from it's neighbors.
I have not tried to increse the NMBCLUSTERS value.I guess I will face =
the same problem of mbuf exhaustion.I want mbufs to be flushed at =
certain intervals to initial values.Can this be done?



Here are the PC2 details:
--------------------------
rt2-lcpu1: {3} uname -a
NetBSD rt2-lcpu1 1.6 NetBSD 1.6 (LCPU) :  i386

rt2-lcpu1: {1} netstat -m
1645 mbufs in use:
        1567 mbufs allocated to data
        78 mbufs allocated to packet headers
1563/1572 mapped pages in use
3564 Kbytes allocated to network (99% in use)
0 requests for memory denied
0 requests for memory delayed
0 calls to protocol drain routines

after 1 minute


rt2-lcpu1: {2} netstat -m
1723 mbufs in use:
        1645 mbufs allocated to data
        78 mbufs allocated to packet headers
1641/1650 mapped pages in use
3736 Kbytes allocated to network (99% in use)
0 requests for memory denied
0 requests for memory delayed
0 calls to protocol drain routines

after a while I get message
/netbsd: WARNING: : mclpool limit reached: increase NMBCLUSTERS =20



rt2-lcpu1: {5} ifconfig -a
pcn0: =
flags=3D28b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> =
mtu 1500
        address: 02:00:7f:01:00:01
        media: Ethernet autoselect (autoselect)
pcn1: flags=3D28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 02:0c:29:de:98:39
        media: Ethernet autoselect (autoselect)
lo0: flags=3D28009<UP,LOOPBACK,MULTICAST> mtu 33220
        inet 127.0.0.1 netmask 0xffff0000
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        inet6 ::1 prefixlen 128
ieth0: flags=3D28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 02:00:7f:01:00:01
        media: Ethernet autoselect (autoselect)
        inet 127.1.0.1 netmask 0xffff0000 broadcast 127.1.255.255


rt2-lcpu1: {6} ps -ax | grep tcp
1155 p2 S+   0:00.04 grep tcp
 896 E0 S    0:01.98 tcpdump -i ieth0 -s 10 -S ether src host =
01:02:03:04:05:06


rt2-lcpu1: {11} sysctl -a | grep clusters
kern.mbuf.nmbclusters =3D 2048




Thanks,
Pavan=20






-----Original Message-----
From: Andy Ruhl [mailto:acruhl@gmail.com]
Sent: Tue 7/5/2005 7:24 PM
To: Mirla, Pavan Kumar
Cc: netbsd-help@netbsd.org
Subject: Re: Need your help to debug mbuf leaks
=20
On 7/4/05, Mirla, Pavan Kumar <pavan@riverstonenet.com> wrote:
>=20
>=20
> Hi,
>=20
> I am facing a problem where I get error messages like " mclpool
> exhausted, increase NMBCLUSTERS". When I type in "netstat -m" I see =
big
> number of calls to protocol drain routines.
>=20
> I suspect a memory leak here.I wanted to know if we can free the mbufs
> dynamically before it reaches starvation.What are the possible causes
> for this situation.If you could provide pointers it will help me.I am
> stuck with this issue.
>=20
> This situation happens when I enable tcpdump on the interfaces.I need =
to
> have tcpdump on my interfaces to make my interfaces be in promisc =
mode.
>=20
> If you need the logs.I will provide them to you.
> I am using netBSD virtual machines instances using vmware sofware.

I'm not going to be the one to help you, but it might be nice to know
this stuff:

o NetBSD level (uname -a)
o What you did to troubleshoot already
o Did you increase nmbclusters and the same problem just keeps coming =
back?
o Whatever other useful information you have.

Andy