From owner-freebsd-current@FreeBSD.ORG Tue Jul 14 23:41:53 2009 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87C8106566B for ; Tue, 14 Jul 2009 23:41:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A24C08FC0C for ; Tue, 14 Jul 2009 23:41:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 5A66D46B3B for ; Tue, 14 Jul 2009 19:41:53 -0400 (EDT) Date: Wed, 15 Jul 2009 00:41:53 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: Rebuild all network-related kernel modules on 8-current due to vnet allocator change X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2009 23:41:54 -0000 On Wed, 15 Jul 2009, Robert Watson wrote: > The attached change, which just entered 8-current, modifies kernel > programming and binary interfaces for many network stack components/modules. > You will want to make sure all kernel modules are rebuilt. FYI, for those following this work, there are a few more loose ends to tie up: - libkvm needs to know how to do the per-vnet variable translation for symbols on a virtualized kernel. I have a prototype already, but I'm currently considering the API implications. - kgdb needs to make it easier to print virtualized global values, perhaps by providing a script wrapper (which requires a small kgdb extension to provide a typeof() operator similar to C), or perhaps in the kgbd implementation itself. - We inherited VNET_GET() from the DPCPU code, but actually we might just want to make it VNET(). Unmentioned in the commit message was that DDB has learned how to do the translation from per-CPU and per-vnet allocated globals automatically. If you do "print if_index", for example, it first tries to look it up as a regular symbol -- if the kernel is compiled with VIMAGE, this will fail and it will then look for a per-CPU variable, and when that fails (since there isn't one), it will try a per-vnet variable, do the translation, and print as normal. By default, we use the kernel CPU's dynamic per-CPU data, and the current thread's per-vnet data, but these can be adjusted using DDB variables ($db_cpu shows the CPU to use, or -1 to use whatever the current CPU is (default), $curcpu shows what the current CPU is. $db_vnet shows what vnet to use, or NULL to use the current vnet (default), and $curvnet shows what the current vnet is). This should make it significantly easier to inspect/get/set per-CPU and per-vnet globals from DDB. And, with the new world order, !VIMAGE kernels now behave as they did previously, with normal symbols for all network stack globals. Robert N M Watson Computer Laboratory University of Cambridge