netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] netdevsim: Fix build error without CONFIG_INET
@ 2019-08-19 12:08 YueHaibing
  2019-08-19 15:58 ` Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: YueHaibing @ 2019-08-19 12:08 UTC (permalink / raw)
  To: davem, idosch, jiri, mcroce; +Cc: linux-kernel, netdev, YueHaibing

If CONFIG_INET is not set, building fails:

drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
dev.c:(.text+0x67b): undefined reference to `ip_send_check'

Add CONFIG_INET Kconfig dependency to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 48e209e..7bb786e 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -505,7 +505,7 @@ source "drivers/net/hyperv/Kconfig"
 
 config NETDEVSIM
 	tristate "Simulated networking device"
-	depends on DEBUG_FS
+	depends on INET && DEBUG_FS
 	select NET_DEVLINK
 	help
 	  This driver is a developer testing tool and software model that can
-- 
2.7.4



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

* Re: [PATCH net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-19 12:08 [PATCH net-next] netdevsim: Fix build error without CONFIG_INET YueHaibing
@ 2019-08-19 15:58 ` Ido Schimmel
  2019-08-19 21:59 ` Jakub Kicinski
  2019-08-20 14:14 ` [PATCH v2 " YueHaibing
  2 siblings, 0 replies; 8+ messages in thread
From: Ido Schimmel @ 2019-08-19 15:58 UTC (permalink / raw)
  To: YueHaibing
  Cc: davem, idosch, jiri, mcroce, linux-kernel, netdev, jakub.kicinski

On Mon, Aug 19, 2019 at 08:08:25PM +0800, YueHaibing wrote:
> If CONFIG_INET is not set, building fails:
> 
> drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
> dev.c:(.text+0x67b): undefined reference to `ip_send_check'
> 
> Add CONFIG_INET Kconfig dependency to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

Thanks for the patch.

> ---
>  drivers/net/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 48e209e..7bb786e 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -505,7 +505,7 @@ source "drivers/net/hyperv/Kconfig"
>  
>  config NETDEVSIM
>  	tristate "Simulated networking device"
> -	depends on DEBUG_FS
> +	depends on INET && DEBUG_FS
>  	select NET_DEVLINK
>  	help
>  	  This driver is a developer testing tool and software model that can
> -- 
> 2.7.4
> 
> 

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

* Re: [PATCH net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-19 12:08 [PATCH net-next] netdevsim: Fix build error without CONFIG_INET YueHaibing
  2019-08-19 15:58 ` Ido Schimmel
@ 2019-08-19 21:59 ` Jakub Kicinski
  2019-08-20 14:08   ` Ido Schimmel
  2019-08-20 14:14 ` [PATCH v2 " YueHaibing
  2 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2019-08-19 21:59 UTC (permalink / raw)
  To: YueHaibing; +Cc: davem, idosch, jiri, mcroce, linux-kernel, netdev

On Mon, 19 Aug 2019 20:08:25 +0800, YueHaibing wrote:
> If CONFIG_INET is not set, building fails:
> 
> drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
> dev.c:(.text+0x67b): undefined reference to `ip_send_check'
> 
> Add CONFIG_INET Kconfig dependency to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Hmm.. I'd rather the test module did not have hard dependencies on
marginally important config options. We have done a pretty good job
so far limiting the requirements though separating the code out at
compilation object level. The more tests depend on netdevsim and the
more bots we have running tests against randconfig - the more important
this is.

This missing reference here is for calculating a checksum over a
constant header.. could we perhaps just hard code the checksum?

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

* Re: [PATCH net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-19 21:59 ` Jakub Kicinski
@ 2019-08-20 14:08   ` Ido Schimmel
  0 siblings, 0 replies; 8+ messages in thread
From: Ido Schimmel @ 2019-08-20 14:08 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: YueHaibing, davem, idosch, jiri, mcroce, linux-kernel, netdev

On Mon, Aug 19, 2019 at 02:59:00PM -0700, Jakub Kicinski wrote:
> On Mon, 19 Aug 2019 20:08:25 +0800, YueHaibing wrote:
> > If CONFIG_INET is not set, building fails:
> > 
> > drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
> > dev.c:(.text+0x67b): undefined reference to `ip_send_check'
> > 
> > Add CONFIG_INET Kconfig dependency to fix this.
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Hmm.. I'd rather the test module did not have hard dependencies on
> marginally important config options. We have done a pretty good job
> so far limiting the requirements though separating the code out at
> compilation object level. The more tests depend on netdevsim and the
> more bots we have running tests against randconfig - the more important
> this is.
> 
> This missing reference here is for calculating a checksum over a
> constant header.. could we perhaps just hard code the checksum?

Sure. I was AFK today, will send a patch later today when I get home.

Thanks

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

* [PATCH v2 net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-19 12:08 [PATCH net-next] netdevsim: Fix build error without CONFIG_INET YueHaibing
  2019-08-19 15:58 ` Ido Schimmel
  2019-08-19 21:59 ` Jakub Kicinski
@ 2019-08-20 14:14 ` YueHaibing
  2019-08-20 17:48   ` Jakub Kicinski
                     ` (2 more replies)
  2 siblings, 3 replies; 8+ messages in thread
From: YueHaibing @ 2019-08-20 14:14 UTC (permalink / raw)
  To: davem, idosch, jiri, mcroce, jakub.kicinski
  Cc: linux-kernel, netdev, YueHaibing

If CONFIG_INET is not set, building fails:

drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
dev.c:(.text+0x67b): undefined reference to `ip_send_check'

Use ip_fast_csum instead of ip_send_check to avoid
dependencies on CONFIG_INET.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use ip_fast_csum instead of ip_send_check
---
 drivers/net/netdevsim/dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index c5b0261..39cdb6c 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -389,7 +389,8 @@ static struct sk_buff *nsim_dev_trap_skb_build(void)
 	iph->ihl = 0x5;
 	iph->tot_len = htons(tot_len);
 	iph->ttl = 100;
-	ip_send_check(iph);
+	iph->check = 0;
+	iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
 
 	udph = skb_put_zero(skb, sizeof(struct udphdr) + data_len);
 	get_random_bytes(&udph->source, sizeof(u16));
-- 
2.7.4



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

* Re: [PATCH v2 net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-20 14:14 ` [PATCH v2 " YueHaibing
@ 2019-08-20 17:48   ` Jakub Kicinski
  2019-08-20 18:10   ` Ido Schimmel
  2019-08-20 20:47   ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2019-08-20 17:48 UTC (permalink / raw)
  To: YueHaibing; +Cc: davem, idosch, jiri, mcroce, linux-kernel, netdev

On Tue, 20 Aug 2019 22:14:46 +0800, YueHaibing wrote:
> If CONFIG_INET is not set, building fails:
> 
> drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
> dev.c:(.text+0x67b): undefined reference to `ip_send_check'
> 
> Use ip_fast_csum instead of ip_send_check to avoid
> dependencies on CONFIG_INET.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thank you!

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

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

* Re: [PATCH v2 net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-20 14:14 ` [PATCH v2 " YueHaibing
  2019-08-20 17:48   ` Jakub Kicinski
@ 2019-08-20 18:10   ` Ido Schimmel
  2019-08-20 20:47   ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Ido Schimmel @ 2019-08-20 18:10 UTC (permalink / raw)
  To: YueHaibing
  Cc: davem, idosch, jiri, mcroce, jakub.kicinski, linux-kernel, netdev

On Tue, Aug 20, 2019 at 10:14:46PM +0800, YueHaibing wrote:
> If CONFIG_INET is not set, building fails:
> 
> drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
> dev.c:(.text+0x67b): undefined reference to `ip_send_check'
> 
> Use ip_fast_csum instead of ip_send_check to avoid
> dependencies on CONFIG_INET.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>

Thanks for fixing this in my stead!

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

* Re: [PATCH v2 net-next] netdevsim: Fix build error without CONFIG_INET
  2019-08-20 14:14 ` [PATCH v2 " YueHaibing
  2019-08-20 17:48   ` Jakub Kicinski
  2019-08-20 18:10   ` Ido Schimmel
@ 2019-08-20 20:47   ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2019-08-20 20:47 UTC (permalink / raw)
  To: yuehaibing; +Cc: idosch, jiri, mcroce, jakub.kicinski, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Tue, 20 Aug 2019 22:14:46 +0800

> If CONFIG_INET is not set, building fails:
> 
> drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work':
> dev.c:(.text+0x67b): undefined reference to `ip_send_check'
> 
> Use ip_fast_csum instead of ip_send_check to avoid
> dependencies on CONFIG_INET.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: use ip_fast_csum instead of ip_send_check

Applied, thank you.

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

end of thread, other threads:[~2019-08-20 20:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 12:08 [PATCH net-next] netdevsim: Fix build error without CONFIG_INET YueHaibing
2019-08-19 15:58 ` Ido Schimmel
2019-08-19 21:59 ` Jakub Kicinski
2019-08-20 14:08   ` Ido Schimmel
2019-08-20 14:14 ` [PATCH v2 " YueHaibing
2019-08-20 17:48   ` Jakub Kicinski
2019-08-20 18:10   ` Ido Schimmel
2019-08-20 20:47   ` 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).