DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>
Subject: Re: [dpdk-dev] [PATCH 2/2] mbuf: make sure userdata is initialized
Date: Fri, 10 Jul 2015 10:32:17 +0100	[thread overview]
Message-ID: <20150710093217.GB10556@bricha3-MOBL3> (raw)
In-Reply-To: <1436485068-30609-3-git-send-email-stephen@networkplumber.org>

On Thu, Jul 09, 2015 at 04:37:48PM -0700, Stephen Hemminger wrote:
> From: Stephen Hemminger <shemming@brocade.com>
> 
> For applications that use m->userdata the initialization can
> be a signficant (10%) performance penalty.
> 
> Rather than taking the cache penalty of initializing userdata
> in the receive handling, do it in the place where mbuf is
> already cache hot and being setup.

Should the management of the userdata field not be the responsibility of the
app itself, rather than having the PMD manage it? If the PMD does manage the
userdata field, I would suggest taking the approach of having the field cleared
by the mbuf library on free, rather than on RX.

> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/net/cxgbe/sge.c               | 1 +
>  drivers/net/e1000/em_rxtx.c           | 2 ++
>  drivers/net/e1000/igb_rxtx.c          | 2 ++
>  drivers/net/enic/enic_main.c          | 2 ++
>  drivers/net/fm10k/fm10k.h             | 1 +
>  drivers/net/i40e/i40e_rxtx.c          | 4 ++++
>  drivers/net/ixgbe/ixgbe_rxtx.c        | 4 ++++
>  drivers/net/ixgbe/ixgbe_rxtx_vec.c    | 1 +
>  drivers/net/virtio/virtio_rxtx.c      | 3 +++
>  drivers/net/vmxnet3/vmxnet3_rxtx.c    | 1 +
>  drivers/net/xenvirt/rte_eth_xenvirt.c | 1 +
>  lib/librte_mbuf/rte_mbuf.h            | 1 +
>  12 files changed, 23 insertions(+)
> 
<snip>
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> index 912d3b4..d73d8dc 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> @@ -742,6 +742,7 @@ ixgbe_rxq_vec_setup(struct ixgbe_rx_queue *rxq)
>  
>  	mb_def.nb_segs = 1;
>  	mb_def.data_off = RTE_PKTMBUF_HEADROOM;
> +	mb_def.userdata = NULL;
>  	mb_def.port = rxq->port_id;
>  	rte_mbuf_refcnt_set(&mb_def, 1);
>  

This won't actually work for the vector PMD. The userdata field is not covered
by the "rearm_data" part of the mbuf.

/Bruce

  reply	other threads:[~2015-07-10  9:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 23:37 [dpdk-dev] [PATCH 0/2] mbuf: improvements Stephen Hemminger
2015-07-09 23:37 ` [dpdk-dev] [PATCH 1/2] mbuf: Add rte_pktmbuf_copy Stephen Hemminger
2015-07-15 10:14   ` Olivier MATZ
2016-01-22 13:40   ` Mrzyglod, DanielX T
2016-01-22 17:33     ` Stephen Hemminger
2016-03-18 17:03       ` Pattan, Reshma
2016-03-18 17:40         ` Stephen Hemminger
2016-02-03 17:23     ` Olivier MATZ
     [not found]     ` <ccbdb829556f4423b009aff93f27c93b@BRMWP-EXMB11.corp.brocade.com>
2016-02-04  0:49       ` Stephen Hemminger
2015-07-09 23:37 ` [dpdk-dev] [PATCH 2/2] mbuf: make sure userdata is initialized Stephen Hemminger
2015-07-10  9:32   ` Bruce Richardson [this message]
2015-07-10 15:43     ` Stephen Hemminger
2015-07-15 10:10       ` Olivier MATZ
2016-02-03 17:23       ` Olivier MATZ

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=20150710093217.GB10556@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=shemming@brocade.com \
    --cc=stephen@networkplumber.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).