From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65AA6A052E; Mon, 9 Mar 2020 08:36:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF06D1BFFD; Mon, 9 Mar 2020 08:36:07 +0100 (CET) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by dpdk.org (Postfix) with ESMTP id 2AF451BFF6 for ; Mon, 9 Mar 2020 08:36:06 +0100 (CET) Received: by mail-il1-f194.google.com with SMTP id b17so7761559iln.3 for ; Mon, 09 Mar 2020 00:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OTHOHT2rV0cQ/MR23CE5n+njBh+lM4WyQIjsIBn3+I4=; b=kCXd5exylhIAkIT4sKR8a2moUTSOQV5ZrwvWzmGxJ9Oz+Uw3C8BT0Lyu5zSg/z6GN0 McL9rcXJ/748G7o39KBzs6kZOmL9WpDiASJXfwM92IZCGd6PQx1rxN+PG+W54IfLY9BN aeG+SgrqHyYCKz1o77Fb3IK8SwFncNcFyOxgSbUGJt0j2oB6ItSxoKZ0uFvMROdSc5x6 md1L3WDodpzFg+yganr7AF5KRjJ9HVxqO05ajWqXqbmsNp1sPfK7qKTYmC/uiBUB/ag5 fkNLl6vWzfpK3HpQOn3srrXVbTSlfWLNCk+Z2taVwE4WaQEOkf4TqxK34zvnCNhc9Jaw Vlnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OTHOHT2rV0cQ/MR23CE5n+njBh+lM4WyQIjsIBn3+I4=; b=Gl9x59T6psCdYAsiVS4PZbDL26NzaWD6UhCPN2BPMe6ayQ/kJQgwFXIFXb995crM5M Dk/IRTf6v7C7u5eTcngXnZj1aFaCo/dm7fumE5pKn1z0UHDeWYJJoqxM9RMO7eFcFd1r jbCpIfCRh/0PvvsYimhLZKgELILO24vlhHyYsaL/S5Yuka4rTWl7tlY51bGW9NhXe5e3 7LN+4JURFbjvSVk/iJmRTXcfWVyf2br9wAviQ6Kx+jGLlcst7aTyf2ttFOqKuicpw/HX HjKbI3nBPmCvVzrQFefYTlZsQjkzQPNcMzHhdtwcYDxZS/PVaiBxVL8/igwM1D9WeYeg KljQ== X-Gm-Message-State: ANhLgQ2ruK+76ma/oh86nSXNNR+b8OIMQKbO0ZwPQ6CRnbv6KvEVcVWE 1qtfYi9egVDEysUZ1Ytp4sR1wTIIpabLdJYhDjw= X-Google-Smtp-Source: ADFU+vsRSrf+ufmAJj0G6qRnSfRiR21uFfZNdUS+pPKV9lN6s458hIUzQkuz9pR8/txAz+4Igdog3rF+PRYVPzDH0A8= X-Received: by 2002:a92:d4c8:: with SMTP id o8mr14262834ilm.162.1583739365263; Mon, 09 Mar 2020 00:36:05 -0700 (PDT) MIME-Version: 1.0 References: <20200306050427.66114-1-gavin.hu@arm.com> <20200306050427.66114-4-gavin.hu@arm.com> In-Reply-To: From: Jerin Jacob Date: Mon, 9 Mar 2020 13:05:49 +0530 Message-ID: To: Gavin Hu Cc: dpdk-dev , nd , David Marchand , "thomas@monjalon.net" , "jerinj@marvell.com" , "Ye, Xiaolong" , Honnappa Nagarahalli , Ruifeng Wang , Phil Yang , Joyce Kong , Steve Capper Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v1 3/3] net/i40e: auto-vectorization to speed up Tx free 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sat, Mar 7, 2020 at 8:34 PM Gavin Hu wrote: > > Hi Jerin, > > > -----Original Message----- > > From: Jerin Jacob > > Sent: Friday, March 6, 2020 3:45 PM > > To: Gavin Hu > > Cc: dpdk-dev ; nd ; David Marchand > > ; thomas@monjalon.net; > > jerinj@marvell.com; Ye, Xiaolong ; Honnappa > > Nagarahalli ; Ruifeng Wang > > ; Phil Yang ; Joyce Kong > > ; Steve Capper > > Subject: Re: [dpdk-dev] [PATCH v1 3/3] net/i40e: auto-vectorization to > > speed up Tx free > > > > On Fri, Mar 6, 2020 at 10:35 AM Gavin Hu wrote: > > > > > > Tx mbuf free is a hotspot for i40e on aarch64, as there are no > > > inter-loop dependencies, it is safe to enable auto-vectorization > > > to speed up. > > > > > > This patch showed 2~3% performance lift on ThunderX2 and no > > degradation > > > on Arm N1SDP. The test case is single core RFC2544 zero-loss test. > > > > > > Signed-off-by: Gavin Hu > > > Reviewed-by: Steve Capper > > > --- > > > drivers/net/i40e/i40e_rxtx_vec_common.h | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h > > b/drivers/net/i40e/i40e_rxtx_vec_common.h > > > index 0e6ffa007..fc0fa45d4 100644 > > > --- a/drivers/net/i40e/i40e_rxtx_vec_common.h > > > +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h > > > @@ -98,6 +98,11 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) > > > if (likely(m != NULL)) { > > > free[0] = m; > > > nb_free = 1; > > > +#if defined(__clang__) > > > +#pragma clang loop vectorize(assume_safety) > > > +#elif defined(__GNUC__) > > > +#pragma GCC ivdep > > > +#endif > > > > IMO, It is better to abstract the compiler features (above compiler > > feature and __restrict__) as macros in > > rte_common.h or so. It will help to support other compilers(ICC or > > Windows) and enable them to have "changes" in one place. > > How about defining RTE_LOOP_AUTO_VECTORIZATION in the rte_common.h? Other compiler stuff in rte_common.h are starting with __rte in small letter(__rte_packed, __rte_unused) etc. I think, a better name would be __rte_loop_auto_vectorize or so. No strong opinion for the name though. # Probably it is worth checking and add performance result of x86 testing in git commit as well as it is common code. > #if defined(__clang__) > define RTE_LOOP_AUTO_VECTORIZATION \ > #pragma clang loop vectorize(assume_safety) > #elif defined(__GNUC__) > define RTE_LOOP_AUTO_VECTORIZATION \ > #pragma GCC ivdep > #else > define RTE_LOOP_AUTO_VECTORIZATION > #endif > If you agree, I will submit a v2. Thanks for your comments! > /Gavin > > > > > > > > > for (i = 1; i < n; i++) { > > > m = rte_pktmbuf_prefree_seg(txep[i].mbuf); > > > if (likely(m != NULL)) { > > > -- > > > 2.17.1 > > >