netstat for vnets

Vijay Singh vijju.singh at gmail.com
Wed Feb 12 14:56:46 UTC 2014


On Feb 11, 2014, at 2:43 AM, Marko Zec <zec at fer.hr> wrote:

> On Mon, 10 Feb 2014 21:24:52 -0800
> Vijay Singh <vijju.singh at gmail.com> wrote:
> 
>> How does "jexec <jid> 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.
> 
> 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...
> 
> 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 going to commit it? I think that there is still an issue with the V_loif pointer in the mbuf and it seems to me that we should add a refcount for that. It would also help wit the interface hot plug case that Adrian has mentioned in the past. Anyhow, this change could go in. Please let me know when you've committed it.

-vijay


More information about the freebsd-net mailing list