From owner-freebsd-net@FreeBSD.ORG Wed Mar 19 16:35:48 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96071943; Wed, 19 Mar 2014 16:35:48 +0000 (UTC) Received: from mail-pb0-x22e.google.com (mail-pb0-x22e.google.com [IPv6:2607:f8b0:400e:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 604E4DCF; Wed, 19 Mar 2014 16:35:48 +0000 (UTC) Received: by mail-pb0-f46.google.com with SMTP id rq2so9181099pbb.33 for ; Wed, 19 Mar 2014 09:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=f8eSW6iS8reDprmjdco7GlMWFx6uD0Vbg0050So2TqY=; b=rwzLfslZxKOFHXRnk3N1uGQ7+lC3r3EDSHuSt78CdHZf77sstuUc+OemTijWVOXG8P UZwKB9K18LvNmGGJqepbL2IqoafnZJiY53p68A4kE+zIyl4LYzeZZylPQJM7mCFOGrt3 YmPujfwVW+iUfnPIzeCIeQ8upoEJLxhe9XVYDCY3mRWjwx72VjsqeXgnJi148b4JNE/R jKdrpOXgCBXWTyjuTO2AI1Rxwp+jaZBt3KJNlpAFQEA3wClxUKF7wthVZKBv73M2HnbV 1fSTVYgcGjPJtp5MhVByn9kAzv7CurkYDaRyrfQWh4dCAC7tIeVezyyBLA+lj4s9C553 1J2Q== X-Received: by 10.66.122.36 with SMTP id lp4mr41395445pab.82.1395246948044; Wed, 19 Mar 2014 09:35:48 -0700 (PDT) Received: from ox (c-24-6-44-228.hsd1.ca.comcast.net. [24.6.44.228]) by mx.google.com with ESMTPSA id ha2sm63778356pbb.8.2014.03.19.09.35.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:35:47 -0700 (PDT) Date: Wed, 19 Mar 2014 09:35:44 -0700 From: Navdeep Parhar To: Julian Elischer Subject: Re: Include port number in "Listen queue overflow" messages Message-ID: <20140319163544.GB11935@ox> Mail-Followup-To: Julian Elischer , George Neville-Neil , hiren panchasara , "freebsd-net@freebsd.org" References: <532933A3.4030403@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <532933A3.4030403@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-net@freebsd.org" , hiren panchasara X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 16:35:48 -0000 On Tue, Mar 18, 2014 at 11:05:23PM -0700, Julian Elischer wrote: > On 3/18/14, 8:33 PM, George Neville-Neil wrote: > >On Mar 7, 2014, at 1:23 , hiren panchasara wrote: > > > >>I am thinking of committing following change that includes port number > >>in "Listen queue overflow" messages. > I think it's a good idea. There is even more information available > but this is probably enough. > >> > >I like it. > > > >Best, > >George > > I think the suggested change isn't correct as is assumes every socket's pcb is an inpcb. Navdeep > >>New message would look something like: > >>sonewconn: pcb 0xfffff8001b155760: Listen queue overflow on port > >>13120: 1 already in queue awaiting acceptance (454 occurrences) > >> > >>I've recently ran into a situation at $work where I could not catch > >>the culprit application via "netstat -A" and had to dive into kgdb to > >>find the port from pcb where this application was listening to. > >> > >>IMO, this change will make debugging easier. > >> > >>cheers, > >>Hiren > >> > >>Index: sys/kern/uipc_socket.c > >>=================================================================== > >>--- sys/kern/uipc_socket.c (revision 262861) > >>+++ sys/kern/uipc_socket.c (working copy) > >>@@ -136,6 +136,7 @@ > >>#include > >>#include > >>#include > >>+#include > >> > >>#include > >> > >>@@ -491,8 +492,11 @@ > >> static int overcount; > >> > >> struct socket *so; > >>+ struct inpcb *inp; > >> int over; > >> > >>+ inp = sotoinpcb(head); > >>+ > >> ACCEPT_LOCK(); > >> over = (head->so_qlen > 3 * head->so_qlimit / 2); > >> ACCEPT_UNLOCK(); > >>@@ -504,10 +508,12 @@ > >> overcount++; > >> > >> if (ratecheck(&lastover, &overinterval)) { > >>- log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " > >>- "%i already in queue awaiting acceptance " > >>+ log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow on " > >>+ "port %d: %i already in queue awaiting acceptance " > >> "(%d occurrences)\n", > >>- __func__, head->so_pcb, head->so_qlen, overcount); > >>+ __func__, head->so_pcb, > >>+ ntohs(inp->inp_inc.inc_lport), head->so_qlen, > >>+ overcount); > >> > >> overcount = 0; > >> } > >>_______________________________________________ > >>freebsd-net@freebsd.org mailing list > >>http://lists.freebsd.org/mailman/listinfo/freebsd-net > >>To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > >_______________________________________________ > >freebsd-net@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-net > >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"