[dpdk-dev,1/5] net/fm10k: remove limit of fm10k_xmit_pkts_vec burst size

Message ID 1487926101-4637-2-git-send-email-zhiyong.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yang, Zhiyong Feb. 24, 2017, 8:48 a.m. UTC
  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 <jing.d.chen@intel.com>

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson Feb. 24, 2017, 9:32 a.m. UTC | #1
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 <jing.d.chen@intel.com>
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
>  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
  
Bruce Richardson Feb. 24, 2017, 9:36 a.m. UTC | #2
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 <jing.d.chen@intel.com>
> > 
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > ---
> >  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)
>
This comment applies for the other patches in the set too.

/Bruce
  
Yang, Zhiyong Feb. 24, 2017, 9:48 a.m. UTC | #3
Hi, Bruce:

> -----Original Message-----
> From: Richardson, Bruce
> Sent: Friday, February 24, 2017 5:36 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; Chen, Jing D <jing.d.chen@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 1/5] net/fm10k: remove limit of
> fm10k_xmit_pkts_vec burst size
> 
> 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 <jing.d.chen@intel.com>
> > >
> > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > > ---
> > >  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)
> >
> 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

> 
> /Bruce
  
Yang, Zhiyong March 3, 2017, 11:17 a.m. UTC | #4
The rte_eth_tx_burst() function in the file Rte_ethdev.h is invoked to
transmit output packets on the output queue for DPDK applications as
follows.

static inline uint16_t
rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
                 struct rte_mbuf **tx_pkts, uint16_t nb_pkts);

Note: The fourth parameter nb_pkts: The number of packets to transmit.

The rte_eth_tx_burst() function returns the number of packets it actually
sent. Most of PMD drivers can support the policy "send as many packets to
transmit as possible" at the PMD level. but the few of PMDs have some sort
of artificial limits for the pkts sent successfully. For example, VHOST tx
burst size is limited to 32 packets. Some rx_burst functions have the
similar problem. The main benefit is consistent batching behavior for user
to simplify their logic and avoid misusage at the application level, there
is unified rte_eth_tx/rx_burst interface already, there is no reason for
inconsistent behaviors. 
This patchset fixes it via adding wrapper function at the PMD level.

Changes in V2:
1. rename ixgbe, i40e and fm10k vec function XXX_xmit_pkts_vec to new name
XXX_xmit_fixed_burst_vec, new wrapper functions use original name
XXX_xmit_pkts_vec according to Bruce's suggestion.

2. simplify the code to avoid the if or if/else.

Zhiyong Yang (5):
  net/fm10k: remove limit of fm10k_xmit_pkts_vec burst size
  net/i40e: remove limit of i40e_xmit_pkts_vec burst size
  net/ixgbe: remove limit of ixgbe_xmit_pkts_vec burst size
  net/vhost: remove limit of vhost TX burst size
  net/vhost: remove limit of vhost RX burst size

 drivers/net/fm10k/fm10k.h               |  4 ++--
 drivers/net/fm10k/fm10k_ethdev.c        | 28 ++++++++++++++++++++++++---
 drivers/net/fm10k/fm10k_rxtx_vec.c      |  4 ++--
 drivers/net/i40e/i40e_rxtx.c            | 28 ++++++++++++++++++++++++---
 drivers/net/i40e/i40e_rxtx.h            |  4 ++--
 drivers/net/i40e/i40e_rxtx_vec_neon.c   |  4 ++--
 drivers/net/i40e/i40e_rxtx_vec_sse.c    |  4 ++--
 drivers/net/ixgbe/ixgbe_rxtx.c          | 29 ++++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_rxtx.h          |  4 ++--
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c |  4 ++--
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c  |  4 ++--
 drivers/net/vhost/rte_eth_vhost.c       | 34 +++++++++++++++++++++++++++++----
 12 files changed, 125 insertions(+), 26 deletions(-)
  
Ananyev, Konstantin March 5, 2017, 1:02 p.m. UTC | #5
> The rte_eth_tx_burst() function in the file Rte_ethdev.h is invoked to
> transmit output packets on the output queue for DPDK applications as
> follows.
> 
> static inline uint16_t
> rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
>                  struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
> 
> Note: The fourth parameter nb_pkts: The number of packets to transmit.
> 
> The rte_eth_tx_burst() function returns the number of packets it actually
> sent. Most of PMD drivers can support the policy "send as many packets to
> transmit as possible" at the PMD level. but the few of PMDs have some sort
> of artificial limits for the pkts sent successfully. For example, VHOST tx
> burst size is limited to 32 packets. Some rx_burst functions have the
> similar problem. The main benefit is consistent batching behavior for user
> to simplify their logic and avoid misusage at the application level, there
> is unified rte_eth_tx/rx_burst interface already, there is no reason for
> inconsistent behaviors.
> This patchset fixes it via adding wrapper function at the PMD level.
> 
> Changes in V2:
> 1. rename ixgbe, i40e and fm10k vec function XXX_xmit_pkts_vec to new name
> XXX_xmit_fixed_burst_vec, new wrapper functions use original name
> XXX_xmit_pkts_vec according to Bruce's suggestion.
> 
> 2. simplify the code to avoid the if or if/else.
> 
> Zhiyong Yang (5):
>   net/fm10k: remove limit of fm10k_xmit_pkts_vec burst size
>   net/i40e: remove limit of i40e_xmit_pkts_vec burst size
>   net/ixgbe: remove limit of ixgbe_xmit_pkts_vec burst size
>   net/vhost: remove limit of vhost TX burst size
>   net/vhost: remove limit of vhost RX burst size
> 
>  drivers/net/fm10k/fm10k.h               |  4 ++--
>  drivers/net/fm10k/fm10k_ethdev.c        | 28 ++++++++++++++++++++++++---
>  drivers/net/fm10k/fm10k_rxtx_vec.c      |  4 ++--
>  drivers/net/i40e/i40e_rxtx.c            | 28 ++++++++++++++++++++++++---
>  drivers/net/i40e/i40e_rxtx.h            |  4 ++--
>  drivers/net/i40e/i40e_rxtx_vec_neon.c   |  4 ++--
>  drivers/net/i40e/i40e_rxtx_vec_sse.c    |  4 ++--
>  drivers/net/ixgbe/ixgbe_rxtx.c          | 29 ++++++++++++++++++++++++++++
>  drivers/net/ixgbe/ixgbe_rxtx.h          |  4 ++--
>  drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c |  4 ++--
>  drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c  |  4 ++--
>  drivers/net/vhost/rte_eth_vhost.c       | 34 +++++++++++++++++++++++++++++----
>  12 files changed, 125 insertions(+), 26 deletions(-)
> 

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> --
> 2.7.4
  
Yang, Zhiyong March 6, 2017, 2:13 a.m. UTC | #6
Thanks, Konstantin.

--Zhiyong

> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Sunday, March 5, 2017 9:03 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2 0/5] consistent PMD batching behaviour
> 
> 
> > The rte_eth_tx_burst() function in the file Rte_ethdev.h is invoked to
> > transmit output packets on the output queue for DPDK applications as
> > follows.
> >
> > static inline uint16_t
> > rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
> >                  struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
> >
> > Note: The fourth parameter nb_pkts: The number of packets to transmit.
> >
> > The rte_eth_tx_burst() function returns the number of packets it
> > actually sent. Most of PMD drivers can support the policy "send as
> > many packets to transmit as possible" at the PMD level. but the few of
> > PMDs have some sort of artificial limits for the pkts sent
> > successfully. For example, VHOST tx burst size is limited to 32
> > packets. Some rx_burst functions have the similar problem. The main
> > benefit is consistent batching behavior for user to simplify their
> > logic and avoid misusage at the application level, there is unified
> > rte_eth_tx/rx_burst interface already, there is no reason for inconsistent
> behaviors.
> > This patchset fixes it via adding wrapper function at the PMD level.
> >
> > Changes in V2:
> > 1. rename ixgbe, i40e and fm10k vec function XXX_xmit_pkts_vec to new
> > name XXX_xmit_fixed_burst_vec, new wrapper functions use original
> name
> > XXX_xmit_pkts_vec according to Bruce's suggestion.
> >
> > 2. simplify the code to avoid the if or if/else.
> >
> > Zhiyong Yang (5):
> >   net/fm10k: remove limit of fm10k_xmit_pkts_vec burst size
> >   net/i40e: remove limit of i40e_xmit_pkts_vec burst size
> >   net/ixgbe: remove limit of ixgbe_xmit_pkts_vec burst size
> >   net/vhost: remove limit of vhost TX burst size
> >   net/vhost: remove limit of vhost RX burst size
> >
> >  drivers/net/fm10k/fm10k.h               |  4 ++--
> >  drivers/net/fm10k/fm10k_ethdev.c        | 28
> ++++++++++++++++++++++++---
> >  drivers/net/fm10k/fm10k_rxtx_vec.c      |  4 ++--
> >  drivers/net/i40e/i40e_rxtx.c            | 28 ++++++++++++++++++++++++---
> >  drivers/net/i40e/i40e_rxtx.h            |  4 ++--
> >  drivers/net/i40e/i40e_rxtx_vec_neon.c   |  4 ++--
> >  drivers/net/i40e/i40e_rxtx_vec_sse.c    |  4 ++--
> >  drivers/net/ixgbe/ixgbe_rxtx.c          | 29
> ++++++++++++++++++++++++++++
> >  drivers/net/ixgbe/ixgbe_rxtx.h          |  4 ++--
> >  drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c |  4 ++--
> > drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c  |  4 ++--
> >  drivers/net/vhost/rte_eth_vhost.c       | 34
> +++++++++++++++++++++++++++++----
> >  12 files changed, 125 insertions(+), 26 deletions(-)
> >
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 
> > --
> > 2.7.4
  
Ferruh Yigit March 24, 2017, 2:02 p.m. UTC | #7
On 3/3/2017 11:17 AM, Zhiyong Yang wrote:
> The rte_eth_tx_burst() function in the file Rte_ethdev.h is invoked to
> transmit output packets on the output queue for DPDK applications as
> follows.
> 
> static inline uint16_t
> rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
>                  struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
> 
> Note: The fourth parameter nb_pkts: The number of packets to transmit.
> 
> The rte_eth_tx_burst() function returns the number of packets it actually
> sent. Most of PMD drivers can support the policy "send as many packets to
> transmit as possible" at the PMD level. but the few of PMDs have some sort
> of artificial limits for the pkts sent successfully. For example, VHOST tx
> burst size is limited to 32 packets. Some rx_burst functions have the
> similar problem. The main benefit is consistent batching behavior for user
> to simplify their logic and avoid misusage at the application level, there
> is unified rte_eth_tx/rx_burst interface already, there is no reason for
> inconsistent behaviors. 
> This patchset fixes it via adding wrapper function at the PMD level.
> 
> Changes in V2:
> 1. rename ixgbe, i40e and fm10k vec function XXX_xmit_pkts_vec to new name
> XXX_xmit_fixed_burst_vec, new wrapper functions use original name
> XXX_xmit_pkts_vec according to Bruce's suggestion.
> 
> 2. simplify the code to avoid the if or if/else.
> 
> Zhiyong Yang (5):
>   net/fm10k: remove limit of fm10k_xmit_pkts_vec burst size
>   net/i40e: remove limit of i40e_xmit_pkts_vec burst size
>   net/ixgbe: remove limit of ixgbe_xmit_pkts_vec burst size
>   net/vhost: remove limit of vhost TX burst size
>   net/vhost: remove limit of vhost RX burst size

Can you please update release notes (release_17_05.rst) with this feature?

This patch changes the PMD behavior for the user, that is why it would
be nice to mention from this change in release notes.


Also i40e_rxtx_vec_altivec.c needs to be updated in patch 2/5.


You can keep Konstantin's ack in next patchset.

Thanks,
ferruh
  
Yang, Zhiyong March 25, 2017, 6:29 a.m. UTC | #8
Hi, Ferruh:
	I will update release note and fix the 2/5 checkpath warnings. send V3 later.  

Thanks
Zhiyong 

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Friday, March 24, 2017 10:02 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2 0/5] consistent PMD batching behaviour

> Can you please update release notes (release_17_05.rst) with this feature?
> 
> This patch changes the PMD behavior for the user, that is why it would be nice
> to mention from this change in release notes.
> 
> 
> Also i40e_rxtx_vec_altivec.c needs to be updated in patch 2/5.
> 
> 
> You can keep Konstantin's ack in next patchset.
> 
> Thanks,
> ferruh
  
Yang, Zhiyong March 28, 2017, 10 a.m. UTC | #9
Hi, Ferruh;

> Also i40e_rxtx_vec_altivec.c needs to be updated in patch 2/5.

Where is the file?   I don't find it in git master branch.

Thanks
Zhiyong

> -----Original Message-----

> From: Yigit, Ferruh

> Sent: Friday, March 24, 2017 10:02 PM

> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org

> Cc: Richardson, Bruce <bruce.richardson@intel.com>

> Subject: Re: [dpdk-dev] [PATCH v2 0/5] consistent PMD batching behaviour

> 

> On 3/3/2017 11:17 AM, Zhiyong Yang wrote:

> Can you please update release notes (release_17_05.rst) with this feature?

> 

> This patch changes the PMD behavior for the user, that is why it would be nice

> to mention from this change in release notes.

> 

> 

> Also i40e_rxtx_vec_altivec.c needs to be updated in patch 2/5.

> 

> 

> You can keep Konstantin's ack in next patchset.

> 

> Thanks,

> ferruh
  
Ferruh Yigit March 28, 2017, 10:05 a.m. UTC | #10
On 3/28/2017 11:00 AM, Yang, Zhiyong wrote:
> Hi, Ferruh;
> 
>> Also i40e_rxtx_vec_altivec.c needs to be updated in patch 2/5.
> Where is the file?   I don't find it in git master branch.

It is in next-net tree, driver patches patches should be on top of this
next-net.

> 
> Thanks
> Zhiyong
> 
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Friday, March 24, 2017 10:02 PM
>> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
>> Cc: Richardson, Bruce <bruce.richardson@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 0/5] consistent PMD batching behaviour
>>
>> On 3/3/2017 11:17 AM, Zhiyong Yang wrote:
>> Can you please update release notes (release_17_05.rst) with this feature?
>>
>> This patch changes the PMD behavior for the user, that is why it would be nice
>> to mention from this change in release notes.
>>
>>
>> Also i40e_rxtx_vec_altivec.c needs to be updated in patch 2/5.
>>
>>
>> You can keep Konstantin's ack in next patchset.
>>
>> Thanks,
>> ferruh
  

Patch

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 {
 		dev->tx_pkt_burst = fm10k_xmit_pkts;