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: <20151118.230101.2199889775612098415.davem@davemloft.net>
Date:	Wed, 18 Nov 2015 23:01:01 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	mans@...sr.com
Cc:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v7] net: ethernet: add driver for Aurora VLSI NB8800
 Ethernet controller

From: Mans Rullgard <mans@...sr.com>
Date: Wed, 18 Nov 2015 17:29:24 +0000

> +static int nb8800_poll(struct napi_struct *napi, int budget)
> +{
> +	struct net_device *dev = napi->dev;
> +	struct nb8800_priv *priv = netdev_priv(dev);
> +	struct nb8800_rx_desc *rxd;
> +	int work = 0;
> +	int last = priv->rx_eoc;
> +	int next;
 ...
> +		next = (last + 1) % RX_DESC_COUNT;

You should look at what the assembler looks like for these modulo
operations.

They will be much simpler (ie. one instruction) if you use unsigned
variables to hold the queue indices.

Please fix this in the entire driver.
--
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