From owner-freebsd-arch@freebsd.org Fri Jun 3 17:14:49 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 403DFB6989C for ; Fri, 3 Jun 2016 17:14:49 +0000 (UTC) (envelope-from kiloreux@gmail.com) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDA98109B; Fri, 3 Jun 2016 17:14:48 +0000 (UTC) (envelope-from kiloreux@gmail.com) Received: by mail-lf0-x242.google.com with SMTP id w16so8518317lfd.0; Fri, 03 Jun 2016 10:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc; bh=F2ZXt6fYLMVoH6IlHeFgQlbefyCTNa76+oRmDbUVMj8=; b=JMGcRGXHC5YSpE3d8wuIww7WxFAOIwCG2JyL/s/sTz7DA5kYU7zJ1JABETHBwcQtPc AMd9S38hGfQR+R3XWYLn/HcgyJ0WJECHuBAiGudbGa7sN2YZdclQ7NqIjBMv/YsHnqJY 0i+iMZfHPsi8e60nAKP2KkYbDPT+vSLIMpTAapNMpHBDOQ2de9Q81AcnqtETuybBOZGx PkaNInZ37K2m1PY56qN25VPueWAMmlOcpIAqaf4RMydj1oBlGbUDEuCPUtKoeM14SINw SWuZrqsJIxlSvJSR8EXUgKY0EYPsVI6xGRAes18FQmC2rEqm6xRnvd/qRD6FY+by4hx6 0i0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=F2ZXt6fYLMVoH6IlHeFgQlbefyCTNa76+oRmDbUVMj8=; b=m7urhtUTd/lBwvgVCLSuX9BS5Ut4jIPIbWz3FwSa7EOHm/n77CLSnVY47LEaD6mfpL G9+14ysesMZwRNPDQ3Wi0ZDOnGBi7xRpwfbWsyXov6qe9eYWvtzwaAJrSeCksl8uE6fR TdezxdbYgK3xQJTUpHTqMhHG4zU+Fikhu0iRaylJEWiUr/LPvprN4SbE5nsvKqsKQSM0 oCWugv9dIDn3J9jCYOHFpJf4DglN1PbCFmNpU80w6x4115OJ+feRviOrSzc+N588lBrl z5rRaTi9k6B2IQeF99+p7EJgOP3rxaiYRqouq3S3t4TQ/UsjtgS0H+fsRuDO3mKts+iq 3B1g== X-Gm-Message-State: ALyK8tJlug9G9ph4JLXZIBfm/GKz4map6182+4DH73nl08AmnFbyi0lxVGDdmKz7qKCyuauveK7/Fe6e5GfXdQ== X-Received: by 10.46.32.85 with SMTP id g82mr1312901ljg.51.1464974086230; Fri, 03 Jun 2016 10:14:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.16.195 with HTTP; Fri, 3 Jun 2016 10:14:45 -0700 (PDT) From: KILOREUX Emperex Date: Fri, 3 Jun 2016 18:14:45 +0100 Message-ID: Subject: API to link sysctl nodes to devices To: freebsd-arch@freebsd.org Cc: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , Koop Mast , eadler@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2016 17:14:49 -0000 Hey, As part of my participation GSOC, I have been working on an API spec to link sysctl nodes to devices. And I cam up with few ideas that I need some feedback on before proceeding to the implementation on the kernel. - We need devices to have their propoer sysctl trees, and thus every device linked will have its own id as the head of its syctl tree. For example a device with id 0x94, would have it's sysctl root look like dev.fs.0x94 where the below parameters can be accessed after that. - We want to give device drivers the ability to create and delete sysctl nodes as they want, thus proposing a proper interface for it. So I have been thinking so far to enable the creation of the root for those sysctl nodes on the system initialization, to allow existing device drivers to link their device on the tree. Also we want to propose a new function similar to make_dev, supposed we name it make_dev_sys, that gets the device id and links it on the tree of existing sysctl nodes, and for the purpose of keeping track of the available sysctl nodes for each device, I thought of proposing a change to the device switching table "cdevsw" to keep systcl context tracked for the device. Would any modification to cdevsw break backward compatibility ? Please provide us with any feedback you have on this proposition and any defects you seeing in the logic. Your help is much appreciated.