Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-11 Thread Johannes Berg
On Thu, 2019-10-10 at 22:00 +0200, Michal Kubecek wrote: > > > Having a common format is way more accessible. Generic netlink (now) > > even exposes the policy (if set) and all of its nested sub-policies to > > userspace (if you use NLA_POLICY_NESTED), so it's very easy to discover > > what's in

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-11 Thread Jiri Pirko
Thu, Oct 10, 2019 at 08:04:01PM CEST, mkube...@suse.cz wrote: >On Thu, Oct 10, 2019 at 03:56:39PM +0200, Jiri Pirko wrote: >> Wed, Oct 09, 2019 at 10:59:27PM CEST, mkube...@suse.cz wrote: [...] >> >+ const struct nlmsghdr *nlhdr, struct net *net, >> >+

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-10 Thread Michal Kubecek
On Thu, Oct 10, 2019 at 08:18:05PM +0200, Johannes Berg wrote: > On Thu, 2019-10-10 at 20:04 +0200, Michal Kubecek wrote: > > > > The only thing I don't like about the genetlink infrastructure is the > > design decision that policy and corresponding maxattr is an attribute of > > the family

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-10 Thread Johannes Berg
On Thu, 2019-10-10 at 20:04 +0200, Michal Kubecek wrote: > > The only thing I don't like about the genetlink infrastructure is the > design decision that policy and corresponding maxattr is an attribute of > the family rather than a command. This forces anyone who wants to use it > to essentially

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-10 Thread Michal Kubecek
On Thu, Oct 10, 2019 at 03:56:39PM +0200, Jiri Pirko wrote: > Wed, Oct 09, 2019 at 10:59:27PM CEST, mkube...@suse.cz wrote: > >+/** > >+ * ethnl_std_parse() - Parse request message > >+ * @req_info:pointer to structure to put data into > >+ * @nlhdr: pointer to request message header >

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-10 Thread Jiri Pirko
Wed, Oct 09, 2019 at 10:59:27PM CEST, mkube...@suse.cz wrote: [...] >+static const struct get_request_ops *get_requests[__ETHTOOL_MSG_USER_CNT] = { I think that prefix would be good here as well: +static const struct ethnl_get_request_ops * ethnl_get_requests[__ETHTOOL_MSG_USER_CNT] = {

Re: [PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-10 Thread Jiri Pirko
Wed, Oct 09, 2019 at 10:59:27PM CEST, mkube...@suse.cz wrote: >Significant part of GET request processing is common for most request >types but unfortunately it cannot be easily separated from type specific >code as we need to alternate between common actions (parsing common request >header,

[PATCH net-next v7 09/17] ethtool: generic handlers for GET requests

2019-10-09 Thread Michal Kubecek
Significant part of GET request processing is common for most request types but unfortunately it cannot be easily separated from type specific code as we need to alternate between common actions (parsing common request header, allocating message and filling netlink/genetlink headers etc.) and