Skip to content

Commit

Permalink
[hermon] Force link speed to SDR
Browse files Browse the repository at this point in the history
SDR link comes up much faster than other speeds.

Signed-off-by: Itay Gazit <itaygazit@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
Itay Gazit authored and mcb30 committed Feb 17, 2011
1 parent 1b84a80 commit 0e878b3
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/drivers/infiniband/hermon.c
Expand Up @@ -1969,17 +1969,20 @@ static int hermon_open ( struct ib_device *ibdev ) {

/* Set port parameters */
memset ( &set_port, 0, sizeof ( set_port ) );
MLX_FILL_7 ( &set_port.ib, 0,
MLX_FILL_8 ( &set_port.ib, 0,
mmc, 1,
mvc, 1,
mp, 1,
mg, 1,
mtu_cap, IB_MTU_2048,
vl_cap, IB_VL_0,
rcm, 1 );
rcm, 1,
lss, 1 );
MLX_FILL_2 ( &set_port.ib, 10,
max_pkey, 1,
max_gid, 1 );
MLX_FILL_1 ( &set_port.ib, 28,
link_speed_supported, 1 );
if ( ( rc = hermon_cmd_set_port ( hermon, 0, ibdev->port,
&set_port ) ) != 0 ) {
DBGC ( hermon, "Hermon %p port %d could not set port: %s\n",
Expand Down
48 changes: 45 additions & 3 deletions src/drivers/infiniband/hermon.h
Expand Up @@ -228,7 +228,10 @@ struct hermonprm_set_port_ib_st {
pseudo_bit_t mp[0x00001];
pseudo_bit_t mvc[0x00001];
pseudo_bit_t mmc[0x00001];
pseudo_bit_t reserved2[0x00009];
pseudo_bit_t reserved2[0x00004];
pseudo_bit_t lws[0x00001];
pseudo_bit_t lss[0x00001];
pseudo_bit_t reserved3[0x00003];
/* -------------- */
pseudo_bit_t capability_mask[0x00020];
/* -------------- */
Expand All @@ -246,14 +249,53 @@ struct hermonprm_set_port_ib_st {
/* -------------- */
pseudo_bit_t egress_sniff_qpn[0x00018];
pseudo_bit_t egress_sniff_mode[0x00002];
pseudo_bit_t reserved3[0x00006];
pseudo_bit_t reserved4[0x00006];
/* -------------- */
pseudo_bit_t ingress_sniff_qpn[0x00018];
pseudo_bit_t ingress_sniff_mode[0x00002];
pseudo_bit_t reserved4[0x00006];
pseudo_bit_t reserved5[0x00006];
/* -------------- */
pseudo_bit_t max_gid[0x00010];
pseudo_bit_t max_pkey[0x00010];
/* -------------- */
pseudo_bit_t reserved6[0x00020];
/* -------------- */
pseudo_bit_t reserved7[0x00020];
/* -------------- */
pseudo_bit_t reserved8[0x00020];
/* -------------- */
pseudo_bit_t reserved9[0x00020];
/* -------------- */
pseudo_bit_t reserved10[0x00020];
/* -------------- */
pseudo_bit_t reserved11[0x00020];
/* -------------- */
pseudo_bit_t reserved12[0x00020];
/* -------------- */
pseudo_bit_t reserved13[0x00020];
/* -------------- */
pseudo_bit_t reserved14[0x00020];
/* -------------- */
pseudo_bit_t reserved15[0x00020];
/* -------------- */
pseudo_bit_t reserved16[0x00020];
/* -------------- */
pseudo_bit_t reserved17[0x00020];
/* -------------- */
pseudo_bit_t reserved18[0x00020];
/* -------------- */
pseudo_bit_t reserved19[0x00020];
/* -------------- */
pseudo_bit_t reserved20[0x00020];
/* -------------- */
pseudo_bit_t reserved21[0x00020];
/* -------------- */
pseudo_bit_t reserved22[0x00020];
/* -------------- */
pseudo_bit_t link_width_supported[0x00004];
pseudo_bit_t link_speed_supported[0x00004];
pseudo_bit_t reserved23[0x00018];
/* -------------- */
} __attribute__ (( packed ));

struct hermonprm_query_port_cap_st {
Expand Down
12 changes: 12 additions & 0 deletions src/drivers/infiniband/mlx_bitops.h
Expand Up @@ -110,6 +110,10 @@ typedef unsigned char pseudo_bit_t;
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_6 ( _structure_st, _index, __VA_ARGS__ ) )

#define MLX_ASSEMBLE_8( _structure_st, _index, _field, _value, ... ) \
( MLX_ASSEMBLE_1 ( _structure_st, _index, _field, _value ) | \
MLX_ASSEMBLE_7 ( _structure_st, _index, __VA_ARGS__ ) )

/*
* Build native-endian (positive) dword bitmasks from named fields
*
Expand Down Expand Up @@ -143,6 +147,10 @@ typedef unsigned char pseudo_bit_t;
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_6 ( _structure_st, _index, __VA_ARGS__ ) )

#define MLX_MASK_8( _structure_st, _index, _field, ... ) \
( MLX_MASK_1 ( _structure_st, _index, _field ) | \
MLX_MASK_7 ( _structure_st, _index, __VA_ARGS__ ) )

/*
* Populate big-endian dwords from named fields and values
*
Expand Down Expand Up @@ -183,6 +191,10 @@ typedef unsigned char pseudo_bit_t;
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_7 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )

#define MLX_FILL_8( _ptr, _index, ... ) \
MLX_FILL ( _ptr, _index, MLX_ASSEMBLE_8 ( MLX_PSEUDO_STRUCT ( _ptr ),\
_index, __VA_ARGS__ ) )

/*
* Modify big-endian dword using named field and value
*
Expand Down

0 comments on commit 0e878b3

Please sign in to comment.