Re: [PATCH net-next v3 1/6] vxlan: refactor verification and application of configuration

From: Johannes Berg
Date: Fri Jun 23 2017 - 09:31:32 EST


On Fri, 2017-06-23 at 14:02 +0200, Matthias Schiffer wrote:
>
> It seems though that rtnl_link_ops.newlink/changelink don't allow
> passing the extack yet... how do we proceed here? Treewide change
> (maybe by someone who knows their Coccinelle-fu?), or would the
> introduction of new versions of the newlink and changelink fields be
> more acceptable, so drivers can be moved to the new API one by one?

I think treewide change is easy enough, this seems to work:

@ops1@
identifier newfn, ops;
@@
static struct rtnl_link_ops ops = {
.newlink = newfn,
...
};

@@
identifier ops1.newfn;
identifier src_net, dev, tb, data;
@@
-int newfn(struct net *src_net, struct net_device *dev,
- ÂÂÂstruct nlattr *tb[], struct nlattr *data[])
+int newfn(struct net *src_net, struct net_device *dev,
+ ÂÂÂstruct nlattr *tb[], struct nlattr *data[],
+ ÂÂÂstruct netlink_ext_ack *extack)
{...}

@ops2@
identifier chfn, ops;
@@
static struct rtnl_link_ops ops = {
.changelink = chfn,
...
};

@@
identifier ops2.chfn;
identifier dev, tb, data;
@@
-int chfn(struct net_device *dev,
- ÂÂstruct nlattr *tb[], struct nlattr *data[])
+int chfn(struct net_device *dev,
+ ÂÂstruct nlattr *tb[], struct nlattr *data[],
+ ÂÂstruct netlink_ext_ack *extack)
{...}

I guess if there are any stragglers you'd find them by compile-testing
:)

johannes