From owner-freebsd-current@FreeBSD.ORG Sat Oct 6 17:17:16 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 115EA1065672 for ; Sat, 6 Oct 2012 17:17:16 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id C60708FC08 for ; Sat, 6 Oct 2012 17:17:15 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id DE8067300A; Sat, 6 Oct 2012 19:28:34 +0200 (CEST) Date: Sat, 6 Oct 2012 19:28:34 +0200 From: Luigi Rizzo To: current@freebsd.org Message-ID: <20121006172834.GB63649@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: sysctl-controlled key-value store ? 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: Sat, 06 Oct 2012 17:17:16 -0000 Hi, in order to control some netmap feature (namely, which interfaces are attached to VALE switches), i would considering the use of a sysctl interface triggering a sysctl-proc, something of the form dev.netmap.switch.xyz=em0 ix1 dev.netmap.switch.foo=ix2 re0 where "xyz" and "foo" are the names of the netmap switch instances. Thing is, right now those names are created dynamically when users configure a netmap port, and I would like to have the same dynamic behaviour with the sysctl, so that an access to a not-yet-existent dev.netmap.switch.xyz node should both create the node and add a value. Is this possible (either now or with a modest modification to the sysctl infrastructure) ? Or should I use a workaround, say have a sysctl node that acts as a 'gate' and the procedure will create (readonly) values e.g. dev.netmap.switch.config="xyz: em0 ix1" # creates dev.netmap.switch.xyz=em0 ix1 dev.netmap.switch.config="xyz: ix1" # updates dev.netmap.switch.xyz=ix1 dev.netmap.switch.config="xyz:" # deletes dev.netmap.switch.xyz= cheers luigi