summaryrefslogtreecommitdiff
path: root/drivers/net/mlx4/mlx4.c
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2018-02-02 17:46:12 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-02-06 14:35:07 +0100
commit2a3b00973d7937e36851c13078d76c02f18e5814 (patch)
treeebf6fb58c8c1ddc115f2c30b9f3ef0b2e935dc7f /drivers/net/mlx4/mlx4.c
parentaeafacd9d79896ac36921d82aa273fbef5c34c37 (diff)
downloaddpdk-2a3b00973d7937e36851c13078d76c02f18e5814.zip
dpdk-2a3b00973d7937e36851c13078d76c02f18e5814.tar.gz
dpdk-2a3b00973d7937e36851c13078d76c02f18e5814.tar.xz
net/mlx: add debug checks to glue structure
This code should catch mistakes early if a glue structure member is added without a corresponding implementation in the library. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers/net/mlx4/mlx4.c')
-rw-r--r--drivers/net/mlx4/mlx4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 8928b31..8611e0c 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -771,6 +771,15 @@ rte_mlx4_pmd_init(void)
return;
assert(mlx4_glue);
#endif
+#ifndef NDEBUG
+ /* Glue structure must not contain any NULL pointers. */
+ {
+ unsigned int i;
+
+ for (i = 0; i != sizeof(*mlx4_glue) / sizeof(void *); ++i)
+ assert(((const void *const *)mlx4_glue)[i]);
+ }
+#endif
mlx4_glue->fork_init();
rte_pci_register(&mlx4_driver);
}