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]
Date:	Fri, 14 Nov 2014 01:09:06 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Yoshihiro Kaneko <ykaneko0929@...il.com>, netdev@...r.kernel.org
CC:	"David S. Miller" <davem@...emloft.net>,
	Simon Horman <horms@...ge.net.au>,
	Magnus Damm <magnus.damm@...il.com>, linux-sh@...r.kernel.org
Subject: Re: [PATCH] sh_eth: Optimization for RX excess judgement

Hello.

On 11/13/2014 10:00 AM, Yoshihiro Kaneko wrote:

> From: Mitsuhiro Kimura <mitsuhiro.kimura.kc@...esas.com>

> Both of 'boguscnt' and 'quota' have nearly meaning as the condition of
> the reception loop.
> In order to cut down redundant processing, this patch changes excess judgement.

> Signed-off-by: Mitsuhiro Kimura <mitsuhiro.kimura.kc@...esas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@...il.com>
> ---

> This patch is based on net tree.

    This is clearly 'net-next' material.

>   drivers/net/ethernet/renesas/sh_eth.c | 15 +++++++++------
>   1 file changed, 9 insertions(+), 6 deletions(-)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 60e9c2c..7d46326 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1394,10 +1394,15 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
>
>   	int entry = mdp->cur_rx % mdp->num_rx_ring;
>   	int boguscnt = (mdp->dirty_rx + mdp->num_rx_ring) - mdp->cur_rx;
> +	int limit = boguscnt;
>   	struct sk_buff *skb;
>   	u16 pkt_len = 0;
>   	u32 desc_status;
>
> +	if (quota) {

    I don't see what's the point in checking -- quota is always non-NULL.

> +		boguscnt = min(boguscnt, *quota);
> +		limit = boguscnt;
> +	}
>   	rxdesc = &mdp->rx_ring[entry];
>   	while (!(rxdesc->status & cpu_to_edmac(mdp, RD_RACT))) {
>   		desc_status = edmac_to_cpu(mdp, rxdesc->status);
[...]
> @@ -1501,7 +1501,10 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
>   		sh_eth_write(ndev, EDRRR_R, EDRRR);
>   	}
>
> -	return *quota <= 0;
> +	if (quota)

    Again, seeing no sense in this check.

> +		*quota -= limit - (++boguscnt);
> +
> +	return (boguscnt <= 0);

    Parens not needed.

[...]

WBR, Sergei

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