From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Machata Subject: [PATCH net-next v2 6/8] net: core: dev: Add call_netdevice_notifiers_extack() Date: Thu, 6 Dec 2018 17:05:45 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "David S. Miller" , Jiri Pirko , Ido Schimmel , David Ahern To: "netdev@vger.kernel.org" Return-path: Received: from mail-eopbgr30069.outbound.protection.outlook.com ([40.107.3.69]:6064 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725942AbeLFRGJ (ORCPT ); Thu, 6 Dec 2018 12:06:09 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- net/core/dev.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index b37e320def13..4b033af8e6cd 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -162,6 +162,9 @@ static struct list_head offload_base __read_mostly; static int netif_rx_internal(struct sk_buff *skb); static int call_netdevice_notifiers_info(unsigned long val, struct netdev_notifier_info *info); +static int call_netdevice_notifiers_extack(unsigned long val, + struct net_device *dev, + struct netlink_ext_ack *extack); static struct napi_struct *napi_by_id(unsigned int napi_id); =20 /* @@ -1734,6 +1737,18 @@ static int call_netdevice_notifiers_info(unsigned lo= ng val, return raw_notifier_call_chain(&netdev_chain, val, info); } =20 +static int call_netdevice_notifiers_extack(unsigned long val, + struct net_device *dev, + struct netlink_ext_ack *extack) +{ + struct netdev_notifier_info info =3D { + .dev =3D dev, + .extack =3D extack, + }; + + return call_netdevice_notifiers_info(val, &info); +} + /** * call_netdevice_notifiers - call all network notifier blocks * @val: value passed unmodified to notifier function @@ -1745,11 +1760,7 @@ static int call_netdevice_notifiers_info(unsigned lo= ng val, =20 int call_netdevice_notifiers(unsigned long val, struct net_device *dev) { - struct netdev_notifier_info info =3D { - .dev =3D dev, - }; - - return call_netdevice_notifiers_info(val, &info); + return call_netdevice_notifiers_extack(val, dev, NULL); } EXPORT_SYMBOL(call_netdevice_notifiers); =20 --=20 2.4.11