From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1D5B02B88 for ; Fri, 24 Feb 2017 10:33:00 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 24 Feb 2017 01:32:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="69095729" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.61]) by fmsmga005.fm.intel.com with SMTP; 24 Feb 2017 01:32:57 -0800 Received: by (sSMTP sendmail emulation); Fri, 24 Feb 2017 09:32:56 +0000 Date: Fri, 24 Feb 2017 09:32:56 +0000 From: Bruce Richardson To: Zhiyong Yang Cc: dev@dpdk.org, Jing Chen Message-ID: <20170224093256.GA87688@bricha3-MOBL3.ger.corp.intel.com> References: <1487926101-4637-1-git-send-email-zhiyong.yang@intel.com> <1487926101-4637-2-git-send-email-zhiyong.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487926101-4637-2-git-send-email-zhiyong.yang@intel.com> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.7.2 (2016-11-26) Subject: Re: [dpdk-dev] [PATCH 1/5] net/fm10k: remove limit of fm10k_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 09:33:01 -0000 On Fri, Feb 24, 2017 at 04:48:17PM +0800, Zhiyong Yang wrote: > To add a wrapper function fm10k_xmit_pkts_vec_simple to remove > the limit of tx burst size. The patch makes fm10k vec function > an best effort to transmit the pkts in the consistent behavior > like fm10k_xmit_pkts does that. > > Cc: Jing Chen > > Signed-off-by: Zhiyong Yang > --- > drivers/net/fm10k/fm10k_ethdev.c | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c > index c4fe746..e9b6254 100644 > --- a/drivers/net/fm10k/fm10k_ethdev.c > +++ b/drivers/net/fm10k/fm10k_ethdev.c > @@ -2741,6 +2741,31 @@ fm10k_check_ftag(struct rte_devargs *devargs) > return 1; > } > > +static uint16_t > +fm10k_xmit_pkts_vec_simple(void *tx_queue, struct rte_mbuf **tx_pkts, > + uint16_t nb_pkts) > +{ > + uint16_t nb_tx = 0; > + struct fm10k_tx_queue *txq = (struct fm10k_tx_queue *)tx_queue; > + > + if (likely(nb_pkts <= txq->rs_thresh)) > + return fm10k_xmit_pkts_vec(tx_queue, tx_pkts, nb_pkts); > + > + /* transmit in chunks of at least txq->rs_thresh */ > + while (nb_pkts) { > + uint16_t ret, num; > + > + num = (uint16_t)RTE_MIN(nb_pkts, txq->rs_thresh); > + ret = fm10k_xmit_pkts_vec(tx_queue, &tx_pkts[nb_tx], num); > + nb_tx += ret; > + nb_pkts -= ret; > + if (ret < num) > + break; > + } > + > + return nb_tx; > +} > + > static void __attribute__((cold)) > fm10k_set_tx_function(struct rte_eth_dev *dev) > { > @@ -2766,7 +2791,7 @@ fm10k_set_tx_function(struct rte_eth_dev *dev) > txq = dev->data->tx_queues[i]; > fm10k_txq_vec_setup(txq); > } > - dev->tx_pkt_burst = fm10k_xmit_pkts_vec; > + dev->tx_pkt_burst = fm10k_xmit_pkts_vec_simple; > dev->tx_pkt_prepare = NULL; > } else { The names of the functions do not look right to me. I don't think the suffic "_simple" is suitable for describing the functionality of the wrapper function vs the original function. I think instead that the original function should be renamed to indicate that it is only handles a fixed size burst of pkts, and the new wrapper function takes the original name. For example: fm10k_xmit_fixed_burst_vec (original fn) fm10k_xmit_pkts_vec (new fn) Regards, /Bruce