netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next v3] idpf: Don't hard code napi_struct size
@ 2024-10-04 10:54 Joe Damato
  2024-10-04 14:22 ` Alexander Lobakin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joe Damato @ 2024-10-04 10:54 UTC (permalink / raw)
  To: netdev
  Cc: aleksander.lobakin, przemyslaw.kitszel, horms, kuba, Joe Damato,
	Tony Nguyen, David S. Miller, Eric Dumazet, Paolo Abeni,
	moderated list:INTEL ETHERNET DRIVERS, open list

The sizeof(struct napi_struct) can change. Don't hardcode the size to
400 bytes and instead use "sizeof(struct napi_struct)".

Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Joe Damato <jdamato@fastly.com>
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
index f0537826f840..9c1fe84108ed 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
@@ -438,7 +438,8 @@ struct idpf_q_vector {
 	__cacheline_group_end_aligned(cold);
 };
 libeth_cacheline_set_assert(struct idpf_q_vector, 112,
-			    424 + 2 * sizeof(struct dim),
+			    24 + sizeof(struct napi_struct) +
+			    2 * sizeof(struct dim),
 			    8 + sizeof(cpumask_var_t));
 
 struct idpf_rx_queue_stats {
-- 
2.34.1


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

* Re: [net-next v3] idpf: Don't hard code napi_struct size
  2024-10-04 10:54 [net-next v3] idpf: Don't hard code napi_struct size Joe Damato
@ 2024-10-04 14:22 ` Alexander Lobakin
  2024-10-08  9:14 ` Paolo Abeni
  2025-04-18 20:39 ` Jacob Keller
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Lobakin @ 2024-10-04 14:22 UTC (permalink / raw)
  To: Joe Damato
  Cc: netdev, przemyslaw.kitszel, horms, kuba, Tony Nguyen,
	David S. Miller, Eric Dumazet, Paolo Abeni,
	moderated list:INTEL ETHERNET DRIVERS, open list

From: Joe Damato <jdamato@fastly.com>
Date: Fri,  4 Oct 2024 10:54:07 +0000

> The sizeof(struct napi_struct) can change. Don't hardcode the size to
> 400 bytes and instead use "sizeof(struct napi_struct)".
> 
> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Signed-off-by: Joe Damato <jdamato@fastly.com>

Acked-by: Alexander Lobakin <aleksander.lobakin@intel.com>

I'm sorry that I complicated things a bit with those assertions =\

> ---
>  drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> index f0537826f840..9c1fe84108ed 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> @@ -438,7 +438,8 @@ struct idpf_q_vector {
>  	__cacheline_group_end_aligned(cold);
>  };
>  libeth_cacheline_set_assert(struct idpf_q_vector, 112,
> -			    424 + 2 * sizeof(struct dim),
> +			    24 + sizeof(struct napi_struct) +
> +			    2 * sizeof(struct dim),
>  			    8 + sizeof(cpumask_var_t));
>  
>  struct idpf_rx_queue_stats {

Thanks,
Olek

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

* Re: [net-next v3] idpf: Don't hard code napi_struct size
  2024-10-04 10:54 [net-next v3] idpf: Don't hard code napi_struct size Joe Damato
  2024-10-04 14:22 ` Alexander Lobakin
@ 2024-10-08  9:14 ` Paolo Abeni
  2024-10-08 17:24   ` [Intel-wired-lan] " Tony Nguyen
  2025-04-18 20:39 ` Jacob Keller
  2 siblings, 1 reply; 5+ messages in thread
From: Paolo Abeni @ 2024-10-08  9:14 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: aleksander.lobakin, przemyslaw.kitszel, horms, kuba,
	David S. Miller, Eric Dumazet,
	moderated list:INTEL ETHERNET DRIVERS, open list, Joe Damato,
	netdev

On 10/4/24 12:54, Joe Damato wrote:
> The sizeof(struct napi_struct) can change. Don't hardcode the size to
> 400 bytes and instead use "sizeof(struct napi_struct)".
> 
> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Signed-off-by: Joe Damato <jdamato@fastly.com>
> ---
>   drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> index f0537826f840..9c1fe84108ed 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> @@ -438,7 +438,8 @@ struct idpf_q_vector {
>   	__cacheline_group_end_aligned(cold);
>   };
>   libeth_cacheline_set_assert(struct idpf_q_vector, 112,
> -			    424 + 2 * sizeof(struct dim),
> +			    24 + sizeof(struct napi_struct) +
> +			    2 * sizeof(struct dim),
>   			    8 + sizeof(cpumask_var_t));
>   
>   struct idpf_rx_queue_stats {

@Tony: I'm assuming you want this one to go via your tree first, please 
LMK otherwise.

Thanks,

Paolo


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

* Re: [Intel-wired-lan] [net-next v3] idpf: Don't hard code napi_struct size
  2024-10-08  9:14 ` Paolo Abeni
@ 2024-10-08 17:24   ` Tony Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2024-10-08 17:24 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: przemyslaw.kitszel, Joe Damato, open list, aleksander.lobakin,
	Eric Dumazet, moderated list:INTEL ETHERNET DRIVERS, horms,
	netdev, kuba, David S. Miller



On 10/8/2024 2:14 AM, Paolo Abeni wrote:
> On 10/4/24 12:54, Joe Damato wrote:
>> The sizeof(struct napi_struct) can change. Don't hardcode the size to
>> 400 bytes and instead use "sizeof(struct napi_struct)".
>>
>> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>> Signed-off-by: Joe Damato <jdamato@fastly.com>
>> ---
>>   drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h 
>> b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
>> index f0537826f840..9c1fe84108ed 100644
>> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
>> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
>> @@ -438,7 +438,8 @@ struct idpf_q_vector {
>>       __cacheline_group_end_aligned(cold);
>>   };
>>   libeth_cacheline_set_assert(struct idpf_q_vector, 112,
>> -                424 + 2 * sizeof(struct dim),
>> +                24 + sizeof(struct napi_struct) +
>> +                2 * sizeof(struct dim),
>>                   8 + sizeof(cpumask_var_t));
>>   struct idpf_rx_queue_stats {
> 
> @Tony: I'm assuming you want this one to go via your tree first, please 
> LMK otherwise.

Hi Paolo,

This seems straightforward and we'd see the issues compile-time so I 
think it's ok for you to take directly.

Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>

Thanks,
Tony

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

* Re: [Intel-wired-lan] [net-next v3] idpf: Don't hard code napi_struct size
  2024-10-04 10:54 [net-next v3] idpf: Don't hard code napi_struct size Joe Damato
  2024-10-04 14:22 ` Alexander Lobakin
  2024-10-08  9:14 ` Paolo Abeni
@ 2025-04-18 20:39 ` Jacob Keller
  2 siblings, 0 replies; 5+ messages in thread
From: Jacob Keller @ 2025-04-18 20:39 UTC (permalink / raw)
  To: Joe Damato, netdev
  Cc: przemyslaw.kitszel, open list, aleksander.lobakin, Eric Dumazet,
	Tony Nguyen, horms, moderated list:INTEL ETHERNET DRIVERS, kuba,
	Paolo Abeni, David S. Miller



On 10/4/2024 3:54 AM, Joe Damato wrote:
> The sizeof(struct napi_struct) can change. Don't hardcode the size to
> 400 bytes and instead use "sizeof(struct napi_struct)".
> 
> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Signed-off-by: Joe Damato <jdamato@fastly.com>
> ---
>  drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> index f0537826f840..9c1fe84108ed 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
> @@ -438,7 +438,8 @@ struct idpf_q_vector {
>  	__cacheline_group_end_aligned(cold);
>  };
>  libeth_cacheline_set_assert(struct idpf_q_vector, 112,
> -			    424 + 2 * sizeof(struct dim),
> +			    24 + sizeof(struct napi_struct) +
> +			    2 * sizeof(struct dim),
>  			    8 + sizeof(cpumask_var_t));
>  
>  struct idpf_rx_queue_stats {

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

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

end of thread, other threads:[~2025-04-18 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 10:54 [net-next v3] idpf: Don't hard code napi_struct size Joe Damato
2024-10-04 14:22 ` Alexander Lobakin
2024-10-08  9:14 ` Paolo Abeni
2024-10-08 17:24   ` [Intel-wired-lan] " Tony Nguyen
2025-04-18 20:39 ` Jacob Keller

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