Skip to content

Commit d1f271d

Browse files
committed
Merge branch 'net-add-netlink_ext_ack-support-to-rtnl_link_ops'
Matthias Schiffer says: ==================== net: add netlink_ext_ack support to rtnl_link_ops Same changes as http://patchwork.ozlabs.org/patch/780351/ , split into separate patches for each rtnl_link_ops field as requested. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents dacdbb4 + d116ffc commit d1f271d

File tree

36 files changed

+190
-107
lines changed

36 files changed

+190
-107
lines changed

drivers/infiniband/ulp/ipoib/ipoib_netlink.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ static int ipoib_fill_info(struct sk_buff *skb, const struct net_device *dev)
6464
return -EMSGSIZE;
6565
}
6666

67-
static int ipoib_changelink(struct net_device *dev,
68-
struct nlattr *tb[], struct nlattr *data[])
67+
static int ipoib_changelink(struct net_device *dev, struct nlattr *tb[],
68+
struct nlattr *data[],
69+
struct netlink_ext_ack *extack)
6970
{
7071
u16 mode, umcast;
7172
int ret = 0;
@@ -93,7 +94,8 @@ static int ipoib_changelink(struct net_device *dev,
9394
}
9495

9596
static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
96-
struct nlattr *tb[], struct nlattr *data[])
97+
struct nlattr *tb[], struct nlattr *data[],
98+
struct netlink_ext_ack *extack)
9799
{
98100
struct net_device *pdev;
99101
struct ipoib_dev_priv *ppriv;
@@ -133,7 +135,7 @@ static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
133135
child_pkey, IPOIB_RTNL_CHILD);
134136

135137
if (!err && data)
136-
err = ipoib_changelink(dev, tb, data);
138+
err = ipoib_changelink(dev, tb, data, extack);
137139
return err;
138140
}
139141

drivers/net/bonding/bond_netlink.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
118118
[IFLA_BOND_SLAVE_QUEUE_ID] = { .type = NLA_U16 },
119119
};
120120

121-
static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
121+
static int bond_validate(struct nlattr *tb[], struct nlattr *data[],
122+
struct netlink_ext_ack *extack)
122123
{
123124
if (tb[IFLA_ADDRESS]) {
124125
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
@@ -131,7 +132,8 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
131132

132133
static int bond_slave_changelink(struct net_device *bond_dev,
133134
struct net_device *slave_dev,
134-
struct nlattr *tb[], struct nlattr *data[])
135+
struct nlattr *tb[], struct nlattr *data[],
136+
struct netlink_ext_ack *extack)
135137
{
136138
struct bonding *bond = netdev_priv(bond_dev);
137139
struct bond_opt_value newval;
@@ -156,8 +158,9 @@ static int bond_slave_changelink(struct net_device *bond_dev,
156158
return 0;
157159
}
158160

159-
static int bond_changelink(struct net_device *bond_dev,
160-
struct nlattr *tb[], struct nlattr *data[])
161+
static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[],
162+
struct nlattr *data[],
163+
struct netlink_ext_ack *extack)
161164
{
162165
struct bonding *bond = netdev_priv(bond_dev);
163166
struct bond_opt_value newval;
@@ -438,11 +441,12 @@ static int bond_changelink(struct net_device *bond_dev,
438441
}
439442

440443
static int bond_newlink(struct net *src_net, struct net_device *bond_dev,
441-
struct nlattr *tb[], struct nlattr *data[])
444+
struct nlattr *tb[], struct nlattr *data[],
445+
struct netlink_ext_ack *extack)
442446
{
443447
int err;
444448

445-
err = bond_changelink(bond_dev, tb, data);
449+
err = bond_changelink(bond_dev, tb, data, extack);
446450
if (err < 0)
447451
return err;
448452

drivers/net/caif/caif_hsi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,8 @@ static void cfhsi_netlink_parms(struct nlattr *data[], struct cfhsi *cfhsi)
13521352
}
13531353

13541354
static int caif_hsi_changelink(struct net_device *dev, struct nlattr *tb[],
1355-
struct nlattr *data[])
1355+
struct nlattr *data[],
1356+
struct netlink_ext_ack *extack)
13561357
{
13571358
cfhsi_netlink_parms(data, netdev_priv(dev));
13581359
netdev_state_change(dev);
@@ -1399,7 +1400,8 @@ static int caif_hsi_fill_info(struct sk_buff *skb, const struct net_device *dev)
13991400
}
14001401

14011402
static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
1402-
struct nlattr *tb[], struct nlattr *data[])
1403+
struct nlattr *tb[], struct nlattr *data[],
1404+
struct netlink_ext_ack *extack)
14031405
{
14041406
struct cfhsi *cfhsi = NULL;
14051407
struct cfhsi_ops *(*get_ops)(void);

drivers/net/can/dev.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,8 @@ static const struct nla_policy can_policy[IFLA_CAN_MAX + 1] = {
848848
= { .len = sizeof(struct can_bittiming_const) },
849849
};
850850

851-
static int can_validate(struct nlattr *tb[], struct nlattr *data[])
851+
static int can_validate(struct nlattr *tb[], struct nlattr *data[],
852+
struct netlink_ext_ack *extack)
852853
{
853854
bool is_can_fd = false;
854855

@@ -880,8 +881,9 @@ static int can_validate(struct nlattr *tb[], struct nlattr *data[])
880881
return 0;
881882
}
882883

883-
static int can_changelink(struct net_device *dev,
884-
struct nlattr *tb[], struct nlattr *data[])
884+
static int can_changelink(struct net_device *dev, struct nlattr *tb[],
885+
struct nlattr *data[],
886+
struct netlink_ext_ack *extack)
885887
{
886888
struct can_priv *priv = netdev_priv(dev);
887889
int err;
@@ -1146,7 +1148,8 @@ static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev)
11461148
}
11471149

11481150
static int can_newlink(struct net *src_net, struct net_device *dev,
1149-
struct nlattr *tb[], struct nlattr *data[])
1151+
struct nlattr *tb[], struct nlattr *data[],
1152+
struct netlink_ext_ack *extack)
11501153
{
11511154
return -EOPNOTSUPP;
11521155
}

drivers/net/can/vxcan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ static void vxcan_setup(struct net_device *dev)
163163
static struct rtnl_link_ops vxcan_link_ops;
164164

165165
static int vxcan_newlink(struct net *net, struct net_device *dev,
166-
struct nlattr *tb[], struct nlattr *data[])
166+
struct nlattr *tb[], struct nlattr *data[],
167+
struct netlink_ext_ack *extack)
167168
{
168169
struct vxcan_priv *priv;
169170
struct net_device *peer;

drivers/net/dummy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ static void dummy_setup(struct net_device *dev)
356356
dev->max_mtu = ETH_MAX_MTU;
357357
}
358358

359-
static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
359+
static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],
360+
struct netlink_ext_ack *extack)
360361
{
361362
if (tb[IFLA_ADDRESS]) {
362363
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)

drivers/net/geneve.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,8 @@ static const struct nla_policy geneve_policy[IFLA_GENEVE_MAX + 1] = {
10581058
[IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = { .type = NLA_U8 },
10591059
};
10601060

1061-
static int geneve_validate(struct nlattr *tb[], struct nlattr *data[])
1061+
static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
1062+
struct netlink_ext_ack *extack)
10621063
{
10631064
if (tb[IFLA_ADDRESS]) {
10641065
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
@@ -1181,7 +1182,8 @@ static void init_tnl_info(struct ip_tunnel_info *info, __u16 dst_port)
11811182
}
11821183

11831184
static int geneve_newlink(struct net *net, struct net_device *dev,
1184-
struct nlattr *tb[], struct nlattr *data[])
1185+
struct nlattr *tb[], struct nlattr *data[],
1186+
struct netlink_ext_ack *extack)
11851187
{
11861188
bool use_udp6_rx_checksums = false;
11871189
struct ip_tunnel_info info;

drivers/net/gtp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ static void gtp_hashtable_free(struct gtp_dev *gtp);
636636
static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[]);
637637

638638
static int gtp_newlink(struct net *src_net, struct net_device *dev,
639-
struct nlattr *tb[], struct nlattr *data[])
639+
struct nlattr *tb[], struct nlattr *data[],
640+
struct netlink_ext_ack *extack)
640641
{
641642
struct gtp_dev *gtp;
642643
struct gtp_net *gn;
@@ -697,7 +698,8 @@ static const struct nla_policy gtp_policy[IFLA_GTP_MAX + 1] = {
697698
[IFLA_GTP_ROLE] = { .type = NLA_U32 },
698699
};
699700

700-
static int gtp_validate(struct nlattr *tb[], struct nlattr *data[])
701+
static int gtp_validate(struct nlattr *tb[], struct nlattr *data[],
702+
struct netlink_ext_ack *extack)
701703
{
702704
if (!data)
703705
return -EINVAL;

drivers/net/ifb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ static int ifb_open(struct net_device *dev)
273273
return 0;
274274
}
275275

276-
static int ifb_validate(struct nlattr *tb[], struct nlattr *data[])
276+
static int ifb_validate(struct nlattr *tb[], struct nlattr *data[],
277+
struct netlink_ext_ack *extack)
277278
{
278279
if (tb[IFLA_ADDRESS]) {
279280
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)

drivers/net/ipvlan/ipvlan.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ unsigned int ipvlan_nf_input(void *priv, struct sk_buff *skb,
140140
void ipvlan_count_rx(const struct ipvl_dev *ipvlan,
141141
unsigned int len, bool success, bool mcast);
142142
int ipvlan_link_new(struct net *src_net, struct net_device *dev,
143-
struct nlattr *tb[], struct nlattr *data[]);
143+
struct nlattr *tb[], struct nlattr *data[],
144+
struct netlink_ext_ack *extack);
144145
void ipvlan_link_delete(struct net_device *dev, struct list_head *head);
145146
void ipvlan_link_setup(struct net_device *dev);
146147
int ipvlan_link_register(struct rtnl_link_ops *ops);

drivers/net/ipvlan/ipvlan_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ static const struct ethtool_ops ipvlan_ethtool_ops = {
455455
};
456456

457457
static int ipvlan_nl_changelink(struct net_device *dev,
458-
struct nlattr *tb[], struct nlattr *data[])
458+
struct nlattr *tb[], struct nlattr *data[],
459+
struct netlink_ext_ack *extack)
459460
{
460461
struct ipvl_dev *ipvlan = netdev_priv(dev);
461462
struct ipvl_port *port = ipvlan_port_get_rtnl(ipvlan->phy_dev);
@@ -476,7 +477,8 @@ static size_t ipvlan_nl_getsize(const struct net_device *dev)
476477
);
477478
}
478479

479-
static int ipvlan_nl_validate(struct nlattr *tb[], struct nlattr *data[])
480+
static int ipvlan_nl_validate(struct nlattr *tb[], struct nlattr *data[],
481+
struct netlink_ext_ack *extack)
480482
{
481483
if (data && data[IFLA_IPVLAN_MODE]) {
482484
u16 mode = nla_get_u16(data[IFLA_IPVLAN_MODE]);
@@ -508,7 +510,8 @@ static int ipvlan_nl_fillinfo(struct sk_buff *skb,
508510
}
509511

510512
int ipvlan_link_new(struct net *src_net, struct net_device *dev,
511-
struct nlattr *tb[], struct nlattr *data[])
513+
struct nlattr *tb[], struct nlattr *data[],
514+
struct netlink_ext_ack *extack)
512515
{
513516
struct ipvl_dev *ipvlan = netdev_priv(dev);
514517
struct ipvl_port *port;

drivers/net/ipvlan/ipvtap.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ static void ipvtap_update_features(struct tap_dev *tap,
7373
netdev_update_features(vlan->dev);
7474
}
7575

76-
static int ipvtap_newlink(struct net *src_net,
77-
struct net_device *dev,
78-
struct nlattr *tb[],
79-
struct nlattr *data[])
76+
static int ipvtap_newlink(struct net *src_net, struct net_device *dev,
77+
struct nlattr *tb[], struct nlattr *data[],
78+
struct netlink_ext_ack *extack)
8079
{
8180
struct ipvtap_dev *vlantap = netdev_priv(dev);
8281
int err;
@@ -98,7 +97,7 @@ static int ipvtap_newlink(struct net *src_net,
9897
/* Don't put anything that may fail after macvlan_common_newlink
9998
* because we can't undo what it does.
10099
*/
101-
err = ipvlan_link_new(src_net, dev, tb, data);
100+
err = ipvlan_link_new(src_net, dev, tb, data, extack);
102101
if (err) {
103102
netdev_rx_handler_unregister(dev);
104103
return err;

drivers/net/macsec.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,7 +3056,8 @@ static void macsec_changelink_common(struct net_device *dev,
30563056
}
30573057

30583058
static int macsec_changelink(struct net_device *dev, struct nlattr *tb[],
3059-
struct nlattr *data[])
3059+
struct nlattr *data[],
3060+
struct netlink_ext_ack *extack)
30603061
{
30613062
if (!data)
30623063
return 0;
@@ -3203,7 +3204,8 @@ static int macsec_add_dev(struct net_device *dev, sci_t sci, u8 icv_len)
32033204
}
32043205

32053206
static int macsec_newlink(struct net *net, struct net_device *dev,
3206-
struct nlattr *tb[], struct nlattr *data[])
3207+
struct nlattr *tb[], struct nlattr *data[],
3208+
struct netlink_ext_ack *extack)
32073209
{
32083210
struct macsec_dev *macsec = macsec_priv(dev);
32093211
struct net_device *real_dev;
@@ -3285,7 +3287,8 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
32853287
return err;
32863288
}
32873289

3288-
static int macsec_validate_attr(struct nlattr *tb[], struct nlattr *data[])
3290+
static int macsec_validate_attr(struct nlattr *tb[], struct nlattr *data[],
3291+
struct netlink_ext_ack *extack)
32893292
{
32903293
u64 csid = MACSEC_DEFAULT_CIPHER_ID;
32913294
u8 icv_len = DEFAULT_ICV_LEN;

drivers/net/macvlan.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,8 @@ static void macvlan_port_destroy(struct net_device *dev)
11621162
kfree(port);
11631163
}
11641164

1165-
static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[])
1165+
static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[],
1166+
struct netlink_ext_ack *extack)
11661167
{
11671168
if (tb[IFLA_ADDRESS]) {
11681169
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
@@ -1390,7 +1391,8 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
13901391
EXPORT_SYMBOL_GPL(macvlan_common_newlink);
13911392

13921393
static int macvlan_newlink(struct net *src_net, struct net_device *dev,
1393-
struct nlattr *tb[], struct nlattr *data[])
1394+
struct nlattr *tb[], struct nlattr *data[],
1395+
struct netlink_ext_ack *extack)
13941396
{
13951397
return macvlan_common_newlink(src_net, dev, tb, data);
13961398
}
@@ -1408,7 +1410,8 @@ void macvlan_dellink(struct net_device *dev, struct list_head *head)
14081410
EXPORT_SYMBOL_GPL(macvlan_dellink);
14091411

14101412
static int macvlan_changelink(struct net_device *dev,
1411-
struct nlattr *tb[], struct nlattr *data[])
1413+
struct nlattr *tb[], struct nlattr *data[],
1414+
struct netlink_ext_ack *extack)
14121415
{
14131416
struct macvlan_dev *vlan = netdev_priv(dev);
14141417
enum macvlan_mode mode;

drivers/net/macvtap.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ static void macvtap_update_features(struct tap_dev *tap,
7777
netdev_update_features(vlan->dev);
7878
}
7979

80-
static int macvtap_newlink(struct net *src_net,
81-
struct net_device *dev,
82-
struct nlattr *tb[],
83-
struct nlattr *data[])
80+
static int macvtap_newlink(struct net *src_net, struct net_device *dev,
81+
struct nlattr *tb[], struct nlattr *data[],
82+
struct netlink_ext_ack *extack)
8483
{
8584
struct macvtap_dev *vlantap = netdev_priv(dev);
8685
int err;

drivers/net/nlmon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ static void nlmon_setup(struct net_device *dev)
127127
dev->min_mtu = sizeof(struct nlmsghdr);
128128
}
129129

130-
static int nlmon_validate(struct nlattr *tb[], struct nlattr *data[])
130+
static int nlmon_validate(struct nlattr *tb[], struct nlattr *data[],
131+
struct netlink_ext_ack *extack)
131132
{
132133
if (tb[IFLA_ADDRESS])
133134
return -EINVAL;

drivers/net/ppp/ppp_generic.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,8 @@ static const struct nla_policy ppp_nl_policy[IFLA_PPP_MAX + 1] = {
10611061
[IFLA_PPP_DEV_FD] = { .type = NLA_S32 },
10621062
};
10631063

1064-
static int ppp_nl_validate(struct nlattr *tb[], struct nlattr *data[])
1064+
static int ppp_nl_validate(struct nlattr *tb[], struct nlattr *data[],
1065+
struct netlink_ext_ack *extack)
10651066
{
10661067
if (!data)
10671068
return -EINVAL;
@@ -1075,7 +1076,8 @@ static int ppp_nl_validate(struct nlattr *tb[], struct nlattr *data[])
10751076
}
10761077

10771078
static int ppp_nl_newlink(struct net *src_net, struct net_device *dev,
1078-
struct nlattr *tb[], struct nlattr *data[])
1079+
struct nlattr *tb[], struct nlattr *data[],
1080+
struct netlink_ext_ack *extack)
10791081
{
10801082
struct ppp_config conf = {
10811083
.unit = -1,

drivers/net/team/team.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,15 +2101,17 @@ static void team_setup(struct net_device *dev)
21012101
}
21022102

21032103
static int team_newlink(struct net *src_net, struct net_device *dev,
2104-
struct nlattr *tb[], struct nlattr *data[])
2104+
struct nlattr *tb[], struct nlattr *data[],
2105+
struct netlink_ext_ack *extack)
21052106
{
21062107
if (tb[IFLA_ADDRESS] == NULL)
21072108
eth_hw_addr_random(dev);
21082109

21092110
return register_netdevice(dev);
21102111
}
21112112

2112-
static int team_validate(struct nlattr *tb[], struct nlattr *data[])
2113+
static int team_validate(struct nlattr *tb[], struct nlattr *data[],
2114+
struct netlink_ext_ack *extack)
21132115
{
21142116
if (tb[IFLA_ADDRESS]) {
21152117
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)

drivers/net/tun.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,8 @@ static void tun_setup(struct net_device *dev)
15801580
/* Trivial set of netlink ops to allow deleting tun or tap
15811581
* device with netlink.
15821582
*/
1583-
static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
1583+
static int tun_validate(struct nlattr *tb[], struct nlattr *data[],
1584+
struct netlink_ext_ack *extack)
15841585
{
15851586
return -EINVAL;
15861587
}

0 commit comments

Comments
 (0)