From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: [PATCH v3 7/7] net/mlx4: remove empty Tx segment support Date: Mon, 30 Oct 2017 10:07:29 +0000 Message-ID: <1509358049-18854-8-git-send-email-matan@mellanox.com> References: <1508768520-4810-1-git-send-email-ophirmu@mellanox.com> <1509358049-18854-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, Ophir Munk To: Adrien Mazarguil Return-path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10067.outbound.protection.outlook.com [40.107.1.67]) by dpdk.org (Postfix) with ESMTP id 002BF1B31B for ; Mon, 30 Oct 2017 11:08:05 +0100 (CET) In-Reply-To: <1509358049-18854-1-git-send-email-matan@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Move empty segment case processing to debug mode. Signed-off-by: Matan Azrad --- drivers/net/mlx4/mlx4_rxtx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index 482c399..c005a41 100644 --- a/drivers/net/mlx4/mlx4_rxtx.c +++ b/drivers/net/mlx4/mlx4_rxtx.c @@ -305,15 +305,18 @@ static int handle_multi_segs(struct rte_mbuf *buf, return -1; } #endif /* NDEBUG */ - if (likely(sbuf->data_len)) { - byte_count = rte_cpu_to_be_32(sbuf->data_len); - } else { + byte_count = rte_cpu_to_be_32(sbuf->data_len); +#ifndef NDEBUG + if (unlikely(!sbuf->data_len)) { + DEBUG("%p: Empty segment is not allowed", + (void *)txq); /* * Zero length segment is treated as inline segment * with zero data. */ byte_count = RTE_BE32(0x80000000); } +#endif /* NDEBUG */ /* * If the data segment is not at the beginning of a * Tx basic block (TXBB) then write the byte count, -- 1.8.3.1