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]
Message-ID: <54B1A22C.2020301@amd.com>
Date:	Sun, 11 Jan 2015 00:05:32 +0200
From:	Oded Gabbay <oded.gabbay@....com>
To:	Eric Dumazet <eric.dumazet@...il.com>,
	Johannes Berg <johannes.berg@...el.com>
CC:	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Willem de Bruijn <willemb@...gle.com>,
	"Bridgman, John" <John.Bridgman@....com>,
	"Elifaz, Dana" <Dana.Elifaz@....com>
Subject: Re: [BUG] 3.19-rc1 net: less interrupt masking in NAPI



On 01/10/2015 11:50 PM, Eric Dumazet wrote:
> On Sat, 2015-01-10 at 23:30 +0200, Oded Gabbay wrote:
> 
>> Yes, no problem.
>> I will update on the result.
> 
> Please try this more complete patch, solving the TX pressure problem as
> well, and not lying about NAPI budget. thanks !
> 
> 
> diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
> index e398eda07298..5f05b387c0a7 100644
> --- a/drivers/net/ethernet/atheros/alx/main.c
> +++ b/drivers/net/ethernet/atheros/alx/main.c
> @@ -184,15 +184,16 @@ static void alx_schedule_reset(struct alx_priv *alx)
>  	schedule_work(&alx->reset_wk);
>  }
>  
> -static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
> +static int alx_clean_rx_irq(struct alx_priv *alx, int budget)
>  {
>  	struct alx_rx_queue *rxq = &alx->rxq;
>  	struct alx_rrd *rrd;
>  	struct alx_buffer *rxb;
>  	struct sk_buff *skb;
>  	u16 length, rfd_cleaned = 0;
> +	int work = 0;
>  
> -	while (budget > 0) {
> +	while (work < budget) {
>  		rrd = &rxq->rrd[rxq->rrd_read_idx];
>  		if (!(rrd->word3 & cpu_to_le32(1 << RRD_UPDATED_SHIFT)))
>  			break;
> @@ -243,7 +244,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
>  		}
>  
>  		napi_gro_receive(&alx->napi, skb);
> -		budget--;
> +		work++;
>  
>  next_pkt:
>  		if (++rxq->read_idx == alx->rx_ringsz)
> @@ -258,21 +259,22 @@ next_pkt:
>  	if (rfd_cleaned)
>  		alx_refill_rx_ring(alx, GFP_ATOMIC);
>  
> -	return budget > 0;
> +	return work;
>  }
>  
>  static int alx_poll(struct napi_struct *napi, int budget)
>  {
>  	struct alx_priv *alx = container_of(napi, struct alx_priv, napi);
>  	struct alx_hw *hw = &alx->hw;
> -	bool complete = true;
>  	unsigned long flags;
> +	bool tx_complete;
> +	int work;
>  
> -	complete = alx_clean_tx_irq(alx) &&
> -		   alx_clean_rx_irq(alx, budget);
> +	tx_complete = alx_clean_tx_irq(alx);
> +	work = alx_clean_rx_irq(alx, budget);
>  
> -	if (!complete)
> -		return 1;
> +	if (!tx_complete || work == budget)
> +		return budget;
>  
>  	napi_complete(&alx->napi);
>  
> @@ -284,7 +286,7 @@ static int alx_poll(struct napi_struct *napi, int budget)
>  
>  	alx_post_write(hw);
>  
> -	return 0;
> +	return work;
>  }
>  
>  static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr)
> 
> 
Hi,
Checked it and its working.
Thanks again.
Please note that I only use this Ethernet controller for NFS and SCP, it is
not used for development of networking software of any kind, so maybe a more
extensive testing is needed.

	Oded
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ