netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
@ 2022-08-30 10:12 Gal Pressman
  2022-08-30 11:52 ` Sudip Mukherjee (Codethink)
  2022-08-31  6:13 ` Jakub Kicinski
  0 siblings, 2 replies; 18+ messages in thread
From: Gal Pressman @ 2022-08-30 10:12 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: netdev, Gal Pressman, Leon Romanovsky

When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
error:
net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?
 2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   NL802154_CMD_SET_CCA_ED_LEVEL

Use __NL802154_CMD_AFTER_LAST instead of
'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command.

Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes")
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
 net/ieee802154/nl802154.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 38c4f3cb010e..dbfd24c70bd0 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -2500,7 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = {
 	.module = THIS_MODULE,
 	.ops = nl802154_ops,
 	.n_ops = ARRAY_SIZE(nl802154_ops),
-	.resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
+	.resv_start_op = __NL802154_CMD_AFTER_LAST,
 	.mcgrps = nl802154_mcgrps,
 	.n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
 };
-- 
2.25.1


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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-30 10:12 [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled Gal Pressman
@ 2022-08-30 11:52 ` Sudip Mukherjee (Codethink)
  2022-08-31  6:13 ` Jakub Kicinski
  1 sibling, 0 replies; 18+ messages in thread
From: Sudip Mukherjee (Codethink) @ 2022-08-30 11:52 UTC (permalink / raw)
  To: Gal Pressman; +Cc: David S. Miller, Jakub Kicinski, netdev, Leon Romanovsky

On Tue, Aug 30, 2022 at 01:12:37PM +0300, Gal Pressman wrote:
> When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
> NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
> error:
> net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?
>  2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
>       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                   NL802154_CMD_SET_CCA_ED_LEVEL
> 
> Use __NL802154_CMD_AFTER_LAST instead of
> 'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command.
> 
> Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes")
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> Signed-off-by: Gal Pressman <gal@nvidia.com>

Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

-- 
Regards
Sudip

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-30 10:12 [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled Gal Pressman
  2022-08-30 11:52 ` Sudip Mukherjee (Codethink)
@ 2022-08-31  6:13 ` Jakub Kicinski
  2022-08-31  6:20   ` Gal Pressman
  1 sibling, 1 reply; 18+ messages in thread
From: Jakub Kicinski @ 2022-08-31  6:13 UTC (permalink / raw)
  To: Gal Pressman; +Cc: David S. Miller, netdev, Leon Romanovsky

On Tue, 30 Aug 2022 13:12:37 +0300 Gal Pressman wrote:
> When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
> NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
> error:
> net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?
>  2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
>       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                   NL802154_CMD_SET_CCA_ED_LEVEL
> 
> Use __NL802154_CMD_AFTER_LAST instead of
> 'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command.
> 
> Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes")
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> Signed-off-by: Gal Pressman <gal@nvidia.com>
> ---
>  net/ieee802154/nl802154.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> index 38c4f3cb010e..dbfd24c70bd0 100644
> --- a/net/ieee802154/nl802154.c
> +++ b/net/ieee802154/nl802154.c
> @@ -2500,7 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = {
>  	.module = THIS_MODULE,
>  	.ops = nl802154_ops,
>  	.n_ops = ARRAY_SIZE(nl802154_ops),
> -	.resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
> +	.resv_start_op = __NL802154_CMD_AFTER_LAST,
>  	.mcgrps = nl802154_mcgrps,
>  	.n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
>  };

Thanks for the fix! I think we should switch to 
NL802154_CMD_SET_WPAN_PHY_NETNS + 1, tho.

The point is to set the value to the cmd number after _currently_ 
last defined command. The meta-value like LAST will move next time
someone adds a command, meaning the validation for new commands will
never actually come.

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31  6:13 ` Jakub Kicinski
@ 2022-08-31  6:20   ` Gal Pressman
  2022-08-31  6:23     ` Leon Romanovsky
  2022-08-31  6:31     ` Jakub Kicinski
  0 siblings, 2 replies; 18+ messages in thread
From: Gal Pressman @ 2022-08-31  6:20 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David S. Miller, netdev, Leon Romanovsky

On 31/08/2022 09:13, Jakub Kicinski wrote:
> On Tue, 30 Aug 2022 13:12:37 +0300 Gal Pressman wrote:
>> When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
>> NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
>> error:
>> net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?
>>  2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
>>       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>       |                   NL802154_CMD_SET_CCA_ED_LEVEL
>>
>> Use __NL802154_CMD_AFTER_LAST instead of
>> 'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command.
>>
>> Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes")
>> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
>> Signed-off-by: Gal Pressman <gal@nvidia.com>
>> ---
>>  net/ieee802154/nl802154.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
>> index 38c4f3cb010e..dbfd24c70bd0 100644
>> --- a/net/ieee802154/nl802154.c
>> +++ b/net/ieee802154/nl802154.c
>> @@ -2500,7 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = {
>>  	.module = THIS_MODULE,
>>  	.ops = nl802154_ops,
>>  	.n_ops = ARRAY_SIZE(nl802154_ops),
>> -	.resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
>> +	.resv_start_op = __NL802154_CMD_AFTER_LAST,
>>  	.mcgrps = nl802154_mcgrps,
>>  	.n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
>>  };
> Thanks for the fix! I think we should switch to 
> NL802154_CMD_SET_WPAN_PHY_NETNS + 1, tho.
>
> The point is to set the value to the cmd number after _currently_ 
> last defined command. The meta-value like LAST will move next time
> someone adds a command, meaning the validation for new commands will
> never actually come.

I see, missed that part.

So, shouldn't it be:
#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
        .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
#else
        .resv_start_op = NL802154_CMD_SET_WPAN_PHY_NETNS + 1,
#endif

?

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31  6:20   ` Gal Pressman
@ 2022-08-31  6:23     ` Leon Romanovsky
  2022-08-31  6:31     ` Jakub Kicinski
  1 sibling, 0 replies; 18+ messages in thread
From: Leon Romanovsky @ 2022-08-31  6:23 UTC (permalink / raw)
  To: Gal Pressman; +Cc: Jakub Kicinski, David S. Miller, netdev

On Wed, Aug 31, 2022 at 09:20:39AM +0300, Gal Pressman wrote:
> On 31/08/2022 09:13, Jakub Kicinski wrote:
> > On Tue, 30 Aug 2022 13:12:37 +0300 Gal Pressman wrote:
> >> When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
> >> NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
> >> error:
> >> net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?
> >>  2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
> >>       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
> >>       |                   NL802154_CMD_SET_CCA_ED_LEVEL
> >>
> >> Use __NL802154_CMD_AFTER_LAST instead of
> >> 'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command.
> >>
> >> Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes")
> >> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> >> Signed-off-by: Gal Pressman <gal@nvidia.com>
> >> ---
> >>  net/ieee802154/nl802154.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> >> index 38c4f3cb010e..dbfd24c70bd0 100644
> >> --- a/net/ieee802154/nl802154.c
> >> +++ b/net/ieee802154/nl802154.c
> >> @@ -2500,7 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = {
> >>  	.module = THIS_MODULE,
> >>  	.ops = nl802154_ops,
> >>  	.n_ops = ARRAY_SIZE(nl802154_ops),
> >> -	.resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
> >> +	.resv_start_op = __NL802154_CMD_AFTER_LAST,
> >>  	.mcgrps = nl802154_mcgrps,
> >>  	.n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
> >>  };
> > Thanks for the fix! I think we should switch to 
> > NL802154_CMD_SET_WPAN_PHY_NETNS + 1, tho.
> >
> > The point is to set the value to the cmd number after _currently_ 
> > last defined command. The meta-value like LAST will move next time
> > someone adds a command, meaning the validation for new commands will
> > never actually come.
> 
> I see, missed that part.
> 
> So, shouldn't it be:
> #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
>         .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
> #else
>         .resv_start_op = NL802154_CMD_SET_WPAN_PHY_NETNS + 1,
> #endif

+1, I wanted to propose the same snippet.

Thanks

> 
> ?

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31  6:20   ` Gal Pressman
  2022-08-31  6:23     ` Leon Romanovsky
@ 2022-08-31  6:31     ` Jakub Kicinski
  2022-08-31 18:21       ` Jakub Kicinski
  1 sibling, 1 reply; 18+ messages in thread
From: Jakub Kicinski @ 2022-08-31  6:31 UTC (permalink / raw)
  To: Gal Pressman
  Cc: David S. Miller, netdev, Leon Romanovsky, Stefan Schmidt,
	linux-wpan, Alexander Aring

On Wed, 31 Aug 2022 09:20:39 +0300 Gal Pressman wrote:
> So, shouldn't it be:
> #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
>         .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
> #else
>         .resv_start_op = NL802154_CMD_SET_WPAN_PHY_NETNS + 1,
> #endif

Hm, let me add 802154 folks.

Either we should treat the commands as reserved in terms of uAPI
even if they get removed the IDs won't be reused, or they are for
testing purposes only.

In the former case we should just remove the #ifdef around the values
in the enum, it just leads to #ifdef proliferation while having no
functional impact.

In the latter case we should start error checking from the last
non-experimental command, as we don't care about breaking the
experimental ones.

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31  6:31     ` Jakub Kicinski
@ 2022-08-31 18:21       ` Jakub Kicinski
  2022-08-31 19:21         ` Alexander Aring
  2022-08-31 20:59         ` Stefan Schmidt
  0 siblings, 2 replies; 18+ messages in thread
From: Jakub Kicinski @ 2022-08-31 18:21 UTC (permalink / raw)
  To: Gal Pressman
  Cc: David S. Miller, netdev, Leon Romanovsky, Stefan Schmidt,
	linux-wpan, Alexander Aring

On Tue, 30 Aug 2022 23:31:24 -0700 Jakub Kicinski wrote:
> Hm, let me add 802154 folks.
> 
> Either we should treat the commands as reserved in terms of uAPI
> even if they get removed the IDs won't be reused, or they are for
> testing purposes only.
> 
> In the former case we should just remove the #ifdef around the values
> in the enum, it just leads to #ifdef proliferation while having no
> functional impact.
> 
> In the latter case we should start error checking from the last
> non-experimental command, as we don't care about breaking the
> experimental ones.

I haven't gone thru all of my inbox yet, but I see no reply from Stefan
or Alexander. My vote is to un-hide the EXPERIMENTAL commands.

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31 18:21       ` Jakub Kicinski
@ 2022-08-31 19:21         ` Alexander Aring
  2022-08-31 20:59         ` Stefan Schmidt
  1 sibling, 0 replies; 18+ messages in thread
From: Alexander Aring @ 2022-08-31 19:21 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Gal Pressman, David S. Miller, Network Development,
	Leon Romanovsky, Stefan Schmidt, linux-wpan - ML,
	Alexander Aring

Hi,

On Wed, Aug 31, 2022 at 2:26 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 30 Aug 2022 23:31:24 -0700 Jakub Kicinski wrote:
> > Hm, let me add 802154 folks.
> >
> > Either we should treat the commands as reserved in terms of uAPI
> > even if they get removed the IDs won't be reused, or they are for
> > testing purposes only.
> >
> > In the former case we should just remove the #ifdef around the values
> > in the enum, it just leads to #ifdef proliferation while having no
> > functional impact.
> >
> > In the latter case we should start error checking from the last
> > non-experimental command, as we don't care about breaking the
> > experimental ones.
>
> I haven't gone thru all of my inbox yet, but I see no reply from Stefan
> or Alexander. My vote is to un-hide the EXPERIMENTAL commands.
>

fine for me if it's still in nl802154 and ends in error if somebody
tries to use it and it's not compiled. But users should still consider
it's not a stable API yet and we don't care about breaking it for
now...

- Alex


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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31 18:21       ` Jakub Kicinski
  2022-08-31 19:21         ` Alexander Aring
@ 2022-08-31 20:59         ` Stefan Schmidt
  2022-08-31 21:09           ` Jakub Kicinski
  1 sibling, 1 reply; 18+ messages in thread
From: Stefan Schmidt @ 2022-08-31 20:59 UTC (permalink / raw)
  To: Jakub Kicinski, Gal Pressman
  Cc: David S. Miller, netdev, Leon Romanovsky, linux-wpan, Alexander Aring

Hello Jakub.

On 31.08.22 20:21, Jakub Kicinski wrote:
> On Tue, 30 Aug 2022 23:31:24 -0700 Jakub Kicinski wrote:
>> Hm, let me add 802154 folks.
>>
>> Either we should treat the commands as reserved in terms of uAPI
>> even if they get removed the IDs won't be reused, or they are for
>> testing purposes only.
>>
>> In the former case we should just remove the #ifdef around the values
>> in the enum, it just leads to #ifdef proliferation while having no
>> functional impact.
>>
>> In the latter case we should start error checking from the last
>> non-experimental command, as we don't care about breaking the
>> experimental ones.
> 
> I haven't gone thru all of my inbox yet, but I see no reply from Stefan
> or Alexander. My vote is to un-hide the EXPERIMENTAL commands.

I was swamped today and I am only now finding time to go through mail.

Given the problem these ifdef are raising I am ok with having these 
commands exposed without them.

Our main reason for having this feature marked as experimental is that 
it does not have much exposure and we fear that some of it needs rewrites.

If that really is going to happen we will simply treat the current 
commands as reserved/burned and come up with other ones if needed. While 
I hope this will not be needed it is a fair plan for mitigating this.

regards
Stefan Schmidt

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31 20:59         ` Stefan Schmidt
@ 2022-08-31 21:09           ` Jakub Kicinski
  2022-08-31 21:13             ` Stefan Schmidt
  2022-09-01  6:38             ` Leon Romanovsky
  0 siblings, 2 replies; 18+ messages in thread
From: Jakub Kicinski @ 2022-08-31 21:09 UTC (permalink / raw)
  To: Stefan Schmidt, Alexander Aring
  Cc: Gal Pressman, David S. Miller, netdev, Leon Romanovsky, linux-wpan

On Wed, 31 Aug 2022 22:59:14 +0200 Stefan Schmidt wrote:
> I was swamped today and I am only now finding time to go through mail.
> 
> Given the problem these ifdef are raising I am ok with having these 
> commands exposed without them.
> 
> Our main reason for having this feature marked as experimental is that 
> it does not have much exposure and we fear that some of it needs rewrites.
> 
> If that really is going to happen we will simply treat the current 
> commands as reserved/burned and come up with other ones if needed. While 
> I hope this will not be needed it is a fair plan for mitigating this.

Thanks for the replies. I keep going back and forth in my head on
what's better - un-hiding or just using NL802154_CMD_SET_WPAN_PHY_NETNS + 1 
as the start of validation, since it's okay to break experimental commands.

Any preference?

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31 21:09           ` Jakub Kicinski
@ 2022-08-31 21:13             ` Stefan Schmidt
  2022-09-01  6:38             ` Leon Romanovsky
  1 sibling, 0 replies; 18+ messages in thread
From: Stefan Schmidt @ 2022-08-31 21:13 UTC (permalink / raw)
  To: Jakub Kicinski, Alexander Aring
  Cc: Gal Pressman, David S. Miller, netdev, Leon Romanovsky, linux-wpan


Hello Jakub.

On 31.08.22 23:09, Jakub Kicinski wrote:
> On Wed, 31 Aug 2022 22:59:14 +0200 Stefan Schmidt wrote:
>> I was swamped today and I am only now finding time to go through mail.
>>
>> Given the problem these ifdef are raising I am ok with having these
>> commands exposed without them.
>>
>> Our main reason for having this feature marked as experimental is that
>> it does not have much exposure and we fear that some of it needs rewrites.
>>
>> If that really is going to happen we will simply treat the current
>> commands as reserved/burned and come up with other ones if needed. While
>> I hope this will not be needed it is a fair plan for mitigating this.
> 
> Thanks for the replies. I keep going back and forth in my head on
> what's better - un-hiding or just using NL802154_CMD_SET_WPAN_PHY_NETNS + 1
> as the start of validation, since it's okay to break experimental commands.
> 
> Any preference?

We saw other problems with these being behind ifdefs from build and 
fuzzing bots. I say its time we un-hide and deal with them being 
formerly deprecated and replaced by something else if it really comes to 
changes for them (which we are not sure of)

regards
Stefan Schmidt

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-08-31 21:09           ` Jakub Kicinski
  2022-08-31 21:13             ` Stefan Schmidt
@ 2022-09-01  6:38             ` Leon Romanovsky
  2022-09-01 12:50               ` Alexander Aring
  2022-09-01 20:23               ` Jakub Kicinski
  1 sibling, 2 replies; 18+ messages in thread
From: Leon Romanovsky @ 2022-09-01  6:38 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Stefan Schmidt, Alexander Aring, Gal Pressman, David S. Miller,
	netdev, linux-wpan

On Wed, Aug 31, 2022 at 02:09:47PM -0700, Jakub Kicinski wrote:
> On Wed, 31 Aug 2022 22:59:14 +0200 Stefan Schmidt wrote:
> > I was swamped today and I am only now finding time to go through mail.
> > 
> > Given the problem these ifdef are raising I am ok with having these 
> > commands exposed without them.
> > 
> > Our main reason for having this feature marked as experimental is that 
> > it does not have much exposure and we fear that some of it needs rewrites.
> > 
> > If that really is going to happen we will simply treat the current 
> > commands as reserved/burned and come up with other ones if needed. While 
> > I hope this will not be needed it is a fair plan for mitigating this.
> 
> Thanks for the replies. I keep going back and forth in my head on
> what's better - un-hiding or just using NL802154_CMD_SET_WPAN_PHY_NETNS + 1 
> as the start of validation, since it's okay to break experimental commands.
> 
> Any preference?

Jakub,

There is no such thing like experimental UAPI. Once you put something
in UAPI headers and/or allowed users to issue calls from userspace
to kernel, they can use it. We don't control how users compile their
kernels.

So it is not break "experimental commands", but break commands that
maybe shouldn't exist in first place.

nl802154 code suffers from two basic mistakes:
1. User visible defines are not part of UAPI headers. For example,
include/net/nl802154.h should be in include/uapi/net/....
2. Used Kconfig option for pseudo-UAPI header.

In this specific case, I checked that Fedora didn't enable this
CONFIG_IEEE802154_NL802154_EXPERIMENTAL knob, but someone needs
to check debian and other distros too.

Most likely it is not used at all.

https://src.fedoraproject.org/rpms/kernel/tree/rawhide

Thanks

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-09-01  6:38             ` Leon Romanovsky
@ 2022-09-01 12:50               ` Alexander Aring
  2022-09-01 13:05                 ` Leon Romanovsky
  2022-09-01 20:23               ` Jakub Kicinski
  1 sibling, 1 reply; 18+ messages in thread
From: Alexander Aring @ 2022-09-01 12:50 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Jakub Kicinski, Stefan Schmidt, Alexander Aring, Gal Pressman,
	David S. Miller, Network Development, linux-wpan - ML

Hi,

On Thu, Sep 1, 2022 at 2:38 AM Leon Romanovsky <leon@kernel.org> wrote:
>
> On Wed, Aug 31, 2022 at 02:09:47PM -0700, Jakub Kicinski wrote:
> > On Wed, 31 Aug 2022 22:59:14 +0200 Stefan Schmidt wrote:
> > > I was swamped today and I am only now finding time to go through mail.
> > >
> > > Given the problem these ifdef are raising I am ok with having these
> > > commands exposed without them.
> > >
> > > Our main reason for having this feature marked as experimental is that
> > > it does not have much exposure and we fear that some of it needs rewrites.
> > >
> > > If that really is going to happen we will simply treat the current
> > > commands as reserved/burned and come up with other ones if needed. While
> > > I hope this will not be needed it is a fair plan for mitigating this.
> >
> > Thanks for the replies. I keep going back and forth in my head on
> > what's better - un-hiding or just using NL802154_CMD_SET_WPAN_PHY_NETNS + 1
> > as the start of validation, since it's okay to break experimental commands.
> >
> > Any preference?
>
> Jakub,
>
> There is no such thing like experimental UAPI. Once you put something
> in UAPI headers and/or allowed users to issue calls from userspace
> to kernel, they can use it. We don't control how users compile their
> kernels.
>
> So it is not break "experimental commands", but break commands that
> maybe shouldn't exist in first place.
>
> nl802154 code suffers from two basic mistakes:
> 1. User visible defines are not part of UAPI headers. For example,
> include/net/nl802154.h should be in include/uapi/net/....

yes, but no because then this will end in breaking UAPI because it
will be exported to uapi headers if we change them?
For now we say everybody needs to copy the header on their own into
their user space application if they want to use the API which means
it fits for the kernel that they copied from.

> 2. Used Kconfig option for pseudo-UAPI header.
>
> In this specific case, I checked that Fedora didn't enable this
> CONFIG_IEEE802154_NL802154_EXPERIMENTAL knob, but someone needs
> to check debian and other distros too.
>

I would remove the CONFIG_IEEE802154_NL802154_EXPERIMENTAL config
option but don't move the header to "include/uapi/..." which means
that the whole nl802154 UAPI (and some others UAPIs) are still
experimental because it's not part of UAPI "directory".
btw: the whole subsystem is still experimental because f4671a90c418
("net/ieee802154: remove depends on CONFIG_EXPERIMENTAL") was never
acked by any maintainer... but indeed has other reasons why it got
removed.

- Alex


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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-09-01 12:50               ` Alexander Aring
@ 2022-09-01 13:05                 ` Leon Romanovsky
  0 siblings, 0 replies; 18+ messages in thread
From: Leon Romanovsky @ 2022-09-01 13:05 UTC (permalink / raw)
  To: Alexander Aring
  Cc: Jakub Kicinski, Stefan Schmidt, Alexander Aring, Gal Pressman,
	David S. Miller, Network Development, linux-wpan - ML

On Thu, Sep 01, 2022 at 08:50:16AM -0400, Alexander Aring wrote:
> Hi,
> 
> On Thu, Sep 1, 2022 at 2:38 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Wed, Aug 31, 2022 at 02:09:47PM -0700, Jakub Kicinski wrote:
> > > On Wed, 31 Aug 2022 22:59:14 +0200 Stefan Schmidt wrote:
> > > > I was swamped today and I am only now finding time to go through mail.
> > > >
> > > > Given the problem these ifdef are raising I am ok with having these
> > > > commands exposed without them.
> > > >
> > > > Our main reason for having this feature marked as experimental is that
> > > > it does not have much exposure and we fear that some of it needs rewrites.
> > > >
> > > > If that really is going to happen we will simply treat the current
> > > > commands as reserved/burned and come up with other ones if needed. While
> > > > I hope this will not be needed it is a fair plan for mitigating this.
> > >
> > > Thanks for the replies. I keep going back and forth in my head on
> > > what's better - un-hiding or just using NL802154_CMD_SET_WPAN_PHY_NETNS + 1
> > > as the start of validation, since it's okay to break experimental commands.
> > >
> > > Any preference?
> >
> > Jakub,
> >
> > There is no such thing like experimental UAPI. Once you put something
> > in UAPI headers and/or allowed users to issue calls from userspace
> > to kernel, they can use it. We don't control how users compile their
> > kernels.
> >
> > So it is not break "experimental commands", but break commands that
> > maybe shouldn't exist in first place.
> >
> > nl802154 code suffers from two basic mistakes:
> > 1. User visible defines are not part of UAPI headers. For example,
> > include/net/nl802154.h should be in include/uapi/net/....
> 
> yes, but no because then this will end in breaking UAPI because it
> will be exported to uapi headers if we change them?
> For now we say everybody needs to copy the header on their own into
> their user space application if they want to use the API which means
> it fits for the kernel that they copied from.

It is not how UAPI works. Once you allowed me to send ID number XXX to
the kernel without any header file. I can use it directly, so "hiding"
files from users make their development harder, but not impossible.

Basically, this is how vendoring and fuzzing works.

> 
> > 2. Used Kconfig option for pseudo-UAPI header.
> >
> > In this specific case, I checked that Fedora didn't enable this
> > CONFIG_IEEE802154_NL802154_EXPERIMENTAL knob, but someone needs
> > to check debian and other distros too.
> >
> 
> I would remove the CONFIG_IEEE802154_NL802154_EXPERIMENTAL config
> option but don't move the header to "include/uapi/..." which means
> that the whole nl802154 UAPI (and some others UAPIs) are still
> experimental because it's not part of UAPI "directory".
> btw: the whole subsystem is still experimental because f4671a90c418
> ("net/ieee802154: remove depends on CONFIG_EXPERIMENTAL") was never
> acked by any maintainer... but indeed has other reasons why it got
> removed.

I don't know anything about NL802154, just trying to explain that UAPI
rules are both relevant to binary and compilation compatibility.

In your case, concept of CONFIG_IEEE802154_NL802154_EXPERIMENTAL breaks
binary compatibility.

Thanks

> 
> - Alex
> 

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-09-01  6:38             ` Leon Romanovsky
  2022-09-01 12:50               ` Alexander Aring
@ 2022-09-01 20:23               ` Jakub Kicinski
  2022-09-02  2:48                 ` Alexander Aring
  1 sibling, 1 reply; 18+ messages in thread
From: Jakub Kicinski @ 2022-09-01 20:23 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Stefan Schmidt, Alexander Aring, Gal Pressman, David S. Miller,
	netdev, linux-wpan

On Thu, 1 Sep 2022 09:38:35 +0300 Leon Romanovsky wrote:
> There is no such thing like experimental UAPI. Once you put something
> in UAPI headers and/or allowed users to issue calls from userspace
> to kernel, they can use it. We don't control how users compile their
> kernels.
> 
> So it is not break "experimental commands", but break commands that
> maybe shouldn't exist in first place.
> 
> nl802154 code suffers from two basic mistakes:
> 1. User visible defines are not part of UAPI headers. For example,
> include/net/nl802154.h should be in include/uapi/net/....
> 2. Used Kconfig option for pseudo-UAPI header.
> 
> In this specific case, I checked that Fedora didn't enable this
> CONFIG_IEEE802154_NL802154_EXPERIMENTAL knob, but someone needs
> to check debian and other distros too.
> 
> Most likely it is not used at all.

You're right, FWIW. I didn't want to get sidetracked into that before
we fix the immediate build issue. It's not the only family playing uAPI
games :(

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-09-01 20:23               ` Jakub Kicinski
@ 2022-09-02  2:48                 ` Alexander Aring
  2022-09-02  3:00                   ` Jakub Kicinski
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Aring @ 2022-09-02  2:48 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Leon Romanovsky, Stefan Schmidt, Alexander Aring, Gal Pressman,
	David S. Miller, Network Development, linux-wpan - ML

Hi,

On Thu, Sep 1, 2022 at 4:23 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 1 Sep 2022 09:38:35 +0300 Leon Romanovsky wrote:
> > There is no such thing like experimental UAPI. Once you put something
> > in UAPI headers and/or allowed users to issue calls from userspace
> > to kernel, they can use it. We don't control how users compile their
> > kernels.
> >
> > So it is not break "experimental commands", but break commands that
> > maybe shouldn't exist in first place.
> >
> > nl802154 code suffers from two basic mistakes:
> > 1. User visible defines are not part of UAPI headers. For example,
> > include/net/nl802154.h should be in include/uapi/net/....
> > 2. Used Kconfig option for pseudo-UAPI header.
> >
> > In this specific case, I checked that Fedora didn't enable this
> > CONFIG_IEEE802154_NL802154_EXPERIMENTAL knob, but someone needs
> > to check debian and other distros too.
> >
> > Most likely it is not used at all.
>
> You're right, FWIW. I didn't want to get sidetracked into that before
> we fix the immediate build issue. It's not the only family playing uAPI
> games :(
>

I am not sure how to proceed here now, if removing the
CONFIG_IEEE802154_NL802154_EXPERIMENTAL option is the way to go. Then
do it?

It was a mistake to introduce that whole thing and a probably better
way is to change nl802154 is to mark it deprecated, after a while
rename the enum value to some reserved value and remove the associated
code. Then after some time it can be reused again? If this sounds like
a better idea how to handle the use case we have here?

I am sorry that this config currently causes such a big problem here.

- Alex


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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-09-02  2:48                 ` Alexander Aring
@ 2022-09-02  3:00                   ` Jakub Kicinski
  2022-09-02 10:35                     ` Leon Romanovsky
  0 siblings, 1 reply; 18+ messages in thread
From: Jakub Kicinski @ 2022-09-02  3:00 UTC (permalink / raw)
  To: Alexander Aring
  Cc: Leon Romanovsky, Stefan Schmidt, Alexander Aring, Gal Pressman,
	David S. Miller, Network Development, linux-wpan - ML

On Thu, 1 Sep 2022 22:48:10 -0400 Alexander Aring wrote:
> > You're right, FWIW. I didn't want to get sidetracked into that before
> > we fix the immediate build issue. It's not the only family playing uAPI
> > games :(
> 
> I am not sure how to proceed here now, if removing the
> CONFIG_IEEE802154_NL802154_EXPERIMENTAL option is the way to go. Then
> do it?

Right, I was kinda expecting v2 from Gal but the weekend may have
started for him already, so let me send it myself.

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

* Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
  2022-09-02  3:00                   ` Jakub Kicinski
@ 2022-09-02 10:35                     ` Leon Romanovsky
  0 siblings, 0 replies; 18+ messages in thread
From: Leon Romanovsky @ 2022-09-02 10:35 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Alexander Aring, Stefan Schmidt, Alexander Aring, Gal Pressman,
	David S. Miller, Network Development, linux-wpan - ML

On Thu, Sep 01, 2022 at 08:00:12PM -0700, Jakub Kicinski wrote:
> On Thu, 1 Sep 2022 22:48:10 -0400 Alexander Aring wrote:
> > > You're right, FWIW. I didn't want to get sidetracked into that before
> > > we fix the immediate build issue. It's not the only family playing uAPI
> > > games :(
> > 
> > I am not sure how to proceed here now, if removing the
> > CONFIG_IEEE802154_NL802154_EXPERIMENTAL option is the way to go. Then
> > do it?
> 
> Right, I was kinda expecting v2 from Gal but the weekend may have
> started for him already, so let me send it myself.

We didn't know how v2 should look like and waited for some sort of
resolution.

Thanks

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

end of thread, other threads:[~2022-09-02 10:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 10:12 [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled Gal Pressman
2022-08-30 11:52 ` Sudip Mukherjee (Codethink)
2022-08-31  6:13 ` Jakub Kicinski
2022-08-31  6:20   ` Gal Pressman
2022-08-31  6:23     ` Leon Romanovsky
2022-08-31  6:31     ` Jakub Kicinski
2022-08-31 18:21       ` Jakub Kicinski
2022-08-31 19:21         ` Alexander Aring
2022-08-31 20:59         ` Stefan Schmidt
2022-08-31 21:09           ` Jakub Kicinski
2022-08-31 21:13             ` Stefan Schmidt
2022-09-01  6:38             ` Leon Romanovsky
2022-09-01 12:50               ` Alexander Aring
2022-09-01 13:05                 ` Leon Romanovsky
2022-09-01 20:23               ` Jakub Kicinski
2022-09-02  2:48                 ` Alexander Aring
2022-09-02  3:00                   ` Jakub Kicinski
2022-09-02 10:35                     ` Leon Romanovsky

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