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: <20140721.223140.1559817699583180859.davem@davemloft.net>
Date:	Mon, 21 Jul 2014 22:31:40 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	sonic.adi@...il.com
Cc:	netdev@...r.kernel.org, romieu@...zoreil.com,
	adi-buildroot-devel@...ts.sourceforge.net, sonic.zhang@...log.com
Subject: Re: [PATCH v6] bfin_mac: convert bfin Ethernet driver to NAPI
 framework

From: Sonic Zhang <sonic.adi@...il.com>
Date: Tue, 22 Jul 2014 13:20:48 +0800

> +static int bfin_mac_poll(struct napi_struct *napi, int budget)
> +{
 ...
> +	if (i < budget) {
> +		napi_complete(napi);
> +		if (lp->rx_irq_disabled) {
> +			lp->rx_irq_disabled--;
> +			enable_irq(IRQ_MAC_RX);
> +		}
 ...
>  /* interrupt routine to handle rx and error signal */
>  static irqreturn_t bfin_mac_interrupt(int irq, void *dev_id)
>  {
 ...
> +
> +	bfin_write_DMA1_IRQ_STATUS(status | DMA_DONE | DMA_ERR);
> +	if ((status & DMA_DONE) && napi_schedule_prep(&lp->napi)) {
> +		disable_irq_nosync(IRQ_MAC_RX);
> +		lp->rx_irq_disabled++;
> +		__napi_schedule(&lp->napi);
>  	}

How in the world does this work?

You should only IRQ disable when rx_irq_disabled is zero before the
increment, and you should only do the IRQ enable when decrementing
rx_irq_disabled will cause it to become zero.
--
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