Re: [PATCH net-next v2] netdevice: define and allocate _device _properly_

2024-07-11 Thread Alexander Lobakin
From: Eric Dumazet Date: Wed, 10 Jul 2024 10:04:39 -0700 > On Wed, Jul 10, 2024 at 4:19 AM Breno Leitao wrote: >> >> Hello Eric, >> >> On Tue, Jul 09, 2024 at 08:27:45AM -0700, Eric Dumazet wrote: >>> On Tue, Jul 9, 2024 at 5:54 AM Breno Leitao wrote: >> @@ -2596,7 +2599,7 @@ void

Re: [PATCH net-next v3] netdevice: define and allocate _device _properly_

2024-07-10 Thread Alexander Lobakin
From: Breno Leitao Date: Wed, 10 Jul 2024 04:30:28 -0700 > From: Alexander Lobakin > > In fact, this structure contains a flexible array at the end, but > historically its size, alignment etc., is calculated manually. > There are several instances of the structure embe

Re: [PATCH net-next] netdevice: define and allocate _device _properly_

2024-05-08 Thread Alexander Lobakin
From: Jakub Kicinski Date: Tue, 7 May 2024 11:10:35 -0700 > On Tue, 7 May 2024 14:39:37 +0200 Alexander Lobakin wrote: >> There are several instances of the structure embedded into other >> structures, but also there's ongoing effort to remove them and we >> could in

Re: [PATCH net-next] netdevice: define and allocate _device _properly_

2024-05-08 Thread Alexander Lobakin
From: Eric Dumazet Date: Tue, 7 May 2024 20:21:58 +0200 > On Tue, May 7, 2024 at 2:40 PM Alexander Lobakin > wrote: >> >> In fact, this structure contains a flexible array at the end, but >> historically its size, alignment etc., is calculated manually. >&g

Re: [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}

2024-05-07 Thread Alexander Lobakin
From: Erick Archer Date: Mon, 6 May 2024 19:42:08 +0200 > Provide UAPI macros for UAPI structs that will gain annotations for > __counted_by_{le, be} attributes. Pls add me to Cc next time. Why is this change needed? __counted_by_{le, be}() aren't used anywhere in the uAPI headers. > >

[PATCH net-next] netdevice: define and allocate _device _properly_

2024-05-07 Thread Alexander Lobakin
-31 On x86_64 with several NICs of different vendors, I was never able to get a _device pointer not aligned to the cacheline size after the change. Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 12 +++- net/core/dev.c| 31 +++ net

Re: [PATCH v3] net: dsa: lan9303: use ethtool_puts() for lan9303_get_strings()

2024-04-09 Thread Alexander Lobakin
el.org > Cc: Kees Cook > Signed-off-by: Justin Stitt > Suggested-by: Alexander Lobakin > --- > Changes in v3: > - use ethtool_puts over ethtool_sprintf > - Link to v2: > https://lore.kernel.org/r/20231005-strncpy-drivers-net-dsa-lan9303-core-c-v2-1-feb452a53...@google.com &

[PATCH net-next v2 3/3] idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header

2024-03-27 Thread Alexander Lobakin
-by: Gustavo A. R. Silva Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/idpf/virtchnl2.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/virtchnl2.h b/drivers/net/ethernet/intel/idpf/virtchnl2.h index 29419211b3d9

[PATCH net-next v2 2/3] idpf: make virtchnl2.h self-contained

2024-03-27 Thread Alexander Lobakin
-by: Kees Cook Acked-by: Gustavo A. R. Silva Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 2 ++ drivers/net/ethernet/intel/idpf/virtchnl2.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b

[PATCH net-next v2 1/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-27 Thread Alexander Lobakin
on platform's Endianness to either __counted_by() when applicable or noop otherwise. Maybe it would be a good idea to introduce such attributes on compiler level if possible, but for now let's stop on what we have. Acked-by: Kees Cook Acked-by: Gustavo A. R. Silva Signed-off-by: Alexander Lobakin

[PATCH net-next v2 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-27 Thread Alexander Lobakin
let's stop on what we have. Alexander Lobakin (3): compiler_types: add Endianness-dependent __counted_by_{le,be} idpf: make virtchnl2.h self-contained idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header Documentation/conf.py | 2 ++ scripts/kernel-doc

Re: [Intel-wired-lan] [PATCH net-next 2/3] idpf: make virtchnl2.h self-contained

2024-03-27 Thread Alexander Lobakin
From: Jakub Kicinski Date: Tue, 26 Mar 2024 21:04:12 -0700 > On Tue, 26 Mar 2024 17:41:15 +0100 Alexander Lobakin wrote: >> To ease maintaining of virtchnl2.h, which already is messy enough, >> make it self-contained by adding missing if_ether.h include due to >> %ETH_ALEN

[PATCH net-next 3/3] idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header

2024-03-26 Thread Alexander Lobakin
-by: Alexander Lobakin --- drivers/net/ethernet/intel/idpf/virtchnl2.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/virtchnl2.h b/drivers/net/ethernet/intel/idpf/virtchnl2.h index 29419211b3d9..63deb120359c 100644

[PATCH net-next 2/3] idpf: make virtchnl2.h self-contained

2024-03-26 Thread Alexander Lobakin
Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/idpf/virtchnl2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/virtchnl2.h b/drivers/net/ethernet/intel/idpf/virtchnl2.h index 4a3c4454d25a..29419211b3d9 100644 --- a/drivers

[PATCH net-next 1/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-26 Thread Alexander Lobakin
on platform's Endianness to either __counted_by() when applicable or noop otherwise. Maybe it would be a good idea to introduce such attributes on compiler level if possible, but for now let's stop on what we have. Acked-by: Kees Cook Signed-off-by: Alexander Lobakin --- Documentation/conf.py

[PATCH net-next 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-26 Thread Alexander Lobakin
let's stop on what we have. Alexander Lobakin (3): compiler_types: add Endianness-dependent __counted_by_{le,be} idpf: make virtchnl2.h self-contained idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header Documentation/conf.py | 2 ++ scripts/kernel-doc

Re: [PATCH RFC kspp-next 3/3] idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header

2024-03-20 Thread Alexander Lobakin
From: Kees Cook Date: Tue, 19 Mar 2024 14:42:56 -0700 > On Tue, Mar 19, 2024 at 06:57:18PM +, Simon Horman wrote: >> On Mon, Mar 18, 2024 at 02:03:54PM +0100, Alexander Lobakin wrote: >>> Both virtchnl2.h and its consumer idpf_virtchnl.c are very error-prone. >>&

Re: [PATCH RFC kspp-next 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-19 Thread Alexander Lobakin
From: Kees Cook Date: Mon, 18 Mar 2024 10:49:25 -0700 > On Mon, Mar 18, 2024 at 02:03:51PM +0100, Alexander Lobakin wrote: >> include/linux/compiler_types.h | 11 ++ >> drivers/net/ethernet/intel/idpf/virtchnl2.h | 24 ++--- >> 2 files c

[PATCH RFC kspp-next 3/3] idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header

2024-03-18 Thread Alexander Lobakin
for this driver, so they would receive additional protection. While we're here, add __counted_by() to virtchnl2_ptype::proto_id, as its counter is `u8` regardless of the Endianness. Compile test on x86_64 (LE) didn't reveal any new issues after applying the attributes. Signed-off-by: Alexander Lobakin

[PATCH RFC kspp-next 2/3] idpf: make virtchnl2.h self-contained

2024-03-18 Thread Alexander Lobakin
To ease maintaining of virtchnl2.h, which already is messy enough, make it self-contained by adding missing if_ether.h include due to %ETH_ALEN usage. At the same time, virtchnl2_lan_desc.h is not anywhere in the file, so remove this include to speed up preprocessing. Signed-off-by: Alexander

[PATCH RFC kspp-next 1/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-18 Thread Alexander Lobakin
on platform's Endianness to either __counted_by() when applicable or noop otherwise. Maybe it would be a good idea to introduce such attributes on compiler level if possible, but for now let's stop on what we have. Signed-off-by: Alexander Lobakin --- include/linux/compiler_types.h | 11 +++ 1

[PATCH RFC kspp-next 0/3] compiler_types: add Endianness-dependent __counted_by_{le,be}

2024-03-18 Thread Alexander Lobakin
let's stop on what we have. Alexander Lobakin (3): compiler_types: add Endianness-dependent __counted_by_{le,be} idpf: make virtchnl2.h self-contained idpf: sprinkle __counted_by{,_le}() in the virtchnl2 header include/linux/compiler_types.h | 11 ++ drivers/net/ethernet

Re: [PATCH] netdev: Use flexible array for trailing private bytes

2024-03-04 Thread Alexander Lobakin
From: Jakub Kicinski Date: Fri, 1 Mar 2024 09:35:17 -0800 > On Fri, 1 Mar 2024 15:30:03 +0100 Alexander Lobakin wrote: >> I like the idea of declaring priv explicitly rather than doing size + >> ptr magic. But maybe we could just add this flex array to struct >> net_device

Re: [PATCH] netdev: Use flexible array for trailing private bytes

2024-03-01 Thread Alexander Lobakin
From: Eric Dumazet Date: Fri, 1 Mar 2024 14:25:37 +0100 > On Fri, Mar 1, 2024 at 1:59 PM Alexander Lobakin > wrote: >> >> From: Eric Dumazet >> Date: Fri, 1 Mar 2024 09:03:55 +0100 >> >>> On Fri, Mar 1, 2024 at 7:59 AM Jakub Kicinski wrote: >>&g

Re: [PATCH] netdev: Use flexible array for trailing private bytes

2024-03-01 Thread Alexander Lobakin
From: Eric Dumazet Date: Fri, 1 Mar 2024 09:03:55 +0100 > On Fri, Mar 1, 2024 at 7:59 AM Jakub Kicinski wrote: >> >> On Thu, 29 Feb 2024 13:30:22 -0800 Kees Cook wrote: Re WARN_ONCE() in netdev_priv(): netdev_priv() is VERY hot, I'm not sure we want to add checks there. Maybe under

Re: [alobakin:pfcp 11/19] include/linux/bitmap.h:642:17: warning: array subscript [1, 1024] is outside array bounds of 'long unsigned int[1]'

2023-11-08 Thread Alexander Lobakin
From: Yury Norov Date: Tue, 7 Nov 2023 11:24:49 -0800 > On Tue, Nov 07, 2023 at 07:52:19PM +0100, Alexander Lobakin wrote: >> From: Yury Norov >> Date: Tue, 7 Nov 2023 10:32:06 -0800 >> >>> On Tue, Nov 07, 2023 at 06:24:04PM +0100, Alexander Lobakin wrote

Re: [alobakin:pfcp 11/19] include/linux/bitmap.h:642:17: warning: array subscript [1, 1024] is outside array bounds of 'long unsigned int[1]'

2023-11-07 Thread Alexander Lobakin
From: Yury Norov Date: Tue, 7 Nov 2023 10:32:06 -0800 > On Tue, Nov 07, 2023 at 06:24:04PM +0100, Alexander Lobakin wrote: >> From: Alexander Lobakin >> Date: Tue, 7 Nov 2023 17:44:00 +0100 >> >>> From: Alexander Potapenko >>> Date: Tue, 7 Nov 2023 17:3

Re: [alobakin:pfcp 11/19] include/linux/bitmap.h:642:17: warning: array subscript [1, 1024] is outside array bounds of 'long unsigned int[1]'

2023-11-07 Thread Alexander Lobakin
From: Alexander Lobakin Date: Tue, 7 Nov 2023 17:44:00 +0100 > From: Alexander Potapenko > Date: Tue, 7 Nov 2023 17:33:56 +0100 > >> On Tue, Nov 7, 2023 at 2:23 PM Alexander Lobakin >> wrote: [...] > I tested it on GCC 9 using modified make.cross from lkp and it tri

Re: [alobakin:pfcp 11/19] include/linux/bitmap.h:642:17: warning: array subscript [1, 1024] is outside array bounds of 'long unsigned int[1]'

2023-11-07 Thread Alexander Lobakin
From: Alexander Potapenko Date: Tue, 7 Nov 2023 17:33:56 +0100 > On Tue, Nov 7, 2023 at 2:23 PM Alexander Lobakin > wrote: >> >> From: Andy Shevchenko >> Date: Mon, 6 Nov 2023 20:23:52 +0200 >> >>> On Mon, Nov 06, 2023 at 05:31:34PM +0100, Alexan

Re: [PATCH v2] net: dsa: lan9303: use ethtool_sprintf() for lan9303_get_strings()

2023-10-06 Thread Alexander Lobakin
tool_sprintf(, "%s", lan9303_mib[u].name); > } > } Either way, this was a nitpick, so Reviewed-by: Alexander Lobakin > > > --- > base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 > change-id: 20231005-strncpy-drivers-net-dsa-lan9303-core-c-6386858e5c22 > > Best regards, > -- > Justin Stitt > Thanks, Olek

Re: [PATCH] net: dsa: lan9303: replace deprecated strncpy with memcpy

2023-10-05 Thread Alexander Lobakin
From: Kees Cook Date: Wed, 4 Oct 2023 22:02:00 -0700 > On Wed, Oct 04, 2023 at 08:07:55PM -0700, Kees Cook wrote: >> On Thu, Oct 05, 2023 at 12:30:18AM +, Justin Stitt wrote: >>> `strncpy` is deprecated for use on NUL-terminated destination strings >>> [1] and as such we should prefer more

Re: [PATCH] sky2: Make sure there is at least one frag_addr available

2023-09-21 Thread Alexander Lobakin
ski > Cc: Paolo Abeni > Cc: net...@vger.kernel.org > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-kbuild-all/202309191958.ubw1cjxk-...@intel.com/ > Signed-off-by: Kees Cook Reviewed-by: Alexander Lobakin That "nobody uses this HW on non-x