RE: [PATCH net-next v6 02/10] dpaa_eth: add support for DPAA Ethernet

From
Madalin-Cristian Bucur <madalin.bucur@nxp.com>
Date
2016-11-09 17:16:31
Also in
lkml, netdev
Reply to
David Miller, 2016-11-03
From: Madalin-Cristian Bucur
Sent: Monday, November 07, 2016 5:43 PM
=20
quoted
From: David Miller [mailto:davem@davemloft.net]
Sent: Thursday, November 03, 2016 9:58 PM

From: Madalin Bucur <madalin.bucur@nxp.com>
Date: Wed, 2 Nov 2016 22:17:26 +0200
quoted
This introduces the Freescale Data Path Acceleration Architecture
<snip>
quoted
quoted
+	int numstats =3D sizeof(struct rtnl_link_stats64) / sizeof(u64);
 ...
quoted
+		cpustats =3D (u64 *)&percpu_priv->stats;
+
+		for (j =3D 0; j < numstats; j++)
+			netstats[j] +=3D cpustats[j];
This is a memcpy() on well-typed datastructures which requires no
casting or special handling whatsoever, so use memcpy instead of
needlessly open coding the operation.
=20
Will fix.
Took a second look at this, it's not copying but adding the percpu
statistics into consolidated results.

Madalin
Thread (29 messages) 29 messages, 10 authors, last reply 2016-11-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help