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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1415290773.3398.61.camel@decadent.org.uk>
Date:	Thu, 06 Nov 2014 16:19:33 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Sowmini Varadhan <sowmini.varadhan@...cle.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCHv2 net-next 2/2] sunvnet: Use one Tx queue per vnet_port

On Thu, 2014-10-30 at 12:46 -0400, Sowmini Varadhan wrote:
> Use multple Tx netdev queues for sunvnet by supporting a one-to-one
> mapping between vnet_port and Tx queue. Provide a ndo_select_queue
> indirection (vnet_select_queue()) which selects the queue based
> on the peer that would be selected in vnet_start_xmit()
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@...cle.com>
[...]
> +static void maybe_tx_wakeup(struct vnet_port *port)
>  {
> -	struct net_device *dev = vp->dev;
> +	struct netdev_queue *txq;
>  
> -	netif_tx_lock(dev);
> -	if (likely(netif_queue_stopped(dev))) {
> -		struct vnet_port *port;
> -		int wake = 1;
> -
> -		rcu_read_lock();
> -		list_for_each_entry_rcu(port, &vp->port_list, list) {
> -			struct vio_dring_state *dr;
> -
> -			dr = &port->vio.drings[VIO_DRIVER_TX_RING];
> -			if (vnet_tx_dring_avail(dr) <
> -			    VNET_TX_WAKEUP_THRESH(dr)) {
> -				wake = 0;
> -				break;
> -			}
> -		}
> -		rcu_read_unlock();
> -		if (wake)
> -			netif_wake_queue(dev);
> +	txq = netdev_get_tx_queue(port->vp->dev, port->q_index);
> +	__netif_tx_lock(txq, smp_processor_id());
> +	if (likely(netif_tx_queue_stopped(txq))) {
> +		struct vio_dring_state *dr;
> +
> +		dr = &port->vio.drings[VIO_DRIVER_TX_RING];

You seem to have dropped the condition for the netif_tx_wake_queue(),
which I would guess based on the old code should be:

		if (vnet_tx_dring_avail(dr) >= VNET_TX_WAKEUP_THRESH(dr))

> +			netif_tx_wake_queue(txq);
>  	}
> -	netif_tx_unlock(dev);
> +	__netif_tx_unlock(txq);
>  }
[...]

-- 
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ