From: Pablo Neira Ayuso <pablo@netfilter.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] netlink: netlink_dump_start may take data pointer for callbacks
Date: Sat, 25 Feb 2012 00:18:03 +0100 [thread overview]
Message-ID: <20120224231803.GA13163@1984> (raw)
In-Reply-To: <20120224.174726.1107636579816083287.davem@davemloft.net>
On Fri, Feb 24, 2012 at 05:47:26PM -0500, David Miller wrote:
> From: pablo@netfilter.org
> Date: Fri, 24 Feb 2012 23:14:07 +0100
>
> > From: Pablo Neira Ayuso <pablo@netfilter.org>
> >
> > This patch modifies the netlink_dump_start function to take one
> > generic pointer to data. This pointer can be used inside the
> > dump() and done() callbacks via cb->data.
> >
> > Netfilter is going to use this patch to provide filtered dumps
> > to user-space. This is specifically interesting in ctnetlink that
> > may handle lots of conntrack entries. We can save precious
> > cycles by skipping the conversion to TLV format of conntrack
> > entries that are not interesting for user-space.
> >
> > More specifically, ctnetlink will include one operation to allow
> > to filter the dumping of conntrack entries by ctmark values.
> >
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
>
> This isn't really your fault but netlink_dump_start() has an
> enormous number of arguments.
>
> Several of them are zero or NULL in all except one special situation.
>
> An entire argument is a lot of overhead for one situation to impose on
> all the others.
>
> I have no objection to the data callback scheme, it's just that
> the argument list of this interface is getting out of control.
>
> Usually, in situations like this, we have some control structure
> that holds all the control state and we pass that in instead.
>
> struct netlink_dump_control c = { .dump = dump, .done = done, ... };
>
> netlink_dump_start(..., &c);
>
> It could be perhaps used here to get things back under control.
OK, I'll send a patch to make it like this.
next prev parent reply other threads:[~2012-02-24 23:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 22:14 [PATCH 0/2] netlink: netlink_dump_start takes pointer to data pablo
2012-02-24 22:14 ` [PATCH 1/2] netlink: netlink_dump_start may take data pointer for callbacks pablo
2012-02-24 22:47 ` David Miller
2012-02-24 23:18 ` Pablo Neira Ayuso [this message]
2012-02-24 22:14 ` [PATCH 2/2] netfilter: ctnetlink: support kernel-space dump filterings pablo
2012-02-25 1:09 ` Jan Engelhardt
2012-02-25 13:26 ` Pablo Neira Ayuso
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=20120224231803.GA13163@1984 \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/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).