From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 768E9293B for ; Wed, 6 Dec 2017 17:22:42 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id v22so4530801wrb.0 for ; Wed, 06 Dec 2017 08:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tdqXMJZLCrn2eDS5jkLoBdVP85Tc4l5BFUmThSYXJ+w=; b=McRRFpnntSk8ZwYjonkczLfT8xQIJ3T26lkpiknf4j4AuHg53sQ//0QYLAC6Dfl591 Si4xdHFJhZfHLN66okFdoK4fro9CBfzoXzK6uktpasd27tgfC0xJ6I3UeN81mX43d13S CA2zikYwOOOD8+OzFbrvo/GCwcAj1goYw9rWt3z9jcM4hODFhFnwo6GF7pwO4zlFXxSy LSROpMLrRFsj5ceK5bz6W/kV3DL+t9il5b2pbnql54TgyYno8kjiWJB8w3ARzRcX2Xif 1UNKxO39Ui/aEn6RwHSsYGq/xv2zwEnJhcDr5YFru1SxUMNZTYoDgRSW5/kxnJUKiU8Y 7SgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tdqXMJZLCrn2eDS5jkLoBdVP85Tc4l5BFUmThSYXJ+w=; b=Q6OGjWGzARuB5zOw+Av2Dktbl4Otrl1j9v7YKTpqDlmXXoDdYDfRjAnSkzeQSDfTOR 07pQJ56s92li5iwK0U2jmCTO+dqiNo4U71QXV55Qh7k+pYhbHF27nb/BH0i4criszrRU 3gug3ygp9P4/iPbMxidIDM/RhR6dmr0DhciKKB9K9UgTAEQJQyiSxKDReftxxcsOYUSI G4dMVm4HP3+PWxO/qt2Q8jBh8Q7MhLTay0vG6eN3YKlpwi2GOaMiIHsIeZapXMuJ13Z7 QTC+OfjnuzzOz9s+Oyuq0gjLpSfhR4FM0nrCpUEcUpfocPPUPhPG73BWiehmyyCWwh1d LH8A== X-Gm-Message-State: AKGB3mIjeWE8LuN9mUF+qE68J3TvJbzYO3EcI5zMjUJh6Vy0IK4GsIIe SFG+xTU6XexM1mC5Jr0mYB2XXc4y X-Google-Smtp-Source: AGs4zMYcrZWO+zqnouigVPR277qYFuMYgLryclKqkytNjcKotTYmD3VKZyTlGSkv1jxjpkAoacWULg== X-Received: by 10.223.182.73 with SMTP id i9mr13599238wre.113.1512577362095; Wed, 06 Dec 2017 08:22:42 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c19sm337237wmd.5.2017.12.06.08.22.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 08:22:41 -0800 (PST) Date: Wed, 6 Dec 2017 17:22:29 +0100 From: Adrien Mazarguil To: Matan Azrad Cc: dev@dpdk.org Message-ID: <20171206162229.GH4062@6wind.com> References: <1511871570-16826-1-git-send-email-matan@mellanox.com> <1512571693-15338-1-git-send-email-matan@mellanox.com> <1512571693-15338-6-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1512571693-15338-6-git-send-email-matan@mellanox.com> Subject: Re: [dpdk-dev] [PATCH v2 5/8] net/mlx4: merge Tx queue rings management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 16:22:42 -0000 On Wed, Dec 06, 2017 at 02:48:10PM +0000, Matan Azrad wrote: > The Tx queue send ring was managed by Tx block head,tail,count and mask > management variables which were used for managing the send queue remain > space and next places of empty or completed work queue entries. > > This method suffered from an actual addresses recalculation per packet, > an unnecessary Tx block based calculations and an expensive dual > management of Tx rings. > > Move send queue ring calculation to be based on actual addresses while > managing it by descriptors ring indexes. > > Add new work queue entry pointer to the descriptor element to hold the > appropriate entry in the send queue. > > Signed-off-by: Matan Azrad A few more comments on this version below. > diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c > index adf02c0..2467d1d 100644 > --- a/drivers/net/mlx4/mlx4_rxtx.c > +++ b/drivers/net/mlx4/mlx4_rxtx.c > @@ -61,9 +61,6 @@ > #include "mlx4_rxtx.h" > #include "mlx4_utils.h" > > -#define WQE_ONE_DATA_SEG_SIZE \ > - (sizeof(struct mlx4_wqe_ctrl_seg) + sizeof(struct mlx4_wqe_data_seg)) > - > /** > * Pointer-value pair structure used in tx_post_send for saving the first > * DWORD (32 byte) of a TXBB. > @@ -268,52 +265,48 @@ struct pv { > * > * @param sq > * Pointer to the SQ structure. > - * @param index > - * Index of the freed WQE. > - * @param num_txbbs > - * Number of blocks to stamp. > - * If < 0 the routine will use the size written in the WQ entry. > - * @param owner > - * The value of the WQE owner bit to use in the stamp. > + * @param wqe > + * Pointer of WQE address to stamp. Clarification on what happens on return is primarily needed here actually: @param[in, out] wqe Pointer of WQE address to stamp. This value is modified on return to store the address of the next WQE. > * > * @return > - * The number of Tx basic blocs (TXBB) the WQE contained. > + * WQE size and updates WQE address to the next WQE. You can leave the previous comment if @param wqe is properly documented. > @@ -654,7 +639,7 @@ struct pv { > > #ifndef NDEBUG > /* Poisoning. */ > - memset(elt, 0x66, sizeof(*elt)); > + memset(elt->buf, 0x66, sizeof(struct rte_mbuf)); This likely causes a crash (did you test in debug mode?) the goal is to poison the buffer address, not the entire mbuf. This should read: memset(&elt->buf, 0x66, sizeof(elt->buf)); -- Adrien Mazarguil 6WIND