idpf: Don't hard code napi_struct size
Subsystems (3)
PATCH v3 1/1 idpf: Don't hard code napi_struct size
The sizeof(struct napi_struct) can change. Don't hardcode the size to 400 bytes and instead use "sizeof(struct napi_struct)".
--- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/idpf/idpf_txrx.h +2 -1
@@ -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 {
Signature · 1 line
2.34.1
From: Joe Damato <[email protected]>
Date: Fri, 4 Oct 2024 10:54:07 +0000
Quoted 5 lines
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 <[email protected]>Signed-off-by Joe Damato <[email protected]>
I'm sorry that I complicated things a bit with those assertions =\
Quoted 9 lines
--- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/idpf/idpf_txrx.h +0
-0
drivers/net/ethernet/intel/idpf/idpf_txrx.h struct idpf_q_vector { · line 445
Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_txrx.h +2
-1@@ -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
Paolo Abeni
maintainerQuoted 14 lines · Joe Damato
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 <[email protected]>Signed-off-by Joe Damato <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/idpf/idpf_txrx.h +0
-0
drivers/net/ethernet/intel/idpf/idpf_txrx.h struct idpf_q_vector { · line 445
Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_txrx.h +2
-1@@ -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
Quoted 10 lines · Paolo Abeni
Quoted 9 lines · Joe Damato
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 <[email protected]>Signed-off-by Joe Damato <[email protected]>---
drivers/net/ethernet/intel/idpf/idpf_txrx.h| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 16 lines
drivers/net/ethernet/intel/idpf/idpf_txrx.h struct idpf_q_vector { · line 444
Quoted 13 lines
drivers/net/ethernet/intel/idpf/idpf_txrx.h +2
-1@@ -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.
Thanks,
Tony
Quoted 14 lines · Joe Damato
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 <[email protected]>Signed-off-by Joe Damato <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/idpf/idpf_txrx.h +0
-0
drivers/net/ethernet/intel/idpf/idpf_txrx.h struct idpf_q_vector { · line 445
Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_txrx.h +2
-1@@ -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 {