From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 99B5A2BA1 for ; Mon, 11 Jul 2016 12:04:24 +0200 (CEST) Received: from lfbn-1-8274-170.w81-254.abo.wanadoo.fr ([81.254.171.170] helo=[192.168.1.13]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bMY74-0002if-Rf; Mon, 11 Jul 2016 12:06:55 +0200 To: John Daley , dev@dpdk.org References: <1468016521-20280-1-git-send-email-johndale@cisco.com> Cc: bruce.richardson@intel.com From: Olivier Matz Message-ID: <1ca338a4-a8fe-8149-2373-d02fee3199cb@6wind.com> Date: Mon, 11 Jul 2016 12:04:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <1468016521-20280-1-git-send-email-johndale@cisco.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/enic: decrement Tx mbuf reference count before recycling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 10:04:24 -0000 Hi John, On 07/09/2016 12:22 AM, John Daley wrote: > In the Tx cleanup function, the reference count in mbufs to be > returned to the pool should to be decremented before they are > returned. Decrementing is not done by rte_mempool_put_bulk() > so it must be done separately using __rte_pktmbuf_prefree_seg(). > If decrementing does not result in a 0 reference count the mbuf > is not returned to the pool and whatever has the last reference > is responsible for freeing. > > Fixes: 36935afbc53c ("net/enic: refactor Tx mbuf recycling") > Reviewed-by: Nelson Escobar > Signed-off-by: John Daley > --- > Since reference counts are set to 0 when mbufs are reallocated from the > pool, and sending packets with reference count not equal to 1 is probably > an application error, this patch may not be critical. But a debug ASSERT > caught it and it would be nice to have it fixed in 16.07. Sending a packet with refcnt != 1 is not an error. It can happen when using mbuf clones. So indeed it would be better to have in 16.07. For the same reason, I also wonder if enic_free_wq_buf() should also be updated with: - rte_mempool_put(mbuf->pool, mbuf); + rte_pktmbuf_free(mbuf); Regards, Olivier