From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B55CDA0613 for ; Sun, 4 Aug 2019 15:56:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C0DE1BEB6; Sun, 4 Aug 2019 15:56:38 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 7151B1BEB6 for ; Sun, 4 Aug 2019 15:56:37 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 4 Aug 2019 16:56:36 +0300 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x74DuaHW004259; Sun, 4 Aug 2019 16:56:36 +0300 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id x74Dua91031660; Sun, 4 Aug 2019 13:56:36 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x74DuaGA031659; Sun, 4 Aug 2019 13:56:36 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: yskoh@mellanox.com, shahafs@mellanox.com Date: Sun, 4 Aug 2019 13:56:35 +0000 Message-Id: <1564926995-31618-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix inline data settings 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If the minimal inline data are required the data inline feature must be engaged. There were the incorrect settings enabling the entire small packet inline (in size up to 82B) which may result in sending rate declining if there is no enough cores. The same problem was raised if inline was enabled to support VLAN tag insertion by software. Fixes: 38b4b397a57d ("net/mlx5: add Tx configuration and setup") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_txq.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index fe3b4ec..a0e27bb 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -784,13 +784,11 @@ struct mlx5_txq_ibv * txq_ctrl->txq.vlan_en = config->hw_vlan_insert; vlan_inline = (dev_txoff & DEV_TX_OFFLOAD_VLAN_INSERT) && !config->hw_vlan_insert; - if (vlan_inline) - inlen_send = RTE_MAX(inlen_send, MLX5_ESEG_MIN_INLINE_SIZE); /* * If there are few Tx queues it is prioritized * to save CPU cycles and disable data inlining at all. */ - if ((inlen_send && priv->txqs_n >= txqs_inline) || vlan_inline) { + if (inlen_send && priv->txqs_n >= txqs_inline) { /* * The data sent with ordinal MLX5_OPCODE_SEND * may be inlined in Ethernet Segment, align the @@ -825,32 +823,27 @@ struct mlx5_txq_ibv * MLX5_WQE_CSEG_SIZE - MLX5_WQE_ESEG_SIZE - MLX5_WQE_DSEG_SIZE * 2); - txq_ctrl->txq.inlen_send = inlen_send; - txq_ctrl->txq.inlen_mode = inlen_mode; - txq_ctrl->txq.inlen_empw = 0; - } else { + } else if (inlen_mode) { /* * If minimal inlining is requested we must * enable inlining in general, despite the - * number of configured queues. + * number of configured queues. Ignore the + * txq_inline_max devarg, this is not + * full-featured inline. */ inlen_send = inlen_mode; - if (inlen_mode) { - /* - * Extend space for inline data to allow - * optional alignment of data buffer - * start address, it may improve PCIe - * performance. - */ - inlen_send = RTE_MIN(inlen_send + MLX5_WQE_SIZE, - MLX5_SEND_MAX_INLINE_LEN); - } - txq_ctrl->txq.inlen_send = inlen_send; - txq_ctrl->txq.inlen_mode = inlen_mode; - txq_ctrl->txq.inlen_empw = 0; - inlen_send = 0; inlen_empw = 0; + } else if (vlan_inline) { + /* + * Hardware does not report offload for + * VLAN insertion, we must enable data inline + * to implement feature by software. + */ + inlen_send = MLX5_ESEG_MIN_INLINE_SIZE; } + txq_ctrl->txq.inlen_send = inlen_send; + txq_ctrl->txq.inlen_mode = inlen_mode; + txq_ctrl->txq.inlen_empw = 0; if (inlen_send && inlen_empw && priv->txqs_n >= txqs_inline) { /* * The data sent with MLX5_OPCODE_ENHANCED_MPSW -- 1.8.3.1