From: Roland Dreier Date: Tue, 11 Apr 2006 21:41:11 +0000 (+0000) Subject: Deprecate "ib_XXX" names X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=e2ac6bb02c36e013227c877624f9aa288b4b20db;p=~shefty%2Flibibverbs.git Deprecate "ib_XXX" names Deprecate various "ib_XXX" names (introduced as part of SA and marshalling code). Preferred versions like "ibv_XXX" are now available. Signed-off-by: Roland Dreier --- diff --git a/ChangeLog b/ChangeLog index 5fa558c..8acd8b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-04-11 Roland Dreier + + * include/infiniband/sa-kern-abi.h: Deprecate struct + ib_kern_path_rec name; struct ibv_kern_path_rec is now preferred. + + * include/infiniband/sa.h: Deprecate struct ib_sa_XXX names; + struct ibv_sa_XXX is now preferred. + + * src/marshall.c, include/infiniband/marshall.h: Deprecate + ib_copy_XXX() names; ibv_copy_XXX() is preferred. Add stub + wrappers with the old names so old binaries still work. + 2006-04-11 Hoang-Nam Nguyen * src/verbs.c (ibv_rate_to_mult, mult_to_ibv_rate): Add new diff --git a/include/infiniband/marshall.h b/include/infiniband/marshall.h index d6bd38f..fe2bb1e 100644 --- a/include/infiniband/marshall.h +++ b/include/infiniband/marshall.h @@ -46,17 +46,38 @@ # define END_C_DECLS #endif /* __cplusplus */ +#if __GNUC__ >= 3 +# define __attribute_deprecated __attribute__((deprecated)) +#else +# define __attribute_deprecated +#endif + BEGIN_C_DECLS +void ibv_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, + struct ibv_kern_qp_attr *src); + +void ibv_copy_path_rec_from_kern(struct ibv_sa_path_rec *dst, + struct ibv_kern_path_rec *src); + +void ibv_copy_path_rec_to_kern(struct ibv_kern_path_rec *dst, + struct ibv_sa_path_rec *src); + +/* + * Obsolete, deprecated names. Will be removed in libibverbs 1.1. + */ + void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, - struct ibv_kern_qp_attr *src); + struct ibv_kern_qp_attr *src) __attribute_deprecated; void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst, - struct ib_kern_path_rec *src); + struct ib_kern_path_rec *src) __attribute_deprecated; void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst, - struct ib_sa_path_rec *src); + struct ib_sa_path_rec *src) __attribute_deprecated; END_C_DECLS +#undef __attribute_deprecated + #endif /* INFINIBAND_MARSHALL_H */ diff --git a/include/infiniband/sa-kern-abi.h b/include/infiniband/sa-kern-abi.h index fe1155e..4927d11 100644 --- a/include/infiniband/sa-kern-abi.h +++ b/include/infiniband/sa-kern-abi.h @@ -30,12 +30,17 @@ * SOFTWARE. */ -#ifndef SA_KERN_ABI_H -#define SA_KERN_ABI_H +#ifndef INFINIBAND_SA_KERN_ABI_H +#define INFINIBAND_SA_KERN_ABI_H #include -struct ib_kern_path_rec { +/* + * Obsolete, deprecated names. Will be removed in libibverbs 1.1. + */ +#define ib_kern_path_rec ibv_kern_path_rec + +struct ibv_kern_path_rec { __u8 dgid[16]; __u8 sgid[16]; __u16 dlid; @@ -57,4 +62,4 @@ struct ib_kern_path_rec { __u8 preference; }; -#endif /* SA_KERN_ABI_H */ +#endif /* INFINIBAND_SA_KERN_ABI_H */ diff --git a/include/infiniband/sa.h b/include/infiniband/sa.h index 951da37..dc2f3b5 100644 --- a/include/infiniband/sa.h +++ b/include/infiniband/sa.h @@ -33,40 +33,19 @@ * $Id: sa.h 2616 2005-06-15 15:22:39Z halr $ */ -#ifndef IB_SA_H -#define IB_SA_H +#ifndef INFINIBAND_SA_H +#define INFINIBAND_SA_H #include -enum ib_sa_rate { - IB_SA_RATE_2_5_GBPS = 2, - IB_SA_RATE_5_GBPS = 5, - IB_SA_RATE_10_GBPS = 3, - IB_SA_RATE_20_GBPS = 6, - IB_SA_RATE_30_GBPS = 4, - IB_SA_RATE_40_GBPS = 7, - IB_SA_RATE_60_GBPS = 8, - IB_SA_RATE_80_GBPS = 9, - IB_SA_RATE_120_GBPS = 10 -}; - -static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate) -{ - switch (rate) { - case IB_SA_RATE_2_5_GBPS: return 1; - case IB_SA_RATE_5_GBPS: return 2; - case IB_SA_RATE_10_GBPS: return 4; - case IB_SA_RATE_20_GBPS: return 8; - case IB_SA_RATE_30_GBPS: return 12; - case IB_SA_RATE_40_GBPS: return 16; - case IB_SA_RATE_60_GBPS: return 24; - case IB_SA_RATE_80_GBPS: return 32; - case IB_SA_RATE_120_GBPS: return 48; - default: return -1; - } -} +/* + * Obsolete, deprecated names. Will be removed in libibverbs 1.1. + */ +#define ib_sa_path_rec ibv_sa_path_rec +#define ib_sa_mcmember_rec ibv_sa_mcmember_rec +#define ib_sa_service_rec ibv_sa_service_rec -struct ib_sa_path_rec { +struct ibv_sa_path_rec { /* reserved */ /* reserved */ union ibv_gid dgid; @@ -92,7 +71,7 @@ struct ib_sa_path_rec { uint8_t preference; }; -struct ib_sa_mcmember_rec { +struct ibv_sa_mcmember_rec { union ibv_gid mgid; union ibv_gid port_gid; uint32_t qkey; @@ -113,7 +92,7 @@ struct ib_sa_mcmember_rec { int proxy_join; }; -struct ib_sa_service_rec { +struct ibv_sa_service_rec { uint64_t id; union ibv_gid gid; uint16_t pkey; @@ -127,4 +106,4 @@ struct ib_sa_service_rec { uint64_t data64[2]; }; -#endif /* IB_SA_H */ +#endif /* INFINIBAND_SA_H */ diff --git a/src/libibverbs.map b/src/libibverbs.map index 807a9d6..29eb220 100644 --- a/src/libibverbs.map +++ b/src/libibverbs.map @@ -64,10 +64,13 @@ IBVERBS_1.0 { ibv_cmd_destroy_ah; ibv_cmd_attach_mcast; ibv_cmd_detach_mcast; + ibv_copy_qp_attr_from_kern; + ibv_copy_path_rec_from_kern; + ibv_copy_path_rec_to_kern; + ibv_rate_to_mult; + mult_to_ibv_rate; ib_copy_qp_attr_from_kern; ib_copy_path_rec_from_kern; ib_copy_path_rec_to_kern; - ibv_rate_to_mult; - mult_to_ibv_rate; local: *; }; diff --git a/src/marshall.c b/src/marshall.c index 6f6c387..1284f64 100644 --- a/src/marshall.c +++ b/src/marshall.c @@ -36,8 +36,8 @@ #include -static void ib_copy_ah_attr_from_kern(struct ibv_ah_attr *dst, - struct ibv_kern_ah_attr *src) +static void ibv_copy_ah_attr_from_kern(struct ibv_ah_attr *dst, + struct ibv_kern_ah_attr *src) { memcpy(dst->grh.dgid.raw, src->grh.dgid, sizeof dst->grh.dgid); dst->grh.flow_label = src->grh.flow_label; @@ -53,8 +53,8 @@ static void ib_copy_ah_attr_from_kern(struct ibv_ah_attr *dst, dst->port_num = src->port_num; } -void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, - struct ibv_kern_qp_attr *src) +void ibv_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, + struct ibv_kern_qp_attr *src) { dst->cur_qp_state = src->cur_qp_state; dst->path_mtu = src->path_mtu; @@ -71,8 +71,8 @@ void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, dst->cap.max_recv_sge = src->max_recv_sge; dst->cap.max_inline_data = src->max_inline_data; - ib_copy_ah_attr_from_kern(&dst->ah_attr, &src->ah_attr); - ib_copy_ah_attr_from_kern(&dst->alt_ah_attr, &src->alt_ah_attr); + ibv_copy_ah_attr_from_kern(&dst->ah_attr, &src->ah_attr); + ibv_copy_ah_attr_from_kern(&dst->alt_ah_attr, &src->alt_ah_attr); dst->pkey_index = src->pkey_index; dst->alt_pkey_index = src->alt_pkey_index; @@ -89,8 +89,8 @@ void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, dst->alt_timeout = src->alt_timeout; } -void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst, - struct ib_kern_path_rec *src) +void ibv_copy_path_rec_from_kern(struct ibv_sa_path_rec *dst, + struct ibv_kern_path_rec *src) { memcpy(dst->dgid.raw, src->dgid, sizeof dst->dgid); memcpy(dst->sgid.raw, src->sgid, sizeof dst->sgid); @@ -114,8 +114,8 @@ void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst, dst->packet_life_time_selector = src->packet_life_time_selector; } -void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst, - struct ib_sa_path_rec *src) +void ibv_copy_path_rec_to_kern(struct ibv_kern_path_rec *dst, + struct ibv_sa_path_rec *src) { memcpy(dst->dgid, src->dgid.raw, sizeof src->dgid); memcpy(dst->sgid, src->sgid.raw, sizeof src->sgid); @@ -138,3 +138,21 @@ void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst, dst->preference = src->preference; dst->packet_life_time_selector = src->packet_life_time_selector; } + +void ib_copy_qp_attr_from_kern(struct ibv_qp_attr *dst, + struct ibv_kern_qp_attr *src) +{ + return ibv_copy_qp_attr_from_kern(dst, src); +} + +void ib_copy_path_rec_from_kern(struct ib_sa_path_rec *dst, + struct ib_kern_path_rec *src) +{ + return ibv_copy_path_rec_from_kern(dst, src); +} + +void ib_copy_path_rec_to_kern(struct ib_kern_path_rec *dst, + struct ib_sa_path_rec *src) +{ + return ibv_copy_path_rec_to_kern(dst, src); +}