diff mbox series

vmxnet3: prevent building with 256K pages

Message ID 20210615123504.547106-1-mpe@ellerman.id.au (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series vmxnet3: prevent building with 256K pages | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch warning WARNING: 'Simliar' may be misspelled - perhaps 'Similar'?
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Michael Ellerman June 15, 2021, 12:35 p.m. UTC
This driver assigns PAGE_SIZE to a u16, which can't work when the page
size is 256K. As reported by lkp:

 drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
 arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' changes value from '262144' to '0'
 drivers/net/vmxnet3/vmxnet3_drv.c:1784:29: note: in expansion of macro 'PAGE_SIZE'
  1784 |    rq->buf_info[0][i].len = PAGE_SIZE;
                                     ^~~~~~~~~

Simliar to what was done previously in commit fbdf0e28d061 ("vmxnet3:
prevent building with 64K pages"), prevent the driver from building when
256K pages are enabled.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 drivers/net/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christophe Leroy June 15, 2021, 12:41 p.m. UTC | #1
Le 15/06/2021 à 14:35, Michael Ellerman a écrit :
> This driver assigns PAGE_SIZE to a u16, which can't work when the page
> size is 256K. As reported by lkp:
> 
>   drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
>   arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' changes value from '262144' to '0'
>   drivers/net/vmxnet3/vmxnet3_drv.c:1784:29: note: in expansion of macro 'PAGE_SIZE'
>    1784 |    rq->buf_info[0][i].len = PAGE_SIZE;
>                                       ^~~~~~~~~
> 
> Simliar to what was done previously in commit fbdf0e28d061 ("vmxnet3:
> prevent building with 64K pages"), prevent the driver from building when
> 256K pages are enabled.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>   drivers/net/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 74dc8e249faa..da46898f060a 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -549,7 +549,7 @@ config VMXNET3
>   	depends on PCI && INET
>   	depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
>   		     IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
> -		     PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
> +		     PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES || PPC_256K_PAGES)

Maybe we should also exclude hexagon, same as my patch on BTRFS 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/a16c31f3caf448dda5d9315e056585b6fafc22c5.1623302442.git.christophe.leroy@csgroup.eu/

>   	help
>   	  This driver supports VMware's vmxnet3 virtual ethernet NIC.
>   	  To compile this driver as a module, choose M here: the
>
Christoph Hellwig June 16, 2021, 5:21 a.m. UTC | #2
On Tue, Jun 15, 2021 at 02:41:34PM +0200, Christophe Leroy wrote:
> Maybe we should also exclude hexagon, same as my patch on BTRFS https://patchwork.ozlabs.org/project/linuxppc-dev/patch/a16c31f3caf448dda5d9315e056585b6fafc22c5.1623302442.git.christophe.leroy@csgroup.eu/

Maybe we really need common config symbols for the page size instead of
all these hacks..
Christophe Leroy June 16, 2021, 5:33 a.m. UTC | #3
Le 16/06/2021 à 07:21, Christoph Hellwig a écrit :
> On Tue, Jun 15, 2021 at 02:41:34PM +0200, Christophe Leroy wrote:
>> Maybe we should also exclude hexagon, same as my patch on BTRFS https://patchwork.ozlabs.org/project/linuxppc-dev/patch/a16c31f3caf448dda5d9315e056585b6fafc22c5.1623302442.git.christophe.leroy@csgroup.eu/
> 
> Maybe we really need common config symbols for the page size instead of
> all these hacks..
> 

I agree.

Today we have:

arch/hexagon/Kconfig:config PAGE_SIZE_4KB
arch/hexagon/Kconfig:config PAGE_SIZE_16KB
arch/hexagon/Kconfig:config PAGE_SIZE_64KB
arch/hexagon/Kconfig:config PAGE_SIZE_256KB
arch/mips/Kconfig:config PAGE_SIZE_4KB
arch/mips/Kconfig:config PAGE_SIZE_8KB
arch/mips/Kconfig:config PAGE_SIZE_16KB
arch/mips/Kconfig:config PAGE_SIZE_32KB
arch/mips/Kconfig:config PAGE_SIZE_64KB
arch/sh/mm/Kconfig:config PAGE_SIZE_4KB
arch/sh/mm/Kconfig:config PAGE_SIZE_8KB
arch/sh/mm/Kconfig:config PAGE_SIZE_16KB
arch/sh/mm/Kconfig:config PAGE_SIZE_64KB


I think we should convert all other architectures to that syntax.

Christophe
diff mbox series

Patch

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 74dc8e249faa..da46898f060a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -549,7 +549,7 @@  config VMXNET3
 	depends on PCI && INET
 	depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
 		     IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
-		     PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
+		     PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES || PPC_256K_PAGES)
 	help
 	  This driver supports VMware's vmxnet3 virtual ethernet NIC.
 	  To compile this driver as a module, choose M here: the