2022-09-01 06:37:04

by [email protected]

[permalink] [raw]
Subject: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW

cross-compilation environment:
ubuntu 20.04
mips-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0

generate a configuration file by make randconfig:
CONFIG_32BIT=y
CONFIG_RDMA_SIW=y

the error message as follows:
In file included from ../arch/mips/include/asm/page.h:270,
from ../arch/mips/include/asm/io.h:29,
from ../arch/mips/include/asm/mmiowb.h:5,
from ../include/linux/spinlock.h:64,
from ../include/linux/wait.h:9,
from ../include/linux/net.h:19,
from ../drivers/infiniband/sw/siw/siw_qp_tx.c:8:
../drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
../arch/mips/include/asm/page.h:255:53: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
| ^
../include/asm-generic/memory_model.h:18:41: note: in definition of macro ‘__pfn_to_page’
18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
| ^~~
../arch/mips/include/asm/page.h:255:31: note: in expansion of macro ‘PFN_DOWN’
255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
| ^~~~~~~~
../arch/mips/include/asm/page.h:256:41: note: in expansion of macro ‘virt_to_pfn’
256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
| ^~~~~~~~~~~
../drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of macro ‘virt_to_page’
538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [../scripts/Makefile.build:249: drivers/infiniband/sw/siw/siw_qp_tx.o] Error 1
make[4]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw/siw] Error 2
make[3]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw] Error 2
make[3]: *** Waiting for unfinished jobs....

Reported-by: k2ci <[email protected]>
Signed-off-by: jianghaoran <[email protected]>
---
drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
index 1f4e60257700..55ed0c27f449 100644
--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -533,7 +533,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s)
kunmap_local(kaddr);
}
} else {
- u64 va = sge->laddr + sge_off;
+ unsigned long va = sge->laddr + sge_off;

page_array[seg] = virt_to_page(va & PAGE_MASK);
if (do_crc)
--
2.25.1


2022-09-01 07:59:44

by Bernard Metzler

[permalink] [raw]
Subject: RE: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW



> -----Original Message-----
> From: jianghaoran <[email protected]>
> Sent: Thursday, 1 September 2022 07:52
> To: Bernard Metzler <[email protected]>
> Cc: [email protected]; [email protected]; [email protected]; linux-
> [email protected]
> Subject: [EXTERNAL] [PATCH] RDMA/siw: Solve the error of compiling the
> 32BIT mips kernel when enable CONFIG_RDMA_SIW
>
> cross-compilation environment:
> ubuntu 20.04
> mips-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
>
> generate a configuration file by make randconfig:
> CONFIG_32BIT=y
> CONFIG_RDMA_SIW=y
>
> the error message as follows:
> In file included from ../arch/mips/include/asm/page.h:270,
> from ../arch/mips/include/asm/io.h:29,
> from ../arch/mips/include/asm/mmiowb.h:5,
> from ../include/linux/spinlock.h:64,
> from ../include/linux/wait.h:9,
> from ../include/linux/net.h:19,
> from ../drivers/infiniband/sw/siw/siw_qp_tx.c:8:
> ../drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
> ../arch/mips/include/asm/page.h:255:53: error: cast to pointer from integer
> of different size [-Werror=int-to-pointer-cast]
> 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void
> *)(kaddr)))
> | ^
> ../include/asm-generic/memory_model.h:18:41: note: in definition of macro
> ‘__pfn_to_page’
> 18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
> | ^~~
> ../arch/mips/include/asm/page.h:255:31: note: in expansion of macro
> ‘PFN_DOWN’
> 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void
> *)(kaddr)))
> | ^~~~~~~~
> ../arch/mips/include/asm/page.h:256:41: note: in expansion of macro
> ‘virt_to_pfn’
> 256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
> | ^~~~~~~~~~~
> ../drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of
> macro ‘virt_to_page’
> 538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
> | ^~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[5]: *** [../scripts/Makefile.build:249:
> drivers/infiniband/sw/siw/siw_qp_tx.o] Error 1
> make[4]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw/siw]
> Error 2
> make[3]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> Reported-by: k2ci <[email protected]>
> Signed-off-by: jianghaoran <[email protected]>
> ---
> drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c
> b/drivers/infiniband/sw/siw/siw_qp_tx.c
> index 1f4e60257700..55ed0c27f449 100644
> --- a/drivers/infiniband/sw/siw/siw_qp_tx.c
> +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
> @@ -533,7 +533,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct
> socket *s)
> kunmap_local(kaddr);
> }
> } else {
> - u64 va = sge->laddr + sge_off;
> + unsigned long va = sge->laddr + sge_off;
>

We discussed same thing a few days ago - see PATCH from Linus:
'[PATCH] RDMA/siw: Pass a pointer to virt_to_page()'

While he suggested casting, I think it would be better to change
'u64' to 'uintptr_t'. I'd prefer 'uintptr_t' over 'unsigned long'
for readability -- since we hold a pointer.
It would also simplify a cast of va a few lines down in
virt_to_page().

Could one of you two re-send?

Thanks Jianghaoran!

Bernard.

> page_array[seg] = virt_to_page(va & PAGE_MASK);
> if (do_crc)
> --
> 2.25.1

2022-09-01 11:53:30

by [email protected]

[permalink] [raw]
Subject: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW



在 2022/9/1 下午3:05, Bernard Metzler 写道:
>
>
>> -----Original Message-----
>> From: jianghaoran <[email protected]>
>> Sent: Thursday, 1 September 2022 07:52
>> To: Bernard Metzler <[email protected]>
>> Cc: [email protected]; [email protected]; [email protected]; linux-
>> [email protected]
>> Subject: [EXTERNAL] [PATCH] RDMA/siw: Solve the error of compiling the
>> 32BIT mips kernel when enable CONFIG_RDMA_SIW
>>
>> cross-compilation environment:
>> ubuntu 20.04
>> mips-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
>>
>> generate a configuration file by make randconfig:
>> CONFIG_32BIT=y
>> CONFIG_RDMA_SIW=y
>>
>> the error message as follows:
>> In file included from ../arch/mips/include/asm/page.h:270,
>> from ../arch/mips/include/asm/io.h:29,
>> from ../arch/mips/include/asm/mmiowb.h:5,
>> from ../include/linux/spinlock.h:64,
>> from ../include/linux/wait.h:9,
>> from ../include/linux/net.h:19,
>> from ../drivers/infiniband/sw/siw/siw_qp_tx.c:8:
>> ../drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
>> ../arch/mips/include/asm/page.h:255:53: error: cast to pointer from integer
>> of different size [-Werror=int-to-pointer-cast]
>> 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void
>> *)(kaddr)))
>> | ^
>> ../include/asm-generic/memory_model.h:18:41: note: in definition of macro
>> ‘__pfn_to_page’
>> 18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
>> | ^~~
>> ../arch/mips/include/asm/page.h:255:31: note: in expansion of macro
>> ‘PFN_DOWN’
>> 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void
>> *)(kaddr)))
>> | ^~~~~~~~
>> ../arch/mips/include/asm/page.h:256:41: note: in expansion of macro
>> ‘virt_to_pfn’
>> 256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
>> | ^~~~~~~~~~~
>> ../drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of
>> macro ‘virt_to_page’
>> 538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
>> | ^~~~~~~~~~~~
>> cc1: all warnings being treated as errors
>> make[5]: *** [../scripts/Makefile.build:249:
>> drivers/infiniband/sw/siw/siw_qp_tx.o] Error 1
>> make[4]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw/siw]
>> Error 2
>> make[3]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw] Error 2
>> make[3]: *** Waiting for unfinished jobs....
>>
>> Reported-by: k2ci <[email protected]>
>> Signed-off-by: jianghaoran <[email protected]>
>> ---
>> drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c
>> b/drivers/infiniband/sw/siw/siw_qp_tx.c
>> index 1f4e60257700..55ed0c27f449 100644
>> --- a/drivers/infiniband/sw/siw/siw_qp_tx.c
>> +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
>> @@ -533,7 +533,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct
>> socket *s)
>> kunmap_local(kaddr);
>> }
>> } else {
>> - u64 va = sge->laddr + sge_off;
>> + unsigned long va = sge->laddr + sge_off;
>>
>
> We discussed same thing a few days ago - see PATCH from Linus:
> '[PATCH] RDMA/siw: Pass a pointer to virt_to_page()'
>
> While he suggested casting, I think it would be better to change
> 'u64' to 'uintptr_t'. I'd prefer 'uintptr_t' over 'unsigned long'
> for readability -- since we hold a pointer.
> It would also simplify a cast of va a few lines down in
> virt_to_page().
>
> Could one of you two re-send?
>
> Thanks Jianghaoran!
>
> Bernard.
>
>> page_array[seg] = virt_to_page(va & PAGE_MASK);
>> if (do_crc)
>> --
>> 2.25.1
>
Modified with suggestions from Linus Walleij <[email protected]>
and Bernard Metzler <[email protected]>

Detailed discussion as follows:
[PATCH] RDMA/siw: Pass a pointer to virt_to_page()

Thanks!


Attachments:
0001-RDMA-siw-Solve-the-error-of-compiling-the-32BIT-mips.patch (3.44 kB)

2022-09-01 12:51:48

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW

On Thu, Sep 01, 2022 at 07:26:19PM +0800, jianghaoran wrote:
>
>
> 在 2022/9/1 下午3:05, Bernard Metzler 写道:
> >
> >
> > > -----Original Message-----
> > > From: jianghaoran <[email protected]>
> > > Sent: Thursday, 1 September 2022 07:52
> > > To: Bernard Metzler <[email protected]>
> > > Cc: [email protected]; [email protected]; [email protected]; linux-
> > > [email protected]
> > > Subject: [EXTERNAL] [PATCH] RDMA/siw: Solve the error of compiling the
> > > 32BIT mips kernel when enable CONFIG_RDMA_SIW

Please read Documentation/process/submitting-patches.rst and resubmit.

Thanks

2022-09-01 14:13:29

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW

On Thu, Sep 1, 2022 at 9:05 AM Bernard Metzler <[email protected]> wrote:

> We discussed same thing a few days ago - see PATCH from Linus:
> '[PATCH] RDMA/siw: Pass a pointer to virt_to_page()'
(...)
> Could one of you two re-send?

I updated and resent my patch now!

Yours,
Linus Walleij

2022-09-22 17:13:55

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW

On Thu, Sep 01, 2022 at 01:51:38PM +0800, jianghaoran wrote:
> cross-compilation environment:
> ubuntu 20.04
> mips-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
>
> generate a configuration file by make randconfig:
> CONFIG_32BIT=y
> CONFIG_RDMA_SIW=y
>
> the error message as follows:
> In file included from ../arch/mips/include/asm/page.h:270,
> from ../arch/mips/include/asm/io.h:29,
> from ../arch/mips/include/asm/mmiowb.h:5,
> from ../include/linux/spinlock.h:64,
> from ../include/linux/wait.h:9,
> from ../include/linux/net.h:19,
> from ../drivers/infiniband/sw/siw/siw_qp_tx.c:8:
> ../drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
> ../arch/mips/include/asm/page.h:255:53: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
> | ^
> ../include/asm-generic/memory_model.h:18:41: note: in definition of macro ‘__pfn_to_page’
> 18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
> | ^~~
> ../arch/mips/include/asm/page.h:255:31: note: in expansion of macro ‘PFN_DOWN’
> 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
> | ^~~~~~~~
> ../arch/mips/include/asm/page.h:256:41: note: in expansion of macro ‘virt_to_pfn’
> 256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
> | ^~~~~~~~~~~
> ../drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of macro ‘virt_to_page’
> 538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
> | ^~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[5]: *** [../scripts/Makefile.build:249: drivers/infiniband/sw/siw/siw_qp_tx.o] Error 1
> make[4]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw/siw] Error 2
> make[3]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> Reported-by: k2ci <[email protected]>
> Signed-off-by: jianghaoran <[email protected]>
> ---
> drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
> index 1f4e60257700..55ed0c27f449 100644
> --- a/drivers/infiniband/sw/siw/siw_qp_tx.c
> +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
> @@ -533,7 +533,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s)
> kunmap_local(kaddr);
> }
> } else {
> - u64 va = sge->laddr + sge_off;
> + unsigned long va = sge->laddr + sge_off;

The compiler is saying it should be a void * not an unsigned long.

Jason

2022-09-22 17:49:37

by Bernard Metzler

[permalink] [raw]
Subject: RE: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW



> -----Original Message-----
> From: Jason Gunthorpe <[email protected]>
> Sent: Thursday, 22 September 2022 19:03
> To: jianghaoran <[email protected]>
> Cc: Bernard Metzler <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]
> Subject: [EXTERNAL] Re: [PATCH] RDMA/siw: Solve the error of compiling the
> 32BIT mips kernel when enable CONFIG_RDMA_SIW
>
> On Thu, Sep 01, 2022 at 01:51:38PM +0800, jianghaoran wrote:
> > cross-compilation environment:
> > ubuntu 20.04
> > mips-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
> >
> > generate a configuration file by make randconfig:
> > CONFIG_32BIT=y
> > CONFIG_RDMA_SIW=y
> >
> > the error message as follows:
> > In file included from ../arch/mips/include/asm/page.h:270,
> > from ../arch/mips/include/asm/io.h:29,
> > from ../arch/mips/include/asm/mmiowb.h:5,
> > from ../include/linux/spinlock.h:64,
> > from ../include/linux/wait.h:9,
> > from ../include/linux/net.h:19,
> > from ../drivers/infiniband/sw/siw/siw_qp_tx.c:8:
> > ../drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
> > ../arch/mips/include/asm/page.h:255:53: error: cast to pointer from
> integer of different size [-Werror=int-to-pointer-cast]
> > 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void
> *)(kaddr)))
> > | ^
> > ../include/asm-generic/memory_model.h:18:41: note: in definition of macro
> ‘__pfn_to_page’
> > 18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
> > | ^~~
> > ../arch/mips/include/asm/page.h:255:31: note: in expansion of macro
> ‘PFN_DOWN’
> > 255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void
> *)(kaddr)))
> > | ^~~~~~~~
> > ../arch/mips/include/asm/page.h:256:41: note: in expansion of macro
> ‘virt_to_pfn’
> > 256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
> > | ^~~~~~~~~~~
> > ../drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of
> macro ‘virt_to_page’
> > 538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
> > | ^~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> > make[5]: *** [../scripts/Makefile.build:249:
> drivers/infiniband/sw/siw/siw_qp_tx.o] Error 1
> > make[4]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw/siw]
> Error 2
> > make[3]: *** [../scripts/Makefile.build:465: drivers/infiniband/sw] Error
> 2
> > make[3]: *** Waiting for unfinished jobs....
> >
> > Reported-by: k2ci <[email protected]>
> > Signed-off-by: jianghaoran <[email protected]>
> > ---
> > drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c
> b/drivers/infiniband/sw/siw/siw_qp_tx.c
> > index 1f4e60257700..55ed0c27f449 100644
> > --- a/drivers/infiniband/sw/siw/siw_qp_tx.c
> > +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
> > @@ -533,7 +533,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx,
> struct socket *s)
> > kunmap_local(kaddr);
> > }
> > } else {
> > - u64 va = sge->laddr + sge_off;
> > + unsigned long va = sge->laddr + sge_off;
>
> The compiler is saying it should be a void * not an unsigned long.
>

Linus' [Patch v3] was moving it to uintptr_t which I think is
the right solution. We went for that afaik.


2022-09-22 18:16:06

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW

On Thu, Sep 22, 2022 at 05:17:24PM +0000, Bernard Metzler wrote:

> > The compiler is saying it should be a void * not an unsigned long.
>
> Linus' [Patch v3] was moving it to uintptr_t which I think is
> the right solution. We went for that afaik.

That isn't what I saw in merged patches:

https://lore.kernel.org/all/[email protected]/

I'm confused??

Jason

2022-09-22 19:30:25

by Bernard Metzler

[permalink] [raw]
Subject: RE: Re: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW



> -----Original Message-----
> From: Jason Gunthorpe <[email protected]>
> Sent: Thursday, 22 September 2022 19:48
> To: Bernard Metzler <[email protected]>
> Cc: jianghaoran <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]; Linus Walleij
> <[email protected]>
> Subject: [EXTERNAL] Re: Re: [PATCH] RDMA/siw: Solve the error of compiling
> the 32BIT mips kernel when enable CONFIG_RDMA_SIW
>
> On Thu, Sep 22, 2022 at 05:17:24PM +0000, Bernard Metzler wrote:
>
> > > The compiler is saying it should be a void * not an unsigned long.
> >
> > Linus' [Patch v3] was moving it to uintptr_t which I think is
> > the right solution. We went for that afaik.
>
> That isn't what I saw in merged patches:
>
> INVALID URI REMOVED
> 3A__lore.kernel.org_all_20220913140416.280860971-
> 40linuxfoundation.org_&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2TaYXQ0T-
> r8ZO1PP1alNwU_QJcRRLfmYTAgd3QCvqSc&m=Rvcp-
> EvvdOCENMF2s1l1j5ky3WQqSiJ0_by31NFDnrQ_iDO6zegGgLPy4OiQmkCO&s=FZOBbAPo0wCJJ
> R0_062_zc6iE6WyRszu3Q9eUwvA6o0&e=
>

Looks good. It's the right patch from Linus W. which got
merged, as your lore link points at. You seem to have looked
at Jianghaoran's patch for the same issue, which came
in almost same time, but was not taken.

What was applied is Linus'
[PATCH v3] RDMA/siw: Pass a pointer to virt_to_page()

Best,
Bernard.

...
@@ -533,13 +533,23 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s)
kunmap_local(kaddr);
}
} else {
- u64 va = sge->laddr + sge_off;
+ /*
+ * Cast to an uintptr_t to preserve all 64 bits
+ * in sge->laddr.
+ */
+ uintptr_t va = (uintptr_t)(sge->laddr + sge_off);
...


> I'm confused??
>
> Jason

2022-09-22 19:32:34

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: Re: Re: [PATCH] RDMA/siw: Solve the error of compiling the 32BIT mips kernel when enable CONFIG_RDMA_SIW

On Thu, Sep 22, 2022 at 07:02:54PM +0000, Bernard Metzler wrote:

> Looks good. It's the right patch from Linus W. which got
> merged, as your lore link points at. You seem to have looked
> at Jianghaoran's patch for the same issue, which came
> in almost same time, but was not taken.

Er, so this is just a dup in patchworks, OK, punted

Thanks,
Jason