diff mbox series

[net-next,3/3] use __netdev_notify_peers in hyperv

Message ID 20201209061811.48524-4-ljp@linux.ibm.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series lockless version of netdev_notify_peers | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Lijun Pan Dec. 9, 2020, 6:18 a.m. UTC
Start to use the lockless version of netdev_notify_peers.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
---
 drivers/net/hyperv/netvsc_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jakub Kicinski Dec. 13, 2020, 1:20 a.m. UTC | #1
On Wed,  9 Dec 2020 00:18:11 -0600 Lijun Pan wrote:
> Start to use the lockless version of netdev_notify_peers.
> 
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
> ---
>  drivers/net/hyperv/netvsc_drv.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index d17bbc75f5e7..4e3dac7bb944 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -2130,10 +2130,10 @@ static void netvsc_link_change(struct work_struct *w)
>  		break;
>  	}
>  
> -	rtnl_unlock();
> -
>  	if (notify)
> -		netdev_notify_peers(net);
> +		__netdev_notify_peers(net);
> +
> +	rtnl_unlock();

Looks like this code is only using this "notify" variable because it
wanted to wait until unlock to call the function. I think you can now
just call the helper where notify used to be set to true.
diff mbox series

Patch

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index d17bbc75f5e7..4e3dac7bb944 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -2130,10 +2130,10 @@  static void netvsc_link_change(struct work_struct *w)
 		break;
 	}
 
-	rtnl_unlock();
-
 	if (notify)
-		netdev_notify_peers(net);
+		__netdev_notify_peers(net);
+
+	rtnl_unlock();
 
 	/* link_watch only sends one notification with current state per
 	 * second, handle next reconfig event in 2 seconds.