Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c
          +++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c
↓ open down ↓ 24 lines elided ↑ open up ↑
  25   25   */
  26   26  
  27   27  /*
  28   28   * tavor_cfg.c
  29   29   *    Tavor Configuration Profile Routines
  30   30   *
  31   31   *    Implements the routines necessary for initializing and (later) tearing
  32   32   *    down the list of Tavor configuration information.
  33   33   */
  34   34  
       35 +#include <sys/sysmacros.h>
  35   36  #include <sys/types.h>
  36   37  #include <sys/conf.h>
  37   38  #include <sys/ddi.h>
  38   39  #include <sys/sunddi.h>
  39   40  #include <sys/modctl.h>
  40   41  #include <sys/bitmap.h>
  41   42  
  42   43  #include <sys/ib/adapters/tavor/tavor.h>
  43   44  
  44   45  /* Set to enable alternative configurations: 0 = automatic config, 1 = manual */
↓ open down ↓ 605 lines elided ↑ open up ↑
 650  651          /*
 651  652           * Use requested maximum number of SGL to calculate the max descriptor
 652  653           * size (while guaranteeing that the descriptor size is a power-of-2
 653  654           * cachelines).  We have to use the calculation for QP1 MLX transport
 654  655           * because the possibility that we might need to inline a GRH, along
 655  656           * with all the other headers and alignment restrictions, sets the
 656  657           * maximum for the number of SGLs that we can advertise support for.
 657  658           */
 658  659          max_size = (TAVOR_QP_WQE_MLX_QP1_HDRS + (max_sgl << 4));
 659  660          log2 = highbit(max_size);
 660      -        if ((max_size & (max_size - 1)) == 0) {
      661 +        if (ISP2(max_size)) {
 661  662                  log2 = log2 - 1;
 662  663          }
 663  664          max_size = (1 << log2);
 664  665  
 665  666          /*
 666  667           * Now clip the maximum descriptor size based on Tavor HW maximum
 667  668           */
 668  669          max_size = min(max_size, TAVOR_QP_WQE_MAX_SIZE);
 669  670  
 670  671          /*
↓ open down ↓ 145 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX