From: Joe Damato <jdamato@fastly.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org,
intel-wired-lan@lists.osuosl.org, davem@davemloft.net
Subject: Re: [Intel-wired-lan] [next-queue 1/3] i40e: Store the irq number in i40e_q_vector
Date: Wed, 5 Oct 2022 10:00:20 -0700 [thread overview]
Message-ID: <20221005170019.GA6629@fastly.com> (raw)
In-Reply-To: <Yz1chBm4F8vJPkl2@boxer>
On Wed, Oct 05, 2022 at 12:29:24PM +0200, Maciej Fijalkowski wrote:
> On Wed, Oct 05, 2022 at 01:31:41AM -0700, Joe Damato wrote:
> > Make it easy to figure out the IRQ number for a particular i40e_q_vector by
> > storing the assigned IRQ in the structure itself.
> >
> > Signed-off-by: Joe Damato <jdamato@fastly.com>
> > ---
> > drivers/net/ethernet/intel/i40e/i40e.h | 1 +
> > drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
> > index 9926c4e..8e1f395 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e.h
> > +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> > @@ -992,6 +992,7 @@ struct i40e_q_vector {
> > struct rcu_head rcu; /* to avoid race with update stats on free */
> > char name[I40E_INT_NAME_STR_LEN];
> > bool arm_wb_state;
> > + int irq_num; /* IRQ assigned to this q_vector */
>
> This struct looks like a mess in terms of members order. Can you check
> with pahole how your patch affects the layout of it? Maybe while at it you
> could pack it in a better way?
OK, sure. I used pahole and asked it to reorganize the struct members,
which saves 24 bytes.
I'll update this commit to include the following reorganization in the v2 of
this set:
$ pahole -R -C i40e_q_vector i40e.ko
struct i40e_q_vector {
struct i40e_vsi * vsi; /* 0 8 */
u16 v_idx; /* 8 2 */
u16 reg_idx; /* 10 2 */
u8 num_ringpairs; /* 12 1 */
u8 itr_countdown; /* 13 1 */
bool arm_wb_state; /* 14 1 */
/* XXX 1 byte hole, try to pack */
struct napi_struct napi; /* 16 400 */
/* --- cacheline 6 boundary (384 bytes) was 32 bytes ago --- */
struct i40e_ring_container rx; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct i40e_ring_container tx; /* 448 32 */
cpumask_t affinity_mask; /* 480 24 */
struct irq_affinity_notify affinity_notify; /* 504 56 */
/* --- cacheline 8 boundary (512 bytes) was 48 bytes ago --- */
struct callback_head rcu; /* 560 16 */
/* --- cacheline 9 boundary (576 bytes) --- */
char name[32]; /* 576 32 */
/* XXX 4 bytes hole, try to pack */
int irq_num; /* 612 4 */
/* size: 616, cachelines: 10, members: 14 */
/* sum members: 611, holes: 2, sum holes: 5 */
/* last cacheline: 40 bytes */
}; /* saved 24 bytes! */
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
WARNING: multiple messages have this Message-ID (diff)
From: Joe Damato <jdamato@fastly.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
kuba@kernel.org, davem@davemloft.net, anthony.l.nguyen@intel.com,
jesse.brandeburg@intel.com
Subject: Re: [next-queue 1/3] i40e: Store the irq number in i40e_q_vector
Date: Wed, 5 Oct 2022 10:00:20 -0700 [thread overview]
Message-ID: <20221005170019.GA6629@fastly.com> (raw)
In-Reply-To: <Yz1chBm4F8vJPkl2@boxer>
On Wed, Oct 05, 2022 at 12:29:24PM +0200, Maciej Fijalkowski wrote:
> On Wed, Oct 05, 2022 at 01:31:41AM -0700, Joe Damato wrote:
> > Make it easy to figure out the IRQ number for a particular i40e_q_vector by
> > storing the assigned IRQ in the structure itself.
> >
> > Signed-off-by: Joe Damato <jdamato@fastly.com>
> > ---
> > drivers/net/ethernet/intel/i40e/i40e.h | 1 +
> > drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
> > index 9926c4e..8e1f395 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e.h
> > +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> > @@ -992,6 +992,7 @@ struct i40e_q_vector {
> > struct rcu_head rcu; /* to avoid race with update stats on free */
> > char name[I40E_INT_NAME_STR_LEN];
> > bool arm_wb_state;
> > + int irq_num; /* IRQ assigned to this q_vector */
>
> This struct looks like a mess in terms of members order. Can you check
> with pahole how your patch affects the layout of it? Maybe while at it you
> could pack it in a better way?
OK, sure. I used pahole and asked it to reorganize the struct members,
which saves 24 bytes.
I'll update this commit to include the following reorganization in the v2 of
this set:
$ pahole -R -C i40e_q_vector i40e.ko
struct i40e_q_vector {
struct i40e_vsi * vsi; /* 0 8 */
u16 v_idx; /* 8 2 */
u16 reg_idx; /* 10 2 */
u8 num_ringpairs; /* 12 1 */
u8 itr_countdown; /* 13 1 */
bool arm_wb_state; /* 14 1 */
/* XXX 1 byte hole, try to pack */
struct napi_struct napi; /* 16 400 */
/* --- cacheline 6 boundary (384 bytes) was 32 bytes ago --- */
struct i40e_ring_container rx; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct i40e_ring_container tx; /* 448 32 */
cpumask_t affinity_mask; /* 480 24 */
struct irq_affinity_notify affinity_notify; /* 504 56 */
/* --- cacheline 8 boundary (512 bytes) was 48 bytes ago --- */
struct callback_head rcu; /* 560 16 */
/* --- cacheline 9 boundary (576 bytes) --- */
char name[32]; /* 576 32 */
/* XXX 4 bytes hole, try to pack */
int irq_num; /* 612 4 */
/* size: 616, cachelines: 10, members: 14 */
/* sum members: 611, holes: 2, sum holes: 5 */
/* last cacheline: 40 bytes */
}; /* saved 24 bytes! */
next prev parent reply other threads:[~2022-10-05 17:00 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 8:31 [Intel-wired-lan] [next-queue 0/3] i40e: Add an i40e_napi_poll tracepoint Joe Damato
2022-10-05 8:31 ` Joe Damato
2022-10-05 8:31 ` [Intel-wired-lan] [next-queue 1/3] i40e: Store the irq number in i40e_q_vector Joe Damato
2022-10-05 8:31 ` Joe Damato
2022-10-05 10:29 ` [Intel-wired-lan] " Maciej Fijalkowski
2022-10-05 10:29 ` Maciej Fijalkowski
2022-10-05 17:00 ` Joe Damato [this message]
2022-10-05 17:00 ` Joe Damato
2022-10-05 18:25 ` [Intel-wired-lan] " Jesse Brandeburg
2022-10-05 18:25 ` Jesse Brandeburg
2022-10-05 18:40 ` [Intel-wired-lan] " Joe Damato
2022-10-05 18:40 ` Joe Damato
2022-10-05 19:37 ` [Intel-wired-lan] " Jesse Brandeburg
2022-10-05 19:37 ` Jesse Brandeburg
2022-10-06 13:06 ` [Intel-wired-lan] " Maciej Fijalkowski
2022-10-06 13:06 ` Maciej Fijalkowski
2022-10-05 8:31 ` [Intel-wired-lan] [next-queue 2/3] i40e: i40e_clean_tx_irq returns work done Joe Damato
2022-10-05 8:31 ` Joe Damato
2022-10-05 8:45 ` [Intel-wired-lan] " Paul Menzel
2022-10-05 8:45 ` Paul Menzel
2022-10-05 10:46 ` Maciej Fijalkowski
2022-10-05 10:46 ` Maciej Fijalkowski
2022-10-05 17:50 ` [Intel-wired-lan] " Joe Damato
2022-10-05 17:50 ` Joe Damato
2022-10-05 18:33 ` [Intel-wired-lan] " Jesse Brandeburg
2022-10-05 18:33 ` Jesse Brandeburg
2022-10-05 18:47 ` [Intel-wired-lan] " Joe Damato
2022-10-05 18:47 ` Joe Damato
2022-10-05 8:31 ` [Intel-wired-lan] [next-queue 3/3] i40e: Add i40e_napi_poll tracepoint Joe Damato
2022-10-05 8:31 ` Joe Damato
2022-10-05 10:27 ` [Intel-wired-lan] " Maciej Fijalkowski
2022-10-05 10:27 ` Maciej Fijalkowski
2022-10-05 17:56 ` [Intel-wired-lan] " Joe Damato
2022-10-05 17:56 ` Joe Damato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221005170019.GA6629@fastly.com \
--to=jdamato@fastly.com \
--cc=davem@davemloft.net \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.