Skip to contentSkip to conversation

linux-next: build failure after merge of the net-next tree

PATCH Stephen Rothwell 3 participants 6 messages Sep 29, 2020 – Oct 2, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the net-next tree, today's linux-next build (x86_64 allmodconfig) failed like this:

drivers/net/ethernet/marvell/prestera/prestera_main.c: In function 'prestera_port_dev_lower_find':
drivers/net/ethernet/marvell/prestera/prestera_main.c:504:33: error: passing argument 2 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]

  504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 int (*)(struct net_device *, void *)
In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
include/linux/netdevice.h:4571:16: note: expected 'int (*)(struct net_device *, struct netdev_nested_priv *)' but argument is of type 'int (*)(struct net_device *, void *)'
 4571 |          int (*fn)(struct net_device *lower_dev,
      |          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4572 |      struct netdev_nested_priv *priv),
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/marvell/prestera/prestera_main.c:504:58: error: passing argument 3 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]
  504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
      |                                                          ^~~~~
      |                                                          |
      |                                                          struct prestera_port **
In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
include/linux/netdevice.h:4573:37: note: expected 'struct netdev_nested_priv *' but argument is of type 'struct prestera_port **'
 4573 |          struct netdev_nested_priv *priv);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

cc1: some warnings being treated as errors

Caused by commit

eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")

interacting with commit

e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")

also in the net-next tree.

I applied the following fix patch.

From: Stephen Rothwell <[email protected]>
Date: Tue, 29 Sep 2020 12:57:59 +1000
Subject: [PATCH] fix up for "net: core: introduce struct netdev_nested_priv for nested interface infrastructure"

---
 drivers/net/ethernet/marvell/prestera/prestera_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/prestera/prestera_main.c +6 -3
index 9bd57b89d1d0..633d8770be35 100644
@@ -482,9 +482,10 @@ bool prestera_netdev_check(const struct net_device *dev)
 	return dev->netdev_ops == &prestera_netdev_ops;
 }
 
-static int prestera_lower_dev_walk(struct net_device *dev, void *data)
+static int prestera_lower_dev_walk(struct net_device *dev,
+				   struct netdev_nested_priv *priv)
 {
-	struct prestera_port **pport = data;
+	struct prestera_port **pport = (struct prestera_port **)priv->data;
 
 	if (prestera_netdev_check(dev)) {
 		*pport = netdev_priv(dev);
@@ -497,11 +498,13 @@ static int prestera_lower_dev_walk(struct net_device *dev, void *data)
 struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev)
 {
 	struct prestera_port *port = NULL;
+	struct netdev_nested_priv priv;
 
 	if (prestera_netdev_check(dev))
 		return netdev_priv(dev);
 
-	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
+	priv.data = (void *)&port;
+	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &priv);
 
 	return port;
 }
Signature · 5 lines
2.28.0

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 72 lines · On Tue, 29 Sep 2020 13:04:46 +1000 Stephen Rothwell <[email protected]>…

After merging the net-next tree, today's linux-next build (x86_64 allmodconfig) failed like this:

drivers/net/ethernet/marvell/prestera/prestera_main.c: In function 'prestera_port_dev_lower_find':
drivers/net/ethernet/marvell/prestera/prestera_main.c:504:33: error: passing argument 2 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]

  504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 int (*)(struct net_device *, void *)
In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
include/linux/netdevice.h:4571:16: note: expected 'int (*)(struct net_device *, struct netdev_nested_priv *)' but argument is of type 'int (*)(struct net_device *, void *)'
 4571 |          int (*fn)(struct net_device *lower_dev,
      |          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4572 |      struct netdev_nested_priv *priv),
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/marvell/prestera/prestera_main.c:504:58: error: passing argument 3 of 'netdev_walk_all_lower_dev' from incompatible pointer type [-Werror=incompatible-pointer-types]
  504 |  netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
      |                                                          ^~~~~
      |                                                          |
      |                                                          struct prestera_port **
In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/marvell/prestera/prestera_main.c:4:
include/linux/netdevice.h:4573:37: note: expected 'struct netdev_nested_priv *' but argument is of type 'struct prestera_port **'
 4573 |          struct netdev_nested_priv *priv);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

cc1: some warnings being treated as errors

Caused by commit

eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")

interacting with commit

e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")

also in the net-next tree.

I applied the following fix patch.

From: Stephen Rothwell <[email protected]>
Date: Tue, 29 Sep 2020 12:57:59 +1000
Subject: [PATCH] fix up for "net: core: introduce struct netdev_nested_priv for nested interface infrastructure"

---
 drivers/net/ethernet/marvell/prestera/prestera_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/prestera/prestera_main.c +4 -2
index 9bd57b89d1d0..633d8770be35 100644
@@ -482,9 +482,10 @@ bool prestera_netdev_check(const struct net_device *dev)
 	return dev->netdev_ops == &prestera_netdev_ops;
 }
 
-static int prestera_lower_dev_walk(struct net_device *dev, void *data)
+static int prestera_lower_dev_walk(struct net_device *dev,
+				   struct netdev_nested_priv *priv)
 {
-	struct prestera_port **pport = data;
+	struct prestera_port **pport = (struct prestera_port **)priv->data;
 
 	if (prestera_netdev_check(dev)) {
 		*pport = netdev_priv(dev);
@@ -497,11 +498,13 @@ static int prestera_lower_dev_walk(struct net_device *dev, void *data)
 struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev)
 {
 	struct prestera_port *port = NULL;
+	struct netdev_nested_priv priv;

drivers/net/ethernet/marvell/prestera/prestera_main.c static int prestera_lower_dev_walk(struct net_device *dev, void *data) · line 510

Quoted 10 lines
drivers/net/ethernet/marvell/prestera/prestera_main.c +2 -1
 
 	if (prestera_netdev_check(dev))
 		return netdev_priv(dev);
 
-	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &port);
+	priv.data = (void *)&port;
+	netdev_walk_all_lower_dev(dev, prestera_lower_dev_walk, &priv);
 
 	return port;
 }

I am still getting this build failure ...

Signature · 2 lines
Cheers,
Stephen Rothwell
#2 lore raw

Hi Stephen,

Quoted 2 lines · Stephen Rothwell

Hi all,

[CUT]

Quoted 4 lines

I am still getting this build failure ...

I just 've checked linux-next/master and it builds fine at least with my custom config, do/how I need to handle this case ?

I see the changes you applied already in linux-next/master.

Quoted 2 lines

Cheers,
Stephen Rothwell

#3 lore raw

Hi Vadym,

Quoted 4 lines · On Thu, 1 Oct 2020 02:06:05 +0300 Vadym Kochan <[email protected]> wrote:
Quoted 2 lines · Stephen Rothwell

Hi all,

Quoted 8 lines

[CUT]

Quoted 4 lines

I am still getting this build failure ...

I just 've checked linux-next/master and it builds fine at least with my custom config, do/how I need to handle this case ?

If you take the net-next tree alone and do an x86_64 allmodconfig build, it currently fails, right?

Quoted 1 line

I see the changes you applied already in linux-next/master.

Linux-next builds fine because it contains the fix patch I posted (I added it to the net-next merge). It needs to be explicitly fixed in the net-next tree either using my patch or something more correct (if necessary).

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#4 lore raw
In reply to Stephen Rothwell

From: Stephen Rothwell <[email protected]>
Date: Tue, 29 Sep 2020 13:04:46 +1000

Quoted 9 lines

Caused by commit

eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")

interacting with commit

e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")

also in the net-next tree.

I would argue against that "also" as the first commit is only in the 'net' tree right now. :-)

This is simply something I'll have to resolve the next time net is merged into net-next.

Thanks.

#5 lore raw

Hi Dave,

Quoted 8 lines · On Thu, 01 Oct 2020 18:40:13 -0700 (PDT) David Miller <[email protected]>…

From: Stephen Rothwell <[email protected]>
Date: Tue, 29 Sep 2020 13:04:46 +1000

Quoted 4 lines

Caused by commit

eff7423365a6 ("net: core: introduce struct netdev_nested_priv for nested interface infrastructure")

Quoted 8 lines
Quoted 5 lines

interacting with commit

e1189d9a5fbe ("net: marvell: prestera: Add Switchdev driver implementation")

also in the net-next tree.

I would argue against that "also" as the first commit is only in the 'net' tree right now. :-)

Sorry, my mistake. I was wondering why your testing did not seem to be affected.

Quoted 2 lines

This is simply something I'll have to resolve the next time net is merged into net-next.

Absolutely, no problem.

Signature · 2 lines
Cheers,
Stephen Rothwell