From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v2 4/8] net/mlx4: optimize Tx multi-segment case Date: Wed, 6 Dec 2017 17:22:14 +0100 Message-ID: <20171206162214.GG4062@6wind.com> References: <1511871570-16826-1-git-send-email-matan@mellanox.com> <1512571693-15338-1-git-send-email-matan@mellanox.com> <1512571693-15338-5-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Matan Azrad Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id C198C293B for ; Wed, 6 Dec 2017 17:22:27 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id f140so8064790wmd.2 for ; Wed, 06 Dec 2017 08:22:27 -0800 (PST) Content-Disposition: inline In-Reply-To: <1512571693-15338-5-git-send-email-matan@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Dec 06, 2017 at 02:48:09PM +0000, Matan Azrad wrote: > mlx4 Tx block can handle up to 4 data segments or control segment + up > to 3 data segments. The first data segment in each not first Tx block > must validate Tx queue wraparound and must use IO memory barrier before > writing the byte count. > > The previous multi-segment code used "for" loop to iterate over all > packet segments and separated first Tx block data case by "if" > statements. > > Use switch case and unconditional branches instead of "for" loop can > optimize the case and prevents the unnecessary checks for each data > segment; This hints to compiler to create optimized jump table. > > Optimize this case by switch case and unconditional branches usage. > > Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil -- Adrien Mazarguil 6WIND