[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190906.150715.1583606913988184408.davem@davemloft.net>
Date: Fri, 06 Sep 2019 15:07:15 +0200 (CEST)
From: David Miller <davem@...emloft.net>
To: yanjun.zhu@...cle.com
Cc: eric.dumazet@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCHv3 1/1] forcedeth: use per cpu to collect xmit/recv
statistics
From: Zhu Yanjun <yanjun.zhu@...cle.com>
Date: Thu, 5 Sep 2019 05:15:42 -0400
> When testing with a background iperf pushing 1Gbit/sec traffic and running
> both ifconfig and netstat to collect statistics, some deadlocks occurred.
>
> Ifconfig and netstat will call nv_get_stats64 to get software xmit/recv
> statistics. In the commit f5d827aece36 ("forcedeth: implement
> ndo_get_stats64() API"), the normal tx/rx variables is to collect tx/rx
> statistics. The fix is to replace normal tx/rx variables with per
> cpu 64-bit variable to collect xmit/recv statistics. The per cpu variable
> will avoid deadlocks and provide fast efficient statistics updates.
>
> In nv_probe, the per cpu variable is initialized. In nv_remove, this
> per cpu variable is freed.
>
> In xmit/recv process, this per cpu variable will be updated.
>
> In nv_get_stats64, this per cpu variable on each cpu is added up. Then
> the driver can get xmit/recv packets statistics.
>
> A test runs for several days with this commit, the deadlocks disappear
> and the performance is better.
>
> Tested:
...
> Fixes: f5d827aece36 ("forcedeth: implement ndo_get_stats64() API")
> CC: Joe Jin <joe.jin@...cle.com>
> CC: JUNXIAO_BI <junxiao.bi@...cle.com>
> Reported-and-tested-by: Nan san <nan.1986san@...il.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@...cle.com>
Applied.
Powered by blists - more mailing lists