All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Alpe <richard.alpe@ericsson.com>
To: Florian Westphal <fw@strlen.de>
Cc: David Miller <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<tipc-discussion@lists.sourceforge.net>
Subject: Re: [PATCH net-next 04/14] tipc: add sock dump to new netlink api
Date: Mon, 15 Sep 2014 14:35:59 +0200	[thread overview]
Message-ID: <5416DD2F.50106@ericsson.com> (raw)
In-Reply-To: <20140915085152.GC14006@breakpoint.cc>

On 09/15/2014 10:51 AM, Florian Westphal wrote:
> Richard Alpe <richard.alpe@ericsson.com> wrote:
>>> You can't just say sometimes you'll partially list the set of nested
>>> attributes in an object, you must public the entire object fully in
>>> the netlink message or skip the object entirely.
>> Ok. I bluntly assumed we could put some reassemble logic in the
>> client as the end integrity should still be preserved(?).
>>
>>> I would suggest that you instead size the amount of space you'll
>>> need for at least the first socket being listed, and if NLMSG_GOODSIZE
>>> is insufficient, allocate as much as you will actually need.
>>>
>>> Then you put full socket netlink blobs in there, including all nested
>>> attributes, and then stop and reset back the the most recent full socket
>>> published if you run out of space.
>> The amount of publications a socket can have is large (~65 000). Do
>> you still think this a viable solution?
>
> I suggest to look at nf_conntrack_netlink.c ctnetlink_dump_table() and
> ctnetlink_fill_info().
>
> It should be doing something similar to what you want and it handles
> the restarts correctly, i.e., cancels all partial nested attributes
> on error and resumes at the beginning of said entry on the next dump.
Thanks. In the case of ctnetlink_fill_info() it looks to me as if a set 
of nested attributes is sure to fit inside a new message and that you 
only have to cancel if the accumulation of multiple top level entities 
along where their nested attributes fills the message(?).

The problem in this case isn't solely the listing of a large amount of 
publication attributes. The problem is that there can be an arbitrary 
amount of sockets with an arbitrary amount of associated (nested) 
publications (~65 000 max).

I "solved" this by nesting as many complete publications as possible for 
each socket. This "works" but as David points out the nested publication 
data for a specific socket might or might not be complete. This is 
solely indicated by the NLMSG_DONE flag, forcing the client to know this 
and reassemble.

I'm now considering splitting the socket and publication listing so that 
the client will have to ask for a list of sockets and then ask for there 
associated publications individually. This would reduce the complexity 
on the kernel side but it may introduce some additional overhead when 
the socket count is high. On the other hand it opens the opportunity for 
client to only ask for publications.

Cheers
Richard

  reply	other threads:[~2014-09-15 12:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  8:29 [PATCH net-next 00/14] tipc: new netlink API richard.alpe
2014-09-11  8:29 ` [PATCH net-next 01/14] tipc: add bearer disable/enable to new netlink api richard.alpe
2014-09-12 21:07   ` David Miller
2014-09-11  8:29 ` [PATCH net-next 02/14] tipc: add bearer get/dump " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 03/14] tipc: add bearer set " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 04/14] tipc: add sock dump " richard.alpe
2014-09-12 21:10   ` David Miller
2014-09-15  7:55     ` Richard Alpe
2014-09-15  8:51       ` Florian Westphal
2014-09-15 12:35         ` Richard Alpe [this message]
2014-09-15 15:38       ` David Miller
2014-09-15 16:35         ` Jon Maloy
2014-09-23 11:12         ` Richard Alpe
2014-09-23 15:37           ` David Miller
2014-09-11  8:29 ` [PATCH net-next 05/14] tipc: add link get/dump " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 06/14] tipc: add link set " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 07/14] tipc: add link stat reset " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 08/14] tipc: add media get/dump " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 09/14] tipc: add media set " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 10/14] tipc: add node get/dump " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 11/14] tipc: add net dump " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 12/14] tipc: add net set " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 13/14] tipc: add name table dump " richard.alpe
2014-09-11  8:29 ` [PATCH net-next 14/14] tipc: remove old ASCII netlink API richard.alpe

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=5416DD2F.50106@ericsson.com \
    --to=richard.alpe@ericsson.com \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.