On Fri, Sep 9, 2016 at 9:57 AM, David Miller <da...@davemloft.net> wrote: > > > 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.
RFC patch sent out as http://patchwork.ozlabs.org/patch/667892/ . This achieves a fair bit of simplification with no or negligible performance impact, because there was a lot of redundancy in the parameters that were passed in. Further simplification could be achieved by removing the "bool net_admin" parameter. I didn't do this in this patch because I don't know the performance impact of calling netlink_ns_capable once per socket instead of once per dump. My guess is that that's in the noise given that we're already doing lots of copying; if it is, I can send out a v2 that removes the net_admin parameter as well. Didn't try the struct since this seemed a good starting point. It could be done later, of course.