Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Apr 2011 09:05:51 -0500
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        Mike Tancsa <mike@sentex.net>
Cc:        freebsd-net@freebsd.org, Przemyslaw Frasunek <przemyslaw@frasunek.com>, Eugene Grosbein <egrosbein@rdtc.ru>
Subject:   Re: mpd5/Netgraph issues after upgrading to 7.4
Message-ID:  <BANLkTimU8Fwso2XHpK3mkdY-k-zeeghVsg@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/4/11 Mike Tancsa <mike@sentex.net>:
> 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



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