summaryrefslogtreecommitdiff
path: root/drivers/net/mlx4/mlx4.c
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2018-02-02 17:46:16 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-02-06 14:35:07 +0100
commit6d5df2eaf667e2e65a34e135ea0e33a055fe9cd0 (patch)
tree7d12b7e7c5c7ede4f5cb5f993d0da10e94a96bc5 /drivers/net/mlx4/mlx4.c
parent747ac2b4d96891876f15e23be82b8c8f87dcabba (diff)
downloaddpdk-6d5df2eaf667e2e65a34e135ea0e33a055fe9cd0.zip
dpdk-6d5df2eaf667e2e65a34e135ea0e33a055fe9cd0.tar.gz
dpdk-6d5df2eaf667e2e65a34e135ea0e33a055fe9cd0.tar.xz
net/mlx: version rdma-core glue libraries
When built as separate objects, these libraries do not have unique names. Since they do not maintain a stable ABI, loading an incompatible library may result in a crash (e.g. in case multiple versions are installed). This patch addresses the above by versioning glue libraries, both on the file system (version suffix) and by comparing a dedicated version field member in glue structures. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers/net/mlx4/mlx4.c')
-rw-r--r--drivers/net/mlx4/mlx4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 8611e0c..a76fc59 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -780,6 +780,11 @@ rte_mlx4_pmd_init(void)
assert(((const void *const *)mlx4_glue)[i]);
}
#endif
+ if (strcmp(mlx4_glue->version, MLX4_GLUE_VERSION)) {
+ ERROR("rdma-core glue \"%s\" mismatch: \"%s\" is required",
+ mlx4_glue->version, MLX4_GLUE_VERSION);
+ return;
+ }
mlx4_glue->fork_init();
rte_pci_register(&mlx4_driver);
}