Skip to content

Commit 2637260

Browse files
pmachatadavem330
authored andcommitted
net: core: dev: Add call_netdevice_notifiers_extack()
In order to propagate extack through NETDEV_PRE_UP, add a new function call_netdevice_notifiers_extack() that primes the extack field of the notifier info. Convert call_netdevice_notifiers() to a simple wrapper around the new function that passes NULL for extack. Signed-off-by: Petr Machata <petrm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6d04032 commit 2637260

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

net/core/dev.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ static struct list_head offload_base __read_mostly;
162162
static int netif_rx_internal(struct sk_buff *skb);
163163
static int call_netdevice_notifiers_info(unsigned long val,
164164
struct netdev_notifier_info *info);
165+
static int call_netdevice_notifiers_extack(unsigned long val,
166+
struct net_device *dev,
167+
struct netlink_ext_ack *extack);
165168
static struct napi_struct *napi_by_id(unsigned int napi_id);
166169

167170
/*
@@ -1734,6 +1737,18 @@ static int call_netdevice_notifiers_info(unsigned long val,
17341737
return raw_notifier_call_chain(&netdev_chain, val, info);
17351738
}
17361739

1740+
static int call_netdevice_notifiers_extack(unsigned long val,
1741+
struct net_device *dev,
1742+
struct netlink_ext_ack *extack)
1743+
{
1744+
struct netdev_notifier_info info = {
1745+
.dev = dev,
1746+
.extack = extack,
1747+
};
1748+
1749+
return call_netdevice_notifiers_info(val, &info);
1750+
}
1751+
17371752
/**
17381753
* call_netdevice_notifiers - call all network notifier blocks
17391754
* @val: value passed unmodified to notifier function
@@ -1745,11 +1760,7 @@ static int call_netdevice_notifiers_info(unsigned long val,
17451760

17461761
int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
17471762
{
1748-
struct netdev_notifier_info info = {
1749-
.dev = dev,
1750-
};
1751-
1752-
return call_netdevice_notifiers_info(val, &info);
1763+
return call_netdevice_notifiers_extack(val, dev, NULL);
17531764
}
17541765
EXPORT_SYMBOL(call_netdevice_notifiers);
17551766

0 commit comments

Comments
 (0)