lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 Mar 2014 07:11:49 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	roy.qing.li@...il.com
Cc:	netdev@...r.kernel.org, amwang@...hat.com
Subject: Re: [PATCH] netpoll: send arp reply on master device immediately

On Mon, Mar 17, 2014 at 03:41:46PM +0800, roy.qing.li@...il.com wrote:
> From: Li RongQing <roy.qing.li@...il.com>
> 
> 1. the arp queue has been moved from slave device to master, so the
> master device netpoll_info should be as input of service_arp_queue()
> 2. not need to check if ni is NULL or not, since it has been used before.
> 
> Signed-off-by: Li RongQing <roy.qing.li@...il.com>
> Cc: WANG Cong <amwang@...hat.com>
> Cc: Neil Horman <nhorman@...driver.com>
> ---
>  net/core/netpoll.c |   26 ++++++++++++--------------
>  1 file changed, 12 insertions(+), 14 deletions(-)
> 
> diff --git a/net/core/netpoll.c b/net/core/netpoll.c
> index a664f78..dd0a796 100644
> --- a/net/core/netpoll.c
> +++ b/net/core/netpoll.c
> @@ -229,21 +229,19 @@ static void netpoll_poll_dev(struct net_device *dev)
>  	up(&ni->dev_lock);
>  
>  	if (dev->flags & IFF_SLAVE) {
> -		if (ni) {
> -			struct net_device *bond_dev;
> -			struct sk_buff *skb;
> -			struct netpoll_info *bond_ni;
> -
> -			bond_dev = netdev_master_upper_dev_get_rcu(dev);
> -			bond_ni = rcu_dereference_bh(bond_dev->npinfo);
> -			while ((skb = skb_dequeue(&ni->neigh_tx))) {
> -				skb->dev = bond_dev;
> -				skb_queue_tail(&bond_ni->neigh_tx, skb);
> -			}
> -		}
> -	}
> +		struct net_device *bond_dev;
> +		struct sk_buff *skb;
> +		struct netpoll_info *bond_ni;
>  
> -	service_neigh_queue(ni);
> +		bond_dev = netdev_master_upper_dev_get_rcu(dev);
> +		bond_ni = rcu_dereference_bh(bond_dev->npinfo);
> +		while ((skb = skb_dequeue(&ni->neigh_tx))) {
> +			skb->dev = bond_dev;
> +			skb_queue_tail(&bond_ni->neigh_tx, skb);
> +		}

Here, instead of calling service_neigh_queue in two separate places, just set
ni = bond_ni if you fall into the if conditional.  Then you can get rid of the
else clause and have a single call site for service_neigh_queue

Other than that, looks good.

Neil

> +		service_neigh_queue(bond_ni);
> +	} else
> +		service_neigh_queue(ni);
>  
>  	zap_completion_queue();
>  }
> -- 
> 1.7.10.4
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ