From owner-freebsd-net@FreeBSD.ORG Fri Sep 21 09:22:42 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6C5A1065675 for ; Fri, 21 Sep 2012 09:22:42 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2F29E8FC08 for ; Fri, 21 Sep 2012 09:22:42 +0000 (UTC) Received: by weyx56 with SMTP id x56so2152079wey.13 for ; Fri, 21 Sep 2012 02:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Bfl+gDfF6BZrZJzQARaafeUjg7bLQdw2DddNZ0QeKXg=; b=Ibp2oRQQzFbWVnNkgqYH66RC52T8dzvqJ7mltHofQu543b+abcZMA8WBikYC+Nik0c TC7Pg1o1Ge0EgNdDsnoomZo/crtMuI56LJLSfiPsMTkhkug003JPGiVf1jhky2huQ1Eb V9wSK6s2PWsJj+K8RDwp74vD1ZEYAw0w6t9sOPI6+isrSHKBCZZ2QzotfxrFLZLKNA2O Kv99NshPjo2y0zVkKbgqz0CipXIlfIvAlP4XxbBxbnEXdpe1NbHXJcKKnQeKGEciQoyN /tf6H9bLthc++y4xnmqHeJSU4C35JnsTckpYfS7sTC1FmPvaM6ulVRmGq7HSJ/goJqLl mCzA== Received: by 10.216.135.217 with SMTP id u67mr2781771wei.115.1348219360301; Fri, 21 Sep 2012 02:22:40 -0700 (PDT) Received: from localhost ([95.69.174.83]) by mx.google.com with ESMTPS id fb20sm15630234wid.1.2012.09.21.02.22.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 02:22:39 -0700 (PDT) Sender: Mikolaj Golub Date: Fri, 21 Sep 2012 12:22:36 +0300 From: Mikolaj Golub To: Anuranjan Shukla Message-ID: <20120921092235.GC66984@gmail.com> References: <5F3C03B6-01D0-42DE-BE9E-323DBDC90C8E@neville-neil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-net@freebsd.org" Subject: Re: Proposal for changes to network device drivers and network stack (RFC) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 09:22:42 -0000 On Fri, Sep 07, 2012 at 01:28:16AM -0700, Anuranjan Shukla wrote: > Hi George, > Thanks for taking a look. Some answers/comments below. > > > > >> Building FreeBSD without the network stack (network stack as a module) > >> ---------------------------------------------------------------------- > >> > >This would be interesting for many reasons, and I think it would be a good > >contribution. Does the work you've done in this area handle the VNET > >stuff that is in the stack as well? That is, how well does the network > >stack > >as a module play with the vnet architecture? > > I'll follow up on this one separately. FYI, there is at least this issue with virtualized global variables in modules: http://lists.freebsd.org/pipermail/freebsd-virtualization/2011-July/000737.html On archs that use link_elf.c (i.e. all except amd64, which uses link_elf_obj.c) virtualized global variables in modules can not be accessed from another modules, because link_elf on a module load does relocation only for VNET variables defined in this module. As it was pointed by Marko Zec, the same issue is with DPCPU. The latest patch I have (both for VNET and DPCPU): http://people.freebsd.org/~trociny/link_elf.c.pcpu_vnet.patch The fix is to make the linker on a module load recognize "external" VNET/DPCPU variables defined in the previously loaded modules and relocate them accordingly. For this set_pcpu_list and set_vnet_list are used, where the addresses of modules 'set_pcpu' and 'set_vnet' linker sets are stored in. -- Mikolaj Golub