netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net-next: ag71xx: Add missing header
@ 2019-07-13  2:09 Rosen Penev
  2019-07-13  2:09 ` [PATCH 2/2] net-next: ag71xx: Rearrange ag711xx struct to remove holes Rosen Penev
  2019-07-14  2:24 ` [PATCH 1/2] net-next: ag71xx: Add missing header David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Rosen Penev @ 2019-07-13  2:09 UTC (permalink / raw)
  To: netdev

ag71xx uses devm_ioremap_nocache. This fixes usage of an implicit function

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/atheros/ag71xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 72a57c6cd254..8f450a03a885 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -35,6 +35,7 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 #include <linux/clk.h>
+#include <linux/io.h>
 
 /* For our NAPI weight bigger does *NOT* mean better - it means more
  * D-cache misses and lots more wasted cycles than we'll ever
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] net-next: ag71xx: Rearrange ag711xx struct to remove holes
  2019-07-13  2:09 [PATCH 1/2] net-next: ag71xx: Add missing header Rosen Penev
@ 2019-07-13  2:09 ` Rosen Penev
  2019-07-14  2:24   ` David Miller
  2019-07-14  2:24 ` [PATCH 1/2] net-next: ag71xx: Add missing header David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Rosen Penev @ 2019-07-13  2:09 UTC (permalink / raw)
  To: netdev

Removed ____cacheline_aligned attribute to ring structs. This actually
causes holes in the ag71xx struc as well as lower performance.

Rearranged struct members to fall within respective cachelines. The RX
ring struct now does not share a cacheline with the TX ring. The NAPI
atruct now takes up its own cachelines and does not share.

According to pahole -C ag71xx -c 32

Before:

struct ag71xx {
	/* size: 384, cachelines: 12, members: 22 */
	/* sum members: 375, holes: 2, sum holes: 9 */

After:

struct ag71xx {
	/* size: 376, cachelines: 12, members: 22 */
	/* last cacheline: 24 bytes */

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/atheros/ag71xx.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 8f450a03a885..f19711984d34 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -295,16 +295,15 @@ struct ag71xx {
 	/* Critical data related to the per-packet data path are clustered
 	 * early in this structure to help improve the D-cache footprint.
 	 */
-	struct ag71xx_ring rx_ring ____cacheline_aligned;
-	struct ag71xx_ring tx_ring ____cacheline_aligned;
-
+	struct ag71xx_ring rx_ring;
 	u16 rx_buf_size;
-	u8 rx_buf_offset;
+	u16 rx_buf_offset;
+	u32 msg_enable;
+	struct ag71xx_ring tx_ring;
 
 	struct net_device *ndev;
 	struct platform_device *pdev;
 	struct napi_struct napi;
-	u32 msg_enable;
 	const struct ag71xx_dcfg *dcfg;
 
 	/* From this point onwards we're not looking at per-packet fields. */
@@ -313,20 +312,17 @@ struct ag71xx {
 	struct ag71xx_desc *stop_desc;
 	dma_addr_t stop_desc_dma;
 
-	int phy_if_mode;
-
-	struct delayed_work restart_work;
-	struct timer_list oom_timer;
-
-	struct reset_control *mac_reset;
-
 	u32 fifodata[3];
 	int mac_idx;
+	int phy_if_mode;
 
-	struct reset_control *mdio_reset;
 	struct mii_bus *mii_bus;
 	struct clk *clk_mdio;
 	struct clk *clk_eth;
+	struct reset_control *mdio_reset;
+	struct delayed_work restart_work;
+	struct timer_list oom_timer;
+	struct reset_control *mac_reset;
 };
 
 static int ag71xx_desc_empty(struct ag71xx_desc *desc)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] net-next: ag71xx: Add missing header
  2019-07-13  2:09 [PATCH 1/2] net-next: ag71xx: Add missing header Rosen Penev
  2019-07-13  2:09 ` [PATCH 2/2] net-next: ag71xx: Rearrange ag711xx struct to remove holes Rosen Penev
@ 2019-07-14  2:24 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-07-14  2:24 UTC (permalink / raw)
  To: rosenp; +Cc: netdev

From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 12 Jul 2019 19:09:20 -0700

> ag71xx uses devm_ioremap_nocache. This fixes usage of an implicit function
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

This is a bug fix and should target 'net'.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] net-next: ag71xx: Rearrange ag711xx struct to remove holes
  2019-07-13  2:09 ` [PATCH 2/2] net-next: ag71xx: Rearrange ag711xx struct to remove holes Rosen Penev
@ 2019-07-14  2:24   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-07-14  2:24 UTC (permalink / raw)
  To: rosenp; +Cc: netdev

From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 12 Jul 2019 19:09:21 -0700

> Removed ____cacheline_aligned attribute to ring structs. This actually
> causes holes in the ag71xx struc as well as lower performance.
> 
> Rearranged struct members to fall within respective cachelines. The RX
> ring struct now does not share a cacheline with the TX ring. The NAPI
> atruct now takes up its own cachelines and does not share.
> 
> According to pahole -C ag71xx -c 32
 ...

net-next is closed, therefore it is not appropriate to submit this change
at the current time.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-14  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-13  2:09 [PATCH 1/2] net-next: ag71xx: Add missing header Rosen Penev
2019-07-13  2:09 ` [PATCH 2/2] net-next: ag71xx: Rearrange ag711xx struct to remove holes Rosen Penev
2019-07-14  2:24   ` David Miller
2019-07-14  2:24 ` [PATCH 1/2] net-next: ag71xx: Add missing header David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).