From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 262472BFF for ; Fri, 24 Feb 2017 09:48:27 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2017 00:48:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="61759887" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.188]) by orsmga004.jf.intel.com with ESMTP; 24 Feb 2017 00:48:26 -0800 From: Zhiyong Yang To: dev@dpdk.org Cc: Helin Zhang , Jingjing Wu , Zhiyong Yang Date: Fri, 24 Feb 2017 16:48:18 +0800 Message-Id: <1487926101-4637-3-git-send-email-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487926101-4637-1-git-send-email-zhiyong.yang@intel.com> References: <1487926101-4637-1-git-send-email-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH 2/5] net/i40e: remove limit of i40e_xmit_pkts_vec burst size 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, 24 Feb 2017 08:48:28 -0000 To add a wrapper function i40e_xmit_pkts_vec_simple to remove the limit of tx burst size. The patch makes i40e vec function an best effort to transmit the pkts in the consistent behavior like i40e_xmit_pkts_simple and i40e_xmit_pkts do that. Cc: Helin Zhang Cc: Jingjing Wu Signed-off-by: Zhiyong Yang --- drivers/net/i40e/i40e_rxtx.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 48429cc..819d1d4 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -1426,6 +1426,31 @@ i40e_xmit_pkts_simple(void *tx_queue, return nb_tx; } +static uint16_t +i40e_xmit_pkts_vec_simple(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + uint16_t nb_tx = 0; + struct i40e_tx_queue *txq = (struct i40e_tx_queue *)tx_queue; + + if (likely(nb_pkts <= txq->tx_rs_thresh)) + return i40e_xmit_pkts_vec(tx_queue, tx_pkts, nb_pkts); + + /* transmit in chunks of at least txq->tx_rs_thresh */ + while (nb_pkts) { + uint16_t ret, num; + + num = (uint16_t)RTE_MIN(nb_pkts, txq->tx_rs_thresh); + ret = i40e_xmit_pkts_vec(tx_queue, &tx_pkts[nb_tx], num); + nb_tx += ret; + nb_pkts -= ret; + if (ret < num) + break; + } + + return nb_tx; +} + /********************************************************************* * * TX prep functions @@ -2840,7 +2865,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev) if (ad->tx_simple_allowed) { if (ad->tx_vec_allowed) { PMD_INIT_LOG(DEBUG, "Vector tx finally be used."); - dev->tx_pkt_burst = i40e_xmit_pkts_vec; + dev->tx_pkt_burst = i40e_xmit_pkts_vec_simple; } else { PMD_INIT_LOG(DEBUG, "Simple tx finally be used."); dev->tx_pkt_burst = i40e_xmit_pkts_simple; -- 2.7.4