From nobody Thu Dec 1 08:35:59 2022 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NN8YJ4K5Nz4jmFx for ; Thu, 1 Dec 2022 08:36:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NN8YJ3Mfkz4Fw0 for ; Thu, 1 Dec 2022 08:36:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669883764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=pjrT5sCaI37NifSPCy9TI/s/2NzPDREa/P8Kj8vqXNw=; b=koup97iBgp7CmVLsB8Z80KoTBoFFfiN39kyDCL/+MJVciTqpWzI75+SPpbMlsC7H0jfqvo tMoleCIhjxojwlIS1DMOs6m0yiCKClSc4PTLLMby7NmerGN/f2deRm1K/LUSfMdtJjX/8W szn81jhjOGAFttwIDNt0Mmlw/KS7OtFZ5wTAYLRY7s12g0OPukASw7d2yXa9U5LElp4RO+ JobOgfHgRDWMKjInZyHJEdko1QCGHv31S1Kvyygqi8vOhety7hdAmzmbwMvXOKEtg9kL/E lDKVgIiCki1wvG97TBw9QM5vJD5xrbCVvfBt4C1zErCfkYQZmxKEe++lONCh5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669883764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=pjrT5sCaI37NifSPCy9TI/s/2NzPDREa/P8Kj8vqXNw=; b=j24ZpA9Y3HAxkCmaXXHDfozwPHMGxihTCgFOlyhac1zYPaZEz/71NqDNl9sOUEwQ+2/WGP KFreIc30wG+m8TdKfghwj7d22JXBVCJxdSVArjYoDOUybS75hUnyUwYYWDmeOjzZVXl9F3 dh/2+W6dE4HX9WngkW5L4JHAnBoS+6n+0vGtIcbIurAIoXlAoWzK4QJKK2qM41Yr5lU6jW OGTxS0GiilkP/9pvtJC5xf8Igke1xyqEJg+uio+LQvD6Pr3cjybHL8xVVWdUocJ+sR5+mB isSmYQl1ZXXgmVAjSe+q1bC0GfHViH6VOvaf5D3Pf+5I37ysy61QAigetmBBsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669883764; a=rsa-sha256; cv=none; b=A9FchhjyfPNC6/VBqkjWOQNgsLIBfthdWs6x6t7Of6e11CQHlB/6bNO79xqOYIQel35+X3 BwM3WkftuhDiyNLo0mgagaoAanhidt8p2ZsjOK0SmeZzK0MMJNGq0clMyee4P9eezjj49u m74Dqo4BBKClLpfd2VQOJbKUXT+V1HkY7Gqs3Liatn5qI3XCirIGAoxQyoStXUsS6vLOHk IP+uOrU1/spU+CRm31edLCRT4hr81NhCHy870xTqbIwC4tcXIxOUQee+KXRmCKiU91ybwf bHuiO2lPMR7XL2EXk3IhFqpZG4EpEKV5zAORfXVy0Ec1T7ZkszaCw5EcMi7i2A== Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NN8YJ1k3Kz1KQF for ; Thu, 1 Dec 2022 08:36:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id E4B26738A2; Thu, 1 Dec 2022 09:35:59 +0100 (CET) Date: Thu, 1 Dec 2022 09:35:59 +0100 From: Baptiste Daroussin To: hackers@freebsd.org Subject: devctl_notify system is inconsistent Message-ID: <20221201083559.xx3v5jn7sf44rfmv@aniel.nours.eu> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-ThisMailContainsUnwantedMimeParts: N Hello, After the addition of netlink(4) by melifaro@, I started working on a new genetlink(4) module, to send kernel notification to the userland via netlink. The goal is to be able to have multiple consumers without the need of devd to be running. The goal is also to be able subscribe to the events the consumer is willing to receive. https://reviews.freebsd.org/D37574 I also added a hook to devctl_notify to make sure all its event got sent via nlsysevent. (https://reviews.freebsd.org/D37573) It works great and so far I am happy with it. on thing I figured out it is: the "system" argment of devctl_notify is inconsistent: Upper case vs lower case "kern" vs "kernel" I intent to fix the following way: Create a new function similar to devctl_notify but with the first argument being an enum. Make the current devctl_notify convert its first argument into that enum and yell if an unkwown "system" is passed. (and probably declare devctl_notify deprecated) Then fix the inconsistencies: all upper case as it seems the most wildly use case s/kern/kernel/g WDYT? Best regards, Bapt