DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
@ 2020-05-05 11:20 Ophir Munk
  2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag Ophir Munk
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-05 11:20 UTC (permalink / raw)
  To: dev; +Cc: Ophir Munk, Raslan Darawsheh, Matan Azrad, Neil Horman

Create file libabigail.internalignore where it is specified to ignore
all symbols in library file librte_pmd_mlx.* during an ABI check.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 devtools/check-abi.sh              | 4 +++-
 devtools/libabigail.internalignore | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 devtools/libabigail.internalignore

diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh
index dd9120e..3bad19a 100755
--- a/devtools/check-abi.sh
+++ b/devtools/check-abi.sh
@@ -10,7 +10,9 @@ fi
 refdir=$1
 newdir=$2
 warnonly=${3:-}
-ABIDIFF_OPTIONS="--suppr $(dirname $0)/libabigail.abignore --no-added-syms"
+ABIDIFF_OPTIONS="--suppr $(dirname $0))/libabigail.abignore" \
+		" --suppr $(dirname $0))/libabigail.internalignore" \
+		" --no-added-syms"
 
 if [ ! -d $refdir ]; then
 	echo "Error: reference directory '$refdir' does not exist."
diff --git a/devtools/libabigail.internalignore b/devtools/libabigail.internalignore
new file mode 100644
index 0000000..55df5b1
--- /dev/null
+++ b/devtools/libabigail.internalignore
@@ -0,0 +1,4 @@
+; These functions were moved from stable to internal.
+; This is a temporary exception till DPDK 20.11.
+[suppress_file]
+        file_name_regexp = librte*mlx5*
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag
  2020-05-05 11:20 [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Ophir Munk
@ 2020-05-05 11:20 ` Ophir Munk
  2020-05-05 11:46   ` Matan Azrad
  2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 3/3] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 29+ messages in thread
From: Ophir Munk @ 2020-05-05 11:20 UTC (permalink / raw)
  To: dev; +Cc: Ophir Munk, Raslan Darawsheh, Matan Azrad, Neil Horman

Move mlx5 symbols in the map file to the INTERNAL section and add
__internal tags to their definitions.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/common/mlx5/mlx5_common.h               |  3 +++
 drivers/common/mlx5/mlx5_devx_cmds.h            | 23 +++++++++++++++++++++++
 drivers/common/mlx5/mlx5_nl.h                   | 18 +++++++++++++++++-
 drivers/common/mlx5/rte_common_mlx5_version.map |  6 +++---
 4 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index c2d688a..b37b820 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -196,6 +196,7 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
 	return MLX5_CQE_STATUS_SW_OWN;
 }
 
+__rte_internal
 int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);
 
 #define MLX5_CLASS_ARG_NAME "class"
@@ -206,7 +207,9 @@ enum mlx5_class {
 	MLX5_CLASS_INVALID,
 };
 
+__rte_internal
 enum mlx5_class mlx5_class_get(struct rte_devargs *devargs);
+__rte_internal
 void mlx5_translate_port_name(const char *port_name_in,
 			      struct mlx5_switch_info *port_info_out);
 
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index f7802e6..6dc27da 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -300,52 +300,75 @@ struct mlx5_devx_qp_attr {
 
 /* mlx5_devx_cmds.c */
 
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
 						       uint32_t bulk_sz);
+__rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
+__rte_internal
 int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
 				     struct mlx5dv_devx_cmd_comp *cmd_comp,
 				     uint64_t async_id);
+__rte_internal
 int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
 				 struct mlx5_hca_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
+__rte_internal
 int mlx5_devx_get_out_command_status(void *out);
+__rte_internal
 int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
+__rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
+__rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+__rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
 					      struct mlx5_devx_cq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
 			       struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
 					      struct mlx5_devx_qp_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
 				  uint32_t qp_st_mod_op, uint32_t remote_qp_id);
+__rte_internal
 int mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
 			     struct mlx5_devx_rqt_attr *rqt_attr);
 
diff --git a/drivers/common/mlx5/mlx5_nl.h b/drivers/common/mlx5/mlx5_nl.h
index 2c3f837..53021e1 100644
--- a/drivers/common/mlx5/mlx5_nl.h
+++ b/drivers/common/mlx5/mlx5_nl.h
@@ -28,35 +28,51 @@ struct mlx5_nl_vlan_vmwa_context {
 	struct mlx5_nl_vlan_dev vlan_dev[4096];
 };
 
-
+__rte_internal
 int mlx5_nl_init(int protocol);
+__rte_internal
 int mlx5_nl_mac_addr_add(int nlsk_fd, unsigned int iface_idx, uint64_t *mac_own,
 			 struct rte_ether_addr *mac, uint32_t index);
+__rte_internal
 int mlx5_nl_mac_addr_remove(int nlsk_fd, unsigned int iface_idx,
 			    uint64_t *mac_own, struct rte_ether_addr *mac,
 			    uint32_t index);
+__rte_internal
 void mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface_idx,
 			   struct rte_ether_addr *mac_addrs, int n);
+__rte_internal
 void mlx5_nl_mac_addr_flush(int nlsk_fd, unsigned int iface_idx,
 			    struct rte_ether_addr *mac_addrs, int n,
 			    uint64_t *mac_own);
+__rte_internal
 int mlx5_nl_promisc(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 int mlx5_nl_allmulti(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 unsigned int mlx5_nl_portnum(int nl, const char *name);
+__rte_internal
 unsigned int mlx5_nl_ifindex(int nl, const char *name, uint32_t pindex);
+__rte_internal
 int mlx5_nl_vf_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 			       struct rte_ether_addr *mac, int vf_index);
+__rte_internal
 int mlx5_nl_switch_info(int nl, unsigned int ifindex,
 			struct mlx5_switch_info *info);
 
+__rte_internal
 void mlx5_nl_vlan_vmwa_delete(struct mlx5_nl_vlan_vmwa_context *vmwa,
 			      uint32_t ifindex);
+__rte_internal
 uint32_t mlx5_nl_vlan_vmwa_create(struct mlx5_nl_vlan_vmwa_context *vmwa,
 				  uint32_t ifindex, uint16_t tag);
+__rte_internal
 int mlx5_nl_devlink_family_id_get(int nlsk_fd);
+__rte_internal
 int mlx5_nl_enable_roce_get(int nlsk_fd, int family_id, const char *pci_addr,
 			    int *enable);
+__rte_internal
 int mlx5_nl_driver_reload(int nlsk_fd, int family_id, const char *pci_addr);
+__rte_internal
 int mlx5_nl_enable_roce_set(int nlsk_fd, int family_id, const char *pci_addr,
 			    int enable);
 
diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map
index b58a378..61d1d4d 100644
--- a/drivers/common/mlx5/rte_common_mlx5_version.map
+++ b/drivers/common/mlx5/rte_common_mlx5_version.map
@@ -1,8 +1,10 @@
-DPDK_20.0.1 {
+INTERNAL {
 	global:
 
 	mlx5_class_get;
 
+	mlx5_dev_to_pci_addr;
+
 	mlx5_devx_cmd_create_cq;
 	mlx5_devx_cmd_create_qp;
 	mlx5_devx_cmd_create_rq;
@@ -27,8 +29,6 @@ DPDK_20.0.1 {
 	mlx5_devx_cmd_query_virtq;
 	mlx5_devx_get_out_command_status;
 
-	mlx5_dev_to_pci_addr;
-
 	mlx5_nl_allmulti;
 	mlx5_nl_devlink_family_id_get;
 	mlx5_nl_driver_reload;
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v1 3/3] common/mlx5: remove devx dependency on ibv and DV
  2020-05-05 11:20 [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Ophir Munk
  2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag Ophir Munk
@ 2020-05-05 11:20 ` Ophir Munk
  2020-05-05 11:45 ` [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Matan Azrad
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-05 11:20 UTC (permalink / raw)
  To: dev; +Cc: Ophir Munk, Raslan Darawsheh, Matan Azrad, Neil Horman

File mlx5_devx_cmds.c should contain pure DevX calls. It must be OS
agnostic and not include any references to ibv or dv structs (defined in
ibverbs and rdma-core linux libraries).  This commit replaces all ibv
and dv references with 'void *'.  Specifically, the following struct
were replaced:
1. struct ibv_context *
2. struct ibv_qp *
3. struct mlx5dv_devx_cmd_comp *

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 59 ++++++++++++++++++------------------
 drivers/common/mlx5/mlx5_devx_cmds.h | 30 +++++++++---------
 2 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 67c8a8c..230ac58 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -15,7 +15,7 @@
  * Allocate flow counters via devx interface.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param dcs
  *   Pointer to counters properties structure to be filled by the routine.
  * @param bulk_n_128
@@ -26,7 +26,7 @@
  *   rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx, uint32_t bulk_n_128)
+mlx5_devx_cmd_flow_counter_alloc(void *ctx, uint32_t bulk_n_128)
 {
 	struct mlx5_devx_obj *dcs = rte_zmalloc("dcs", sizeof(*dcs), 0);
 	uint32_t in[MLX5_ST_SZ_DW(alloc_flow_counter_in)]   = {0};
@@ -81,7 +81,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				 int clear, uint32_t n_counters,
 				 uint64_t *pkts, uint64_t *bytes,
 				 uint32_t mkey, void *addr,
-				 struct mlx5dv_devx_cmd_comp *cmd_comp,
+				 void *cmd_comp,
 				 uint64_t async_id)
 {
 	int out_len = MLX5_ST_SZ_BYTES(query_flow_counter_out) +
@@ -130,7 +130,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  * Create a new mkey.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[in] attr
  *   Attributes of the requested mkey.
  *
@@ -139,7 +139,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  *   is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+mlx5_devx_cmd_mkey_create(void *ctx,
 			  struct mlx5_devx_mkey_attr *attr)
 {
 	struct mlx5_klm *klm_array = attr->klm_array;
@@ -279,7 +279,7 @@ mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj)
  *   0 on success, a negative value otherwise.
  */
 static int
-mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
+mlx5_devx_cmd_query_nic_vport_context(void *ctx,
 				      unsigned int vport,
 				      struct mlx5_hca_attr *attr)
 {
@@ -321,12 +321,12 @@ mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
  * Query NIC vDPA attributes.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] vdpa_attr
  *   vDPA Attributes structure to fill.
  */
 static void
-mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_vdpa_attr(void *ctx,
 				  struct mlx5_hca_vdpa_attr *vdpa_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -402,7 +402,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  * is having the required capabilities.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] attr
  *   Attributes device values.
  *
@@ -410,7 +410,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_attr(void *ctx,
 			     struct mlx5_hca_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -570,7 +570,7 @@ mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 			      uint32_t *tis_td)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_tis_in)] = {0};
@@ -637,7 +637,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  * Create RQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rq_attr
  *   Pointer to create RQ attributes structure.
  * @param [in] socket
@@ -647,7 +647,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rq(void *ctx,
 			struct mlx5_devx_create_rq_attr *rq_attr,
 			int socket)
 {
@@ -746,7 +746,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  * Create TIR using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *  Context returned from mlx5 open_device() glue function.
  * @param [in] tir_attr
  *   Pointer to TIR attributes structure.
  *
@@ -754,7 +754,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tir(void *ctx,
 			 struct mlx5_devx_tir_attr *tir_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tir_in)] = {0};
@@ -815,7 +815,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  * Create RQT using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rqt_attr
  *   Pointer to RQT attributes structure.
  *
@@ -823,7 +823,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rqt(void *ctx,
 			 struct mlx5_devx_rqt_attr *rqt_attr)
 {
 	uint32_t *in = NULL;
@@ -917,7 +917,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  * Create SQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] sq_attr
  *   Pointer to SQ attributes structure.
  * @param [in] socket
@@ -927,7 +927,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  **/
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_sq(void *ctx,
 			struct mlx5_devx_create_sq_attr *sq_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_sq_in)] = {0};
@@ -1019,7 +1019,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  * Create TIS using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] tis_attr
  *   Pointer to TIS attributes structure.
  *
@@ -1027,7 +1027,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tis(void *ctx,
 			 struct mlx5_devx_tis_attr *tis_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tis_in)] = {0};
@@ -1066,13 +1066,12 @@ mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
  * Create transport domain using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
- *
+ *   Context returned from mlx5 open_device() glue function.
  * @return
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_td(struct ibv_context *ctx)
+mlx5_devx_cmd_create_td(void *ctx)
 {
 	uint32_t in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {0};
@@ -1143,7 +1142,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  * Create CQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to CQ attributes structure.
  *
@@ -1151,7 +1150,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
+mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_cq_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(create_cq_out)] = {0};
@@ -1201,7 +1200,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  * Create VIRTQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to VIRTQ attributes structure.
  *
@@ -1209,7 +1208,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_virtq(void *ctx,
 			   struct mlx5_devx_virtq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_virtq_in)] = {0};
@@ -1370,7 +1369,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  * Create QP using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to QP attributes structure.
  *
@@ -1378,7 +1377,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+mlx5_devx_cmd_create_qp(void *ctx,
 			struct mlx5_devx_qp_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_qp_in)] = {0};
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 6dc27da..ac10687 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -11,7 +11,7 @@
 
 /* devX creation object */
 struct mlx5_devx_obj {
-	struct mlx5dv_devx_obj *obj; /* The DV object. */
+	void *obj; /* The DV object. */
 	int id; /* The object ID. */
 };
 
@@ -301,7 +301,7 @@ struct mlx5_devx_qp_attr {
 /* mlx5_devx_cmds.c */
 
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(void *ctx,
 						       uint32_t bulk_sz);
 __rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
@@ -310,51 +310,51 @@ int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
-				     struct mlx5dv_devx_cmd_comp *cmd_comp,
+				     void *cmd_comp,
 				     uint64_t async_id);
 __rte_internal
-int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+int mlx5_devx_cmd_query_hca_attr(void *ctx,
 				 struct mlx5_hca_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(void *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
 __rte_internal
 int mlx5_devx_get_out_command_status(void *out);
 __rte_internal
-int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+int mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(void *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
 __rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(void *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(void *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(void *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
 __rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(void *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+struct mlx5_devx_obj *mlx5_devx_cmd_create_td(void *ctx);
 __rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(void *ctx,
 					      struct mlx5_devx_cq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(void *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
@@ -363,7 +363,7 @@ __rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(void *ctx,
 					      struct mlx5_devx_qp_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-05 11:20 [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Ophir Munk
  2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag Ophir Munk
  2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 3/3] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
@ 2020-05-05 11:45 ` Matan Azrad
  2020-05-05 14:53 ` David Marchand
  2020-05-07  7:37 ` [dpdk-dev] [PATCH v2 0/2] add INTERNAL tags and avoid comparison Ophir Munk
  4 siblings, 0 replies; 29+ messages in thread
From: Matan Azrad @ 2020-05-05 11:45 UTC (permalink / raw)
  To: Ophir Munk, dev; +Cc: Ophir Munk, Raslan Darawsheh, Neil Horman



From: Ophir Munk
> Create file libabigail.internalignore where it is specified to ignore all symbols
> in library file librte_pmd_mlx.* during an ABI check.
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag
  2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag Ophir Munk
@ 2020-05-05 11:46   ` Matan Azrad
  0 siblings, 0 replies; 29+ messages in thread
From: Matan Azrad @ 2020-05-05 11:46 UTC (permalink / raw)
  To: Ophir Munk, dev; +Cc: Ophir Munk, Raslan Darawsheh, Neil Horman



From: Ophir Munk
> Move mlx5 symbols in the map file to the INTERNAL section and add
> __internal tags to their definitions.
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-05 11:20 [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Ophir Munk
                   ` (2 preceding siblings ...)
  2020-05-05 11:45 ` [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Matan Azrad
@ 2020-05-05 14:53 ` David Marchand
  2020-05-05 15:02   ` Ray Kinsella
  2020-05-06 12:27   ` Thomas Monjalon
  2020-05-07  7:37 ` [dpdk-dev] [PATCH v2 0/2] add INTERNAL tags and avoid comparison Ophir Munk
  4 siblings, 2 replies; 29+ messages in thread
From: David Marchand @ 2020-05-05 14:53 UTC (permalink / raw)
  To: Ophir Munk; +Cc: dev, Raslan Darawsheh, Matan Azrad, Neil Horman, Ray Kinsella

Don't forget to Cc: Ray.

On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
>
> Create file libabigail.internalignore where it is specified to ignore
> all symbols in library file librte_pmd_mlx.* during an ABI check.

I don't like the separate file, having rules with comments in a single
place is easier to maintain.

Why waive all changes in all mlx drivers?
There is a single issue with 20.02, see below.


Besides, looking at next patches, why keep experimental symbols?
If all symbols in common/mlx5 are for internal use, mark them _all_ as such.


>
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> ---
>  devtools/check-abi.sh              | 4 +++-
>  devtools/libabigail.internalignore | 4 ++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
>  create mode 100644 devtools/libabigail.internalignore
>
> diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh
> index dd9120e..3bad19a 100755
> --- a/devtools/check-abi.sh
> +++ b/devtools/check-abi.sh
> @@ -10,7 +10,9 @@ fi
>  refdir=$1
>  newdir=$2
>  warnonly=${3:-}
> -ABIDIFF_OPTIONS="--suppr $(dirname $0)/libabigail.abignore --no-added-syms"
> +ABIDIFF_OPTIONS="--suppr $(dirname $0))/libabigail.abignore" \
> +               " --suppr $(dirname $0))/libabigail.internalignore" \
> +               " --no-added-syms"
>
>  if [ ! -d $refdir ]; then
>         echo "Error: reference directory '$refdir' does not exist."
> diff --git a/devtools/libabigail.internalignore b/devtools/libabigail.internalignore
> new file mode 100644
> index 0000000..55df5b1
> --- /dev/null
> +++ b/devtools/libabigail.internalignore
> @@ -0,0 +1,4 @@
> +; These functions were moved from stable to internal.
> +; This is a temporary exception till DPDK 20.11.

This is not until 20.11 if we merge this patch now.
It is only when comparing 20.02 to 20.05.
After this, symbols will be marked INTERNAL and will be skipped by the
generic rule, so we can remove this exception in 20.08-rc0.


> +[suppress_file]
> +        file_name_regexp = librte*mlx5*
> --
> 2.8.4

A stricter rule is enough, can you try something like:

+[suppress_file]
+       file_name_regexp = ^librte_common_mlx5\.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-05 14:53 ` David Marchand
@ 2020-05-05 15:02   ` Ray Kinsella
  2020-05-06 12:27   ` Thomas Monjalon
  1 sibling, 0 replies; 29+ messages in thread
From: Ray Kinsella @ 2020-05-05 15:02 UTC (permalink / raw)
  To: David Marchand, Ophir Munk
  Cc: dev, Raslan Darawsheh, Matan Azrad, Neil Horman



On 05/05/2020 15:53, David Marchand wrote:
> Don't forget to Cc: Ray.
> 
> On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
>>
>> Create file libabigail.internalignore where it is specified to ignore
>> all symbols in library file librte_pmd_mlx.* during an ABI check.
> 
> I don't like the separate file, having rules with comments in a single
> place is easier to maintain.

agreed, it would become confusing which file should be updated?

> 
> Why waive all changes in all mlx drivers?
> There is a single issue with 20.02, see below.
isn't this exactly what rte_internal was created for right?

> 
> 
> Besides, looking at next patches, why keep experimental symbols?
> If all symbols in common/mlx5 are for internal use, mark them _all_ as such.
> 
> 
>>
>> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
>> ---
>>  devtools/check-abi.sh              | 4 +++-
>>  devtools/libabigail.internalignore | 4 ++++
>>  2 files changed, 7 insertions(+), 1 deletion(-)
>>  create mode 100644 devtools/libabigail.internalignore
>>
>> diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh
>> index dd9120e..3bad19a 100755
>> --- a/devtools/check-abi.sh
>> +++ b/devtools/check-abi.sh
>> @@ -10,7 +10,9 @@ fi
>>  refdir=$1
>>  newdir=$2
>>  warnonly=${3:-}
>> -ABIDIFF_OPTIONS="--suppr $(dirname $0)/libabigail.abignore --no-added-syms"
>> +ABIDIFF_OPTIONS="--suppr $(dirname $0))/libabigail.abignore" \
>> +               " --suppr $(dirname $0))/libabigail.internalignore" \
>> +               " --no-added-syms"
>>
>>  if [ ! -d $refdir ]; then
>>         echo "Error: reference directory '$refdir' does not exist."
>> diff --git a/devtools/libabigail.internalignore b/devtools/libabigail.internalignore
>> new file mode 100644
>> index 0000000..55df5b1
>> --- /dev/null
>> +++ b/devtools/libabigail.internalignore
>> @@ -0,0 +1,4 @@
>> +; These functions were moved from stable to internal.
>> +; This is a temporary exception till DPDK 20.11.
> 
> This is not until 20.11 if we merge this patch now.
> It is only when comparing 20.02 to 20.05.
> After this, symbols will be marked INTERNAL and will be skipped by the
> generic rule, so we can remove this exception in 20.08-rc0.
> 
> 
>> +[suppress_file]
>> +        file_name_regexp = librte*mlx5*
>> --
>> 2.8.4
> 
> A stricter rule is enough, can you try something like:
> 
> +[suppress_file]
> +       file_name_regexp = ^librte_common_mlx5\.
> 
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-05 14:53 ` David Marchand
  2020-05-05 15:02   ` Ray Kinsella
@ 2020-05-06 12:27   ` Thomas Monjalon
  2020-05-06 12:42     ` David Marchand
  1 sibling, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2020-05-06 12:27 UTC (permalink / raw)
  To: Ray Kinsella, David Marchand
  Cc: Ophir Munk, dev, Raslan Darawsheh, Matan Azrad, Neil Horman

05/05/2020 16:53, David Marchand:
> On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
> > +; These functions were moved from stable to internal.
> > +; This is a temporary exception till DPDK 20.11.
> 
> This is not until 20.11 if we merge this patch now.
> It is only when comparing 20.02 to 20.05.
> After this, symbols will be marked INTERNAL and will be skipped by the
> generic rule, so we can remove this exception in 20.08-rc0.

I think we need to keep this rule until 20.11,
because we want to ignore symbols which were in 19.11 and 20.02,
and removed (as internal) in 20.05.

If we remove this rule in 20.08, and comparing with 19.11,
the tool will complain about removed symbols, isn't it?



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-06 12:27   ` Thomas Monjalon
@ 2020-05-06 12:42     ` David Marchand
  2020-05-06 12:52       ` Thomas Monjalon
  0 siblings, 1 reply; 29+ messages in thread
From: David Marchand @ 2020-05-06 12:42 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ray Kinsella, Ophir Munk, dev, Raslan Darawsheh, Matan Azrad,
	Neil Horman

On Wed, May 6, 2020 at 2:27 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 05/05/2020 16:53, David Marchand:
> > On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
> > > +; These functions were moved from stable to internal.
> > > +; This is a temporary exception till DPDK 20.11.
> >
> > This is not until 20.11 if we merge this patch now.
> > It is only when comparing 20.02 to 20.05.
> > After this, symbols will be marked INTERNAL and will be skipped by the
> > generic rule, so we can remove this exception in 20.08-rc0.
>
> I think we need to keep this rule until 20.11,
> because we want to ignore symbols which were in 19.11 and 20.02,
> and removed (as internal) in 20.05.

Those symbols were exported in 20.02.
Before this, they were internal to mlx5 net driver.


>
> If we remove this rule in 20.08, and comparing with 19.11,
> the tool will complain about removed symbols, isn't it?

If we remove the rule in 20.08 and compare to _20.02_ then yes, we
would get an issue.
I was only thinking of comparing 20.08 with 20.05.

We can keep this until 20.11 if you think it is safer.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-06 12:42     ` David Marchand
@ 2020-05-06 12:52       ` Thomas Monjalon
  2020-05-06 14:15         ` Ray Kinsella
  0 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2020-05-06 12:52 UTC (permalink / raw)
  To: David Marchand, Ophir Munk
  Cc: Ray Kinsella, dev, Raslan Darawsheh, Matan Azrad, Neil Horman

06/05/2020 14:42, David Marchand:
> On Wed, May 6, 2020 at 2:27 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > 05/05/2020 16:53, David Marchand:
> > > On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
> > > > +; These functions were moved from stable to internal.
> > > > +; This is a temporary exception till DPDK 20.11.
> > >
> > > This is not until 20.11 if we merge this patch now.
> > > It is only when comparing 20.02 to 20.05.
> > > After this, symbols will be marked INTERNAL and will be skipped by the
> > > generic rule, so we can remove this exception in 20.08-rc0.
> >
> > I think we need to keep this rule until 20.11,
> > because we want to ignore symbols which were in 19.11 and 20.02,
> > and removed (as internal) in 20.05.
> 
> Those symbols were exported in 20.02.

Right, no issue when comparing with 19.11.


> Before this, they were internal to mlx5 net driver.
> 
> 
> >
> > If we remove this rule in 20.08, and comparing with 19.11,
> > the tool will complain about removed symbols, isn't it?
> 
> If we remove the rule in 20.08 and compare to _20.02_ then yes, we
> would get an issue.
> I was only thinking of comparing 20.08 with 20.05.
> 
> We can keep this until 20.11 if you think it is safer.

Yes I think we must make sure any comparison can be done during
compatibility lifetime.



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-06 12:52       ` Thomas Monjalon
@ 2020-05-06 14:15         ` Ray Kinsella
  2020-05-06 14:22           ` Thomas Monjalon
  0 siblings, 1 reply; 29+ messages in thread
From: Ray Kinsella @ 2020-05-06 14:15 UTC (permalink / raw)
  To: Thomas Monjalon, David Marchand, Ophir Munk
  Cc: dev, Raslan Darawsheh, Matan Azrad, Neil Horman



On 06/05/2020 13:52, Thomas Monjalon wrote:
> 06/05/2020 14:42, David Marchand:
>> On Wed, May 6, 2020 at 2:27 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>>>
>>> 05/05/2020 16:53, David Marchand:
>>>> On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
>>>>> +; These functions were moved from stable to internal.
>>>>> +; This is a temporary exception till DPDK 20.11.
>>>>
>>>> This is not until 20.11 if we merge this patch now.
>>>> It is only when comparing 20.02 to 20.05.
>>>> After this, symbols will be marked INTERNAL and will be skipped by the
>>>> generic rule, so we can remove this exception in 20.08-rc0.
>>>
>>> I think we need to keep this rule until 20.11,
>>> because we want to ignore symbols which were in 19.11 and 20.02,
>>> and removed (as internal) in 20.05.
>>
>> Those symbols were exported in 20.02.
> 
> Right, no issue when comparing with 19.11.

Right, which also makes it different to the Traffic Manager issue.
As these symbols where never in v20 - 19.11, they won't be missed.
We never had a commitment to maintain them. 

If there were in v20, the situation might be considered differently. 

> 
>> Before this, they were internal to mlx5 net driver.
>>
>>
>>>
>>> If we remove this rule in 20.08, and comparing with 19.11,
>>> the tool will complain about removed symbols, isn't it?
>>
>> If we remove the rule in 20.08 and compare to _20.02_ then yes, we
>> would get an issue.
>> I was only thinking of comparing 20.08 with 20.05.
>>
>> We can keep this until 20.11 if you think it is safer.
> 
> Yes I think we must make sure any comparison can be done during
> compatibility lifetime.

As David said, 20.08 _should_ be being compared to 20.05 by the CI.
So it should be find to drop the rule then.

However
It might make easier though to let libabigail.ignore accumulate these kind of 
suppressions between major releases / lts (v20 -> v21),  and the completely 
reset, and start over.  

Ray K



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-06 14:15         ` Ray Kinsella
@ 2020-05-06 14:22           ` Thomas Monjalon
  2020-05-07  7:48             ` Ophir Munk
  0 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2020-05-06 14:22 UTC (permalink / raw)
  To: David Marchand, Ophir Munk, Ray Kinsella
  Cc: dev, Raslan Darawsheh, Matan Azrad, Neil Horman

06/05/2020 16:15, Ray Kinsella:
> 
> On 06/05/2020 13:52, Thomas Monjalon wrote:
> > 06/05/2020 14:42, David Marchand:
> >> On Wed, May 6, 2020 at 2:27 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >>>
> >>> 05/05/2020 16:53, David Marchand:
> >>>> On Tue, May 5, 2020 at 1:21 PM Ophir Munk <ophirmu@mellanox.com> wrote:
> >>>>> +; These functions were moved from stable to internal.
> >>>>> +; This is a temporary exception till DPDK 20.11.
> >>>>
> >>>> This is not until 20.11 if we merge this patch now.
> >>>> It is only when comparing 20.02 to 20.05.
> >>>> After this, symbols will be marked INTERNAL and will be skipped by the
> >>>> generic rule, so we can remove this exception in 20.08-rc0.
> >>>
> >>> I think we need to keep this rule until 20.11,
> >>> because we want to ignore symbols which were in 19.11 and 20.02,
> >>> and removed (as internal) in 20.05.
> >>
> >> Those symbols were exported in 20.02.
> > 
> > Right, no issue when comparing with 19.11.
> 
> Right, which also makes it different to the Traffic Manager issue.
> As these symbols where never in v20 - 19.11, they won't be missed.
> We never had a commitment to maintain them. 
> 
> If there were in v20, the situation might be considered differently. 
> 
> > 
> >> Before this, they were internal to mlx5 net driver.
> >>
> >>
> >>>
> >>> If we remove this rule in 20.08, and comparing with 19.11,
> >>> the tool will complain about removed symbols, isn't it?
> >>
> >> If we remove the rule in 20.08 and compare to _20.02_ then yes, we
> >> would get an issue.
> >> I was only thinking of comparing 20.08 with 20.05.
> >>
> >> We can keep this until 20.11 if you think it is safer.
> > 
> > Yes I think we must make sure any comparison can be done during
> > compatibility lifetime.
> 
> As David said, 20.08 _should_ be being compared to 20.05 by the CI.
> So it should be find to drop the rule then.

"should", but users "could" do something else ;-)

> However
> It might make easier though to let libabigail.ignore accumulate these kind of 
> suppressions between major releases / lts (v20 -> v21),  and the completely 
> reset, and start over.  

Yes it's simpler and safer.



^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v2 0/2] add INTERNAL tags and avoid comparison
  2020-05-05 11:20 [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Ophir Munk
                   ` (3 preceding siblings ...)
  2020-05-05 14:53 ` David Marchand
@ 2020-05-07  7:37 ` Ophir Munk
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag " Ophir Munk
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
  4 siblings, 2 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  7:37 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

v1:
Initial version
v2:
Follow review comments.
Suppress librte_common_mlx5.* in libabigail.abignore file. Use a stricter regexp.
Squash the first two commits from v1.

Ophir Munk (2):
  common/mlx5: add rte internal tag and avoid comparison
  common/mlx5: remove devx dependency on ibv and DV

 devtools/libabigail.abignore                    |  7 +++
 drivers/common/mlx5/mlx5_common.h               |  3 ++
 drivers/common/mlx5/mlx5_devx_cmds.c            | 59 ++++++++++++-------------
 drivers/common/mlx5/mlx5_devx_cmds.h            | 53 +++++++++++++++-------
 drivers/common/mlx5/mlx5_nl.h                   | 18 +++++++-
 drivers/common/mlx5/rte_common_mlx5_version.map |  6 +--
 6 files changed, 97 insertions(+), 49 deletions(-)

-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  7:37 ` [dpdk-dev] [PATCH v2 0/2] add INTERNAL tags and avoid comparison Ophir Munk
@ 2020-05-07  7:37   ` Ophir Munk
  2020-05-07  7:44     ` Matan Azrad
                       ` (2 more replies)
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
  1 sibling, 3 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  7:37 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

Move mlx5 symbols in the map file to the INTERNAL section and add
__internal tags to their definitions.
Those symbols were exported in 20.02 and now (20.05) they are removed.
Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
suppress_file directive to libabigail.abignore file. This directive will
prevent loading mlx5 common symbols and no comparison will be performed.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 devtools/libabigail.abignore                    |  7 +++++++
 drivers/common/mlx5/mlx5_common.h               |  3 +++
 drivers/common/mlx5/mlx5_devx_cmds.h            | 23 +++++++++++++++++++++++
 drivers/common/mlx5/mlx5_nl.h                   | 18 +++++++++++++++++-
 drivers/common/mlx5/rte_common_mlx5_version.map |  6 +++---
 5 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 0326662..f22d540 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -35,3 +35,10 @@
         type_kind = enum
         name = rte_eth_event_type
         changed_enumerators = RTE_ETH_EVENT_MAX
+
+; These functions were moved from stable to internal.
+; Avoid loading the symbols and comparing them.
+; This is a temporary exception till DPDK 20.11
+[suppress_file]
+	file_name_regexp = ^librte_common_mlx5\.
+
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index c2d688a..b37b820 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -196,6 +196,7 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
 	return MLX5_CQE_STATUS_SW_OWN;
 }
 
+__rte_internal
 int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);
 
 #define MLX5_CLASS_ARG_NAME "class"
@@ -206,7 +207,9 @@ enum mlx5_class {
 	MLX5_CLASS_INVALID,
 };
 
+__rte_internal
 enum mlx5_class mlx5_class_get(struct rte_devargs *devargs);
+__rte_internal
 void mlx5_translate_port_name(const char *port_name_in,
 			      struct mlx5_switch_info *port_info_out);
 
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index f7802e6..6dc27da 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -300,52 +300,75 @@ struct mlx5_devx_qp_attr {
 
 /* mlx5_devx_cmds.c */
 
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
 						       uint32_t bulk_sz);
+__rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
+__rte_internal
 int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
 				     struct mlx5dv_devx_cmd_comp *cmd_comp,
 				     uint64_t async_id);
+__rte_internal
 int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
 				 struct mlx5_hca_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
+__rte_internal
 int mlx5_devx_get_out_command_status(void *out);
+__rte_internal
 int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
+__rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
+__rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+__rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
 					      struct mlx5_devx_cq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
 			       struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
 					      struct mlx5_devx_qp_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
 				  uint32_t qp_st_mod_op, uint32_t remote_qp_id);
+__rte_internal
 int mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
 			     struct mlx5_devx_rqt_attr *rqt_attr);
 
diff --git a/drivers/common/mlx5/mlx5_nl.h b/drivers/common/mlx5/mlx5_nl.h
index 2c3f837..53021e1 100644
--- a/drivers/common/mlx5/mlx5_nl.h
+++ b/drivers/common/mlx5/mlx5_nl.h
@@ -28,35 +28,51 @@ struct mlx5_nl_vlan_vmwa_context {
 	struct mlx5_nl_vlan_dev vlan_dev[4096];
 };
 
-
+__rte_internal
 int mlx5_nl_init(int protocol);
+__rte_internal
 int mlx5_nl_mac_addr_add(int nlsk_fd, unsigned int iface_idx, uint64_t *mac_own,
 			 struct rte_ether_addr *mac, uint32_t index);
+__rte_internal
 int mlx5_nl_mac_addr_remove(int nlsk_fd, unsigned int iface_idx,
 			    uint64_t *mac_own, struct rte_ether_addr *mac,
 			    uint32_t index);
+__rte_internal
 void mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface_idx,
 			   struct rte_ether_addr *mac_addrs, int n);
+__rte_internal
 void mlx5_nl_mac_addr_flush(int nlsk_fd, unsigned int iface_idx,
 			    struct rte_ether_addr *mac_addrs, int n,
 			    uint64_t *mac_own);
+__rte_internal
 int mlx5_nl_promisc(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 int mlx5_nl_allmulti(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 unsigned int mlx5_nl_portnum(int nl, const char *name);
+__rte_internal
 unsigned int mlx5_nl_ifindex(int nl, const char *name, uint32_t pindex);
+__rte_internal
 int mlx5_nl_vf_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 			       struct rte_ether_addr *mac, int vf_index);
+__rte_internal
 int mlx5_nl_switch_info(int nl, unsigned int ifindex,
 			struct mlx5_switch_info *info);
 
+__rte_internal
 void mlx5_nl_vlan_vmwa_delete(struct mlx5_nl_vlan_vmwa_context *vmwa,
 			      uint32_t ifindex);
+__rte_internal
 uint32_t mlx5_nl_vlan_vmwa_create(struct mlx5_nl_vlan_vmwa_context *vmwa,
 				  uint32_t ifindex, uint16_t tag);
+__rte_internal
 int mlx5_nl_devlink_family_id_get(int nlsk_fd);
+__rte_internal
 int mlx5_nl_enable_roce_get(int nlsk_fd, int family_id, const char *pci_addr,
 			    int *enable);
+__rte_internal
 int mlx5_nl_driver_reload(int nlsk_fd, int family_id, const char *pci_addr);
+__rte_internal
 int mlx5_nl_enable_roce_set(int nlsk_fd, int family_id, const char *pci_addr,
 			    int enable);
 
diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map
index 564a9a7..61d1d4d 100644
--- a/drivers/common/mlx5/rte_common_mlx5_version.map
+++ b/drivers/common/mlx5/rte_common_mlx5_version.map
@@ -1,8 +1,10 @@
-DPDK_21 {
+INTERNAL {
 	global:
 
 	mlx5_class_get;
 
+	mlx5_dev_to_pci_addr;
+
 	mlx5_devx_cmd_create_cq;
 	mlx5_devx_cmd_create_qp;
 	mlx5_devx_cmd_create_rq;
@@ -27,8 +29,6 @@ DPDK_21 {
 	mlx5_devx_cmd_query_virtq;
 	mlx5_devx_get_out_command_status;
 
-	mlx5_dev_to_pci_addr;
-
 	mlx5_nl_allmulti;
 	mlx5_nl_devlink_family_id_get;
 	mlx5_nl_driver_reload;
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v2 2/2] common/mlx5: remove devx dependency on ibv and DV
  2020-05-07  7:37 ` [dpdk-dev] [PATCH v2 0/2] add INTERNAL tags and avoid comparison Ophir Munk
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag " Ophir Munk
@ 2020-05-07  7:37   ` Ophir Munk
  1 sibling, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  7:37 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

File mlx5_devx_cmds.c should contain pure DevX calls. It must be OS
agnostic and not include any references to ibv or dv structs (defined in
ibverbs and rdma-core linux libraries).  This commit replaces all ibv
and dv references with 'void *'.  Specifically, the following struct
were replaced:
1. struct ibv_context *
2. struct ibv_qp *
3. struct mlx5dv_devx_cmd_comp *

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 59 ++++++++++++++++++------------------
 drivers/common/mlx5/mlx5_devx_cmds.h | 30 +++++++++---------
 2 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 67c8a8c..230ac58 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -15,7 +15,7 @@
  * Allocate flow counters via devx interface.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param dcs
  *   Pointer to counters properties structure to be filled by the routine.
  * @param bulk_n_128
@@ -26,7 +26,7 @@
  *   rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx, uint32_t bulk_n_128)
+mlx5_devx_cmd_flow_counter_alloc(void *ctx, uint32_t bulk_n_128)
 {
 	struct mlx5_devx_obj *dcs = rte_zmalloc("dcs", sizeof(*dcs), 0);
 	uint32_t in[MLX5_ST_SZ_DW(alloc_flow_counter_in)]   = {0};
@@ -81,7 +81,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				 int clear, uint32_t n_counters,
 				 uint64_t *pkts, uint64_t *bytes,
 				 uint32_t mkey, void *addr,
-				 struct mlx5dv_devx_cmd_comp *cmd_comp,
+				 void *cmd_comp,
 				 uint64_t async_id)
 {
 	int out_len = MLX5_ST_SZ_BYTES(query_flow_counter_out) +
@@ -130,7 +130,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  * Create a new mkey.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[in] attr
  *   Attributes of the requested mkey.
  *
@@ -139,7 +139,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  *   is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+mlx5_devx_cmd_mkey_create(void *ctx,
 			  struct mlx5_devx_mkey_attr *attr)
 {
 	struct mlx5_klm *klm_array = attr->klm_array;
@@ -279,7 +279,7 @@ mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj)
  *   0 on success, a negative value otherwise.
  */
 static int
-mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
+mlx5_devx_cmd_query_nic_vport_context(void *ctx,
 				      unsigned int vport,
 				      struct mlx5_hca_attr *attr)
 {
@@ -321,12 +321,12 @@ mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
  * Query NIC vDPA attributes.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] vdpa_attr
  *   vDPA Attributes structure to fill.
  */
 static void
-mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_vdpa_attr(void *ctx,
 				  struct mlx5_hca_vdpa_attr *vdpa_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -402,7 +402,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  * is having the required capabilities.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] attr
  *   Attributes device values.
  *
@@ -410,7 +410,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_attr(void *ctx,
 			     struct mlx5_hca_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -570,7 +570,7 @@ mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 			      uint32_t *tis_td)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_tis_in)] = {0};
@@ -637,7 +637,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  * Create RQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rq_attr
  *   Pointer to create RQ attributes structure.
  * @param [in] socket
@@ -647,7 +647,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rq(void *ctx,
 			struct mlx5_devx_create_rq_attr *rq_attr,
 			int socket)
 {
@@ -746,7 +746,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  * Create TIR using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *  Context returned from mlx5 open_device() glue function.
  * @param [in] tir_attr
  *   Pointer to TIR attributes structure.
  *
@@ -754,7 +754,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tir(void *ctx,
 			 struct mlx5_devx_tir_attr *tir_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tir_in)] = {0};
@@ -815,7 +815,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  * Create RQT using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rqt_attr
  *   Pointer to RQT attributes structure.
  *
@@ -823,7 +823,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rqt(void *ctx,
 			 struct mlx5_devx_rqt_attr *rqt_attr)
 {
 	uint32_t *in = NULL;
@@ -917,7 +917,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  * Create SQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] sq_attr
  *   Pointer to SQ attributes structure.
  * @param [in] socket
@@ -927,7 +927,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  **/
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_sq(void *ctx,
 			struct mlx5_devx_create_sq_attr *sq_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_sq_in)] = {0};
@@ -1019,7 +1019,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  * Create TIS using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] tis_attr
  *   Pointer to TIS attributes structure.
  *
@@ -1027,7 +1027,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tis(void *ctx,
 			 struct mlx5_devx_tis_attr *tis_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tis_in)] = {0};
@@ -1066,13 +1066,12 @@ mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
  * Create transport domain using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
- *
+ *   Context returned from mlx5 open_device() glue function.
  * @return
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_td(struct ibv_context *ctx)
+mlx5_devx_cmd_create_td(void *ctx)
 {
 	uint32_t in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {0};
@@ -1143,7 +1142,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  * Create CQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to CQ attributes structure.
  *
@@ -1151,7 +1150,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
+mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_cq_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(create_cq_out)] = {0};
@@ -1201,7 +1200,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  * Create VIRTQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to VIRTQ attributes structure.
  *
@@ -1209,7 +1208,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_virtq(void *ctx,
 			   struct mlx5_devx_virtq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_virtq_in)] = {0};
@@ -1370,7 +1369,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  * Create QP using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to QP attributes structure.
  *
@@ -1378,7 +1377,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+mlx5_devx_cmd_create_qp(void *ctx,
 			struct mlx5_devx_qp_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_qp_in)] = {0};
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 6dc27da..ac10687 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -11,7 +11,7 @@
 
 /* devX creation object */
 struct mlx5_devx_obj {
-	struct mlx5dv_devx_obj *obj; /* The DV object. */
+	void *obj; /* The DV object. */
 	int id; /* The object ID. */
 };
 
@@ -301,7 +301,7 @@ struct mlx5_devx_qp_attr {
 /* mlx5_devx_cmds.c */
 
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(void *ctx,
 						       uint32_t bulk_sz);
 __rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
@@ -310,51 +310,51 @@ int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
-				     struct mlx5dv_devx_cmd_comp *cmd_comp,
+				     void *cmd_comp,
 				     uint64_t async_id);
 __rte_internal
-int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+int mlx5_devx_cmd_query_hca_attr(void *ctx,
 				 struct mlx5_hca_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(void *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
 __rte_internal
 int mlx5_devx_get_out_command_status(void *out);
 __rte_internal
-int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+int mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(void *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
 __rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(void *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(void *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(void *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
 __rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(void *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+struct mlx5_devx_obj *mlx5_devx_cmd_create_td(void *ctx);
 __rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(void *ctx,
 					      struct mlx5_devx_cq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(void *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
@@ -363,7 +363,7 @@ __rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(void *ctx,
 					      struct mlx5_devx_qp_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag " Ophir Munk
@ 2020-05-07  7:44     ` Matan Azrad
  2020-05-07  7:56     ` Ray Kinsella
  2020-05-07  8:56     ` [dpdk-dev] [PATCH v3 " Ophir Munk
  2 siblings, 0 replies; 29+ messages in thread
From: Matan Azrad @ 2020-05-07  7:44 UTC (permalink / raw)
  To: Ophir Munk, dev, David Marchand
  Cc: Ray Kinsella, Raslan Darawsheh, Thomas Monjalon



From: Ophir Munk:
> Move mlx5 symbols in the map file to the INTERNAL section and add
> __internal tags to their definitions.
> Those symbols were exported in 20.02 and now (20.05) they are removed.
> Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
> suppress_file directive to libabigail.abignore file. This directive will prevent
> loading mlx5 common symbols and no comparison will be performed.
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail
  2020-05-06 14:22           ` Thomas Monjalon
@ 2020-05-07  7:48             ` Ophir Munk
  0 siblings, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  7:48 UTC (permalink / raw)
  To: Thomas Monjalon, David Marchand, Ray Kinsella
  Cc: dev, Raslan Darawsheh, Matan Azrad, Neil Horman

Thanks all for this discussion. I have sent v2 of this patchset.

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, May 6, 2020 5:23 PM
> To: David Marchand <david.marchand@redhat.com>; Ophir Munk
> <ophirmu@mellanox.com>; Ray Kinsella <mdr@ashroe.eu>
> Cc: dev <dev@dpdk.org>; Raslan Darawsheh <rasland@mellanox.com>;
> Matan Azrad <matan@mellanox.com>; Neil Horman
> <nhorman@tuxdriver.com>
> Subject: Re: [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file
> for libabigail
> 
> 06/05/2020 16:15, Ray Kinsella:
> >
> > On 06/05/2020 13:52, Thomas Monjalon wrote:
> > > 06/05/2020 14:42, David Marchand:
> > >> On Wed, May 6, 2020 at 2:27 PM Thomas Monjalon
> <thomas@monjalon.net> wrote:
> > >>>
> > >>> 05/05/2020 16:53, David Marchand:
> > >>>> On Tue, May 5, 2020 at 1:21 PM Ophir Munk
> <ophirmu@mellanox.com> wrote:
> > >>>>> +; These functions were moved from stable to internal.
> > >>>>> +; This is a temporary exception till DPDK 20.11.
> > >>>>
> > >>>> This is not until 20.11 if we merge this patch now.
> > >>>> It is only when comparing 20.02 to 20.05.
> > >>>> After this, symbols will be marked INTERNAL and will be skipped
> > >>>> by the generic rule, so we can remove this exception in 20.08-rc0.
> > >>>
> > >>> I think we need to keep this rule until 20.11, because we want to
> > >>> ignore symbols which were in 19.11 and 20.02, and removed (as
> > >>> internal) in 20.05.
> > >>
> > >> Those symbols were exported in 20.02.
> > >
> > > Right, no issue when comparing with 19.11.
> >
> > Right, which also makes it different to the Traffic Manager issue.
> > As these symbols where never in v20 - 19.11, they won't be missed.
> > We never had a commitment to maintain them.
> >
> > If there were in v20, the situation might be considered differently.
> >
> > >
> > >> Before this, they were internal to mlx5 net driver.
> > >>
> > >>
> > >>>
> > >>> If we remove this rule in 20.08, and comparing with 19.11, the
> > >>> tool will complain about removed symbols, isn't it?
> > >>
> > >> If we remove the rule in 20.08 and compare to _20.02_ then yes, we
> > >> would get an issue.
> > >> I was only thinking of comparing 20.08 with 20.05.
> > >>
> > >> We can keep this until 20.11 if you think it is safer.
> > >
> > > Yes I think we must make sure any comparison can be done during
> > > compatibility lifetime.
> >
> > As David said, 20.08 _should_ be being compared to 20.05 by the CI.
> > So it should be find to drop the rule then.
> 
> "should", but users "could" do something else ;-)
> 
> > However
> > It might make easier though to let libabigail.ignore accumulate these
> > kind of suppressions between major releases / lts (v20 -> v21),  and
> > the completely reset, and start over.
> 
> Yes it's simpler and safer.
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag " Ophir Munk
  2020-05-07  7:44     ` Matan Azrad
@ 2020-05-07  7:56     ` Ray Kinsella
  2020-05-07  9:03       ` Ophir Munk
  2020-05-07  8:56     ` [dpdk-dev] [PATCH v3 " Ophir Munk
  2 siblings, 1 reply; 29+ messages in thread
From: Ray Kinsella @ 2020-05-07  7:56 UTC (permalink / raw)
  To: Ophir Munk, dev, David Marchand
  Cc: Matan Azrad, Raslan Darawsheh, Thomas Monjalon



On 07/05/2020 08:37, Ophir Munk wrote:
> Move mlx5 symbols in the map file to the INTERNAL section and add
> __internal tags to their definitions.
> Those symbols were exported in 20.02 and now (20.05) they are removed.
> Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
> suppress_file directive to libabigail.abignore file. This directive will
> prevent loading mlx5 common symbols and no comparison will be performed.
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> ---
>  devtools/libabigail.abignore                    |  7 +++++++
>  drivers/common/mlx5/mlx5_common.h               |  3 +++
>  drivers/common/mlx5/mlx5_devx_cmds.h            | 23 +++++++++++++++++++++++
>  drivers/common/mlx5/mlx5_nl.h                   | 18 +++++++++++++++++-
>  drivers/common/mlx5/rte_common_mlx5_version.map |  6 +++---
>  5 files changed, 53 insertions(+), 4 deletions(-)

Can you add a Fixes: section.
Referencing the original git commit that added the symbols we are ignoring?

Ray K

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag " Ophir Munk
  2020-05-07  7:44     ` Matan Azrad
  2020-05-07  7:56     ` Ray Kinsella
@ 2020-05-07  8:56     ` Ophir Munk
  2020-05-07  8:56       ` [dpdk-dev] [PATCH v3 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
                         ` (2 more replies)
  2 siblings, 3 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  8:56 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

Move mlx5 symbols in the map file to the INTERNAL section and add
__internal tags to their definitions.
Those symbols were exported in 20.02 and now (20.05) they are removed.
Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
suppress_file directive to libabigail.abignore file. This directive will
prevent loading mlx5 common symbols and no comparison will be performed.

Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
v3: add "Fixes" and "Acked-by" to commit message

 devtools/libabigail.abignore                    |  7 +++++++
 drivers/common/mlx5/mlx5_common.h               |  3 +++
 drivers/common/mlx5/mlx5_devx_cmds.h            | 23 +++++++++++++++++++++++
 drivers/common/mlx5/mlx5_nl.h                   | 18 +++++++++++++++++-
 drivers/common/mlx5/rte_common_mlx5_version.map |  6 +++---
 5 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 0326662..f22d540 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -35,3 +35,10 @@
         type_kind = enum
         name = rte_eth_event_type
         changed_enumerators = RTE_ETH_EVENT_MAX
+
+; These functions were moved from stable to internal.
+; Avoid loading the symbols and comparing them.
+; This is a temporary exception till DPDK 20.11
+[suppress_file]
+	file_name_regexp = ^librte_common_mlx5\.
+
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index c2d688a..b37b820 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -196,6 +196,7 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
 	return MLX5_CQE_STATUS_SW_OWN;
 }
 
+__rte_internal
 int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);
 
 #define MLX5_CLASS_ARG_NAME "class"
@@ -206,7 +207,9 @@ enum mlx5_class {
 	MLX5_CLASS_INVALID,
 };
 
+__rte_internal
 enum mlx5_class mlx5_class_get(struct rte_devargs *devargs);
+__rte_internal
 void mlx5_translate_port_name(const char *port_name_in,
 			      struct mlx5_switch_info *port_info_out);
 
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index f7802e6..6dc27da 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -300,52 +300,75 @@ struct mlx5_devx_qp_attr {
 
 /* mlx5_devx_cmds.c */
 
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
 						       uint32_t bulk_sz);
+__rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
+__rte_internal
 int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
 				     struct mlx5dv_devx_cmd_comp *cmd_comp,
 				     uint64_t async_id);
+__rte_internal
 int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
 				 struct mlx5_hca_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
+__rte_internal
 int mlx5_devx_get_out_command_status(void *out);
+__rte_internal
 int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
+__rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
+__rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+__rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
 					      struct mlx5_devx_cq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
 			       struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
 					      struct mlx5_devx_qp_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
 				  uint32_t qp_st_mod_op, uint32_t remote_qp_id);
+__rte_internal
 int mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
 			     struct mlx5_devx_rqt_attr *rqt_attr);
 
diff --git a/drivers/common/mlx5/mlx5_nl.h b/drivers/common/mlx5/mlx5_nl.h
index 2c3f837..53021e1 100644
--- a/drivers/common/mlx5/mlx5_nl.h
+++ b/drivers/common/mlx5/mlx5_nl.h
@@ -28,35 +28,51 @@ struct mlx5_nl_vlan_vmwa_context {
 	struct mlx5_nl_vlan_dev vlan_dev[4096];
 };
 
-
+__rte_internal
 int mlx5_nl_init(int protocol);
+__rte_internal
 int mlx5_nl_mac_addr_add(int nlsk_fd, unsigned int iface_idx, uint64_t *mac_own,
 			 struct rte_ether_addr *mac, uint32_t index);
+__rte_internal
 int mlx5_nl_mac_addr_remove(int nlsk_fd, unsigned int iface_idx,
 			    uint64_t *mac_own, struct rte_ether_addr *mac,
 			    uint32_t index);
+__rte_internal
 void mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface_idx,
 			   struct rte_ether_addr *mac_addrs, int n);
+__rte_internal
 void mlx5_nl_mac_addr_flush(int nlsk_fd, unsigned int iface_idx,
 			    struct rte_ether_addr *mac_addrs, int n,
 			    uint64_t *mac_own);
+__rte_internal
 int mlx5_nl_promisc(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 int mlx5_nl_allmulti(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 unsigned int mlx5_nl_portnum(int nl, const char *name);
+__rte_internal
 unsigned int mlx5_nl_ifindex(int nl, const char *name, uint32_t pindex);
+__rte_internal
 int mlx5_nl_vf_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 			       struct rte_ether_addr *mac, int vf_index);
+__rte_internal
 int mlx5_nl_switch_info(int nl, unsigned int ifindex,
 			struct mlx5_switch_info *info);
 
+__rte_internal
 void mlx5_nl_vlan_vmwa_delete(struct mlx5_nl_vlan_vmwa_context *vmwa,
 			      uint32_t ifindex);
+__rte_internal
 uint32_t mlx5_nl_vlan_vmwa_create(struct mlx5_nl_vlan_vmwa_context *vmwa,
 				  uint32_t ifindex, uint16_t tag);
+__rte_internal
 int mlx5_nl_devlink_family_id_get(int nlsk_fd);
+__rte_internal
 int mlx5_nl_enable_roce_get(int nlsk_fd, int family_id, const char *pci_addr,
 			    int *enable);
+__rte_internal
 int mlx5_nl_driver_reload(int nlsk_fd, int family_id, const char *pci_addr);
+__rte_internal
 int mlx5_nl_enable_roce_set(int nlsk_fd, int family_id, const char *pci_addr,
 			    int enable);
 
diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map
index 564a9a7..61d1d4d 100644
--- a/drivers/common/mlx5/rte_common_mlx5_version.map
+++ b/drivers/common/mlx5/rte_common_mlx5_version.map
@@ -1,8 +1,10 @@
-DPDK_21 {
+INTERNAL {
 	global:
 
 	mlx5_class_get;
 
+	mlx5_dev_to_pci_addr;
+
 	mlx5_devx_cmd_create_cq;
 	mlx5_devx_cmd_create_qp;
 	mlx5_devx_cmd_create_rq;
@@ -27,8 +29,6 @@ DPDK_21 {
 	mlx5_devx_cmd_query_virtq;
 	mlx5_devx_get_out_command_status;
 
-	mlx5_dev_to_pci_addr;
-
 	mlx5_nl_allmulti;
 	mlx5_nl_devlink_family_id_get;
 	mlx5_nl_driver_reload;
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v3 2/2] common/mlx5: remove devx dependency on ibv and DV
  2020-05-07  8:56     ` [dpdk-dev] [PATCH v3 " Ophir Munk
@ 2020-05-07  8:56       ` Ophir Munk
  2020-05-07 10:23       ` [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison Thomas Monjalon
  2020-05-07 11:31       ` [dpdk-dev] [PATCH v4 " Ophir Munk
  2 siblings, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  8:56 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

File mlx5_devx_cmds.c should contain pure DevX calls. It must be OS
agnostic and not include any references to ibv or dv structs (defined in
ibverbs and rdma-core linux libraries).  This commit replaces all ibv
and dv references with 'void *'.  Specifically, the following struct
were replaced:
1. struct ibv_context *
2. struct ibv_qp *
3. struct mlx5dv_devx_cmd_comp *

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 59 ++++++++++++++++++------------------
 drivers/common/mlx5/mlx5_devx_cmds.h | 30 +++++++++---------
 2 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 67c8a8c..230ac58 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -15,7 +15,7 @@
  * Allocate flow counters via devx interface.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param dcs
  *   Pointer to counters properties structure to be filled by the routine.
  * @param bulk_n_128
@@ -26,7 +26,7 @@
  *   rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx, uint32_t bulk_n_128)
+mlx5_devx_cmd_flow_counter_alloc(void *ctx, uint32_t bulk_n_128)
 {
 	struct mlx5_devx_obj *dcs = rte_zmalloc("dcs", sizeof(*dcs), 0);
 	uint32_t in[MLX5_ST_SZ_DW(alloc_flow_counter_in)]   = {0};
@@ -81,7 +81,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				 int clear, uint32_t n_counters,
 				 uint64_t *pkts, uint64_t *bytes,
 				 uint32_t mkey, void *addr,
-				 struct mlx5dv_devx_cmd_comp *cmd_comp,
+				 void *cmd_comp,
 				 uint64_t async_id)
 {
 	int out_len = MLX5_ST_SZ_BYTES(query_flow_counter_out) +
@@ -130,7 +130,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  * Create a new mkey.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[in] attr
  *   Attributes of the requested mkey.
  *
@@ -139,7 +139,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  *   is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+mlx5_devx_cmd_mkey_create(void *ctx,
 			  struct mlx5_devx_mkey_attr *attr)
 {
 	struct mlx5_klm *klm_array = attr->klm_array;
@@ -279,7 +279,7 @@ mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj)
  *   0 on success, a negative value otherwise.
  */
 static int
-mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
+mlx5_devx_cmd_query_nic_vport_context(void *ctx,
 				      unsigned int vport,
 				      struct mlx5_hca_attr *attr)
 {
@@ -321,12 +321,12 @@ mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
  * Query NIC vDPA attributes.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] vdpa_attr
  *   vDPA Attributes structure to fill.
  */
 static void
-mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_vdpa_attr(void *ctx,
 				  struct mlx5_hca_vdpa_attr *vdpa_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -402,7 +402,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  * is having the required capabilities.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] attr
  *   Attributes device values.
  *
@@ -410,7 +410,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_attr(void *ctx,
 			     struct mlx5_hca_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -570,7 +570,7 @@ mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 			      uint32_t *tis_td)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_tis_in)] = {0};
@@ -637,7 +637,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  * Create RQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rq_attr
  *   Pointer to create RQ attributes structure.
  * @param [in] socket
@@ -647,7 +647,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rq(void *ctx,
 			struct mlx5_devx_create_rq_attr *rq_attr,
 			int socket)
 {
@@ -746,7 +746,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  * Create TIR using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *  Context returned from mlx5 open_device() glue function.
  * @param [in] tir_attr
  *   Pointer to TIR attributes structure.
  *
@@ -754,7 +754,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tir(void *ctx,
 			 struct mlx5_devx_tir_attr *tir_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tir_in)] = {0};
@@ -815,7 +815,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  * Create RQT using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rqt_attr
  *   Pointer to RQT attributes structure.
  *
@@ -823,7 +823,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rqt(void *ctx,
 			 struct mlx5_devx_rqt_attr *rqt_attr)
 {
 	uint32_t *in = NULL;
@@ -917,7 +917,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  * Create SQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] sq_attr
  *   Pointer to SQ attributes structure.
  * @param [in] socket
@@ -927,7 +927,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  **/
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_sq(void *ctx,
 			struct mlx5_devx_create_sq_attr *sq_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_sq_in)] = {0};
@@ -1019,7 +1019,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  * Create TIS using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] tis_attr
  *   Pointer to TIS attributes structure.
  *
@@ -1027,7 +1027,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tis(void *ctx,
 			 struct mlx5_devx_tis_attr *tis_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tis_in)] = {0};
@@ -1066,13 +1066,12 @@ mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
  * Create transport domain using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
- *
+ *   Context returned from mlx5 open_device() glue function.
  * @return
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_td(struct ibv_context *ctx)
+mlx5_devx_cmd_create_td(void *ctx)
 {
 	uint32_t in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {0};
@@ -1143,7 +1142,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  * Create CQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to CQ attributes structure.
  *
@@ -1151,7 +1150,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
+mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_cq_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(create_cq_out)] = {0};
@@ -1201,7 +1200,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  * Create VIRTQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to VIRTQ attributes structure.
  *
@@ -1209,7 +1208,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_virtq(void *ctx,
 			   struct mlx5_devx_virtq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_virtq_in)] = {0};
@@ -1370,7 +1369,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  * Create QP using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to QP attributes structure.
  *
@@ -1378,7 +1377,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+mlx5_devx_cmd_create_qp(void *ctx,
 			struct mlx5_devx_qp_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_qp_in)] = {0};
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 6dc27da..ac10687 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -11,7 +11,7 @@
 
 /* devX creation object */
 struct mlx5_devx_obj {
-	struct mlx5dv_devx_obj *obj; /* The DV object. */
+	void *obj; /* The DV object. */
 	int id; /* The object ID. */
 };
 
@@ -301,7 +301,7 @@ struct mlx5_devx_qp_attr {
 /* mlx5_devx_cmds.c */
 
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(void *ctx,
 						       uint32_t bulk_sz);
 __rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
@@ -310,51 +310,51 @@ int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
-				     struct mlx5dv_devx_cmd_comp *cmd_comp,
+				     void *cmd_comp,
 				     uint64_t async_id);
 __rte_internal
-int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+int mlx5_devx_cmd_query_hca_attr(void *ctx,
 				 struct mlx5_hca_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(void *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
 __rte_internal
 int mlx5_devx_get_out_command_status(void *out);
 __rte_internal
-int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+int mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(void *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
 __rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(void *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(void *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(void *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
 __rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(void *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+struct mlx5_devx_obj *mlx5_devx_cmd_create_td(void *ctx);
 __rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(void *ctx,
 					      struct mlx5_devx_cq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(void *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
@@ -363,7 +363,7 @@ __rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(void *ctx,
 					      struct mlx5_devx_qp_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  7:56     ` Ray Kinsella
@ 2020-05-07  9:03       ` Ophir Munk
  0 siblings, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07  9:03 UTC (permalink / raw)
  To: Ray Kinsella, dev, David Marchand
  Cc: Matan Azrad, Raslan Darawsheh, Thomas Monjalon



> -----Original Message-----
> From: Ray Kinsella <mdr@ashroe.eu>
> Sent: Thursday, May 7, 2020 10:56 AM
> To: Ophir Munk <ophirmu@mellanox.com>; dev@dpdk.org; David Marchand
> <david.marchand@redhat.com>
> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Thomas Monjalon <homas@monjalon.net>
> Subject: Re: [PATCH v2 1/2] common/mlx5: add rte internal tag and avoid
> comparison
> 
> 
> Can you add a Fixes: section.
> Referencing the original git commit that added the symbols we are ignoring?

Done. V3 was sent.

> 
> Ray K

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  8:56     ` [dpdk-dev] [PATCH v3 " Ophir Munk
  2020-05-07  8:56       ` [dpdk-dev] [PATCH v3 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
@ 2020-05-07 10:23       ` Thomas Monjalon
  2020-05-07 11:41         ` Ophir Munk
  2020-05-07 11:31       ` [dpdk-dev] [PATCH v4 " Ophir Munk
  2 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2020-05-07 10:23 UTC (permalink / raw)
  To: Ophir Munk
  Cc: dev, David Marchand, Ray Kinsella, Matan Azrad, Raslan Darawsheh

07/05/2020 10:56, Ophir Munk:
> Move mlx5 symbols in the map file to the INTERNAL section and add
> __internal tags to their definitions.
> Those symbols were exported in 20.02 and now (20.05) they are removed.
[...]
> --- a/drivers/common/mlx5/rte_common_mlx5_version.map
> +++ b/drivers/common/mlx5/rte_common_mlx5_version.map
> @@ -1,8 +1,10 @@
> -DPDK_21 {
> +INTERNAL {

I think you forgot the EXPERIMENTAL section.
In my opinion, everything should be in INTERNAL
and marked with __rte_internal in source code.



^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07  8:56     ` [dpdk-dev] [PATCH v3 " Ophir Munk
  2020-05-07  8:56       ` [dpdk-dev] [PATCH v3 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
  2020-05-07 10:23       ` [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison Thomas Monjalon
@ 2020-05-07 11:31       ` Ophir Munk
  2020-05-07 11:31         ` [dpdk-dev] [PATCH v4 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
                           ` (2 more replies)
  2 siblings, 3 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07 11:31 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

Move mlx5 symbols in the map file to the INTERNAL section and add
__internal tags to their definitions.
Those symbols were exported in 20.02 and now (20.05) they are removed.
Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
suppress_file directive to libabigail.abignore file. This directive will
prevent loading mlx5 common symbols and no comparison will be performed.

In addition move symbols from the EXPERIMENTAL section to the INTERNAL
section.

Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
v4:
Move symbols from EXPERIMENTAL section to INTERNAL section

 devtools/libabigail.abignore                    |  7 ++++
 drivers/common/mlx5/mlx5_common.h               |  3 ++
 drivers/common/mlx5/mlx5_common_mp.h            | 14 +++----
 drivers/common/mlx5/mlx5_common_mr.h            | 26 ++++++------
 drivers/common/mlx5/mlx5_devx_cmds.h            | 23 +++++++++++
 drivers/common/mlx5/mlx5_nl.h                   | 18 ++++++++-
 drivers/common/mlx5/rte_common_mlx5_version.map | 53 ++++++++++++-------------
 7 files changed, 95 insertions(+), 49 deletions(-)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 0326662..f22d540 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -35,3 +35,10 @@
         type_kind = enum
         name = rte_eth_event_type
         changed_enumerators = RTE_ETH_EVENT_MAX
+
+; These functions were moved from stable to internal.
+; Avoid loading the symbols and comparing them.
+; This is a temporary exception till DPDK 20.11
+[suppress_file]
+	file_name_regexp = ^librte_common_mlx5\.
+
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index c2d688a..b37b820 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -196,6 +196,7 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
 	return MLX5_CQE_STATUS_SW_OWN;
 }
 
+__rte_internal
 int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);
 
 #define MLX5_CLASS_ARG_NAME "class"
@@ -206,7 +207,9 @@ enum mlx5_class {
 	MLX5_CLASS_INVALID,
 };
 
+__rte_internal
 enum mlx5_class mlx5_class_get(struct rte_devargs *devargs);
+__rte_internal
 void mlx5_translate_port_name(const char *port_name_in,
 			      struct mlx5_switch_info *port_info_out);
 
diff --git a/drivers/common/mlx5/mlx5_common_mp.h b/drivers/common/mlx5/mlx5_common_mp.h
index 7aab77a..05466fd 100644
--- a/drivers/common/mlx5/mlx5_common_mp.h
+++ b/drivers/common/mlx5/mlx5_common_mp.h
@@ -79,20 +79,20 @@ mp_init_msg(struct mlx5_mp_id *mp_id, struct rte_mp_msg *msg,
 	param->port_id = mp_id->port_id;
 }
 
-__rte_experimental
+__rte_internal
 int mlx5_mp_init_primary(const char *name, const rte_mp_t primary_action);
-__rte_experimental
+__rte_internal
 void mlx5_mp_uninit_primary(const char *name);
-__rte_experimental
+__rte_internal
 int mlx5_mp_init_secondary(const char *name, const rte_mp_t secondary_action);
-__rte_experimental
+__rte_internal
 void mlx5_mp_uninit_secondary(const char *name);
-__rte_experimental
+__rte_internal
 int mlx5_mp_req_mr_create(struct mlx5_mp_id *mp_id, uintptr_t addr);
-__rte_experimental
+__rte_internal
 int mlx5_mp_req_queue_state_modify(struct mlx5_mp_id *mp_id,
 				   struct mlx5_mp_arg_queue_state_modify *sm);
-__rte_experimental
+__rte_internal
 int mlx5_mp_req_verbs_cmd_fd(struct mlx5_mp_id *mp_id);
 
 #endif /* RTE_PMD_MLX5_COMMON_MP_H_ */
diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index e805f96..4ea47cd 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -115,42 +115,42 @@ mlx5_mr_lookup_lkey(struct mr_cache_entry *lkp_tbl, uint16_t *cached_idx,
 	return UINT32_MAX;
 }
 
-__rte_experimental
+__rte_internal
 int mlx5_mr_btree_init(struct mlx5_mr_btree *bt, int n, int socket);
-__rte_experimental
+__rte_internal
 void mlx5_mr_btree_free(struct mlx5_mr_btree *bt);
-__rte_experimental
+__rte_internal
 void mlx5_mr_btree_dump(struct mlx5_mr_btree *bt __rte_unused);
-__rte_experimental
+__rte_internal
 uint32_t mlx5_mr_addr2mr_bh(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
 			    struct mlx5_mr_share_cache *share_cache,
 			    struct mlx5_mr_ctrl *mr_ctrl,
 			    uintptr_t addr, unsigned int mr_ext_memseg_en);
-__rte_experimental
+__rte_internal
 void mlx5_mr_release_cache(struct mlx5_mr_share_cache *mr_cache);
-__rte_experimental
+__rte_internal
 void mlx5_mr_dump_cache(struct mlx5_mr_share_cache *share_cache __rte_unused);
-__rte_experimental
+__rte_internal
 void mlx5_mr_rebuild_cache(struct mlx5_mr_share_cache *share_cache);
-__rte_experimental
+__rte_internal
 void mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl);
-__rte_experimental
+__rte_internal
 int
 mlx5_mr_insert_cache(struct mlx5_mr_share_cache *share_cache,
 		     struct mlx5_mr *mr);
-__rte_experimental
+__rte_internal
 uint32_t
 mlx5_mr_lookup_cache(struct mlx5_mr_share_cache *share_cache,
 		     struct mr_cache_entry *entry, uintptr_t addr);
-__rte_experimental
+__rte_internal
 struct mlx5_mr *
 mlx5_mr_lookup_list(struct mlx5_mr_share_cache *share_cache,
 		    struct mr_cache_entry *entry, uintptr_t addr);
-__rte_experimental
+__rte_internal
 struct mlx5_mr *
 mlx5_create_mr_ext(struct ibv_pd *pd, uintptr_t addr, size_t len,
 		   int socket_id);
-__rte_experimental
+__rte_internal
 uint32_t
 mlx5_mr_create_primary(struct ibv_pd *pd,
 		       struct mlx5_mr_share_cache *share_cache,
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index f7802e6..6dc27da 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -300,52 +300,75 @@ struct mlx5_devx_qp_attr {
 
 /* mlx5_devx_cmds.c */
 
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
 						       uint32_t bulk_sz);
+__rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
+__rte_internal
 int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
 				     struct mlx5dv_devx_cmd_comp *cmd_comp,
 				     uint64_t async_id);
+__rte_internal
 int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
 				 struct mlx5_hca_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
+__rte_internal
 int mlx5_devx_get_out_command_status(void *out);
+__rte_internal
 int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
+__rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
+__rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+__rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
 					      struct mlx5_devx_cq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
 			       struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
 					      struct mlx5_devx_qp_attr *attr);
+__rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
 				  uint32_t qp_st_mod_op, uint32_t remote_qp_id);
+__rte_internal
 int mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
 			     struct mlx5_devx_rqt_attr *rqt_attr);
 
diff --git a/drivers/common/mlx5/mlx5_nl.h b/drivers/common/mlx5/mlx5_nl.h
index 2c3f837..53021e1 100644
--- a/drivers/common/mlx5/mlx5_nl.h
+++ b/drivers/common/mlx5/mlx5_nl.h
@@ -28,35 +28,51 @@ struct mlx5_nl_vlan_vmwa_context {
 	struct mlx5_nl_vlan_dev vlan_dev[4096];
 };
 
-
+__rte_internal
 int mlx5_nl_init(int protocol);
+__rte_internal
 int mlx5_nl_mac_addr_add(int nlsk_fd, unsigned int iface_idx, uint64_t *mac_own,
 			 struct rte_ether_addr *mac, uint32_t index);
+__rte_internal
 int mlx5_nl_mac_addr_remove(int nlsk_fd, unsigned int iface_idx,
 			    uint64_t *mac_own, struct rte_ether_addr *mac,
 			    uint32_t index);
+__rte_internal
 void mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface_idx,
 			   struct rte_ether_addr *mac_addrs, int n);
+__rte_internal
 void mlx5_nl_mac_addr_flush(int nlsk_fd, unsigned int iface_idx,
 			    struct rte_ether_addr *mac_addrs, int n,
 			    uint64_t *mac_own);
+__rte_internal
 int mlx5_nl_promisc(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 int mlx5_nl_allmulti(int nlsk_fd, unsigned int iface_idx, int enable);
+__rte_internal
 unsigned int mlx5_nl_portnum(int nl, const char *name);
+__rte_internal
 unsigned int mlx5_nl_ifindex(int nl, const char *name, uint32_t pindex);
+__rte_internal
 int mlx5_nl_vf_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 			       struct rte_ether_addr *mac, int vf_index);
+__rte_internal
 int mlx5_nl_switch_info(int nl, unsigned int ifindex,
 			struct mlx5_switch_info *info);
 
+__rte_internal
 void mlx5_nl_vlan_vmwa_delete(struct mlx5_nl_vlan_vmwa_context *vmwa,
 			      uint32_t ifindex);
+__rte_internal
 uint32_t mlx5_nl_vlan_vmwa_create(struct mlx5_nl_vlan_vmwa_context *vmwa,
 				  uint32_t ifindex, uint16_t tag);
+__rte_internal
 int mlx5_nl_devlink_family_id_get(int nlsk_fd);
+__rte_internal
 int mlx5_nl_enable_roce_get(int nlsk_fd, int family_id, const char *pci_addr,
 			    int *enable);
+__rte_internal
 int mlx5_nl_driver_reload(int nlsk_fd, int family_id, const char *pci_addr);
+__rte_internal
 int mlx5_nl_enable_roce_set(int nlsk_fd, int family_id, const char *pci_addr,
 			    int enable);
 
diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map
index 564a9a7..350e771 100644
--- a/drivers/common/mlx5/rte_common_mlx5_version.map
+++ b/drivers/common/mlx5/rte_common_mlx5_version.map
@@ -1,8 +1,12 @@
-DPDK_21 {
+INTERNAL {
 	global:
 
 	mlx5_class_get;
 
+	mlx5_create_mr_ext;
+
+	mlx5_dev_to_pci_addr;
+
 	mlx5_devx_cmd_create_cq;
 	mlx5_devx_cmd_create_qp;
 	mlx5_devx_cmd_create_rq;
@@ -27,7 +31,26 @@ DPDK_21 {
 	mlx5_devx_cmd_query_virtq;
 	mlx5_devx_get_out_command_status;
 
-	mlx5_dev_to_pci_addr;
+	mlx5_mp_init_primary;
+	mlx5_mp_uninit_primary;
+	mlx5_mp_init_secondary;
+	mlx5_mp_uninit_secondary;
+	mlx5_mp_req_mr_create;
+	mlx5_mp_req_queue_state_modify;
+	mlx5_mp_req_verbs_cmd_fd;
+
+	mlx5_mr_btree_init;
+	mlx5_mr_btree_free;
+	mlx5_mr_btree_dump;
+	mlx5_mr_addr2mr_bh;
+	mlx5_mr_release_cache;
+	mlx5_mr_dump_cache;
+	mlx5_mr_rebuild_cache;
+	mlx5_mr_insert_cache;
+	mlx5_mr_lookup_cache;
+	mlx5_mr_lookup_list;
+	mlx5_mr_create_primary;
+	mlx5_mr_flush_local_cache;
 
 	mlx5_nl_allmulti;
 	mlx5_nl_devlink_family_id_get;
@@ -48,31 +71,5 @@ DPDK_21 {
 	mlx5_nl_vlan_vmwa_delete;
 
 	mlx5_translate_port_name;
-
 };
 
-EXPERIMENTAL {
-        global:
-
-	mlx5_mp_init_primary;
-	mlx5_mp_uninit_primary;
-	mlx5_mp_init_secondary;
-	mlx5_mp_uninit_secondary;
-	mlx5_mp_req_mr_create;
-	mlx5_mp_req_queue_state_modify;
-	mlx5_mp_req_verbs_cmd_fd;
-
-	mlx5_mr_btree_init;
-	mlx5_mr_btree_free;
-	mlx5_mr_btree_dump;
-	mlx5_mr_addr2mr_bh;
-	mlx5_mr_release_cache;
-	mlx5_mr_dump_cache;
-	mlx5_mr_rebuild_cache;
-	mlx5_mr_insert_cache;
-	mlx5_mr_lookup_cache;
-	mlx5_mr_lookup_list;
-	mlx5_create_mr_ext;
-	mlx5_mr_create_primary;
-	mlx5_mr_flush_local_cache;
-};
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [dpdk-dev] [PATCH v4 2/2] common/mlx5: remove devx dependency on ibv and DV
  2020-05-07 11:31       ` [dpdk-dev] [PATCH v4 " Ophir Munk
@ 2020-05-07 11:31         ` Ophir Munk
  2020-05-12 10:52         ` [dpdk-dev] [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid comparison Raslan Darawsheh
  2020-05-19  9:08         ` Thomas Monjalon
  2 siblings, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-07 11:31 UTC (permalink / raw)
  To: dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Raslan Darawsheh, Thomas Monjalon, Ophir Munk

File mlx5_devx_cmds.c should contain pure DevX calls. It must be OS
agnostic and not include any references to ibv or dv structs (defined in
ibverbs and rdma-core linux libraries).  This commit replaces all ibv
and dv references with 'void *'.  Specifically, the following struct
were replaced:
1. struct ibv_context *
2. struct ibv_qp *
3. struct mlx5dv_devx_cmd_comp *

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 59 ++++++++++++++++++------------------
 drivers/common/mlx5/mlx5_devx_cmds.h | 30 +++++++++---------
 2 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 67c8a8c..230ac58 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -15,7 +15,7 @@
  * Allocate flow counters via devx interface.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param dcs
  *   Pointer to counters properties structure to be filled by the routine.
  * @param bulk_n_128
@@ -26,7 +26,7 @@
  *   rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx, uint32_t bulk_n_128)
+mlx5_devx_cmd_flow_counter_alloc(void *ctx, uint32_t bulk_n_128)
 {
 	struct mlx5_devx_obj *dcs = rte_zmalloc("dcs", sizeof(*dcs), 0);
 	uint32_t in[MLX5_ST_SZ_DW(alloc_flow_counter_in)]   = {0};
@@ -81,7 +81,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				 int clear, uint32_t n_counters,
 				 uint64_t *pkts, uint64_t *bytes,
 				 uint32_t mkey, void *addr,
-				 struct mlx5dv_devx_cmd_comp *cmd_comp,
+				 void *cmd_comp,
 				 uint64_t async_id)
 {
 	int out_len = MLX5_ST_SZ_BYTES(query_flow_counter_out) +
@@ -130,7 +130,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  * Create a new mkey.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[in] attr
  *   Attributes of the requested mkey.
  *
@@ -139,7 +139,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
  *   is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+mlx5_devx_cmd_mkey_create(void *ctx,
 			  struct mlx5_devx_mkey_attr *attr)
 {
 	struct mlx5_klm *klm_array = attr->klm_array;
@@ -279,7 +279,7 @@ mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj)
  *   0 on success, a negative value otherwise.
  */
 static int
-mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
+mlx5_devx_cmd_query_nic_vport_context(void *ctx,
 				      unsigned int vport,
 				      struct mlx5_hca_attr *attr)
 {
@@ -321,12 +321,12 @@ mlx5_devx_cmd_query_nic_vport_context(struct ibv_context *ctx,
  * Query NIC vDPA attributes.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] vdpa_attr
  *   vDPA Attributes structure to fill.
  */
 static void
-mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_vdpa_attr(void *ctx,
 				  struct mlx5_hca_vdpa_attr *vdpa_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -402,7 +402,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  * is having the required capabilities.
  *
  * @param[in] ctx
- *   ibv contexts returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param[out] attr
  *   Attributes device values.
  *
@@ -410,7 +410,7 @@ mlx5_devx_cmd_query_hca_vdpa_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+mlx5_devx_cmd_query_hca_attr(void *ctx,
 			     struct mlx5_hca_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0};
@@ -570,7 +570,7 @@ mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
  *   0 on success, a negative value otherwise.
  */
 int
-mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 			      uint32_t *tis_td)
 {
 	uint32_t in[MLX5_ST_SZ_DW(query_tis_in)] = {0};
@@ -637,7 +637,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  * Create RQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rq_attr
  *   Pointer to create RQ attributes structure.
  * @param [in] socket
@@ -647,7 +647,7 @@ devx_cmd_fill_wq_data(void *wq_ctx, struct mlx5_devx_wq_attr *wq_attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rq(void *ctx,
 			struct mlx5_devx_create_rq_attr *rq_attr,
 			int socket)
 {
@@ -746,7 +746,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  * Create TIR using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *  Context returned from mlx5 open_device() glue function.
  * @param [in] tir_attr
  *   Pointer to TIR attributes structure.
  *
@@ -754,7 +754,7 @@ mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tir(void *ctx,
 			 struct mlx5_devx_tir_attr *tir_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tir_in)] = {0};
@@ -815,7 +815,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  * Create RQT using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] rqt_attr
  *   Pointer to RQT attributes structure.
  *
@@ -823,7 +823,7 @@ mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+mlx5_devx_cmd_create_rqt(void *ctx,
 			 struct mlx5_devx_rqt_attr *rqt_attr)
 {
 	uint32_t *in = NULL;
@@ -917,7 +917,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  * Create SQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] sq_attr
  *   Pointer to SQ attributes structure.
  * @param [in] socket
@@ -927,7 +927,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  **/
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_sq(void *ctx,
 			struct mlx5_devx_create_sq_attr *sq_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_sq_in)] = {0};
@@ -1019,7 +1019,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  * Create TIS using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] tis_attr
  *   Pointer to TIS attributes structure.
  *
@@ -1027,7 +1027,7 @@ mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+mlx5_devx_cmd_create_tis(void *ctx,
 			 struct mlx5_devx_tis_attr *tis_attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_tis_in)] = {0};
@@ -1066,13 +1066,12 @@ mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
  * Create transport domain using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
- *
+ *   Context returned from mlx5 open_device() glue function.
  * @return
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_td(struct ibv_context *ctx)
+mlx5_devx_cmd_create_td(void *ctx)
 {
 	uint32_t in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {0};
@@ -1143,7 +1142,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  * Create CQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to CQ attributes structure.
  *
@@ -1151,7 +1150,7 @@ mlx5_devx_cmd_flow_dump(void *fdb_domain __rte_unused,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
+mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_cq_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(create_cq_out)] = {0};
@@ -1201,7 +1200,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  * Create VIRTQ using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to VIRTQ attributes structure.
  *
@@ -1209,7 +1208,7 @@ mlx5_devx_cmd_create_cq(struct ibv_context *ctx, struct mlx5_devx_cq_attr *attr)
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+mlx5_devx_cmd_create_virtq(void *ctx,
 			   struct mlx5_devx_virtq_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_virtq_in)] = {0};
@@ -1370,7 +1369,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  * Create QP using DevX API.
  *
  * @param[in] ctx
- *   ibv_context returned from mlx5dv_open_device.
+ *   Context returned from mlx5 open_device() glue function.
  * @param [in] attr
  *   Pointer to QP attributes structure.
  *
@@ -1378,7 +1377,7 @@ mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
  *   The DevX object created, NULL otherwise and rte_errno is set.
  */
 struct mlx5_devx_obj *
-mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+mlx5_devx_cmd_create_qp(void *ctx,
 			struct mlx5_devx_qp_attr *attr)
 {
 	uint32_t in[MLX5_ST_SZ_DW(create_qp_in)] = {0};
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 6dc27da..ac10687 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -11,7 +11,7 @@
 
 /* devX creation object */
 struct mlx5_devx_obj {
-	struct mlx5dv_devx_obj *obj; /* The DV object. */
+	void *obj; /* The DV object. */
 	int id; /* The object ID. */
 };
 
@@ -301,7 +301,7 @@ struct mlx5_devx_qp_attr {
 /* mlx5_devx_cmds.c */
 
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_flow_counter_alloc(void *ctx,
 						       uint32_t bulk_sz);
 __rte_internal
 int mlx5_devx_cmd_destroy(struct mlx5_devx_obj *obj);
@@ -310,51 +310,51 @@ int mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
 				     int clear, uint32_t n_counters,
 				     uint64_t *pkts, uint64_t *bytes,
 				     uint32_t mkey, void *addr,
-				     struct mlx5dv_devx_cmd_comp *cmd_comp,
+				     void *cmd_comp,
 				     uint64_t async_id);
 __rte_internal
-int mlx5_devx_cmd_query_hca_attr(struct ibv_context *ctx,
+int mlx5_devx_cmd_query_hca_attr(void *ctx,
 				 struct mlx5_hca_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_mkey_create(void *ctx,
 					      struct mlx5_devx_mkey_attr *attr);
 __rte_internal
 int mlx5_devx_get_out_command_status(void *out);
 __rte_internal
-int mlx5_devx_cmd_qp_query_tis_td(struct ibv_qp *qp, uint32_t tis_num,
+int mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
 				  uint32_t *tis_td);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rq(void *ctx,
 				       struct mlx5_devx_create_rq_attr *rq_attr,
 				       int socket);
 __rte_internal
 int mlx5_devx_cmd_modify_rq(struct mlx5_devx_obj *rq,
 			    struct mlx5_devx_modify_rq_attr *rq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tir(void *ctx,
 					   struct mlx5_devx_tir_attr *tir_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_rqt(void *ctx,
 					   struct mlx5_devx_rqt_attr *rqt_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_sq(void *ctx,
 				      struct mlx5_devx_create_sq_attr *sq_attr);
 __rte_internal
 int mlx5_devx_cmd_modify_sq(struct mlx5_devx_obj *sq,
 			    struct mlx5_devx_modify_sq_attr *sq_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(void *ctx,
 					   struct mlx5_devx_tis_attr *tis_attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_td(struct ibv_context *ctx);
+struct mlx5_devx_obj *mlx5_devx_cmd_create_td(void *ctx);
 __rte_internal
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(void *ctx,
 					      struct mlx5_devx_cq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_virtq(void *ctx,
 					     struct mlx5_devx_virtq_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_virtq(struct mlx5_devx_obj *virtq_obj,
@@ -363,7 +363,7 @@ __rte_internal
 int mlx5_devx_cmd_query_virtq(struct mlx5_devx_obj *virtq_obj,
 			      struct mlx5_devx_virtq_attr *attr);
 __rte_internal
-struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(struct ibv_context *ctx,
+struct mlx5_devx_obj *mlx5_devx_cmd_create_qp(void *ctx,
 					      struct mlx5_devx_qp_attr *attr);
 __rte_internal
 int mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp,
-- 
2.8.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07 10:23       ` [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison Thomas Monjalon
@ 2020-05-07 11:41         ` Ophir Munk
  2020-05-07 20:08           ` Thomas Monjalon
  0 siblings, 1 reply; 29+ messages in thread
From: Ophir Munk @ 2020-05-07 11:41 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, David Marchand, Ray Kinsella, Matan Azrad, Raslan Darawsheh



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, May 7, 2020 1:23 PM
> To: Ophir Munk <ophirmu@mellanox.com>
> Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>; Ray
> Kinsella <mdr@ashroe.eu>; Matan Azrad <matan@mellanox.com>; Raslan
> Darawsheh <rasland@mellanox.com>
> Subject: Re: [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid
> comparison
> 
> 07/05/2020 10:56, Ophir Munk:
> > Move mlx5 symbols in the map file to the INTERNAL section and add
> > __internal tags to their definitions.
> > Those symbols were exported in 20.02 and now (20.05) they are removed.
> [...]
> > --- a/drivers/common/mlx5/rte_common_mlx5_version.map
> > +++ b/drivers/common/mlx5/rte_common_mlx5_version.map
> > @@ -1,8 +1,10 @@
> > -DPDK_21 {
> > +INTERNAL {
> 
> I think you forgot the EXPERIMENTAL section.
> In my opinion, everything should be in INTERNAL and marked with
> __rte_internal in source code.
> 

I moved all EXPERIMENTAL to INTERNAL and sent V4.
A general question: what is the difference between EXPERIMENTAL and INTERNAL functionalities?
In the end both indicate to skip ABI check. 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07 11:41         ` Ophir Munk
@ 2020-05-07 20:08           ` Thomas Monjalon
  2020-05-10  8:14             ` Ophir Munk
  0 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2020-05-07 20:08 UTC (permalink / raw)
  To: Ophir Munk
  Cc: dev, David Marchand, Ray Kinsella, Matan Azrad, Raslan Darawsheh

07/05/2020 13:41, Ophir Munk:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 07/05/2020 10:56, Ophir Munk:
> > > Move mlx5 symbols in the map file to the INTERNAL section and add
> > > __internal tags to their definitions.
> > > Those symbols were exported in 20.02 and now (20.05) they are removed.
> > [...]
> > > --- a/drivers/common/mlx5/rte_common_mlx5_version.map
> > > +++ b/drivers/common/mlx5/rte_common_mlx5_version.map
> > > @@ -1,8 +1,10 @@
> > > -DPDK_21 {
> > > +INTERNAL {
> > 
> > I think you forgot the EXPERIMENTAL section.
> > In my opinion, everything should be in INTERNAL and marked with
> > __rte_internal in source code.
> > 
> 
> I moved all EXPERIMENTAL to INTERNAL and sent V4.
> A general question: what is the difference between EXPERIMENTAL and INTERNAL functionalities?
> In the end both indicate to skip ABI check. 

Regarding ABI check, yes the result is the same.
Regarding API, it is different:
INTERNAL is forbidden to applications,
while EXPERIMENTAL is to be used with cautious
as compatibility is not guaranteed.



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07 20:08           ` Thomas Monjalon
@ 2020-05-10  8:14             ` Ophir Munk
  0 siblings, 0 replies; 29+ messages in thread
From: Ophir Munk @ 2020-05-10  8:14 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, David Marchand, Ray Kinsella, Matan Azrad, Raslan Darawsheh

Thanks for clarifying the INTERNAL/EXPERIMENTAL difference.

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, May 7, 2020 11:08 PM
> To: Ophir Munk <ophirmu@mellanox.com>
> Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>; Ray
> Kinsella <mdr@ashroe.eu>; Matan Azrad <matan@mellanox.com>; Raslan
> Darawsheh <rasland@mellanox.com>
> Subject: Re: [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid
> comparison
> 
> 07/05/2020 13:41, Ophir Munk:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 07/05/2020 10:56, Ophir Munk:
> > > > Move mlx5 symbols in the map file to the INTERNAL section and add
> > > > __internal tags to their definitions.
> > > > Those symbols were exported in 20.02 and now (20.05) they are
> removed.
> > > [...]
> > > > --- a/drivers/common/mlx5/rte_common_mlx5_version.map
> > > > +++ b/drivers/common/mlx5/rte_common_mlx5_version.map
> > > > @@ -1,8 +1,10 @@
> > > > -DPDK_21 {
> > > > +INTERNAL {
> > >
> > > I think you forgot the EXPERIMENTAL section.
> > > In my opinion, everything should be in INTERNAL and marked with
> > > __rte_internal in source code.
> > >
> >
> > I moved all EXPERIMENTAL to INTERNAL and sent V4.
> > A general question: what is the difference between EXPERIMENTAL and
> INTERNAL functionalities?
> > In the end both indicate to skip ABI check.
> 
> Regarding ABI check, yes the result is the same.
> Regarding API, it is different:
> INTERNAL is forbidden to applications,
> while EXPERIMENTAL is to be used with cautious as compatibility is not
> guaranteed.
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07 11:31       ` [dpdk-dev] [PATCH v4 " Ophir Munk
  2020-05-07 11:31         ` [dpdk-dev] [PATCH v4 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
@ 2020-05-12 10:52         ` Raslan Darawsheh
  2020-05-19  9:08         ` Thomas Monjalon
  2 siblings, 0 replies; 29+ messages in thread
From: Raslan Darawsheh @ 2020-05-12 10:52 UTC (permalink / raw)
  To: Ophir Munk, dev, David Marchand
  Cc: Ray Kinsella, Matan Azrad, Thomas Monjalon

Hi,

> -----Original Message-----
> From: Ophir Munk <ophirmu@mellanox.com>
> Sent: Thursday, May 7, 2020 2:31 PM
> To: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> Cc: Ray Kinsella <mdr@ashroe.eu>; Matan Azrad <matan@mellanox.com>;
> Raslan Darawsheh <rasland@mellanox.com>; Thomas Monjalon
> <thomas@monjalon.net>; Ophir Munk <ophirmu@mellanox.com>
> Subject: [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid
> comparison
> 
> Move mlx5 symbols in the map file to the INTERNAL section and add
> __internal tags to their definitions.
> Those symbols were exported in 20.02 and now (20.05) they are removed.
> Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
> suppress_file directive to libabigail.abignore file. This directive will
> prevent loading mlx5 common symbols and no comparison will be
> performed.
> 
> In addition move symbols from the EXPERIMENTAL section to the INTERNAL
> section.
> 
> Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
> v4:
> Move symbols from EXPERIMENTAL section to INTERNAL section
> 
>  devtools/libabigail.abignore                    |  7 ++++
>  drivers/common/mlx5/mlx5_common.h               |  3 ++
>  drivers/common/mlx5/mlx5_common_mp.h            | 14 +++----
>  drivers/common/mlx5/mlx5_common_mr.h            | 26 ++++++------
>  drivers/common/mlx5/mlx5_devx_cmds.h            | 23 +++++++++++
>  drivers/common/mlx5/mlx5_nl.h                   | 18 ++++++++-
>  drivers/common/mlx5/rte_common_mlx5_version.map | 53
> ++++++++++++-------------
>  7 files changed, 95 insertions(+), 49 deletions(-)


Series rebased and applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid comparison
  2020-05-07 11:31       ` [dpdk-dev] [PATCH v4 " Ophir Munk
  2020-05-07 11:31         ` [dpdk-dev] [PATCH v4 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
  2020-05-12 10:52         ` [dpdk-dev] [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid comparison Raslan Darawsheh
@ 2020-05-19  9:08         ` Thomas Monjalon
  2 siblings, 0 replies; 29+ messages in thread
From: Thomas Monjalon @ 2020-05-19  9:08 UTC (permalink / raw)
  To: Ophir Munk
  Cc: dev, David Marchand, Ray Kinsella, Matan Azrad, Raslan Darawsheh,
	ferruh.yigit

07/05/2020 13:31, Ophir Munk:
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> +; These functions were moved from stable to internal.
> +; Avoid loading the symbols and comparing them.
> +; This is a temporary exception till DPDK 20.11
> +[suppress_file]
> +	file_name_regexp = ^librte_common_mlx5\.

Updated comments while merging in master.

General comment for all similar cases:
+;;;;;;;;;;;;;;;;;;;;;;
+; Temporary exceptions for new __rte_internal marking till DPDK 20.11
+;;;;;;;;;;;;;;;;;;;;;;

Specific comment for this case:
+; Ignore moving mlx5 stable functions to INTERNAL




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2020-05-19  9:08 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 11:20 [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Ophir Munk
2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 2/3] common/mlx5: add rte internal tag Ophir Munk
2020-05-05 11:46   ` Matan Azrad
2020-05-05 11:20 ` [dpdk-dev] [PATCH v1 3/3] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
2020-05-05 11:45 ` [dpdk-dev] [PATCH v1 1/3] devtools: create internal ignore file for libabigail Matan Azrad
2020-05-05 14:53 ` David Marchand
2020-05-05 15:02   ` Ray Kinsella
2020-05-06 12:27   ` Thomas Monjalon
2020-05-06 12:42     ` David Marchand
2020-05-06 12:52       ` Thomas Monjalon
2020-05-06 14:15         ` Ray Kinsella
2020-05-06 14:22           ` Thomas Monjalon
2020-05-07  7:48             ` Ophir Munk
2020-05-07  7:37 ` [dpdk-dev] [PATCH v2 0/2] add INTERNAL tags and avoid comparison Ophir Munk
2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add rte internal tag " Ophir Munk
2020-05-07  7:44     ` Matan Azrad
2020-05-07  7:56     ` Ray Kinsella
2020-05-07  9:03       ` Ophir Munk
2020-05-07  8:56     ` [dpdk-dev] [PATCH v3 " Ophir Munk
2020-05-07  8:56       ` [dpdk-dev] [PATCH v3 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
2020-05-07 10:23       ` [dpdk-dev] [PATCH v3 1/2] common/mlx5: add rte internal tag and avoid comparison Thomas Monjalon
2020-05-07 11:41         ` Ophir Munk
2020-05-07 20:08           ` Thomas Monjalon
2020-05-10  8:14             ` Ophir Munk
2020-05-07 11:31       ` [dpdk-dev] [PATCH v4 " Ophir Munk
2020-05-07 11:31         ` [dpdk-dev] [PATCH v4 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk
2020-05-12 10:52         ` [dpdk-dev] [PATCH v4 1/2] common/mlx5: add rte internal tag and avoid comparison Raslan Darawsheh
2020-05-19  9:08         ` Thomas Monjalon
2020-05-07  7:37   ` [dpdk-dev] [PATCH v2 2/2] common/mlx5: remove devx dependency on ibv and DV Ophir Munk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).