linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled
@ 2025-06-23 11:14 Erni Sri Satya Vennela
  2025-06-24 10:02 ` Simon Horman
  2025-06-24 23:33 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Erni Sri Satya Vennela @ 2025-06-23 11:14 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	kuba, pabeni, shradhagupta, longli, kotaranov, lorenzo,
	shirazsaleem, ernis, schakrabarti, linux-hyperv, netdev,
	linux-kernel

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,

Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Fixes: 75cabb46935b ("net: mana: Add support for net_shaper_ops")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506230625.bfUlqb8o-lkp@intel.com/
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 10e766c73fca..a4a18eb02558 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -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)
-- 
2.34.1


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

* Re: [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled
  2025-06-23 11:14 [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled Erni Sri Satya Vennela
@ 2025-06-24 10:02 ` Simon Horman
  2025-06-24 23:33 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-06-24 10:02 UTC (permalink / raw)
  To: Erni Sri Satya Vennela
  Cc: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	kuba, pabeni, shradhagupta, longli, kotaranov, lorenzo,
	shirazsaleem, schakrabarti, linux-hyperv, netdev, linux-kernel

On Mon, Jun 23, 2025 at 04:14:01AM -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]
> 
>      804 |         .net_shaper_ops         = &mana_shaper_ops,
> 
> Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> Fixes: 75cabb46935b ("net: mana: Add support for net_shaper_ops")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202506230625.bfUlqb8o-lkp@intel.com/

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled
  2025-06-23 11:14 [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled Erni Sri Satya Vennela
  2025-06-24 10:02 ` Simon Horman
@ 2025-06-24 23:33 ` Jakub Kicinski
  2025-06-25 10:58   ` Erni Sri Satya Vennela
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2025-06-24 23:33 UTC (permalink / raw)
  To: Erni Sri Satya Vennela
  Cc: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	pabeni, shradhagupta, longli, kotaranov, lorenzo, shirazsaleem,
	schakrabarti, linux-hyperv, netdev, linux-kernel

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]
> 
>      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.
-- 
pw-bot: cr

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

* Re: [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled
  2025-06-24 23:33 ` Jakub Kicinski
@ 2025-06-25 10:58   ` Erni Sri Satya Vennela
  0 siblings, 0 replies; 4+ messages in thread
From: Erni Sri Satya Vennela @ 2025-06-25 10:58 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	pabeni, shradhagupta, longli, kotaranov, lorenzo, shirazsaleem,
	schakrabarti, linux-hyperv, netdev, linux-kernel

On Tue, Jun 24, 2025 at 04:33:42PM -0700, Jakub Kicinski wrote:
> 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]
> > 
> >      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
> -- 
> pw-bot: cr

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

end of thread, other threads:[~2025-06-25 10:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 11:14 [PATCH net-next] net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled Erni Sri Satya Vennela
2025-06-24 10:02 ` Simon Horman
2025-06-24 23:33 ` Jakub Kicinski
2025-06-25 10:58   ` Erni Sri Satya Vennela

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).