From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by dpdk.org (Postfix) with ESMTP id 6E4974A63 for ; Tue, 3 Nov 2015 19:53:49 +0100 (CET) Received: by igbhv6 with SMTP id hv6so19150832igb.0 for ; Tue, 03 Nov 2015 10:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infiniteio_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rQWBlRq9EbjLcmXzOycg60jmZEFkJT0RK5GDwOgaSDY=; b=0Z+9SEVs/IoJ0K/UHTD1ftPvlki8uo0q0+8NeHhOi+9PMe02nN3FqTdlzamqH9aEFP WPydU+VBc/8iDZ0lytraroGik/zOaW1OFcDvVqH7+Rxa/Nrn6xwDpIt5cOqNLAa0RrqB eFtnPLO33idbpZSe5KARRsejpO8zPWD53pG87xExdnfBGdMmIajTkYc7+Tmez7n6VeJJ 9Y3iz9JioM6TDg3BG6yo6xXqqeVvXyw8u56YdSn/wRhK268Ad2UsQHEAccBuwBbHX2wm MYRIiUtQcVO12OKqDPxbv0PHaRIEd5bQlAgAFg/uLFVrktuDUED72ZfxlcEsd/EhWD/b Xr7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rQWBlRq9EbjLcmXzOycg60jmZEFkJT0RK5GDwOgaSDY=; b=KvunkhIutLlAmMg57zAjdZ64ZWqhe7Iw9JHuq+1WudSi6iTAQkGCqMSTKo5soPvJrw MxinkWuO7rTMHVmiiLFhSBd3lrwgukWAUjN+MTDNDbk7bYzSI1cvKuBp6UpszCuyFJDz ItiULLu92jeQShY1pFEliSNiqIdFX9++MjNq4yr62ZWIFUzUoLH1i23V7XhiCbi4sAoy PW8zfYG6ptKhj+1EDsKoSlbBVKmIwVwB293SA9IM93fsnDu/vx7PU5sEZF1RIJnohMKm 9DgqnXNRBkGJc95YqQLCuIBU4QtdCB01lrfHmm3LIOM3Lt4hmlcn/4JEyvFapIygSeZ5 m3Tg== X-Gm-Message-State: ALoCoQm+jcDo9GovprV1F6gFXw9dCcRMYSeYIPR+NWDmZVHiyJ4CB4toPwwMPMIWSADhUfAK/1Yl MIME-Version: 1.0 X-Received: by 10.50.50.232 with SMTP id f8mr14213925igo.95.1446576828922; Tue, 03 Nov 2015 10:53:48 -0800 (PST) Received: by 10.107.201.76 with HTTP; Tue, 3 Nov 2015 10:53:48 -0800 (PST) In-Reply-To: <1446572959.590162182@f422.i.mail.ru> References: <1446572959.590162182@f422.i.mail.ru> Date: Tue, 3 Nov 2015 12:53:48 -0600 Message-ID: From: Matt Laswell To: =?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCh0LDQvNC+0LnQu9C+0LI=?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: users Subject: Re: [dpdk-users] A question about rte_pktmbuf_init() and alike functions X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2015 18:53:49 -0000 The init functions are called once per object at initialization time, not at allocation time. From a performance perspective, this is preferable, though it leaves a dependency on the application to do subsequent initialization when the object is allocated or when it is freed. -- Matt Laswell Principal Software Engineer, infinite io laswell@infiniteio.com On Tue, Nov 3, 2015 at 11:49 AM, =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD= =D0=B4=D1=80 =D0=A1=D0=B0=D0=BC=D0=BE=D0=B9=D0=BB=D0=BE=D0=B2 wrote: > Hi all. I'm sorry if the question is naive or stupid, but still I > couldn't find the answer in the manual. > > The question is: are the element init functions called just once (with th= e > mempool creation) or are they called each time we retrieve a new element > from a pool? I'm asking because I use a mempool pool with pkt_mbuf > structures for generating new Ethernet frames (with IP and TCP data) and = it > works just fine for a while (I reckon just as long as I'm getting a new > pktmbuf with rte_pktmbuf_alloc and not a recycled one) and at some point = my > generated frames start to have the wrong TCP ckecksum (even though TCP > checksum it totally OK at first). And the strange thing is that if, for > instance, mempool has 2048 elements - my program works for 5 seconds > (rough estimate), and if mempool has 4096 elements - my program works for > 10 seconds. The connection is obvious. I used to believe that init() > functions are called each time we retrieve an element from a mempool, but > now I'm not so sure. > > > Alex Samoylov