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] [day] [month] [year] [list]
Message-ID: <1302484406.12482.19.camel@concordia>
Date:	Mon, 11 Apr 2011 11:13:26 +1000
From:	Michael Ellerman <michael@...erman.id.au>
To:	Anton Blanchard <anton@...ba.org>
Cc:	leitao@...ux.vnet.ibm.com, netdev@...r.kernel.org
Subject: Re: [PATCH 2/14] ehea: Update multiqueue support

On Tue, 2011-04-05 at 21:29 +1000, Anton Blanchard wrote:
> The ehea driver had some multiqueue support but was missing the last
> few years of networking stack improvements:

...

> Index: linux-2.6/drivers/net/ehea/ehea_main.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/ehea/ehea_main.c	2011-04-05 20:34:36.300715364 +1000
> +++ linux-2.6/drivers/net/ehea/ehea_main.c	2011-04-05 20:35:36.703818722 +1000
> @@ -753,6 +753,8 @@ static int ehea_proc_rwqes(struct net_de
>  				skb_copy_to_linear_data(skb, ((char *)cqe) + 64,
>  						 cqe->num_bytes_transfered - 4);
>  				ehea_fill_skb(dev, skb, cqe);
> +				skb_record_rx_queue(skb,
> +					pr - &pr->port->port_res[0]);
>  			} else if (rq == 2) {
>  				/* RQ2 */
>  				skb = get_skb_by_index(skb_arr_rq2,
> @@ -763,6 +765,8 @@ static int ehea_proc_rwqes(struct net_de
>  					break;
>  				}
>  				ehea_fill_skb(dev, skb, cqe);
> +				skb_record_rx_queue(skb,
> +					pr - &pr->port->port_res[0]);
>  				processed_rq2++;
>  			} else {
>  				/* RQ3 */
> @@ -774,6 +778,8 @@ static int ehea_proc_rwqes(struct net_de
>  					break;
>  				}
>  				ehea_fill_skb(dev, skb, cqe);
> +				skb_record_rx_queue(skb,
> +					pr - &pr->port->port_res[0]);
>  				processed_rq3++;
>  			}
>  

Couldn't you call skb_record_rx_queue() in ehea_proc_skb() and save
replicating it three times?

> @@ -909,14 +916,16 @@ static struct ehea_cqe *ehea_proc_cqes(s
>  	ehea_update_feca(send_cq, cqe_counter);
>  	atomic_add(swqe_av, &pr->swqe_avail);
>  
> -	spin_lock_irqsave(&pr->netif_queue, flags);
> -
> -	if (pr->queue_stopped && (atomic_read(&pr->swqe_avail)
> -				  >= pr->swqe_refill_th)) {
> -		netif_wake_queue(pr->port->netdev);
> -		pr->queue_stopped = 0;
> +	if (unlikely(netif_tx_queue_stopped(txq) &&
> +		     (atomic_read(&pr->swqe_avail) >= pr->swqe_refill_th))) {
> +		__netif_tx_lock(txq, smp_processor_id());
> +		if (netif_tx_queue_stopped(txq) &&
> +		    (atomic_read(&pr->swqe_avail) >= pr->swqe_refill_th)) {
> +			netif_tx_wake_queue(txq);
> +			__netif_tx_unlock(txq);
> +		}
>  	}

This potentially leaves the txq locked doesn't it, which I don't think
you want to do?

cheers



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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ