netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"leon@kernel.org" <leon@kernel.org>
Subject: Re: [PATCH net-next 3/3] net/mlx5e: use indirect calls wrapper for the rx packet handler
Date: Mon, 03 Jun 2019 11:55:12 +0200	[thread overview]
Message-ID: <94e7d8feb29bf7d7b2add710a997bc095990a019.camel@redhat.com> (raw)
In-Reply-To: <1b740c86d3917640657934961b40fe4b288c2a40.camel@mellanox.com>

On Fri, 2019-05-31 at 18:41 +0000, Saeed Mahameed wrote:
> On Fri, 2019-05-31 at 14:53 +0200, Paolo Abeni wrote:
> > We can avoid another indirect call per packet wrapping the rx
> > handler call with the proper helper.
> > 
> > To ensure that even the last listed direct call experience
> > measurable gain, despite the additional conditionals we must
> > traverse before reaching it, I tested reversing the order of the
> > listed options, with performance differences below noise level.
> > 
> > Together with the previous indirect call patch, this gives
> > ~6% performance improvement in raw UDP tput.
> > 
> 
> Nice ! I like it.
> 
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > ---
> >  drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> > index 0fe5f13d07cc..c3752dbe00c8 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> > @@ -1333,7 +1333,9 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int
> > budget)
> >  
> >  		mlx5_cqwq_pop(cqwq);
> >  
> > -		rq->handle_rx_cqe(rq, cqe);
> > +		INDIRECT_CALL_4(rq->handle_rx_cqe,
> > mlx5e_handle_rx_cqe_mpwrq,
> > +				mlx5e_handle_rx_cqe,
> > mlx5e_handle_rx_cqe_rep,
> > +				mlx5e_ipsec_handle_rx_cqe, rq, cqe);
> 
> you missed mlx5i_handle_rx_cqe, anyway don't add INDIRECT_CALL_5 :D
> 
> just replace mlx5e_handle_rx_cqe_rep with mlx5i_handle_rx_cqe, 
> mlx5e_handle_rx_cqe_rep is actually a slow path of switchdev mode.

Thank you! This is exactly the kind of feedback I was looking for! I
hoped some of the options was less relevant than the other, but I do
not know the driver well enough to guess. Also I missed completely
mlx5i_handle_rx_cqe, as you noded.

> Maybe define the list somewhere in en.h where it is visible for every
> one:
> 
> #define MLX5_RX_INDIRECT_CALL_LIST \
> mlx5e_handle_rx_cqe_mpwrq, mlx5e_handle_rx_cqe, mlx5i_handle_rx_cqe,
> mlx5e_ipsec_handle_rx_cqe
> 
> and here:
> INDIRECT_CALL_4(rq->handle_rx_cqe, MLX5_RX_INDIRECT_CALL_LIST, rq,
> cqe);

Will do in v2, unless this patch will be dropped, please see my reply
to patch 2/3.

Thanks,

Paolo


      reply	other threads:[~2019-06-03  9:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 12:53 [PATCH net-next 0/3] net/mlx5: use indirect call wrappers Paolo Abeni
2019-05-31 12:53 ` [PATCH net-next 1/3] net/mlx5e: use indirect calls wrapper for skb allocation Paolo Abeni
2019-05-31 12:53 ` [PATCH net-next 2/3] indirect call wrappers: add helpers for 3 and 4 ways switch Paolo Abeni
2019-05-31 18:30   ` Saeed Mahameed
2019-06-03  9:51     ` Paolo Abeni
2019-06-03 22:27       ` Saeed Mahameed
2019-06-05  8:35         ` Paolo Abeni
2019-05-31 12:53 ` [PATCH net-next 3/3] net/mlx5e: use indirect calls wrapper for the rx packet handler Paolo Abeni
2019-05-31 18:41   ` Saeed Mahameed
2019-06-03  9:55     ` Paolo Abeni [this message]

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=94e7d8feb29bf7d7b2add710a997bc095990a019.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    /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).