From owner-freebsd-net@FreeBSD.ORG Wed Feb 12 14:56:46 2014 Return-Path: Delivered-To: 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 39243BD3 for ; Wed, 12 Feb 2014 14:56:46 +0000 (UTC) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D09C1ADE for ; Wed, 12 Feb 2014 14:56:46 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id rd3so9217974pab.5 for ; Wed, 12 Feb 2014 06:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=XKFBoQH5fO1KePJWvWRwJSLA0i2my8bJs5CnAiWGNgc=; b=IvdcM/vC7sN/wF47/9XFuHMIM6ZZbOtk4zxcVFU0qh7QYTENGRsDkshStp9UhLpxXT ILU8QSP3dZUtxnXq1pZPA4tTXDVROBjY1xtLz71wPnLHxbTJ6AF24gOo7v4d3YHor246 rRkb+RYlRAIZgOIboOt8zGPDtdCc0qDsFTXuyDtcbAuu4Nr4rYOygyV6/9+DL0lDx8K5 1eJT0TtnKYSUM7sHRxjUENLrEZZuHz502qPuFgWM+eYSqhe7Y+pkoFGD+rs8TL2mtoxK ZMnz51YKDiG91lIHxZ5VoJpZO9QUqK+Pa62KHq3+SMkuHb1KMMjDs20nSSBvIYfw1+os woUw== X-Received: by 10.66.164.70 with SMTP id yo6mr40280943pab.85.1392217005595; Wed, 12 Feb 2014 06:56:45 -0800 (PST) Received: from [192.168.1.64] (108-64-226-69.lightspeed.sntcca.sbcglobal.net. [108.64.226.69]) by mx.google.com with ESMTPSA id j3sm64392233pbh.38.2014.02.12.06.56.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 06:56:44 -0800 (PST) References: <20140211114329.43bda628@x23> Mime-Version: 1.0 (1.0) In-Reply-To: <20140211114329.43bda628@x23> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (10B329) From: Vijay Singh Subject: Re: netstat for vnets Date: Wed, 12 Feb 2014 06:56:41 -0800 To: Marko Zec Cc: FreeBSD Net 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, 12 Feb 2014 14:56:46 -0000 On Feb 11, 2014, at 2:43 AM, Marko Zec wrote: > On Mon, 10 Feb 2014 21:24:52 -0800 > Vijay Singh wrote: >=20 >> How does "jexec netstat -an" get its data from the kernel? I >> know that netstat uses kvm, but I'm not sure how it works with >> vnet-jails. Any pointers would be much appreciated. >=20 > I think these days libkvm first tries to find "native" symbols via > kldsym(), and if it fails, attempts to prepend a "vnet_entry_" prefix > in front of the search key, which then get resolved to the proper > addres in _kvm_vnet_validaddr() in lib/libkvm/kvm_vnet.c. In the early > days of VIMAGE it was the kernel who was responsible for resolving the > symbol address in the proper vnet, honestly I do not recall when the > magic moved to the userland and why... >=20 > Btw. Vijay - did the patch I posted here: > http://lists.freebsd.org/pipermail/freebsd-net/2014-February/037769.html > resolve the panics you complained about? Marco, I got a chance to test it yesterday and it seems to work. Are you goi= ng to commit it? I think that there is still an issue with the V_loif pointe= r in the mbuf and it seems to me that we should add a refcount for that. It w= ould also help wit the interface hot plug case that Adrian has mentioned in t= he past. Anyhow, this change could go in. Please let me know when you've com= mitted it. -vijay=