From: Jeremy Kerr <jk@codeconstruct.com.au> Date: 2021-10-02 02:27:16
The current kunit infrastructure defines its own module_init() when
built as a module, which conflicts with the mctp core's own.
So, only allow MCTP_TEST when both MCTP and KUNIT are built-in.
Reported-by: kernel test robot <redacted>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
net/mctp/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: David Gow <hidden> Date: 2021-10-02 03:10:55
On Sat, Oct 2, 2021 at 10:27 AM Jeremy Kerr [off-list ref] wrote:
The current kunit infrastructure defines its own module_init() when
built as a module, which conflicts with the mctp core's own.
So, only allow MCTP_TEST when both MCTP and KUNIT are built-in.
Reported-by: kernel test robot <redacted>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
This looks good to me. I don't think you'll be the only person to hit
this issue, so -- while it's probably overall nicer if tests can sit
in their own module -- we'll look into finding a way of supporting
this with KUnit at some point. In the meantime, though, this is a
reasonable workaround.
Reviewed-by: David Gow <redacted>
-- David
From: David Gow <hidden> Date: 2021-10-02 03:16:22
On Sat, Oct 2, 2021 at 10:27 AM Jeremy Kerr [off-list ref] wrote:
The MCTP device isn't available until we've registered the netdev, so
defer storing our convenience pointer.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
From: David Miller <davem@davemloft.net> Date: 2021-10-02 13:02:04
From: Jeremy Kerr <jk@codeconstruct.com.au>
Date: Sat, 2 Oct 2021 10:26:55 +0800
The current kunit infrastructure defines its own module_init() when
built as a module, which conflicts with the mctp core's own.
So, only allow MCTP_TEST when both MCTP and KUNIT are built-in.
Reported-by: kernel test robot <redacted>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Jeremy I had to revert your entire series because of this.
You will need rseubmit the entire series with this build failure fixed.
Thasnk you.
From: Jeremy Kerr <jk@codeconstruct.com.au> Date: 2021-10-03 02:22:52
Hi David,
Jeremy I had to revert your entire series because of this.
You will need rseubmit the entire series with this build failure
fixed.
OK, thanks for letting me know, apologies for the breakage. Looks like
my MCTP=m pre-send check didn't end up enabling MCTP_TEST...
v2 coming shortly.
Cheers,
Jeremy
From: Jeremy Kerr <jk@codeconstruct.com.au> Date: 2021-10-03 03:24:35
Hi David,
Haha -- you sent this just as I'd come up with the same patch here.
:-)
With these changes, alongside the rt->dev == NULL in
mctp_route_release() crash fix mentioned in [1], the tests all pass
on
my system. (They also pass under KASAN, which bodes well.)
Awesome, thanks for checking these out. I've since sent a v2 with the
fixes integrated, in order to not break davem's build.
I've refined the rt->dev == NULL case a little; rather than allowing
->dev == NULL in the core code (which should never happen), I've
modified the test's route refcounting so that the route destroy path
should only ever hit the test's own destructor instead (which allows
!rt->dev cases). This means we can keep the ->dev != NULL assumption in
the core, and still handle tests where our fake route->dev is unset.
Cheers,
Jeremy