[dpdk-dev] [PATCH] net/i40e: update tx_free_threshold to improve zero copy performance
Ananyev, Konstantin
konstantin.ananyev at intel.com
Thu Apr 12 13:51:36 CEST 2018
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Junjie Chen
> Sent: Thursday, April 12, 2018 6:32 AM
> To: Xing, Beilei <beilei.xing at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>
> Cc: dev at dpdk.org; Chen, Junjie J <junjie.j.chen at intel.com>; Chen at dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: update tx_free_threshold to improve zero copy performance
>
> From: "Chen, Junjie" <junjie.j.chen at intel.com>
>
> When vhost backend works in dequeue zero copy mode, nic locks virtio's
> buffer until there is less or equal than tx_free_threshold buffer remain
> and then free number of tx burst buffer. This causes packets drop in
> virtio side and impacts zero copy performance. So we need to increase
> the tx_free_threshold to let nic free virtio's buffer as soon as possible.
> Also we keep the upper limit to tx max burst size to ensure least
> performance impact on non zero copy.
Ok but why vhost app can't just use tx_queue_setup() to specify desired value for
tx_free_thresh?
Why instead we have to modify PMD to satisfy needs of one app?
Konstantin
>
> Signed-off-by: Chen, Junjie <junjie.j.chen at intel.com>
> ---
> drivers/net/i40e/i40e_rxtx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 56a854cec..d9569bdc9 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -2039,6 +2039,8 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
> tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH);
> tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ?
> tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);
> + if (tx_free_thresh < nb_desc - I40E_TX_MAX_BURST)
> + tx_free_thresh = nb_desc - I40E_TX_MAX_BURST;
> if (tx_rs_thresh >= (nb_desc - 2)) {
> PMD_INIT_LOG(ERR, "tx_rs_thresh must be less than the "
> "number of TX descriptors minus 2. "
> --
> 2.16.0
More information about the dev
mailing list