From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Network Development <netdev@vger.kernel.org>,
"Karlsson, Magnus" <magnus.karlsson@intel.com>,
Alexander Lobakin <alexandr.lobakin@intel.com>
Subject: Re: [PATCH bpf-next v4 7/8] ice: xsk: improve AF_XDP ZC Tx and use batching API
Date: Tue, 25 Jan 2022 12:23:23 +0100 [thread overview]
Message-ID: <Ye/dqylvNNa72wI8@boxer> (raw)
In-Reply-To: <CAJ8uoz1KRjks7k-tVQoZAHScrmqEhUQJqs5_L_gJX8PnY=VCwg@mail.gmail.com>
On Tue, Jan 25, 2022 at 10:32:35AM +0100, Magnus Karlsson wrote:
> On Mon, Jan 24, 2022 at 8:38 PM Maciej Fijalkowski
> <maciej.fijalkowski@intel.com> wrote:
> >
> > Apply the logic that was done for regular XDP from commit 9610bd988df9
> > ("ice: optimize XDP_TX workloads") to the ZC side of the driver. On top
> > of that, introduce batching to Tx that is inspired by i40e's
> > implementation with adjustments to the cleaning logic - take into the
> > account NAPI budget in ice_clean_xdp_irq_zc().
> >
> > Separating the stats structs onto separate cache lines seemed to improve
> > the performance.
>
> Nice one, thanks! Just one smaller comment below.
>
> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
>
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> > ---
> > drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +-
> > drivers/net/ethernet/intel/ice/ice_txrx.h | 2 +-
> > drivers/net/ethernet/intel/ice/ice_xsk.c | 256 ++++++++++++++--------
> > drivers/net/ethernet/intel/ice/ice_xsk.h | 27 ++-
> > 4 files changed, 188 insertions(+), 99 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
> > index 73f60493209d..7d8824b4c8ff 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_txrx.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
> > @@ -1462,7 +1462,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget)
> > bool wd;
> >
> > if (tx_ring->xsk_pool)
> > - wd = ice_clean_tx_irq_zc(tx_ring, budget);
> > + wd = ice_xmit_zc(tx_ring, ICE_DESC_UNUSED(tx_ring), budget);
> > else if (ice_ring_is_xdp(tx_ring))
> > wd = true;
> > else
> > diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.h b/drivers/net/ethernet/intel/ice/ice_txrx.h
> > index 611dd7c4a631..ea6c9cc02a1a 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_txrx.h
> > +++ b/drivers/net/ethernet/intel/ice/ice_txrx.h
> > @@ -322,9 +322,9 @@ struct ice_tx_ring {
> > u16 count; /* Number of descriptors */
> > u16 q_index; /* Queue number of ring */
> > /* stats structs */
> > + struct ice_txq_stats tx_stats;
> > struct ice_q_stats stats;
> > struct u64_stats_sync syncp;
> > - struct ice_txq_stats tx_stats;
> >
> > /* CL3 - 3rd cacheline starts here */
> > struct rcu_head rcu; /* to avoid race on free */
>
> Seems like these comments are wrong these days. Your move indeed moves
> the tx_stats to another cache line as seen in the pahole dump below,
> but that is not obvious with the comments that point to the opposite.
> Maybe update the cacheline start comments to the correct locations?
Indeed it's off. It seems there are minor things to improve here and
there, so let me send a v5.
Thanks!
>
> <snip>
> u16 q_index; /* 94 2 */
> struct ice_txq_stats tx_stats; /* 96 32 */
>
> /* XXX last struct has 4 bytes of padding */
>
> /* --- cacheline 2 boundary (128 bytes) --- */
> struct ice_q_stats stats; /* 128 16 */
> struct u64_stats_sync syncp; /* 144 0 */
> struct callback_head rcu __attribute__((__aligned__(8))); /*
> 144 16 */
> long unsigned int xps_state[1]; /* 160 8 */
> <snip>
>
(...)
next prev parent reply other threads:[~2022-01-25 11:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 16:55 [PATCH v4 bpf-next 0/8] xsk: Intel driver improvements Maciej Fijalkowski
2022-01-24 16:55 ` [PATCH bpf-next v4 1/8] ice: remove likely for napi_complete_done Maciej Fijalkowski
2022-01-25 8:59 ` Magnus Karlsson
2022-01-24 16:55 ` [PATCH bpf-next v4 2/8] ice: xsk: force rings to be sized to power of 2 Maciej Fijalkowski
2022-01-25 9:06 ` Magnus Karlsson
2022-01-25 11:23 ` Alexander Lobakin
2022-01-25 11:28 ` Maciej Fijalkowski
2022-01-25 11:42 ` Alexander Lobakin
2022-01-25 11:49 ` Maciej Fijalkowski
2022-01-25 12:00 ` Alexander Lobakin
2022-01-25 15:01 ` Maciej Fijalkowski
2022-01-25 15:24 ` Alexander Lobakin
2022-01-24 16:55 ` [PATCH bpf-next v4 3/8] ice: xsk: handle SW XDP ring wrap and bump tail more often Maciej Fijalkowski
2022-01-24 16:55 ` [PATCH bpf-next v4 4/8] ice: make Tx threshold dependent on ring length Maciej Fijalkowski
2022-01-25 9:09 ` Magnus Karlsson
2022-01-24 16:55 ` [PATCH bpf-next v4 5/8] i40e: xsk: move tmp desc array from driver to pool Maciej Fijalkowski
2022-01-24 16:55 ` [PATCH bpf-next v4 6/8] ice: xsk: avoid potential dead AF_XDP Tx processing Maciej Fijalkowski
2022-01-24 16:55 ` [PATCH bpf-next v4 7/8] ice: xsk: improve AF_XDP ZC Tx and use batching API Maciej Fijalkowski
2022-01-25 9:32 ` Magnus Karlsson
2022-01-25 11:23 ` Maciej Fijalkowski [this message]
2022-01-24 16:55 ` [PATCH bpf-next v4 8/8] ice: xsk: borrow xdp_tx_active logic from i40e Maciej Fijalkowski
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=Ye/dqylvNNa72wI8@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=alexandr.lobakin@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@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 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).