Skip to contentSkip to conversation

net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled

PATCH Superseded Erni Sri Satya Vennela 3 participants 4 messages Jun 23, 2025 – Jun 25, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled

Fix build errors when CONFIG_NET_SHAPER is disabled, including:

drivers/net/ethernet/microsoft/mana/mana_en.c:804:10: error:
'const struct net_device_ops' has no member named 'net_shaper_ops'

804 | .net_shaper_ops = &mana_shaper_ops,

drivers/net/ethernet/microsoft/mana/mana_en.c:804:35: error:
initialization of 'int (*)(struct net_device *, struct neigh_parms *)' from incompatible pointer type 'const struct net_shaper_ops *' [-Werror=incompatible-pointer-types]

804 | .net_shaper_ops = &mana_shaper_ops,

---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/microsoft/mana/mana_en.c +4 -0
index 10e766c73fca..a4a18eb02558 100644
@@ -719,6 +719,7 @@ static int mana_change_mtu(struct net_device *ndev, int new_mtu)
 	return err;
 }
 
+#if IS_ENABLED(CONFIG_NET_SHAPER)
 static int mana_shaper_set(struct net_shaper_binding *binding,
 			   const struct net_shaper *shaper,
 			   struct netlink_ext_ack *extack)
@@ -790,6 +791,7 @@ static const struct net_shaper_ops mana_shaper_ops = {
 	.delete = mana_shaper_del,
 	.capabilities = mana_shaper_cap,
 };
+#endif
 
 static const struct net_device_ops mana_devops = {
 	.ndo_open		= mana_open,
@@ -801,7 +803,9 @@ static const struct net_device_ops mana_devops = {
 	.ndo_bpf		= mana_bpf,
 	.ndo_xdp_xmit		= mana_xdp_xmit,
 	.ndo_change_mtu		= mana_change_mtu,
+#if IS_ENABLED(CONFIG_NET_SHAPER)
 	.net_shaper_ops         = &mana_shaper_ops,
+#endif
 };
 
 static void mana_cleanup_port_context(struct mana_port_context *apc)
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Erni Sri Satya Vennela

Fix build errors when CONFIG_NET_SHAPER is disabled, including:

drivers/net/ethernet/microsoft/mana/mana_en.c:804:10: error:
'const struct net_device_ops' has no member named 'net_shaper_ops'

804 | .net_shaper_ops = &mana_shaper_ops,

drivers/net/ethernet/microsoft/mana/mana_en.c:804:35: error:
initialization of 'int (*)(struct net_device *, struct neigh_parms *)' from incompatible pointer type 'const struct net_shaper_ops *' [-Werror=incompatible-pointer-types]

Quoted 7 lines

804 | .net_shaper_ops = &mana_shaper_ops,

maintainer
#2 lore raw
In reply to Erni Sri Satya Vennela
Quoted 5 lines · On Mon, 23 Jun 2025 04:14:01 -0700 Erni Sri Satya Vennela wrote:

Fix build errors when CONFIG_NET_SHAPER is disabled, including:

drivers/net/ethernet/microsoft/mana/mana_en.c:804:10: error:
'const struct net_device_ops' has no member named 'net_shaper_ops'

Quoted 8 lines

804 | .net_shaper_ops = &mana_shaper_ops,

drivers/net/ethernet/microsoft/mana/mana_en.c:804:35: error:
initialization of 'int (*)(struct net_device *, struct neigh_parms *)' from incompatible pointer type 'const struct net_shaper_ops *' [-Werror=incompatible-pointer-types]

804 | .net_shaper_ops = &mana_shaper_ops,

You have to add

select NET_SHAPER

to kconfig dependencies for the driver. This symbol cannot be selected by the user, its hidden from the menus.

Signature · 1 line
pw-bot: cr
#3 lore raw
Quoted 13 lines · Jakub Kicinski
Quoted 12 lines · On Mon, 23 Jun 2025 04:14:01 -0700 Erni Sri Satya Vennela wrote:

Fix build errors when CONFIG_NET_SHAPER is disabled, including:

drivers/net/ethernet/microsoft/mana/mana_en.c:804:10: error:
'const struct net_device_ops' has no member named 'net_shaper_ops'

804 | .net_shaper_ops = &mana_shaper_ops,

drivers/net/ethernet/microsoft/mana/mana_en.c:804:35: error:
initialization of 'int (*)(struct net_device *, struct neigh_parms *)' from incompatible pointer type 'const struct net_shaper_ops *' [-Werror=incompatible-pointer-types]

Quoted 8 lines
Quoted 1 line

804 | .net_shaper_ops = &mana_shaper_ops,

You have to add

select NET_SHAPER

to kconfig dependencies for the driver. This symbol cannot be selected by the user, its hidden from the menus.

Thankyou for pointing it out Jakub.
I'll make this change in the next version of this patch.

- Vennela

Quoted 2 lines
Signature · 1 line
pw-bot: cr