Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/65092/?format=api
http://patches.dpdk.org/api/patches/65092/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1579803629-152938-5-git-send-email-akozyrev@mellanox.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1579803629-152938-5-git-send-email-akozyrev@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1579803629-152938-5-git-send-email-akozyrev@mellanox.com", "date": "2020-01-23T18:20:28", "name": "[v2,4/5] net/mlx5: use mlx5 debug flag instead of NDEBUG", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "482e66a8c9cc2d7dd04fc38b6ba3b7d52f50ee61", "submitter": { "id": 1573, "url": "http://patches.dpdk.org/api/people/1573/?format=api", "name": "Alexander Kozyrev", "email": "akozyrev@mellanox.com" }, "delegate": { "id": 3268, "url": "http://patches.dpdk.org/api/users/3268/?format=api", "username": "rasland", "first_name": "Raslan", "last_name": "Darawsheh", "email": "rasland@nvidia.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1579803629-152938-5-git-send-email-akozyrev@mellanox.com/mbox/", "series": [ { "id": 8278, "url": "http://patches.dpdk.org/api/series/8278/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8278", "date": "2020-01-23T18:20:24", "name": "net/mlx: assert cleanup in mlx drivers", "version": 2, "mbox": "http://patches.dpdk.org/series/8278/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/65092/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/65092/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D00B4A0530;\n\tThu, 23 Jan 2020 19:21:00 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 95E0E49DF;\n\tThu, 23 Jan 2020 19:20:39 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id DF4372BAE\n for <dev@dpdk.org>; Thu, 23 Jan 2020 19:20:31 +0100 (CET)", "from Internal Mail-Server by MTLPINE2 (envelope-from\n akozyrev@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 23 Jan 2020 20:20:30 +0200", "from pegasus02.mtr.labs.mlnx. (pegasus02.mtr.labs.mlnx\n [10.210.16.122])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00NIKUb4026240;\n Thu, 23 Jan 2020 20:20:30 +0200" ], "From": "Alexander Kozyrev <akozyrev@mellanox.com>", "To": "dev@dpdk.org", "Cc": "rasland@mellanox.com, matan@mellanox.com, viacheslavo@mellanox.com,\n ferruh.yigit@intel.com, thomas@monjalon.net", "Date": "Thu, 23 Jan 2020 20:20:28 +0200", "Message-Id": "<1579803629-152938-5-git-send-email-akozyrev@mellanox.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1579803629-152938-1-git-send-email-akozyrev@mellanox.com>", "References": "<1579789555-23239-1-git-send-email-akozyrev@mellanox.com>\n <1579803629-152938-1-git-send-email-akozyrev@mellanox.com>", "Subject": "[dpdk-dev] [PATCH v2 4/5] net/mlx5: use mlx5 debug flag instead of\n\tNDEBUG", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Define a new MLX5_DEBUG compilation flag to get rid of dependency\non the NDEBUG definition. This is a preparation step to switch\nfrom standard assert clauses to DPDK RTE_ASSERT ones in MLX5 driver.\n\nSigned-off-by: Alexander Kozyrev <akozyrev@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/Makefile | 4 ++--\n drivers/net/mlx5/meson.build | 4 ++--\n drivers/net/mlx5/mlx5.c | 6 +++---\n drivers/net/mlx5/mlx5_flow_dv.c | 2 +-\n drivers/net/mlx5/mlx5_mr.c | 4 ++--\n drivers/net/mlx5/mlx5_nl.c | 2 +-\n drivers/net/mlx5/mlx5_rxtx.c | 8 ++++----\n drivers/net/mlx5/mlx5_rxtx.h | 6 +++---\n drivers/net/mlx5/mlx5_txq.c | 2 +-\n drivers/net/mlx5/mlx5_utils.h | 14 +++++++-------\n 10 files changed, 26 insertions(+), 26 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex 0466d9d..f249ecd 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -85,13 +85,13 @@ endif\n \n # User-defined CFLAGS.\n ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DEBUG),y)\n-CFLAGS += -pedantic -UNDEBUG\n+CFLAGS += -pedantic -DMLX5_DEBUG\n ifneq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)\n CFLAGS += -DPEDANTIC\n endif\n AUTO_CONFIG_CFLAGS += -Wno-pedantic\n else\n-CFLAGS += -DNDEBUG -UPEDANTIC\n+CFLAGS += -UMLX5_DEBUG -UPEDANTIC\n endif\n \n include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build\nindex 3ad4f02..119a654 100644\n--- a/drivers/net/mlx5/meson.build\n+++ b/drivers/net/mlx5/meson.build\n@@ -84,9 +84,9 @@ if build\n \t\tendif\n \tendforeach\n \tif get_option('buildtype').contains('debug')\n-\t\tcflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ]\n+\t\tcflags += [ '-pedantic', '-DMLX5_DEBUG', '-DPEDANTIC' ]\n \telse\n-\t\tcflags += [ '-DNDEBUG', '-UPEDANTIC' ]\n+\t\tcflags += [ '-UMLX5_DEBUG', '-UPEDANTIC' ]\n \tendif\n \t# To maintain the compatibility with the make build system\n \t# mlx5_autoconf.h file is still generated.\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex ffee39c..5124491 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -654,7 +654,7 @@ struct mlx5_flow_id_pool *\n mlx5_free_shared_ibctx(struct mlx5_ibv_shared *sh)\n {\n \tpthread_mutex_lock(&mlx5_ibv_list_mutex);\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \t/* Check the object presence in the list. */\n \tstruct mlx5_ibv_shared *lctx;\n \n@@ -2612,7 +2612,7 @@ struct mlx5_flow_id_pool *\n \t\tmac.addr_bytes[0], mac.addr_bytes[1],\n \t\tmac.addr_bytes[2], mac.addr_bytes[3],\n \t\tmac.addr_bytes[4], mac.addr_bytes[5]);\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \t{\n \t\tchar ifname[IF_NAMESIZE];\n \n@@ -3658,7 +3658,7 @@ struct mlx5_flow_id_pool *\n \t\treturn;\n \tassert(mlx5_glue);\n #endif\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \t/* Glue structure must not contain any NULL pointers. */\n \t{\n \t\tunsigned int i;\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 5a1b426..93e7c37 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -5145,7 +5145,7 @@ struct field_modify_info modify_tcp[] = {\n \treturn dev_flow;\n }\n \n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n /**\n * Sanity check for match mask and value. Similar to check_valid_spec() in\n * kernel driver. If unmasked bit is present in value, it returns failure.\ndiff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c\nindex 0d549b6..e423947 100644\n--- a/drivers/net/mlx5/mlx5_mr.c\n+++ b/drivers/net/mlx5/mlx5_mr.c\n@@ -240,7 +240,7 @@ struct mr_update_mp_data {\n void\n mlx5_mr_btree_dump(struct mlx5_mr_btree *bt __rte_unused)\n {\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \tint idx;\n \tstruct mlx5_mr_cache *lkp_tbl;\n \n@@ -1551,7 +1551,7 @@ struct mr_update_mp_data {\n void\n mlx5_mr_dump_dev(struct mlx5_ibv_shared *sh __rte_unused)\n {\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \tstruct mlx5_mr *mr;\n \tint mr_n = 0;\n \tint chunk_n = 0;\ndiff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c\nindex e7ba034..2e6d29c 100644\n--- a/drivers/net/mlx5/mlx5_nl.c\n+++ b/drivers/net/mlx5/mlx5_nl.c\n@@ -356,7 +356,7 @@ struct mlx5_nl_ifindex_data {\n \t\t\t\trte_errno = ENOMEM;\n \t\t\t\treturn -rte_errno;\n \t\t\t}\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \t\t\tchar m[18];\n \n \t\t\trte_ether_format_addr(m, 18, RTA_DATA(attribute));\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c\nindex 5e31f01..2f775bd 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -2179,11 +2179,11 @@ enum mlx5_txcmp_code {\n \t\tlast->cseg.flags = RTE_BE32(MLX5_COMP_ALWAYS <<\n \t\t\t\t\t MLX5_COMP_MODE_OFFSET);\n \t\t/* Save elts_head in dedicated free on completion queue. */\n-#ifdef NDEBUG\n-\t\ttxq->fcqs[txq->cq_pi++ & txq->cqe_m] = head;\n-#else\n+#ifdef MLX5_DEBUG\n \t\ttxq->fcqs[txq->cq_pi++ & txq->cqe_m] = head |\n-\t\t\t\t\t(last->cseg.opcode >> 8) << 16;\n+\t\t\t (last->cseg.opcode >> 8) << 16;\n+#else\n+\t\ttxq->fcqs[txq->cq_pi++ & txq->cqe_m] = head;\n #endif\n \t\t/* A CQE slot must always be available. */\n \t\tassert((txq->cq_pi - txq->cq_ci) <= txq->cqe_s);\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h\nindex 3f659d2..d443509 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -295,10 +295,10 @@ struct mlx5_txq_data {\n \tstruct mlx5_mr_ctrl mr_ctrl; /* MR control descriptor. */\n \tstruct mlx5_wqe *wqes; /* Work queue. */\n \tstruct mlx5_wqe *wqes_end; /* Work queue array limit. */\n-#ifdef NDEBUG\n-\tuint16_t *fcqs; /* Free completion queue. */\n-#else\n+#ifdef MLX5_DEBUG\n \tuint32_t *fcqs; /* Free completion queue (debug extended). */\n+#else\n+\tuint16_t *fcqs; /* Free completion queue. */\n #endif\n \tvolatile struct mlx5_cqe *cqes; /* Completion queue. */\n \tvolatile uint32_t *qp_db; /* Work queue doorbell. */\ndiff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c\nindex 1a76f6e..5c48dcf 100644\n--- a/drivers/net/mlx5/mlx5_txq.c\n+++ b/drivers/net/mlx5/mlx5_txq.c\n@@ -82,7 +82,7 @@\n \n \t\tassert(elt != NULL);\n \t\trte_pktmbuf_free_seg(elt);\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \t\t/* Poisoning. */\n \t\tmemset(&(*elts)[elts_tail & elts_m],\n \t\t 0x77,\ndiff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h\nindex ebf79b8..8b12bce 100644\n--- a/drivers/net/mlx5/mlx5_utils.h\n+++ b/drivers/net/mlx5/mlx5_utils.h\n@@ -81,10 +81,10 @@\n \t\tRTE_FMT_TAIL(__VA_ARGS__,)))\n \n /*\n- * When debugging is enabled (NDEBUG not defined), file, line and function\n+ * When debugging is enabled (MLX5_DEBUG is defined), file, line and function\n * information replace the driver name (MLX5_DRIVER_NAME) in log messages.\n */\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \n #define PMD_DRV_LOG__(level, ...) \\\n \tPMD_DRV_LOG___(level, \"%s:%u: %s(): \" __VA_ARGS__)\n@@ -96,13 +96,13 @@\n \t\t__func__, \\\n \t\t__VA_ARGS__)\n \n-#else /* NDEBUG */\n+#else /* MLX5_DEBUG */\n #define PMD_DRV_LOG__(level, ...) \\\n \tPMD_DRV_LOG___(level, __VA_ARGS__)\n #define PMD_DRV_LOG_(level, s, ...) \\\n \tPMD_DRV_LOG__(level, s \"\\n\", __VA_ARGS__)\n \n-#endif /* NDEBUG */\n+#endif /* MLX5_DEBUG */\n \n /* Generic printf()-like logging macro with automatic line feed. */\n #define DRV_LOG(level, ...) \\\n@@ -111,19 +111,19 @@\n \t\tPMD_DRV_LOG_CPAREN)\n \n /* claim_zero() does not perform any check when debugging is disabled. */\n-#ifndef NDEBUG\n+#ifdef MLX5_DEBUG\n \n #define DEBUG(...) DRV_LOG(DEBUG, __VA_ARGS__)\n #define claim_zero(...) assert((__VA_ARGS__) == 0)\n #define claim_nonzero(...) assert((__VA_ARGS__) != 0)\n \n-#else /* NDEBUG */\n+#else /* MLX5_DEBUG */\n \n #define DEBUG(...) (void)0\n #define claim_zero(...) (__VA_ARGS__)\n #define claim_nonzero(...) (__VA_ARGS__)\n \n-#endif /* NDEBUG */\n+#endif /* MLX5_DEBUG */\n \n #define INFO(...) DRV_LOG(INFO, __VA_ARGS__)\n #define WARN(...) DRV_LOG(WARNING, __VA_ARGS__)\n", "prefixes": [ "v2", "4/5" ] }{ "id": 65092, "url": "