From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53D62C43219 for ; Fri, 26 Apr 2019 18:21:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33CF620B7C for ; Fri, 26 Apr 2019 18:21:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726173AbfDZSVG (ORCPT ); Fri, 26 Apr 2019 14:21:06 -0400 Received: from mail.us.es ([193.147.175.20]:51610 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfDZSVG (ORCPT ); Fri, 26 Apr 2019 14:21:06 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id D02B011ED82 for ; Fri, 26 Apr 2019 20:21:04 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id C1345DA702 for ; Fri, 26 Apr 2019 20:21:04 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id B64ACDA70B; Fri, 26 Apr 2019 20:21:04 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id C3492DA702; Fri, 26 Apr 2019 20:21:02 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Fri, 26 Apr 2019 20:21:02 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id A11B04265A32; Fri, 26 Apr 2019 20:21:02 +0200 (CEST) Date: Fri, 26 Apr 2019 20:21:02 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Johannes Berg Cc: netdev@vger.kernel.org, David Ahern , Johannes Berg Subject: Re: [PATCH 6/6] netlink: add infrastructure to expose policies to userspace Message-ID: <20190426182102.2q4yqqxaj7biwwor@salvia> References: <20190426121306.10871-1-johannes@sipsolutions.net> <20190426121306.10871-7-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426121306.10871-7-johannes@sipsolutions.net> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Apr 26, 2019 at 02:13:06PM +0200, Johannes Berg wrote: > diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h > index 877f7fa95466..9c0636ec2286 100644 > --- a/include/uapi/linux/genetlink.h > +++ b/include/uapi/linux/genetlink.h > @@ -48,6 +48,7 @@ enum { > CTRL_CMD_NEWMCAST_GRP, > CTRL_CMD_DELMCAST_GRP, > CTRL_CMD_GETMCAST_GRP, /* unused */ > + CTRL_CMD_GETPOLICY, It would be good to single entry point to request descriptions, ie. have a NETLINK_DESC family for this. Thus, we could use the same program to pull for policy/command descriptions without updating an array that includes the command to get the policy _for each subsystem_. The program to inquire for policy/command descriptions would be very much the same along time, no need for updates to include new command type for each subsystem. It would just spin over NETLINK_DESC discovering subsystems ID that we support. In genetlink, I understand this can be exception if you prefer so, ie. I'll be fine with this CTRL_CMD_GETPOLICY if that makes it look nicer in terms of integration with the existing infrastructure. But for other netlink subsystems, NETLINK_DESC allows you to pull the description for genetlink itself, not the internal subsystems.