[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 08 Sep 2016 17:57:03 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: lorenzo@...gle.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
dsa@...ulusnetworks.com, ek@...gle.com
Subject: Re: [PATCH net-next v3] net: inet: diag: expose the socket mark to
privileged processes.
From: Lorenzo Colitti <lorenzo@...gle.com>
Date: Fri, 9 Sep 2016 09:48:27 +0900
> On Fri, Sep 9, 2016 at 8:13 AM, David Miller <davem@...emloft.net> wrote:
>>> This adds the capability for a process that has CAP_NET_ADMIN on
>>> a socket to see the socket mark in socket dumps.
>>
>> Applied, but the argument list of inet_sk_diag_fill is starting to get out
>> of control.
>
> I think a lot of the parameters it takes are just a couple of pointer
> lookups away from in_skb. I assumed it did not take in_skb directly
> for performance reasons: this way the calling functions can calculate
> many of these arguments just once per dump instead of once per socket.
> But thinking about it some more the cost of those pointer lookups is
> negligible compared to the cost of iterating over the hashtables,
> marshalling the attributes, etc.
>
> I'll see if I can send something out to pass in in_skb instead.
The other option is to have a "struct foo_info" object on the callers
stack that holds all of these values, then pass a pointer to the foo_info
to inet_sk_diag_fill.
Powered by blists - more mailing lists