From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from kolab1.optenet.com (kolab1-pri.optenet.com [5.9.115.82]) by dpdk.org (Postfix) with ESMTP id DC49C5944 for ; Fri, 26 Jul 2013 16:15:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by kolab1.optenet.com (Postfix) with ESMTP id 18CAA9F0801B for ; Fri, 26 Jul 2013 16:16:10 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 kolab1.optenet.com 18CAA9F0801B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=optenet.com; s=default; t=1374848170; bh=yrC3qAUAugcexKugcLMIoLAfPzk7tmDAANEg29lcFOU=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=QymTVVXFkkvmBBW69nqfK4ZWHsUdHufkwUhic7OxE6yClp3uBaw/k0Op27yqRve00 3Qf7cvvLMkoeE5SaaC3yg0wmtivqvcDT632NiOCdEEprOZnghAWR9kps71/w25myZW QgXfDFOx7SZyMV9tx8T2u9gTRIuEGtPlHuTH45zU= Received: from [192.168.100.232] (cablelink-189-218-14-200.hosts.intercable.net [189.218.14.200]) (Authenticated sender: jvelazquez) by kolab1.optenet.com (Postfix) with ESMTPSA id A94269F08017 for ; Fri, 26 Jul 2013 16:16:09 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 kolab1.optenet.com A94269F08017 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=optenet.com; s=default; t=1374848170; bh=yrC3qAUAugcexKugcLMIoLAfPzk7tmDAANEg29lcFOU=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=QymTVVXFkkvmBBW69nqfK4ZWHsUdHufkwUhic7OxE6yClp3uBaw/k0Op27yqRve00 3Qf7cvvLMkoeE5SaaC3yg0wmtivqvcDT632NiOCdEEprOZnghAWR9kps71/w25myZW QgXfDFOx7SZyMV9tx8T2u9gTRIuEGtPlHuTH45zU= Message-ID: <51F284A4.5040608@optenet.com> Date: Fri, 26 Jul 2013 09:16:04 -0500 From: Jesus Velazquez User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: dev@dpdk.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] Question regarding rte_eth_tx_burst() 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: Fri, 26 Jul 2013 14:15:47 -0000 Hi all, Any ideas would be helpful, I have an application that uses a rte_ring for queuing packets to be sent (a single consumer - multiple producer). The problem I am facing is with rte_eth_tx_burst(), once I dequeue N packets from tx ring, there is no guaranty that all packets will be sent, if not all packets are sent, rte_ring does not allow pushing packets at front (it is a FIFO). So, if I re-queue them in the ring, packets will be network reordered. There is no mechanism to know the number of TX free descriptors in a particular queue. I'm working with ixgbe and I found that nb_tx_free is an approximation of that, it is updated every time at ixgbe_xmit_cleanup() that is called during ixgbe_xmit_pkts(). I was wondering to add a function that returns nb_tx_free value in order to have an idea of how many packets can be safety sent. Right now my code does this: .... nbulk = RTE_MIN(rte_ring_count(queue->tx_ring), (uint16_t)TX_DRAIN_PKTS); ret = rte_ring_sc_dequeue_bulk(queue->tx_ring, (void **)ptrs, nbulk); if(unlikely(ret < 0)) return 0; /* Not enough objects?, I asked a moment ago */ ret = rte_eth_tx_burst(queue->port, queue->id, ptrs, nbulk); if(unlikely(ret > nbulk)) { TRACE(RTE, ">>>Imposible sent more than existing\n"); return -1; } while(ret < nbulk) { /* bad case: packet reordering */ ret2 = rte_ring_mp_enqueue(queue->tx_ring, (void *)&ptrs[ret]); if(ret2 < 0) { /* TODO: may be an emergency tx queue? */ /* wrost case: dropping */ rte_pktmbuf_free(ptrs[ret]); } ret++; } I would appreciate any ideas of how to overcome this situation. Thanks and regards, Jesus