From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E9C54C31A for ; Thu, 21 May 2015 14:28:32 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 21 May 2015 05:28:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,468,1427785200"; d="scan'208";a="733047889" Received: from unknown (HELO stargo) ([10.217.248.233]) by orsmga002.jf.intel.com with SMTP; 21 May 2015 05:28:30 -0700 Received: by stargo (sSMTP sendmail emulation); Thu, 21 May 2015 14:29:00 +0200 From: Maciej Gajdzica To: dev@dpdk.org Date: Thu, 21 May 2015 14:28:41 +0200 Message-Id: <1432211324-5078-2-git-send-email-maciejx.t.gajdzica@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432211324-5078-1-git-send-email-maciejx.t.gajdzica@intel.com> References: <1432211324-5078-1-git-send-email-maciejx.t.gajdzica@intel.com> Subject: [dpdk-dev] [PATCH v3 1/4] port: removed second implementation of tx_bulk from ethdev_writer port 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: Thu, 21 May 2015 12:28:33 -0000 There was two implementations of tx_bulk function in ethdev_writer port. The function to run is chosen with WRITER_APPROACH define. This patch removes WRITER_APPROACH = 0 implementation, as it seems to be slower. Signed-off-by: Maciej Gajdzica --- lib/librte_port/rte_port_ethdev.c | 47 ------------------------------------- 1 file changed, 47 deletions(-) diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d014913..55ed829 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -99,8 +99,6 @@ rte_port_ethdev_reader_free(void *port) /* * Port ETHDEV Writer */ -#define RTE_PORT_ETHDEV_WRITER_APPROACH 1 - struct rte_port_ethdev_writer { struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; uint32_t tx_burst_sz; @@ -171,45 +169,6 @@ rte_port_ethdev_writer_tx(void *port, struct rte_mbuf *pkt) return 0; } -#if RTE_PORT_ETHDEV_WRITER_APPROACH == 0 - -static int -rte_port_ethdev_writer_tx_bulk(void *port, - struct rte_mbuf **pkts, - uint64_t pkts_mask) -{ - struct rte_port_ethdev_writer *p = - (struct rte_port_ethdev_writer *) port; - - if ((pkts_mask & (pkts_mask + 1)) == 0) { - uint64_t n_pkts = __builtin_popcountll(pkts_mask); - uint32_t i; - - for (i = 0; i < n_pkts; i++) { - struct rte_mbuf *pkt = pkts[i]; - - p->tx_buf[p->tx_buf_count++] = pkt; - if (p->tx_buf_count >= p->tx_burst_sz) - send_burst(p); - } - } else { - for ( ; pkts_mask; ) { - uint32_t pkt_index = __builtin_ctzll(pkts_mask); - uint64_t pkt_mask = 1LLU << pkt_index; - struct rte_mbuf *pkt = pkts[pkt_index]; - - p->tx_buf[p->tx_buf_count++] = pkt; - if (p->tx_buf_count >= p->tx_burst_sz) - send_burst(p); - pkts_mask &= ~pkt_mask; - } - } - - return 0; -} - -#elif RTE_PORT_ETHDEV_WRITER_APPROACH == 1 - static int rte_port_ethdev_writer_tx_bulk(void *port, struct rte_mbuf **pkts, @@ -255,12 +214,6 @@ rte_port_ethdev_writer_tx_bulk(void *port, return 0; } -#else - -#error Invalid value for RTE_PORT_ETHDEV_WRITER_APPROACH - -#endif - static int rte_port_ethdev_writer_flush(void *port) { -- 1.7.9.5