From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f193.google.com (mail-io0-f193.google.com [209.85.223.193]) by dpdk.org (Postfix) with ESMTP id C2C3EFB10 for ; Thu, 19 Jan 2017 00:32:43 +0100 (CET) Received: by mail-io0-f193.google.com with SMTP id q20so3307478ioi.3 for ; Wed, 18 Jan 2017 15:32:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=WVGHRx/tFV4ApuO9z0uShZbeqe947FlI3Z8M3J0TNPQ=; b=kA1tWHHRP3kk8pGCuOJ66la5EHoisTCdNK3jYtJ62Qi06wncKReMdLYo3X38Btiy53 UQZV64hZoys6Yt6PBXaMeJjIx5AKlSp4tYHvrfqm0ykK/vuuzeSJEkDlhCR6XJiu132p 90O7HgI0n8jH9vuK3I3kJTaRc3GLaBwy0erXSUVexPSzOWj8abbkxewdEcBZsU/GnLeS d5YnyKGhSS74PpFjelG9p/W6tx63eHCmVfukGJ3SMUrltHy8gmmsZQUmToHxtYJHWDXn EwEKY/+MqrHMvp6wZL7RZpQ3CuaKn/LG+dupHaAbvhGF4I0WWtVmLcNy8/lgVRJEkoBt isBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=WVGHRx/tFV4ApuO9z0uShZbeqe947FlI3Z8M3J0TNPQ=; b=QMyX5Yn5yMm0UPQ484/IxqXeyMpFeMasyGdxvzvGoXlg8atWliO34mCDFltGBOi0JF A7J77Hcr6RWEpMbt5Oa93tH0I0sILZgIaTEkoHoUUk+FmHkeUPLCgdKIuvDgOa3NvtCW 25vt7wlETajdRKP/sY3815QiLUc4ZMIO8q2uLcadzJw4xdfefJhVBClUH+PRfhKnCPd2 0TKrY0Bd1SXevHyXtvz0kekao/X3O42JwzoHLJP+P19aP53DQu3GUsqy69KKpjxaQJOQ j7b6t9X3/I39WhbUWs+vOmfFcqr7ftqIAGjM0U1HV5MZVic1GOKerqHh5jNhtqh2jCjI +HOA== X-Gm-Message-State: AIkVDXJXoYRSHPJSZ6N6Lc1Tn7MMk6syO1zKvVKcSppXn8U5dI+KlDSpiY5I+3R8We6izB4CnwGY3NP4rjJNHA== X-Received: by 10.107.197.69 with SMTP id v66mr5885096iof.119.1484782362959; Wed, 18 Jan 2017 15:32:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.148.40 with HTTP; Wed, 18 Jan 2017 15:32:22 -0800 (PST) In-Reply-To: <1484735282-14876-3-git-send-email-s.vyazmitinov@brain4net.com> References: <1484735282-14876-1-git-send-email-s.vyazmitinov@brain4net.com> <1484735282-14876-3-git-send-email-s.vyazmitinov@brain4net.com> From: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Date: Thu, 19 Jan 2017 00:32:22 +0100 Message-ID: To: Sergey Vyazmitinov Cc: olivier.matz@6wind.com, konstantin.ananyev@intel.com, stephen@networkplumber.org, yuanhan.liu@linux.intel.com, ferruh.yigit@intel.com, dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v4 2/2] kni: Use bulk functions to allocate and free mbufs 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, 18 Jan 2017 23:32:44 -0000 2017-01-18 11:28 GMT+01:00 Sergey Vyazmitinov = : > Optimized kni_allocate_mbufs and kni_free_mbufs by using mbuf bulk > functions. This can improve performance more than two times. > > Signed-off-by: Sergey Vyazmitinov > --- > lib/librte_kni/rte_kni.c | 46 +++++++++++++++++++++----------------= ------ > lib/librte_kni/rte_kni_fifo.h | 18 +++++++++++++++++ > 2 files changed, 40 insertions(+), 24 deletions(-) > > diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c > index a80cefd..ad746ad 100644 > --- a/lib/librte_kni/rte_kni.c > +++ b/lib/librte_kni/rte_kni.c [...] > + /* Check if any mbufs not put into alloc_q, and then free them */ > + if (unlikely(put < count)) { > + for (unsigned int j =3D put; j < count; j++) { > + RTE_LOG(ERR, KNI, "Free allocated buffer\n"); > rte_pktmbuf_free(pkts[j]); > + } This could also use bulk free, even if only to shave two lines of code. Best Regards, Micha=C5=82 Miros=C5=82aw