From: Shailabh Nagar <nagar@watson.ibm.com>
To: hadi@cyberus.ca
Cc: James Morris <jmorris@namei.org>,
Per Liden <per.liden@ericsson.com>, Jay Lan <jlan@engr.sgi.com>,
Thomas Graf <tgraf@suug.ch>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [DOC]: generic netlink
Date: Mon, 19 Jun 2006 11:58:06 -0400 [thread overview]
Message-ID: <4496C98E.8030407@watson.ibm.com> (raw)
In-Reply-To: <1150730884.5384.10.camel@jzny2>
jamal wrote:
> On Mon, 2006-19-06 at 11:13 -0400, James Morris wrote:
>
>
>>It seems that TIPC is multiplexing all of it's commands through
>>TIPC_GENL_CMD.
>
>
>
> TIPC is a deviation; they had the 100 ioctls and therefore did a direct
> one-to-one mapping.
>
>
>>I wonder, if this is how other protocols are likely to utilize genl, then
>>we could possibly drop the command registration code completely and one
>>command op can be registered by the protocol during
>>genl_register_family().
>>
>
>
> The intent is to have a handful of commands as in classical netlink
> (eg route or qdisc etc) where you are controlling data that sits in the
> kernel; i.e when you have an attribute or a vector of attributes, then
> the commands will be of the semantics: ADD/DEL/GET/DUMP only.
> Other that TIPC the two other users i have seen use it in this manner.
> But, you are right if usage tends to lean in some other way we could get
> rid of it (I think TIPC is a bad example).
The taskstats interface, currently in -mm, is one user of genetlink
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17-rc6/2.6.17-rc6-mm2/broken-out/per-task-delay-accounting-taskstats-interface.patch
Based on Jamal's suggestions, we found it useful to have the "limited"
set of commands model and ended up with having to register just one GET
command. And in subsequent discussions, a SET command would also be handy.
But I'm not too clear about what are the advantages of trying to limit the
number of commands registered by a given exploiter of genetlink (say TIPC or taskstats),
other than the conventional usage of netlink.
e.g in the taskstats code, userspace needs to GET data on a per-pid and per-tgid basis
from the kernel and supplies the specific pid or tgid. We could either have registered
two commands (say GET_PID and GET_TGID) and then the parsing of the supplied uint32 would
be implicit in the command. But we went with the model where we have only one GET command
and the type of the parameter is specified via netlink attributes.
In our case, it didn't matter and since the type of data returned is very similar and so is
the parameter supplied (pid/tgid), one GET suffices. But I'm wondering if userspace should
consciously try and limit the commands or would it be better from a performance standpoint,
to permit a reasonably larger "fan-out" to happen at the genetlink command level (for each exploiter).
I guess this introduces more overhead for in-kernel structures (the linked list of command structures
that needs to be kept around) while saving time on doing a second level of parsing within the
exploiter-defined function that services the GET command.
The "small" set model looks like a good compromise. Reducing number of commands to one is not a good
idea IMHO....for reasons similar to why ioctl type syscalls aren't encouraged...since the genetlink
layer anyway has code for demultiplexing, might as well use it and avoid an extra level of indirection.
--Shailabh
>>This would both simplify the genl code and API, and help ensure
>>consistency of users.
>>
>
>
> You are talking from an SELinux perspective i take it?
> My view: If you want to have ACLs against such commands
> then it becomes easier to say "can only do ADD but not DEL" for example
> (We need to resolve genl_rcv_msg() check on commands to be in sync with
> SELinux as was pointed by Thomas)
>
> cheers,
> jamal
>
next prev parent reply other threads:[~2006-06-19 15:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-19 13:41 [DOC]: generic netlink jamal
2006-06-19 15:13 ` James Morris
2006-06-19 15:28 ` jamal
2006-06-19 15:54 ` James Morris
2006-06-20 12:59 ` jamal
2006-06-19 15:58 ` Shailabh Nagar [this message]
2006-06-20 13:19 ` jamal
2006-06-19 22:37 ` Shailabh Nagar
2006-06-20 14:50 ` jamal
2006-07-11 23:57 ` Randy.Dunlap
2006-07-12 11:30 ` Jamal Hadi Salim
2006-07-12 15:16 ` Shailabh Nagar
2006-06-20 8:02 ` Thomas Graf
2006-06-20 15:01 ` jamal
2006-06-20 21:34 ` Thomas Graf
2006-06-22 19:07 ` jamal
2006-07-13 17:50 ` Randy.Dunlap
2006-07-14 11:43 ` Jamal Hadi Salim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4496C98E.8030407@watson.ibm.com \
--to=nagar@watson.ibm.com \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=jlan@engr.sgi.com \
--cc=jmorris@namei.org \
--cc=netdev@vger.kernel.org \
--cc=per.liden@ericsson.com \
--cc=tgraf@suug.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).