From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 92FC7D586 for ; Sun, 8 Jan 2017 16:42:24 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from eladpe@mellanox.com) with ESMTPS (AES256-SHA encrypted); 8 Jan 2017 17:42:20 +0200 Received: from r-aa-dragon21.mtr.labs.mlnx (r-aa-dragon21.mtr.labs.mlnx [10.209.68.158]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v08FgK7Z007960; Sun, 8 Jan 2017 17:42:20 +0200 Received: from r-aa-dragon21.mtr.labs.mlnx (localhost [127.0.0.1]) by r-aa-dragon21.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id v08FgKaN004903; Sun, 8 Jan 2017 15:42:20 GMT Received: (from eladpe@localhost) by r-aa-dragon21.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id v08FgJoK004901; Sun, 8 Jan 2017 15:42:19 GMT From: Elad Persiko To: dev@dpdk.org Cc: Elad Persiko Date: Sun, 8 Jan 2017 15:41:59 +0000 Message-Id: <1483890123-4854-1-git-send-email-eladpe@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH 1/5] net/mlx5: last WQE no room inline 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: Sun, 08 Jan 2017 15:42:24 -0000 Prior to this patch, when sending a packet and the following conditions were reached: 1. last working queue element is used. 2. inline was requested by the user 3. no room for inline packet. then the inline request was ignored and the packet was sent by pointer completely. This patch handles this scenario. In this case the last work queue element is turned to be a null work queue element and the packet is being sent after the wrap around. Signed-off-by: Elad Persiko --- drivers/net/mlx5/mlx5_rxtx.c | 12 ++++++++++++ drivers/net/mlx5/mlx5_txq.c | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index e0ee2f2..be38aed 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -481,6 +481,17 @@ pkt_inline_sz += copy_b; /* Sanity check. */ assert(addr <= addr_end); + } else { + wqe->ctrl = (rte_v128u32_t){ + htonl(txq->wqe_ci << 8), + htonl(txq->qp_num_8s | 1), + 0, + 0, + }; + length = 0; + buf = *(pkts--); + ds = 1; + goto next_pkt_part; } /* * 2 DWORDs consumed by the WQE header + ETH segment + @@ -577,6 +588,7 @@ 0, 0, }; +next_pkt_part: wqe->eseg = (rte_v128u32_t){ 0, cs_flags, diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 949035b..951e50a 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -314,8 +314,12 @@ /* CQ to be associated with the receive queue. */ .recv_cq = tmpl.cq, .cap = { - /* Max number of outstanding WRs. */ - .max_send_wr = ((priv->device_attr.max_qp_wr < desc) ? + /* + * Max number of outstanding WRs. + * "+1" for null WQE place holder. + */ + .max_send_wr = ((priv->device_attr.max_qp_wr < + (desc + 1)) ? priv->device_attr.max_qp_wr : desc), /* -- 1.8.3.1