From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 7282D7D19 for ; Mon, 23 Oct 2017 09:00:28 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id b9so1945312wmh.0 for ; Mon, 23 Oct 2017 00:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=LSm6eSREIagrlqyQygdUu5HM7Qo5PDq/r7lgrynsmsk=; b=QpTUsPj9rZFKj1FNj9kN5CjUBerqBKu+fwA4Y9ajYiZFK5CKjlN+3zpsVQgi7f2be1 adUY1ZNRinLynKEMO1DGMCi++lAtwo5e5Et0JATNtLISYs0iyZNujCr4OA2FS+ITgEMj OZhEGi6Wu5UCedLBzg80yJml0Lu+WiWEjgSN5vsM0/7ALM5+u4IX0d1pDTwxPRS6Vo82 WMC2E/GBlvVrQ9FYSKPhEpHfWvtSqbhJaiYwie/+MzyHUGN7/5LiN/MSVjbQUb1uxDii 5Mn2gqHxM8KMTzKbGBN02V8RIP5oMpw2S+QcpK5EhCJAvWsj1h6aXSljq9coybIdvzWp 1HwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=LSm6eSREIagrlqyQygdUu5HM7Qo5PDq/r7lgrynsmsk=; b=nd/BLMfdw+LQu995wRyuLWR8UYmA3FlUp/xaugNAY+zCdlnY4Bmdz62WSw5hmV5GST nmiYwl64u37WoiuIrflvNoJvjk/IqwkP+1HDPWnzPYCverxf+5bhoXuA3udXtZ9RHx+A pW0eWzI0d7sVgty3vf3XaHpIaxuq89MqMF+svuR1/7ELFE2Z4JapaaLDHw2DgEOso/EB EBN5Ep9DhZH3wls6C86KMrsW5BQ1CTuwgcBV9QxU7sOCStXfw4eRzLHWoyZuw0z7gYEE YoVtsZOGKX/WKnUf9MHevqMyp9P8EAWT/czKqMFzVuXANlAxpsqaFuZxu9ZHubZSpvRn BNGg== X-Gm-Message-State: AMCzsaUNIfSDYJNSrsKgveqff4/wnQCLMd4ssBo85eiHYOWFusEVBgLq oP1VRUU58gfajZH5Dz5lO3AL2ZLukA== X-Google-Smtp-Source: ABhQp+R/dIDeUh+2hRHRrwRCPXGN/doKIjTy0wDa0j7ls/eT9AUbC8J+Myha0D7+Oajf4S6BxWlmsQ== X-Received: by 10.80.183.148 with SMTP id h20mr15503785ede.178.1508742028046; Mon, 23 Oct 2017 00:00:28 -0700 (PDT) Received: from laranjeiro-vm (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i61sm5604198edc.32.2017.10.23.00.00.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 00:00:27 -0700 (PDT) From: "=?iso-8859-1?Q?N=E9lio?= Laranjeiro" X-Google-Original-From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Date: Mon, 23 Oct 2017 09:00:21 +0200 To: Yongseok Koh Cc: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, dev@dpdk.org, stable@dpdk.org, Sagi Grimberg , Alexander Solganik Message-ID: <20171023070021.wlajjzyrfrs7qrve@laranjeiro-vm> References: <20171022080022.13528-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171022080022.13528-1-yskoh@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix Tx doorbell memory barrier X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 07:00:28 -0000 On Sun, Oct 22, 2017 at 01:00:22AM -0700, Yongseok Koh wrote: >[...] > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -584,9 +584,11 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb) > * Pointer to TX queue structure. > * @param wqe > * Pointer to the last WQE posted in the NIC. > + * @param mb > + * Request for write memory barrier after BF update. BF should be replaced by its real name i.e. BlueFlame. If the mb is only related to the BlueFlame, why not naming it mbbf or bfmf? > */ > static __rte_always_inline void > -mlx5_tx_dbrec(struct mlx5_txq_data *txq, volatile struct mlx5_wqe *wqe) > +mlx5_tx_dbrec(struct mlx5_txq_data *txq, volatile struct mlx5_wqe *wqe, int mb) > { > uint64_t *dst = (uint64_t *)((uintptr_t)txq->bf_reg); > volatile uint64_t *src = ((volatile uint64_t *)wqe); > @@ -596,6 +598,8 @@ mlx5_tx_dbrec(struct mlx5_txq_data *txq, volatile struct mlx5_wqe *wqe) > /* Ensure ordering between DB record and BF copy. */ > rte_wmb(); > *dst = *src; > + if (mb) > + rte_wmb(); > } My last point, this modification seems necessary only for the MPS vector case, why not adding a new function for this specific case instead? At least I would suggest to create an enum with the possible values it helps to read the source: enum mlx5_blueflame_mb { MLX5_BLUEFLAME_MB_DIS, MLX5_BLUEFLAME_MB_EN, } you can also create wrappers for the function to avoid this extract argument in the tx code: mlx5_tx_dbrec_bfmb(txq, wqe); mlx5_tx_dbrec_no_bfmb(txq, wqe); Multiple ways instead of having 0 or 1 hard coded. Thanks, -- Nélio Laranjeiro 6WIND