All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
@ 2026-06-23  4:37 Ratheesh Kannoth
  2026-06-23  9:48 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Ratheesh Kannoth @ 2026-06-23  4:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Ratheesh Kannoth

Add MNL_TYPE_UARR (129) to enum mnl_attr_data_type to match
DEVLINK_VAR_ATTR_TYPE_U64_ARRAY in the kernel. That type represents
devlink param values encoded as a nested list of u64 attributes in
DEVLINK_ATTR_PARAM_VALUE_DATA, allowing drivers and userspace to
exchange variable-length u64/u32 arrays (e.g. multi-value devlink params).

Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
---
 include/libmnl/libmnl.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
index 0331da7..078d517 100644
--- a/include/libmnl/libmnl.h
+++ b/include/libmnl/libmnl.h
@@ -133,6 +133,7 @@ enum mnl_attr_data_type {
 	MNL_TYPE_NESTED_COMPAT,
 	MNL_TYPE_NUL_STRING,
 	MNL_TYPE_BINARY,
+	MNL_TYPE_UARR = 129,
 	MNL_TYPE_MAX,
 };
 
-- 
2.43.0


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

* Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
  2026-06-23  4:37 [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes Ratheesh Kannoth
@ 2026-06-23  9:48 ` Pablo Neira Ayuso
  2026-06-23 10:33   ` RE:: " Ratheesh Kannoth
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2026-06-23  9:48 UTC (permalink / raw)
  To: Ratheesh Kannoth; +Cc: netfilter-devel

On Tue, Jun 23, 2026 at 10:07:55AM +0530, Ratheesh Kannoth wrote:
> Add MNL_TYPE_UARR (129) to enum mnl_attr_data_type to match
> DEVLINK_VAR_ATTR_TYPE_U64_ARRAY in the kernel. That type represents
> devlink param values encoded as a nested list of u64 attributes in
> DEVLINK_ATTR_PARAM_VALUE_DATA, allowing drivers and userspace to
> exchange variable-length u64/u32 arrays (e.g. multi-value devlink params).
> 
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> ---
>  include/libmnl/libmnl.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
> index 0331da7..078d517 100644
> --- a/include/libmnl/libmnl.h
> +++ b/include/libmnl/libmnl.h
> @@ -133,6 +133,7 @@ enum mnl_attr_data_type {
>  	MNL_TYPE_NESTED_COMPAT,
>  	MNL_TYPE_NUL_STRING,
>  	MNL_TYPE_BINARY,
> +	MNL_TYPE_UARR = 129,

Why 129?

>  	MNL_TYPE_MAX,
>  };
>  
> -- 
> 2.43.0
> 
> 

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

* RE:: Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
  2026-06-23  9:48 ` Pablo Neira Ayuso
@ 2026-06-23 10:33   ` Ratheesh Kannoth
  2026-06-23 11:01     ` : " Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Ratheesh Kannoth @ 2026-06-23 10:33 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel@vger.kernel.org

From: Pablo Neira Ayuso <pablo@netfilter.org> 
Subject: [EXTERNAL] Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
>  include/libmnl/libmnl.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
> index 0331da7..078d517 100644
> --- a/include/libmnl/libmnl.h
> +++ b/include/libmnl/libmnl.h
> @@ -133,6 +133,7 @@ enum mnl_attr_data_type {
>  	MNL_TYPE_NESTED_COMPAT,
>  	MNL_TYPE_NUL_STRING,
>  	MNL_TYPE_BINARY,
> +	MNL_TYPE_UARR = 129,

Why 129?

>  	MNL_TYPE_MAX,
>  };

I would like to merge https://patchwork.kernel.org/project/netdevbpf/patch/20260615041042.549715-1-rkannoth@marvell.com/
But this has a hard coded value 129. I believe, I need to use a macro here instead of 129.  


The value 129 is based on __DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80 (i.e., 128) defined in the kernel, with custom types starting at that offset. The relevant kernel-side definition is:
  @@ -406,6 +406,7 @@ enum devlink_var_attr_type {
          DEVLINK_VAR_ATTR_TYPE_BINARY,
          _DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80,
          /* Any possible custom types, unrelated to NLA* values go below */
           DEVLINK_VAR_ATTR_TYPE_U64_ARRAY,
   };
So DEVLINK_VAR_ATTR_TYPE_U64_ARRAY resolves to 0x81 = 129.
Please see the kernel patch for full context:
https://lore.kernel.org/all/20260609040453.711932-5-rkannoth@marvell.com/

Once this libmnl patch is merged, I will update the hardcoded 129 to use
MNL_TYPE_UARR in:
https://patchwork.kernel.org/project/netdevbpf/patch/20260615041042.549715-1-rkannoth@marvell.com/


Thanks,
Ratheesh

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

* Re: : Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
  2026-06-23 10:33   ` RE:: " Ratheesh Kannoth
@ 2026-06-23 11:01     ` Pablo Neira Ayuso
  2026-06-23 11:08       ` [EXTERNAL] " Ratheesh Kannoth
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2026-06-23 11:01 UTC (permalink / raw)
  To: Ratheesh Kannoth; +Cc: netfilter-devel@vger.kernel.org

On Tue, Jun 23, 2026 at 10:33:50AM +0000, Ratheesh Kannoth wrote:
> From: Pablo Neira Ayuso <pablo@netfilter.org> 
> Subject: [EXTERNAL] Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
> >  include/libmnl/libmnl.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
> > index 0331da7..078d517 100644
> > --- a/include/libmnl/libmnl.h
> > +++ b/include/libmnl/libmnl.h
> > @@ -133,6 +133,7 @@ enum mnl_attr_data_type {
> >  	MNL_TYPE_NESTED_COMPAT,
> >  	MNL_TYPE_NUL_STRING,
> >  	MNL_TYPE_BINARY,
> > +	MNL_TYPE_UARR = 129,
> 
> Why 129?
> 
> >  	MNL_TYPE_MAX,
> >  };
> 
> I would like to merge https://patchwork.kernel.org/project/netdevbpf/patch/20260615041042.549715-1-rkannoth@marvell.com/
> But this has a hard coded value 129. I believe, I need to use a macro here instead of 129.  
> 
> 
> The value 129 is based on __DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80 (i.e., 128) defined in the kernel, with custom types starting at that offset. The relevant kernel-side definition is:
>   @@ -406,6 +406,7 @@ enum devlink_var_attr_type {
>           DEVLINK_VAR_ATTR_TYPE_BINARY,
>           _DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80,
>           /* Any possible custom types, unrelated to NLA* values go below */
>            DEVLINK_VAR_ATTR_TYPE_U64_ARRAY,
>    };
> So DEVLINK_VAR_ATTR_TYPE_U64_ARRAY resolves to 0x81 = 129.
> Please see the kernel patch for full context:
> https://lore.kernel.org/all/20260609040453.711932-5-rkannoth@marvell.com/
> 
> Once this libmnl patch is merged, I will update the hardcoded 129 to use
> MNL_TYPE_UARR in:
> https://patchwork.kernel.org/project/netdevbpf/patch/20260615041042.549715-1-rkannoth@marvell.com/

This value is only internal for __mnl_attr_validate(), this validates
the attribute type.

I think this is not what you're searching for...

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

* RE: [EXTERNAL] Re: : Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes
  2026-06-23 11:01     ` : " Pablo Neira Ayuso
@ 2026-06-23 11:08       ` Ratheesh Kannoth
  0 siblings, 0 replies; 5+ messages in thread
From: Ratheesh Kannoth @ 2026-06-23 11:08 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel@vger.kernel.org

From: Pablo Neira Ayuso <pablo@netfilter.org> 
Sent: Tuesday, June 23, 2026 4:32 PM
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: netfilter-devel@vger.kernel.org
Subject: [EXTERNAL] Re: : Re: [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes

>> Once this libmnl patch is merged, I will update the hardcoded 129 to use
>> MNL_TYPE_UARR in:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_project_netdevbpf_patch_20260615041042.549715-2D1-2Drkannoth-40marvell.com_&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=aekcsyBCH00_LewrEDcQBzsRw8KCpUR0vZb_auTHk4M&m=wDiuehWQ149iF11smw-oJ->2DYcumcZ2p_TOt6cZjNrBIJEpJGcHrMnzaoJlDSDV5&s=4llebXoU9zDF5M9XK5vZ9LNM-Jq-kaCIiBUpfqfZeqg&e=

>This value is only internal for __mnl_attr_validate(), this validates
>the attribute type.

>I think this is not what you're searching for...
Thank you !. You are right.  Please abandon the patch. 




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

end of thread, other threads:[~2026-06-23 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23  4:37 [PATCH] libmnl: add MNL_TYPE_UARR for devlink u64 array attributes Ratheesh Kannoth
2026-06-23  9:48 ` Pablo Neira Ayuso
2026-06-23 10:33   ` RE:: " Ratheesh Kannoth
2026-06-23 11:01     ` : " Pablo Neira Ayuso
2026-06-23 11:08       ` [EXTERNAL] " Ratheesh Kannoth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.