[openib-general] RE: [PATCH] OpenSM/ib_types.h: Modify ib_port_info_compute_rate
Eitan Zahavi
eitan at mellanox.co.il
Sun Dec 18 03:53:24 PST 2005
Hi Hal,
The attached patch is fine. Please go ahead and commit it.
BTW:
In the following commit 4509 you have changed the name of a switch info
record field.
Note this is an API change and have severe effect on any application
using ib_types.h
(and there are plenty of these)
I would appreciate if you will revert this un-necessary change. Also in
the future please post a patch before changing ib_types.h
osm_vendor_api.h osm_vendor_sa_api.h and any of the complib H files.
------------------------------------------------------------------------
r4509 | halr | 2005-12-16 22:25:29 +0200 (Fri, 16 Dec 2005) | 5 lines
In switchinfo, rename enforce_cap to partition_enf_cap
to be closer to it's IBA spec name
EZ
Eitan Zahavi
Design Technology Director
Mellanox Technologies LTD
Tel:+972-4-9097208
Fax:+972-4-9593245
P.O. Box 586 Yokneam 20692 ISRAEL
> -----Original Message-----
> From: Hal Rosenstock [mailto:halr at voltaire.com]
> Sent: Thursday, December 15, 2005 4:33 PM
> To: Yael Kalka
> Cc: openib-general at openib.org; Eitan Zahavi
> Subject: [PATCH] OpenSM/ib_types.h: Modify ib_port_info_compute_rate
>
> OpenSM/ib_types.h: Modify ib_port_info_compute_rate so that gcc
version
> 4.0.0 20050519 (Red Hat 4.0.0-8) doesn't complain when compiling
> osm_sa_path_record.c as follows:
>
> osm_sa_path_record.c: In function '__osm_pr_rcv_get_path_parms':
> osm_sa_path_record.c:194: warning: control may reach end of non-void
function
> 'ib_port_info_compute_rate' being inlined
>
> Signed-off-by: Hal Rosenstock <halr at voltaire.com>
>
> Index: include/iba/ib_types.h
> ===================================================================
> --- include/iba/ib_types.h (revision 4479)
> +++ include/iba/ib_types.h (working copy)
> @@ -4290,59 +4290,76 @@ static inline uint8_t
> ib_port_info_compute_rate(
> IN const ib_port_info_t* const p_pi )
> {
> + uint8_t rate = 0;
> +
> switch (ib_port_info_get_link_speed_active(p_pi))
> {
> case IB_LINK_SPEED_ACTIVE_2_5:
> switch (p_pi->link_width_active)
> {
> case IB_LINK_WIDTH_ACTIVE_1X:
> - return IB_PATH_RECORD_RATE_2_5_GBS;
> + rate = IB_PATH_RECORD_RATE_2_5_GBS;
> + break;
>
> case IB_LINK_WIDTH_ACTIVE_4X:
> - return IB_PATH_RECORD_RATE_10_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_10_GBS;
> + break;
> +
> case IB_LINK_WIDTH_ACTIVE_12X:
> - return IB_PATH_RECORD_RATE_30_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_30_GBS;
> + break;
> +
> default:
> - return IB_PATH_RECORD_RATE_2_5_GBS;
> + rate = IB_PATH_RECORD_RATE_2_5_GBS;
> + break;
> }
> break;
> case IB_LINK_SPEED_ACTIVE_5:
> switch (p_pi->link_width_active)
> {
> case IB_LINK_WIDTH_ACTIVE_1X:
> - return IB_PATH_RECORD_RATE_5_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_5_GBS;
> + break;
> +
> case IB_LINK_WIDTH_ACTIVE_4X:
> - return IB_PATH_RECORD_RATE_20_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_20_GBS;
> + break;
> +
> case IB_LINK_WIDTH_ACTIVE_12X:
> - return IB_PATH_RECORD_RATE_60_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_60_GBS;
> + break;
> +
> default:
> - return IB_PATH_RECORD_RATE_5_GBS;
> + rate = IB_PATH_RECORD_RATE_5_GBS;
> + break;
> }
> break;
> case IB_LINK_SPEED_ACTIVE_10:
> switch (p_pi->link_width_active)
> {
> case IB_LINK_WIDTH_ACTIVE_1X:
> - return IB_PATH_RECORD_RATE_10_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_10_GBS;
> + break;
> +
> case IB_LINK_WIDTH_ACTIVE_4X:
> - return IB_PATH_RECORD_RATE_40_GBS;
> -
> + rate = IB_PATH_RECORD_RATE_40_GBS;
> + break;
> +
> case IB_LINK_WIDTH_ACTIVE_12X:
> - return IB_PATH_RECORD_RATE_120_GBS;
> -
> + rate =IB_PATH_RECORD_RATE_120_GBS;
> + break;
> +
> default:
> - return IB_PATH_RECORD_RATE_10_GBS;
> + rate = IB_PATH_RECORD_RATE_10_GBS;
> + break;
> }
> break;
> default:
> - return IB_PATH_RECORD_RATE_2_5_GBS;
> + rate = IB_PATH_RECORD_RATE_2_5_GBS;
> + break;
> }
> +
> + return rate;
> }
> /*
> * PARAMETERS
More information about the general
mailing list