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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/clients/rds/rdssubr.c
          +++ new/usr/src/uts/common/io/ib/clients/rds/rdssubr.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
       26 +#include <sys/sysmacros.h>
  26   27  #include <sys/ib/clients/rds/rds.h>
  27   28  #include <sys/ib/clients/rds/rds_kstat.h>
  28   29  
  29   30  #include <inet/ipclassifier.h>
  30   31  
  31   32  struct rds_kstat_s rds_kstat = {
  32   33          {"rds_nports",                  KSTAT_DATA_ULONG},
  33   34          {"rds_nsessions",               KSTAT_DATA_ULONG},
  34   35          {"rds_tx_bytes",                KSTAT_DATA_ULONG},
  35   36          {"rds_tx_pkts",                 KSTAT_DATA_ULONG},
↓ open down ↓ 106 lines elided ↑ open up ↑
 142  143                  kstat_install(rds_kstatsp);
 143  144          }
 144  145  }
 145  146  
 146  147  #define UINT_32_BITS 31
 147  148  void
 148  149  rds_hash_init()
 149  150  {
 150  151          int i;
 151  152  
 152      -        if (rds_bind_fanout_size & (rds_bind_fanout_size - 1)) {
      153 +        if (!ISP2(rds_bind_fanout_size)) {
 153  154                  /* Not a power of two. Round up to nearest power of two */
 154  155                  for (i = 0; i < UINT_32_BITS; i++) {
 155  156                          if (rds_bind_fanout_size < (1 << i))
 156  157                                  break;
 157  158                  }
 158  159                  rds_bind_fanout_size = 1 << i;
 159  160          }
 160  161          rds_bind_fanout = kmem_zalloc(rds_bind_fanout_size *
 161  162              sizeof (rds_bf_t), KM_SLEEP);
 162  163          for (i = 0; i < rds_bind_fanout_size; i++) {
↓ open down ↓ 147 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX