From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Zhiyong" Subject: Re: [PATCH 1/5] net/fm10k: remove limit of fm10k_xmit_pkts_vec burst size Date: Fri, 24 Feb 2017 09:48:09 +0000 Message-ID: References: <1487926101-4637-1-git-send-email-zhiyong.yang@intel.com> <1487926101-4637-2-git-send-email-zhiyong.yang@intel.com> <20170224093256.GA87688@bricha3-MOBL3.ger.corp.intel.com> <20170224093629.GB87688@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Chen, Jing D" , "Zhang, Helin" , "Wu, Jingjing" To: "Richardson, Bruce" Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A102D2BAA for ; Fri, 24 Feb 2017 10:48:15 +0100 (CET) In-Reply-To: <20170224093629.GB87688@bricha3-MOBL3.ger.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Bruce: > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, February 24, 2017 5:36 PM > To: Yang, Zhiyong > Cc: dev@dpdk.org; Chen, Jing D > Subject: Re: [dpdk-dev] [PATCH 1/5] net/fm10k: remove limit of > fm10k_xmit_pkts_vec burst size >=20 > On Fri, Feb 24, 2017 at 09:32:56AM +0000, Bruce Richardson wrote: > > 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 =3D 0; > > > + struct fm10k_tx_queue *txq =3D (struct fm10k_tx_queue *)tx_queue; > > > + > > > + if (likely(nb_pkts <=3D 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 =3D (uint16_t)RTE_MIN(nb_pkts, txq->rs_thresh); > > > + ret =3D fm10k_xmit_pkts_vec(tx_queue, &tx_pkts[nb_tx], > num); > > > + nb_tx +=3D ret; > > > + nb_pkts -=3D 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 =3D dev->data->tx_queues[i]; > > > fm10k_txq_vec_setup(txq); > > > } > > > - dev->tx_pkt_burst =3D fm10k_xmit_pkts_vec; > > > + dev->tx_pkt_burst =3D fm10k_xmit_pkts_vec_simple; > > > dev->tx_pkt_prepare =3D 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) > > > This comment applies for the other patches in the set too. I use the suffix "_simple" only because I see the similar wrapper function i40e_xmit_pkts_simple, Your suggestion looks better obviously. Thanks Zhiyong >=20 > /Bruce