Skip to content
Snippets Groups Projects
  1. Mar 16, 2020
  2. Mar 15, 2020
  3. Jul 23, 2019
  4. Apr 25, 2019
    • Nicolas Morey-Chaisemartin's avatar
      ib_types: Drop packed attribute where unnecessary · 70722b48
      Nicolas Morey-Chaisemartin authored
      
      For many of the IBA structures, the packed attribute has no effect.
      
      List of impacted struct and checks were done this way:
      
      Before applying this patch
      - Generate a single file with all the IBA structs
      (echo -e "#include <iba/ib_types.h>\n#include <stdio.h>\n\n\n"; for struct in $(git grep '^} PACK_SUFFIX' -- include/iba/ib_types.h | awk '{ print $NF }' | sed -e 's/;//'); do echo -e "$struct a_$struct;"; done) > ib_sizes.c
      - Compile for both 32 and 64b
      gcc -o ib_sizes.64.o -g3 -c ib_sizes.c -I./include/
      gcc -o ib_sizes.32.o -g3 -m32 -c ib_sizes.c -I./include/
      - Generate structure data using pahole
      pahole ib_sizes.64.o > sizes.64.org
      pahole ib_sizes.32.o > sizes.32.org
      
      After applying this patch:
      - Compile for both 32 and 64b
      gcc -o ib_sizes.64.o -g3 -c ib_sizes.c -I./include/
      gcc -o ib_sizes.32.o -g3 -m32 -c ib_sizes.c -I./include/
      - Generate structure data using pahole
      pahole ib_sizes.64.o > sizes.64.new
      pahole ib_sizes.32.o > sizes.32.new
      
      Diff pahole results:
      diff sizes.64.org sizes.64.new
      diff sizes.32.org sizes.32.new
      
      As the patch remove effect-less attribute, no diff shows up
      
      Signed-off-by: default avatarNicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      70722b48
    • Hal Rosenstock's avatar
      opensm.spec.in: Move COPYING back into doc · 9a7cc0d1
      Hal Rosenstock authored
      
      as having in license breaks rpm building on some distros
      
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      9a7cc0d1
  5. Apr 24, 2019
  6. Apr 21, 2019
  7. Apr 17, 2019
  8. Apr 11, 2019
    • Nicolas Morey-Chaisemartin's avatar
      libvendor/osm_vendor_ibumad.c: Fix type of array passed to umad_get_ca_portguids in libibumad · 1c57b7d3
      Nicolas Morey-Chaisemartin authored
      
      Fixes GCC warning:
      osm_vendor_ibumad.c: In function ‘osm_vendor_open_port’:
      osm_vendor_ibumad.c:745:56: error: passing argument 2 of ‘umad_get_ca_portguids’ from incompatible pointer type [-Werror=incompatible-pointer-types]
         if ((r = umad_get_ca_portguids(p_vend->ca_names[ca], portguids,
                                                              ^~~~~~~~~
      
      Second argument to umad_get_ca_portguids was changed from uint64_t * to __be64 * in rdma-core by:
      96db7b90 (Bart Van Assche 2017-03-10 14:52:27 -0800 178) int umad_get_ca_portguids(const char *ca_name, __be64 *portguids, int max);
      
      Note that this change causes similar warning when OpenSM is built
      with older libibumad rather than the other way around as it was
      prior to this patch.
      osm_vendor_ibumad.c: In function 'osm_vendor_open_port':
      osm_vendor_ibumad.c:747: warning: passing argument 2 of 'umad_get_ca_portguids' from incompatible pointer type
      ./../../libibumad/include/infiniband/umad.h:166: note: expected 'uint64_t *' but argument is of type '__be64 *'
      
      Signed-off-by: default avatarNicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      1c57b7d3
  9. Apr 09, 2019
  10. Feb 08, 2019
  11. Feb 06, 2019
    • Hal Rosenstock's avatar
      osm_[link_mgr trap_rcv].c: Check the return value of osm_get_port_by_guid · 92a9c3e5
      Hal Rosenstock authored
      
      Issue was found by Coverity.
      
      3. Defect type: NULL_RETURNS
      8. opensm-3.3.21/opensm/osm_trap_rcv.c:254: returned_null: "osm_get_port_by_guid" returns null (checked 46 out of 49 times).
      9. opensm-3.3.21/opensm/osm_trap_rcv.c:254: var_assigned: Assigning: "p_port" = null return value from "osm_get_port_by_guid".
      10. opensm-3.3.21/opensm/osm_trap_rcv.c:256: dereference: Dereferencing a null pointer "p_port".
      11. opensm-3.3.21/opensm/osm_congestion_control.c:678: example_assign: Example 1: Assigning: "p_port" = return value from "osm_get_port_by_guid(p_cc->subn, port_guid)".
      12. opensm-3.3.21/opensm/osm_congestion_control.c:679: example_checked: Example 1 (cont.): "p_port" has its value checked in "p_port".
      13. opensm-3.3.21/opensm/osm_drop_mgr.c:91: example_assign: Example 2: Assigning: "p_remote_port" = return value from "osm_get_port_by_guid(sm->p_subn, p_remote_physp->port_guid)".
      14. opensm-3.3.21/opensm/osm_drop_mgr.c:94: example_checked: Example 2 (cont.): "p_remote_port" has its value checked in "p_remote_port".
      15. opensm-3.3.21/opensm/osm_guid_info_rcv.c:105: example_assign: Example 3: Assigning: "p_port" = return value from "osm_get_port_by_guid(sm->p_subn, port_guid)".
      16. opensm-3.3.21/opensm/osm_guid_info_rcv.c:106: example_checked: Example 3 (cont.): "p_port" has its value checked in "p_port".
      17. opensm-3.3.21/opensm/osm_inform.c:434: example_assign: Example 4: Assigning: "p_src_port" = return value from "osm_get_port_by_guid(p_subn, source_gid.unicast.interface_id)".
      18. opensm-3.3.21/opensm/osm_inform.c:436: example_checked: Example 4 (cont.): "p_src_port" has its value checked in "p_src_port".
      19. opensm-3.3.21/opensm/osm_lid_mgr.c:1112: example_assign: Example 5: Assigning: "p_port" = return value from "osm_get_port_by_guid(p_mgr->p_subn, p_mgr->p_subn->sm_port_guid)".
      20. opensm-3.3.21/opensm/osm_lid_mgr.c:1114: example_checked: Example 5 (cont.): "p_port" has its value checked in "p_port".
      //  1112|   	p_port = osm_get_port_by_guid(p_mgr->p_subn,
      //  1113|   				      p_mgr->p_subn->sm_port_guid);
      //  1114|-> 	if (!p_port) {
      //  1115|   		OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 0308: "
      //  1116|   			"Can't acquire SM's port object, GUID 0x%016" PRIx64
      
      4. Defect type: NULL_RETURNS
      3. opensm-3.3.21/opensm/osm_link_mgr.c:126: returned_null: "osm_get_port_by_guid" returns null (checked 46 out of 49 times).
      4. opensm-3.3.21/opensm/osm_link_mgr.c:126: var_assigned: Assigning: "p_port" = null return value from "osm_get_port_by_guid".
      5. opensm-3.3.21/opensm/osm_link_mgr.c:128: dereference: Dereferencing a null pointer "p_port".
      6. opensm-3.3.21/opensm/osm_congestion_control.c:678: example_assign: Example 1: Assigning: "p_port" = return value from "osm_get_port_by_guid(p_cc->subn, port_guid)".
      7. opensm-3.3.21/opensm/osm_congestion_control.c:679: example_checked: Example 1 (cont.): "p_port" has its value checked in "p_port".
      8. opensm-3.3.21/opensm/osm_drop_mgr.c:91: example_assign: Example 2: Assigning: "p_remote_port" = return value from "osm_get_port_by_guid(sm->p_subn, p_remote_physp->port_guid)".
      9. opensm-3.3.21/opensm/osm_drop_mgr.c:94: example_checked: Example 2 (cont.): "p_remote_port" has its value checked in "p_remote_port".
      10. opensm-3.3.21/opensm/osm_guid_info_rcv.c:105: example_assign: Example 3: Assigning: "p_port" = return value from "osm_get_port_by_guid(sm->p_subn, port_guid)".
      11. opensm-3.3.21/opensm/osm_guid_info_rcv.c:106: example_checked: Example 3 (cont.): "p_port" has its value checked in "p_port".
      12. opensm-3.3.21/opensm/osm_inform.c:434: example_assign: Example 4: Assigning: "p_src_port" = return value from "osm_get_port_by_guid(p_subn, source_gid.unicast.interface_id)".
      13. opensm-3.3.21/opensm/osm_inform.c:436: example_checked: Example 4 (cont.): "p_src_port" has its value checked in "p_src_port".
      14. opensm-3.3.21/opensm/osm_lid_mgr.c:1112: example_assign: Example 5: Assigning: "p_port" = return value from "osm_get_port_by_guid(p_mgr->p_subn, p_mgr->p_subn->sm_port_guid)".
      15. opensm-3.3.21/opensm/osm_lid_mgr.c:1114: example_checked: Example 5 (cont.): "p_port" has its value checked in "p_port".
      //  1112|   	p_port = osm_get_port_by_guid(p_mgr->p_subn,
      //  1113|   				      p_mgr->p_subn->sm_port_guid);
      //  1114|-> 	if (!p_port) {
      //  1115|   		OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 0308: "
      //  1116|   			"Can't acquire SM's port object, GUID 0x%016" PRIx64
      
      Pointed-out-by: default avatarHonggang Li <honli@redhat.com>
      
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      92a9c3e5
    • Honggang Li's avatar
      main.c: Remove NO_EFFECT code · 06b168ad
      Honggang Li authored
      
      Issue was found by Coverity.
      
      opensm-3.3.21/opensm/main.c:1165: unsigned_compare: This less-than-zero comparison of an unsigned value is never true. "temp < 0U".
      //  1163|   		case 15:
      //  1164|   			temp = strtoul(optarg, NULL, 0);
      //  1165|-> 			if (temp < 0 || temp >= IB_MAX_NUM_VLS) {
      //  1166|   				fprintf(stderr,
      //  1167|   					"ERROR: maximum #VLs for nue routing must be between 0
      
      Signed-off-by: default avatarHonggang Li <honli@redhat.com>
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      06b168ad
    • Hal Rosenstock's avatar
    • Honggang Li's avatar
      osm_helper.c: Fix lsea_str_fixed_width OVERRUN issue · df22e547
      Honggang Li authored
      
      Issue was found by Coverity.
      
      When (lsea == IB_LINK_SPEED_EXT_ACTIVE_50 == 4), lsea_str_fixed_width[lsea]
      will overrun array.
      
      Defect type: OVERRUN
      4. opensm-3.3.21/opensm/osm_helper.c:3225: cond_at_least: Checking "lsea == 0" implies that "lsea" is at least 1 on the false branch.
      6. opensm-3.3.21/opensm/osm_helper.c:3231: cond_between: Checking "lsea > 4" implies that "lsea" is between 1 and 4 (inclusive) on the false branch.
      7. opensm-3.3.21/opensm/osm_helper.c:3233: overrun-local: Overrunning array "lsea_str_fixed_width" of 4 8-byte elements at element index 4 (byte offset 32) using index "lsea" (which evaluates to 4).
      //  3231|   	if (lsea > IB_LINK_SPEED_EXT_ACTIVE_50)
      //  3232|   		return lsa_str_fixed_width[3];
      //  3233|-> 	return lsea_str_fixed_width[lsea];
      //  3234|   }
      //  3235|
      
      Signed-off-by: default avatarHonggang Li <honli@redhat.com>
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      df22e547
    • Honggang Li's avatar
      Add '--subnet_prefix' and '--dump_files_dir' options · 82c3ea6c
      Honggang Li authored
      
      The original patch was written by Doug Ledford.
      
      For RHEL users who need to run multiple instances of opensm over
      multiple InfiniBand ports, most of time, they need to pass five options
      to all instances of opensm.
      
      1) guid
      2) subnet_prefix
      3) partition_config_file
      4) log_file
      5) dump_files_dir
      
      1), 3) and 4) are available in upstream. But 2) and 5) are not.
      We need create separate configuration files for opensm instances
      to apply 2) and 5), when those options are unavailable.
      
      We add '--subnet_prefix' option because:
      openmpi will refuse to run if you have two physically separate subnets
      with the same subnet prefix.  The subnet prefix is supposed to be unique
      on each subnet.  It's how software can tell for certain whether or not
      to end points can communicate with each other.
      
      We add '--dump_files_dir' option to keep dumps of different fabrics
      into different directories.
      
      Signed-off-by: default avatarHonggang Li <honli@redhat.com>
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      82c3ea6c
    • Aleksandr Minchiu's avatar
      osm_trap_rcv.c: Fix missing log message when 10 traps are received from the... · d2893165
      Aleksandr Minchiu authored
      osm_trap_rcv.c: Fix missing log message when 10 traps are received from the same source within time window
      
      Signed-off-by: default avatarAleksandr Minchiu <alexmi@mellanox.com>
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      d2893165
  12. Dec 17, 2018
    • Hal Rosenstock's avatar
      man/opensm.8.in: Quiet some man warnings · ceef0387
      Hal Rosenstock authored
      
      LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 man/opensm.8 >/dev/null
      <standard input>:584: warning [p 9, 1.0i]: cannot adjust line
      <standard input>:748: warning [p 11, 6.0i]: cannot adjust line
      <standard input>:749: warning [p 11, 6.3i]: cannot adjust line
      
      Pointed-out-by: default avatarBenjamin Drung <benjamin.drung@cloud.ionos.com>
      
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      ceef0387
    • Hal Rosenstock's avatar
      Eliminate circular dependencies in shared libraries · 399fe25b
      Hal Rosenstock authored
      
      in order to fix the unresolved symbols.
      
      The shared objects have some unresolved symbols which the program which
      links against it must resolve. This isn't a good idea because when you
      introduce new dependencies the package previously linked against the old
      version will break because it doesn't know about the new dependency.
      
      dpkg-shlibdeps: warning: symbol osm_log_v2 used by debian/libosmvendor4/usr/lib/x86_64-linux-gnu/libosmvendor.so.4.0.3 found in none of the libraries
      dpkg-shlibdeps: warning: symbol osm_mad_pool_get used by debian/libosmvendor4/usr/lib/x86_64-linux-gnu/libosmvendor.so.4.0.3 found in none of the libraries
      dpkg-shlibdeps: warning: symbol osm_mad_pool_put used by debian/libosmvendor4/usr/lib/x86_64-linux-gnu/libosmvendor.so.4.0.3 found in none of the libraries
      dpkg-shlibdeps: warning: symbol osm_log used by debian/libosmvendor4/usr/lib/x86_64-linux-gnu/libosmvendor.so.4.0.3 found in none of the libraries
      dpkg-shlibdeps: warning: symbol osm_dump_smp_dr_path used by debian/libosmvendor4/usr/lib/x86_64-linux-gnu/libosmvendor.so.4.0.3 found in none of the libraries
      dpkg-shlibdeps: warning: symbol cl_atomic_spinlock used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      dpkg-shlibdeps: warning: symbol osm_vendor_get used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      dpkg-shlibdeps: warning: symbol cl_spinlock_init used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      dpkg-shlibdeps: warning: symbol cl_spinlock_acquire used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      dpkg-shlibdeps: warning: symbol cl_get_time_stamp used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      dpkg-shlibdeps: warning: symbol cl_spinlock_release used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      dpkg-shlibdeps: warning: symbol osm_vendor_put used by debian/libopensm8/usr/lib/x86_64-linux-gnu/libopensm.so.8.0.0 found in none of the libraries
      
      To fix this, restructure the internal libraries as follows:
      libopensm currently has dependency on libosmvendor because of
      osm_mad_pool.c. This module is moved to libosmvendor (even though
      it's not really vendor but opensm) and then libopensm (now only
      depending on libosmcomp) is split out from opensm and built after
      libosmcomp but before libosmvendor. Only danger would be external
      program which dynamically links with libopensm and needs some
      osm_mad_pool routine and would now need to also link with
      libosmvendor but such program is unlikely (and these libraries
      are internal).
      
      Pointed-out-by: default avatarBenjamin Drung <benjamin.drung@cloud.ionos.com>
      
      Signed-off-by: default avatarHal Rosenstock <hal@mellanox.com>
      399fe25b
  13. Dec 10, 2018
  14. Dec 03, 2018