* [PATCH v2] sh_eth: Optimization for RX excess judgement
@ 2014-12-08 10:48 Yoshihiro Kaneko
2014-12-08 11:47 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Kaneko @ 2014-12-08 10:48 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh
From: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas•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@renesas•com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail•com>
---
This patch is based on net-next tree.
v2 [Yoshihiro Kaneko]
* re-spin for net-next.
* remove unneeded check of "quota".
drivers/net/ethernet/renesas/sh_eth.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index dbe8606..266c9b2 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1394,10 +1394,13 @@ 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;
struct sk_buff *skb;
u16 pkt_len = 0;
u32 desc_status;
+ 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);
@@ -1406,11 +1409,6 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
if (--boguscnt < 0)
break;
- if (*quota <= 0)
- break;
-
- (*quota)--;
-
if (!(desc_status & RDFEND))
ndev->stats.rx_length_errors++;
@@ -1501,6 +1499,8 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
sh_eth_write(ndev, EDRRR_R, EDRRR);
}
+ *quota -= limit - boguscnt + 1;
+
return *quota <= 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] sh_eth: Optimization for RX excess judgement
2014-12-08 10:48 [PATCH v2] sh_eth: Optimization for RX excess judgement Yoshihiro Kaneko
@ 2014-12-08 11:47 ` Sergei Shtylyov
2014-12-08 12:16 ` Yoshihiro Kaneko
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2014-12-08 11:47 UTC (permalink / raw)
To: Yoshihiro Kaneko, netdev
Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh
Hello.
On 12/8/2014 1:48 PM, Yoshihiro Kaneko wrote:
> From: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas•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@renesas•com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail•com>
> ---
> This patch is based on net-next tree.
> v2 [Yoshihiro Kaneko]
> * re-spin for net-next.
> * remove unneeded check of "quota".
This is not a complete list. :-/
> drivers/net/ethernet/renesas/sh_eth.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index dbe8606..266c9b2 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -1501,6 +1499,8 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
> sh_eth_write(ndev, EDRRR_R, EDRRR);
> }
>
> + *quota -= limit - boguscnt + 1;
> +
Sorry for the wrong previous suggestion, it clearly should have been -1,
not +1. :-<
[...]
WBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] sh_eth: Optimization for RX excess judgement
2014-12-08 11:47 ` Sergei Shtylyov
@ 2014-12-08 12:16 ` Yoshihiro Kaneko
0 siblings, 0 replies; 3+ messages in thread
From: Yoshihiro Kaneko @ 2014-12-08 12:16 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: netdev, David S. Miller, Simon Horman, Magnus Damm, Linux-sh list
Hello Sergei,
2014-12-08 20:47 GMT+09:00 Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>:
> Hello.
>
> On 12/8/2014 1:48 PM, Yoshihiro Kaneko wrote:
>
>> From: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas•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@renesas•com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail•com>
>> ---
>
>
>> This patch is based on net-next tree.
>
>
>> v2 [Yoshihiro Kaneko]
>> * re-spin for net-next.
>> * remove unneeded check of "quota".
>
>
> This is not a complete list. :-/
Sorry, I'll update on the next time.
>
>> drivers/net/ethernet/renesas/sh_eth.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>
>
>> diff --git a/drivers/net/ethernet/renesas/sh_eth.c
>> b/drivers/net/ethernet/renesas/sh_eth.c
>> index dbe8606..266c9b2 100644
>> --- a/drivers/net/ethernet/renesas/sh_eth.c
>> +++ b/drivers/net/ethernet/renesas/sh_eth.c
>
> [...]
>>
>> @@ -1501,6 +1499,8 @@ static int sh_eth_rx(struct net_device *ndev, u32
>> intr_status, int *quota)
>> sh_eth_write(ndev, EDRRR_R, EDRRR);
>> }
>>
>> + *quota -= limit - boguscnt + 1;
>> +
>
>
> Sorry for the wrong previous suggestion, it clearly should have been -1,
> not +1. :-<
Oh, I agree.
Thanks,
Kaneko
>
> [...]
>
> WBR, Sergei
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-08 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 10:48 [PATCH v2] sh_eth: Optimization for RX excess judgement Yoshihiro Kaneko
2014-12-08 11:47 ` Sergei Shtylyov
2014-12-08 12:16 ` Yoshihiro Kaneko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox