From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 8E22229D1 for ; Fri, 10 Jun 2016 23:41:57 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id v199so8032876wmv.0 for ; Fri, 10 Jun 2016 14:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=PXq+tosk8AqNFdP0rOMeI4mXr4TU+CJJ0gzQa5bCAmo=; b=BFVtkFHVPW3TZfskvd7DbAnIMNPmWZbOtDYphRNv/TuC8KS8SmAlyHN0x0KHeQnamh Qn7cte0vTXPN8ISD6cBwkfoy20waYM65gTuXFDiP7JRNl0h6mSBx9etc984XTVKkvLm4 DMLW6nX7+pyE2k83SEV/Vc8icr4SOqRpVYPF4VjnUsDNIPCp6emQhpO+XRpbnQv7vGSy /G+bRKPwh6Uuuj4xjdXV6Wu3Kk/257wKSUwt+QI3q+aolKxHypaP6fzii92c6NbybJDH VV0wvRVcmsT8U6M7UTDUtk990W0tYBYlXZejkfPr4NEO48zyOAxT4t8ZpW1ot6gqD8QF f0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=PXq+tosk8AqNFdP0rOMeI4mXr4TU+CJJ0gzQa5bCAmo=; b=gP4kgNWKWbZjVF7yoF0VguSKVQ7Fb3YiIzeVxZH6bd1VJxleuaj0fPYUrxd6O+4a+b BlD97iGWF4rUA8OzdVF6HJG9sm/3iSq0DKB+2mzUkT5mhd8rmKJ8B6r0xUTlA1pyScgE t4xe1eogHFSLQ92D0+35ldh7+EaB35OOkXLu8ujteQUDF5x8R17ik99awndBH5Q6HFbe O1jW6xI1v+LcJPbh1XsXAAwF0bNmQ1pdaFtws4oD6DYLVZDeuUyww9djCTPErixXxFOX cUBvX2O70Ji+ED6UKq/eeqdona/cZABx4kK6NmYWcLgmmmvlZfPJChttKi70dHaobGfN gO3Q== X-Gm-Message-State: ALyK8tL0x6v8R/nj6PA6vb2rKfaAH+alYC2trytytdS06ngz8NXozVTLfuTR1/CHL6o5hXoK X-Received: by 10.194.9.71 with SMTP id x7mr3844266wja.62.1465594917251; Fri, 10 Jun 2016 14:41:57 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id e5sm14234725wjj.10.2016.06.10.14.41.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 14:41:56 -0700 (PDT) From: Thomas Monjalon To: "Wu, Xiaoban" Cc: users@dpdk.org, olivier.matz@6wind.com Date: Fri, 10 Jun 2016 23:41:55 +0200 Message-ID: <1666418.3LcrSlnKs6@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-users] A minor suggestion to the comment of the rte_eth_tx_burst() of dpdk-16.04 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: Fri, 10 Jun 2016 21:41:57 -0000 2016-06-10 19:09, Wu, Xiaoban: > Dear DPDK Users, > > > I have a very small suggestion to the comment of the rte_eth_tx_burst(). It is not a big deal to the experienced users, but I think this will make the new users know how to use this function more clearly and see the big picture easily. > > > The comment of "tx_pkts" says: > > * @param tx_pkts > * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures > * which contain the output packets. > > > I am a beginner of DPDK. If I see this comment I would probably naively use rte_zmalloc() to construct such pointer array, for each pointer I use rte_malloc() to allocate memory, and finally fill the memory starting from the position (pointed by the macro rte_pktmbuf_mtod()) with real packet content(header and payload). > > > But I just find that the rte_eth_tx_burst() will call the rte_pktmbuf_free() to free the struct rte_mbuf. In default, "CONFIG_RTE_LIBRTE_MBUF_DEBUG=n", this means it will skip the __rte_mbuf_sanity_check(), and will finally get into rte_mempool_put(). Since above construction process skip the construction of the field "struct rte_mempool", it means the "struct rte_mempool" field is null in each packet "struct rte_mbuf"(of course, all the fields are zero). Hence it will finally cause segmentation fault. > > > Thus, I have a very small suggestion, please add something like "It is recommended that the tx_pkts is constructed by rte_pktmbuf_pool_create() combined with rte_mempool_get_bulk(), if not please make sure the fields of the struct rte_mbuf are correctly configured." Good suggestion. Olivier do you agree?