From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id A5B0E2BB9 for ; Fri, 9 Jun 2017 13:59:43 +0200 (CEST) Received: by mail-wr0-f169.google.com with SMTP id q97so30581446wrb.2 for ; Fri, 09 Jun 2017 04:59:43 -0700 (PDT) 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=GZozhJNEPIFF/2hFawv/53nF2l7Zr/wH+LUQ4xGrTNk=; b=yOOO8I1x5ZoX3SuWIBd+XP7+1xCS1xMi2fkaQWXbaAojwWJ7qqM9v4qWPMwxS7fQjn BJXn9sx3fefAlv+ZZkpuNSfakowjDX+2zSzqb/pHPtvc9e2lNmF38wdbP4qSixfAgBAq 9L12TXnC22DgOZrs5yQiC6Q9KHgHnPh31MCZ8iVZFwX+IukI5XiTEDMG7NESA9J3KC2n MTwpFYNqW3ft4GxEywbUEwgn72oKi7ITM1ru9R0LK2rxCRyKeWUvXAYlfxp+nXarlMbb 6XJP9b2jyy9pZG3ye0R/UNAJm4iK0di51j9QEObp1H72/77XA889HWtTd1+nFDJrmMs0 OnDA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GZozhJNEPIFF/2hFawv/53nF2l7Zr/wH+LUQ4xGrTNk=; b=o7rbxlol8aiUNFDRWQvNdKPpHHL5Yrn/sEjnzWpU++JKQQMhQ7GUeWHw2E5laZ8n7U WWoK6cugjxaH6lZCgm/J0/lIeHFLv3PeyQM+Qyr6jG9u3bgLavoYS2GQbZPr0Ah8nKMc jAxCqZ3zw3WEHan62Qrkx4fqxmTnso8SPSp5uNLOqQmlOLKmnJXp3xyRpecblY52VzYn RLOH5nDxDwBG4ClsF1XeGcwfpxbaXG3ndRz+nRA9de1mz/EhAtb4kVb8rQ/6CvsTS9jZ 4BaODwNbWNSMZIEUl3IzS80kv1vICz2LsgST3HJF1c1EOm62iJrpxUtEpFAaDpnvHwp7 VeTA== X-Gm-Message-State: AODbwcAT2yn1+Ro5YlHBwD+Yubm/6pWn8bflZoHMJz92r5Lo5Cy593Wg ZEtXnMwIQpw8RfMsrgc= X-Received: by 10.28.4.21 with SMTP id 21mr4735447wme.24.1497009583357; Fri, 09 Jun 2017 04:59:43 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id o200sm1577058wmg.22.2017.06.09.04.59.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Jun 2017 04:59:43 -0700 (PDT) Date: Fri, 9 Jun 2017 13:59:40 +0200 From: Olivier Matz To: Ferruh Yigit Cc: Shijith Thotton , dev@dpdk.org Message-ID: <20170609135940.0c20c0e6@platinum> In-Reply-To: <8a2d812e-846b-73fd-4418-6da5738005d5@intel.com> References: <1496920971-9400-1-git-send-email-shijith.thotton@caviumnetworks.com> <8a2d812e-846b-73fd-4418-6da5738005d5@intel.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/liquidio: do not touch mbuf initialized fields 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: Fri, 09 Jun 2017 11:59:43 -0000 Hi Ferruh, On Fri, 9 Jun 2017 12:24:56 +0100, Ferruh Yigit wrote: > On 6/8/2017 12:22 PM, Shijith Thotton wrote: > > Avoid re-initializing of mbuf fields which are set while in pool. > > Replaced lio_recv_buffer_alloc with rte_pktmbuf_alloc. > > > > See commit 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool"). > > > > Signed-off-by: Shijith Thotton > > <...> > > > @@ -489,9 +466,6 @@ > > droq->refill_count++; > > > > if (likely(nicbuf != NULL)) { > > - nicbuf->data_off = RTE_PKTMBUF_HEADROOM; > > Hi Shijith, Olivier, > > nb_segs and next are initialized properly when mbuf allocated, but is > "data_off = RTE_PKTMBUF_HEADROOM" guaranteed? > > > - nicbuf->nb_segs = 1; > > - nicbuf->next = NULL; > > /* We don't have a way to pass flags yet */ > > nicbuf->ol_flags = 0; > > if (rh->r_dh.has_hash) { > > <...> It's not guaranteed when using a raw allocation, i.e. rte_mbuf_raw_alloc() or rte_mempool_get(). The PMD usually use these functions in Rx path to fully initialize the mbuf fields on their own. In this driver, it looks it uses rte_pktmbuf_alloc(), which calls rte_pktmbuf_reset(), fully initializing the mbuf struct. So data_off is properly set. As a side note, I wonder if lio_recv_buffer_alloc() replaced by rte_pktmbuf_alloc() everywhere in the code. Olivier