From owner-freebsd-net@FreeBSD.ORG Mon Apr 11 14:05:53 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA04106564A for ; Mon, 11 Apr 2011 14:05:53 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 17F3D8FC16 for ; Mon, 11 Apr 2011 14:05:52 +0000 (UTC) Received: by wwk4 with SMTP id 4so2675840wwk.1 for ; Mon, 11 Apr 2011 07:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=KNZyfU5B2y0/E64RH9qpmANNfhwdAJJjk3/iaUE4Lcg=; b=H4bjWRjXGm9ypxd1FpCoRlG4KoCm+cUpJzCDYtHjZ+HcyJqCp2KYoYwwatPLexi9lu pOdPoSsEdS/+OZHRhh+W30DbL6UDYFMCIaDkbkv2Nvx0/h947MVpUNl4YZT8ilzbJ+az OLiM+ayQBrL3u4W80HDhDs91qCGf+Hi2aIdvM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ichKNr8VXVwIH6756rvXZGYaBrkQN2PpAQxkeKAmng5YcrObF0dbma6upDRGBmakYU QCk5cR2FQo2UZBJzrhA3v8jKHksLR4bC0K72IQbrx8VqMVu5oQ2cxRFF66spRICWdEr1 BgfFQLBJ/jUubsSuGpAzhaCyyl3aNbHOtbWyI= MIME-Version: 1.0 Received: by 10.216.87.8 with SMTP id x8mr1050790wee.46.1302530751522; Mon, 11 Apr 2011 07:05:51 -0700 (PDT) Received: by 10.216.138.29 with HTTP; Mon, 11 Apr 2011 07:05:51 -0700 (PDT) In-Reply-To: <4DA3060C.6090901@sentex.net> References: <4D947756.6050808@freebsd.lublin.pl> <4D9F6C71.1040209@frasunek.com> <4DA171BA.9000507@frasunek.com> <4DA1E39C.9090300@rdtc.ru> <4DA23090.8060206@frasunek.com> <20110411054932.GU84445@FreeBSD.org> <4DA3060C.6090901@sentex.net> Date: Mon, 11 Apr 2011 09:05:51 -0500 Message-ID: From: Brandon Gooch To: Mike Tancsa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, Przemyslaw Frasunek , Eugene Grosbein Subject: Re: mpd5/Netgraph issues after upgrading to 7.4 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 14:05:53 -0000 2011/4/11 Mike Tancsa : > On 4/11/2011 1:49 AM, Gleb Smirnoff wrote: >> On Mon, Apr 11, 2011 at 12:34:56AM +0200, Przemyslaw Frasunek wrote: >> P> > Use command "vmstat -z|egrep 'ITEM|NetGraph'" and check FAILURES co= lumn. >> P> > If you see non-zero values there, you need to increase netgraph mem= ory limits >> P> > net.graph.maxdata and net.graph.maxalloc using /boot/loader.conf. >> P> >> P> Unfortunately, increasing net.graph.maxdata & net.graph.maxalloc didn= 't >> P> solved EPERM problems on netgraph control sockets. It is still appear= ing >> P> every few hours, but failure counters are zero: >> >> IMO, any kind of memory allocation code (malloc, uma, netgraph item >> allocator) never return EPERM, they return ENOMEM or ENOBUFS. >> >> So, there is a bug somewhere else. > > > I am also running with the following patch from mlaier that is not in > RELENG_8. > > > --- rtsock.c =A0 =A02010-10-30 07:54:55.000000000 -0400 > +++ /tmp/rtsock.c =A0 =A0 =A0 2011-04-11 09:44:52.000000000 -0400 > @@ -27,7 +27,7 @@ > =A0* SUCH DAMAGE. > =A0* > =A0* =A0 =A0 @(#)rtsock.c =A0 =A08.7 (Berkeley) 10/12/95 > - * $FreeBSD: src/sys/net/rtsock.c,v 1.181.2.10 2010/10/30 11:54:55 bz Ex= p $ > + * $FreeBSD: src/sys/net/rtsock.c,v 1.191 2011/02/10 01:24:09 mlaier Exp= $ > =A0*/ > =A0#include "opt_compat.h" > =A0#include "opt_sctp.h" > @@ -159,7 +159,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct rt_metrics_lite *ou= t); > =A0static void =A0 =A0rt_getmetrics(const struct rt_metrics_lite *in, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct rt_metrics *out); > -static void =A0 =A0rt_dispatch(struct mbuf *, const struct sockaddr *); > +static void =A0 =A0rt_dispatch(struct mbuf *, sa_family_t); > > =A0static struct netisr_handler rtsock_nh =3D { > =A0 =A0 =A0 =A0.nh_name =3D "rtsock", > @@ -513,6 +513,7 @@ > =A0 =A0 =A0 =A0int len, error =3D 0; > =A0 =A0 =A0 =A0struct ifnet *ifp =3D NULL; > =A0 =A0 =A0 =A0union sockaddr_union saun; > + =A0 =A0 =A0 sa_family_t saf =3D AF_MAX; > > =A0#define senderr(e) { error =3D e; goto flush;} > =A0 =A0 =A0 =A0if (m =3D=3D NULL || ((m->m_len < sizeof(long)) && > @@ -549,6 +550,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0(info.rti_info[RTAX_GATEWAY] !=3D NULL && > =A0 =A0 =A0 =A0 =A0 =A0 info.rti_info[RTAX_GATEWAY]->sa_family >=3D AF_MA= X)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0senderr(EINVAL); > + =A0 =A0 =A0 saf =3D info.rti_info[RTAX_DST]->sa_family; > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Verify that the caller has the appropriate privilege; R= TM_GET > =A0 =A0 =A0 =A0 * is the only operation the non-superuser is allowed. > @@ -883,7 +885,6 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m =3D NULL; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else if (m->m_pkthdr.len > rtm->rtm_msgl= en) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m_adj(m, rtm->rtm_msglen -= m->m_pkthdr.len); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 Free(rtm); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (m) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (rp) { > @@ -893,11 +894,14 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unsigned short family =3D = rp->rcb_proto.sp_family; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rp->rcb_proto.sp_family = =3D 0; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, info.rti_inf= o[RTAX_DST]); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, saf); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rp->rcb_proto.sp_family = =3D family; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, info.rti_inf= o[RTAX_DST]); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, saf); > =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 /* info.rti_info[RTAX_DST] (used above) can point inside of= rtm */ > + =A0 =A0 =A0 if (rtm) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 Free(rtm); > =A0 =A0 } > =A0 =A0 =A0 =A0return (error); > =A0#undef sa_equal > @@ -1140,7 +1144,7 @@ > =A0 =A0 =A0 =A0rtm->rtm_flags =3D RTF_DONE | flags; > =A0 =A0 =A0 =A0rtm->rtm_errno =3D error; > =A0 =A0 =A0 =A0rtm->rtm_addrs =3D rtinfo->rti_addrs; > - =A0 =A0 =A0 rt_dispatch(m, sa); > + =A0 =A0 =A0 rt_dispatch(m, sa ? sa->sa_family : AF_MAX); > =A0} > > =A0/* > @@ -1165,7 +1169,7 @@ > =A0 =A0 =A0 =A0ifm->ifm_flags =3D ifp->if_flags | ifp->if_drv_flags; > =A0 =A0 =A0 =A0ifm->ifm_data =3D ifp->if_data; > =A0 =A0 =A0 =A0ifm->ifm_addrs =3D 0; > - =A0 =A0 =A0 rt_dispatch(m, NULL); > + =A0 =A0 =A0 rt_dispatch(m, AF_MAX); > =A0} > > =A0/* > @@ -1235,7 +1239,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rtm->rtm_errno =3D error; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rtm->rtm_addrs =3D info.rt= i_addrs; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, sa); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, sa ? sa->sa_family : AF_MAX)= ; > =A0 =A0 =A0 =A0} > =A0} > > @@ -1271,7 +1275,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0__func__)); > =A0 =A0 =A0 =A0ifmam->ifmam_index =3D ifp->if_index; > =A0 =A0 =A0 =A0ifmam->ifmam_addrs =3D info.rti_addrs; > - =A0 =A0 =A0 rt_dispatch(m, ifma->ifma_addr); > + =A0 =A0 =A0 rt_dispatch(m, ifma->ifma_addr ? ifma->ifma_addr->sa_family= : > AF_MAX); > =A0} > > =A0static struct mbuf * > @@ -1331,7 +1335,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (m->m_flags & M_PKTHDR) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m->m_pkthdr.len +=3D data_= len; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mtod(m, struct if_announcemsghdr *)->ifan_= msglen +=3D > data_len; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, AF_MAX); > =A0 =A0 =A0 =A0} > =A0} > > @@ -1347,11 +1351,11 @@ > > =A0 =A0 =A0 =A0m =3D rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &inf= o); > =A0 =A0 =A0 =A0if (m !=3D NULL) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rt_dispatch(m, AF_MAX); > =A0} > > =A0static void > -rt_dispatch(struct mbuf *m, const struct sockaddr *sa) > +rt_dispatch(struct mbuf *m, sa_family_t saf) > =A0{ > =A0 =A0 =A0 =A0struct m_tag *tag; > > @@ -1360,14 +1364,14 @@ > =A0 =A0 =A0 =A0 * use when injecting the mbuf into the routing socket buf= fer from > =A0 =A0 =A0 =A0 * the netisr. > =A0 =A0 =A0 =A0 */ > - =A0 =A0 =A0 if (sa !=3D NULL) { > + =A0 =A0 =A0 if (saf !=3D AF_MAX) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tag =3D m_tag_get(PACKET_TAG_RTSOCKFAM, si= zeof(unsigned > short), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0M_NOWAIT); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (tag =3D=3D NULL) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m_freem(m); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 *(unsigned short *)(tag + 1) =3D sa->sa_fam= ily; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *(unsigned short *)(tag + 1) =3D saf; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m_tag_prepend(m, tag); > =A0 =A0 =A0 =A0} > =A0#ifdef VIMAGE > > > =A0 =A0 =A0 =A0---Mike > > > -- > ------------------- > Mike Tancsa, tel +1 519 651 3400 > Sentex Communications, mike@sentex.net > Providing Internet services since 1994 www.sentex.net > Cambridge, Ontario Canada =A0 http://www.tancsa.com/ So it's in HEAD? If so, any ideas about a possible MFC? -Brandon