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]
Date:	Mon, 17 Sep 2007 12:08:36 +0200 (CEST)
From:	Martin Josefsson <gandalf@...g.westbo.se>
To:	Stephen Hemminger <shemminger@...ux-foundation.org>
cc:	netdev@...r.kernel.org
Subject: Re: [RFT] sky2: receive hang check

On Wed, 12 Sep 2007, Stephen Hemminger wrote:

> -/* Check for lost IRQ once a second */
> +static void sky2_rx_check(struct net_device *dev)
> +{
> +	struct sky2_port *sky2 = netdev_priv(dev);
> +	struct sky2_hw *hw = sky2->hw;
> +	unsigned port = sky2->port;
> +	unsigned rxq = rxqaddr[port];
> +	u32 mac_rp = sky2_read32(hw, SK_REG(port, RX_GMF_RP));
> +	u8 mac_lev = sky2_read8(hw, SK_REG(port, RX_GMF_RLEV));
> +	u8 fifo_rp = sky2_read8(hw, Q_ADDR(rxq, Q_RP));
> +	u8 fifo_lev = sky2_read8(hw, Q_ADDR(rxq, Q_RL));
> +
> +	/* If not idle and MAC or PCI is stuck */
> +	if (sky2->check.last != dev->last_rx &&

Don't you want == here? You want to run the rest of this test when no 
packets has been received for a while.

> +	    ((mac_rp == sky2->check.mac_rp &&
> +		     mac_lev != 0 && mac_lev >= sky2->check.mac_lev) ||
> +		    /* Check if the PCI RX hang */
> +		    (fifo_rp == sky2->check.fifo_rp &&
> +		     fifo_lev != 0 && fifo_lev >= sky2->check.fifo_lev))) {
> +
> +		pr_info(PFX "%s: receiver hang detected\n", dev->name);
> +		schedule_work(&hw->restart_work);
> +	}
> +
> +	sky2->check.last = dev->last_rx;
> +	sky2->check.mac_rp = mac_rp;
> +	sky2->check.mac_lev = mac_lev;
> +	sky2->check.fifo_rp = fifo_rp;
> +	sky2->check.fifo_lev = fifo_lev;
> +}

/Martin
-
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