All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: WangDong <dong.wang.pro-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>,
	"dev-VfR2kkLFssw@public.gmane.org"
	<dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [PATCH] ixgbe:Add write memory barrier for recv pkts.
Date: Tue, 14 Apr 2015 22:50:15 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB97725821415A3A@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <BLU436-SMTP1791A6BD70260D97089EDBFBFF90-MsuGFMq8XAE@public.gmane.org>

Hi,

> -----Original Message-----
> From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of WangDong
> Sent: Saturday, April 11, 2015 4:34 PM
> To: dev-VfR2kkLFssw@public.gmane.org
> Subject: [dpdk-dev] [PATCH] ixgbe:Add write memory barrier for recv pkts.
> 
> Like transmit packets, before update receive descriptor's tail pointer, rte_wmb() should be added after writing recv descriptor.
> 
> Signed-off-by: Dong Wang <dong.wang.pro-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
> ---
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> index 9da2c7e..d504688 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> @@ -1338,6 +1338,9 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>  		 */
>  		rx_pkts[nb_rx++] = rxm;
>  	}
> +
> +	rte_wmb();
> +

Why do you think it is necessary?
I can't see any good reason to put wmb() here.
I would understand if, at least you'll try to insert it just before updating RDT:
 rx_id = (uint16_t) ((rx_id == 0) ?
                                     (rxq->nb_rx_desc - 1) : (rx_id - 1));
+ rte_wmb();
IXGBE_PCI_REG_WRITE(rxq->rdt_reg_addr, rx_id);

That is not needed IA with current implementation, but would make sense for machines with relaxed memory ordering.
Though right now DPDK IXGBE PMD is supported only on IA,  anyway.
Same for ixgbe_recv_scattered_pkts().

Konstantin


>  	rxq->rx_tail = rx_id;
> 
>  	/*
> @@ -1595,6 +1598,8 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>  		first_seg = NULL;
>  	}
> 
> +	rte_wmb();
> +
>  	/*
>  	 * Record index of the next RX descriptor to probe.
>  	 */
> --
> 1.9.1

  parent reply	other threads:[~2015-04-14 22:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11 15:33 [PATCH] ixgbe:Add write memory barrier for recv pkts WangDong
     [not found] ` <BLU436-SMTP1791A6BD70260D97089EDBFBFF90-MsuGFMq8XAE@public.gmane.org>
2015-04-14 22:50   ` Ananyev, Konstantin [this message]
     [not found]     ` <2601191342CEEE43887BDE71AB97725821415A3A-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-04-15 13:46       ` Dong.Wang
     [not found]         ` <BLU436-SMTP22AEE6E7C0129FF42E71B2BFE50-MsuGFMq8XAE@public.gmane.org>
2015-04-15 16:06           ` Stephen Hemminger
2015-04-16 11:29             ` Wang Dong
2015-04-15 22:52           ` Ananyev, Konstantin
     [not found]             ` <2601191342CEEE43887BDE71AB97725821415E37-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-04-16 11:36               ` Wang Dong
     [not found]                 ` <BLU436-SMTP198103C46C2C7C9EBA5C96ABFE40-MsuGFMq8XAE@public.gmane.org>
2015-04-16 15:14                   ` Ananyev, Konstantin
     [not found]                     ` <2601191342CEEE43887BDE71AB9772582141626B-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-04-16 15:55                       ` David Marchand
2015-05-05 15:52                       ` Dong Wang
2015-04-16 15:55 Dong Wang
2015-04-16 15:58 Dong Wang

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=2601191342CEEE43887BDE71AB97725821415A3A@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=dong.wang.pro-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.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.