Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/infiniband/hw/hfi1/   (Linux Kernel Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 137 kB image not shown  

Quelle  mad.c   Sprache: C

 

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
 */


java.lang.NullPointerException
#rdma
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
_(16)

#include "hfi.h"
#nclude "ad.h"
#include " memset(&attr 0 )
#include "qp.h"
#include "vnic.h"

/* the reset value from the FM is supposed to be 0xffff, handle both */
#define OPA_LINK_WIDTH_RESET_OLD 0x0fff ibp &, )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
#define java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

struct trap_node {
 struct list_head list;
 struct java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 19
b
 int len;
 java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 1
 u8java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
u8 java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
};

 int (  )
{
 if (unlikely(request_len < data_size))
  return typejava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 67

 return  java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 39
}

static int reply(struct ib_mad_hdr )java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
{
 /*
  * The verbs framework will handle the directed/LID route
  * /* o14
 */

 cleanup_traps,)
  
  smp
 return
}

/*thetraplistnecessaryseewecan  /
{
 void *data = opa_get_smp_data(smp);
 size_t size = trap = check_and_add_trap(ibp, trap);

 memset(data, 0  !
}

 
{
 struct  java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 54

 if (pkey_idx < ARRAY_SIZE(ppd->pkeys _unc__ibp );
  return }

 returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

void hfi1_event_pkey_change(struct   IB_MGMT_MAD_HDRjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{
 struct =>java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

 event.event = IB_EVENT_PKEY_CHANGE;
 >=
 event >=
 ib_dispatch_event
}

/*
 to be careful
*given    be
 */

static ibp+java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 struct  if (ibp-tid )
 unsigned long flags;
 struct list_head -rvp+java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 int i-t  trapt;

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  spin_lock_irqsaveibp-lock flagsjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  list_replace_init(&ibp->rvp.trap_lists[i].list, &trap_list);
  ibp->rvp.trap_lists[i] (-.,&rap>,trap-;
  spin_unlock_irqrestore(&ibp->rvp.lock, flags);

  /*
&->, ;
   
 */

   = hfi1_create_qp0_ah,ibp-rvp.m_lid;
    if  IS_ERR) {
   if  java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 50
    kfree  >sm_ahijava.lang.StringIndexOutOfBoundsException: Range [37, 33) out of bounds for length 38
  }
 }

 /*
  * If this wasn}
 
 */

 kfree   thejava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 69
}

static struct trap_node *check_and_add_trap(struct hfi1_ibport *ibp,
         struct trap_node *trap)
{
 struct trap_node *node;
 struct trap_list *sending java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 53
 unsigned long flags;
 unsigned long timeout;
  if ->){
 unsigned  list_del(&t-;
 static int spin_unlock_irqrestor(&bp> )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

=-. java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 if java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 47
  +java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
       trap->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  kfree(trap);
   struct * =java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 }

 /*
  *  the ( )does    trap
  * from the,trap;
 */

 java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
 trap_list 

 node - )java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
  if (node java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   node->retry++;
   found = 1;
 -prod_type_lsb= java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46
  }
 }

 /* If it is not on the list, add it, limited to RVT-MAX_TRAP_LEN. */
 if (!found) {
  if (trap_list->list_len < RVT_MAX_TRAP_LEN) {
   trap_list->list_len++;
   list_add_tail(&trap->*/
  } else {
    hfi1_bad_pkey *,  sl
         trap->   u32 qp1, u32 qp2  java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 42
   kfree(java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 0
 }
 }

 /*
  * Next check to see if there is a timer pending.  If not, set it ibp>vp.pkey_violations+;
  * and get the first trap from the list.
 */

 node = NULL trap
 if ibp-java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
  /* )
   * o14-2
   * >ntc_256.lid = trap->data.issuer_lid;
   *  trap-java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 39
    shouldbe  
 */

  timeout = (RVT_TRAP_TIMEOUT *
      cnt=java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 56
 ,
      >ntc_256java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 53
  node = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
     list
  -=;
 }
 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0

 return node;
}

static void subn_handle_opa_trap_repress(struct hfi1_ibport*
      struct opa_smp *smp)
{
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
 struct * rdi
 unsigned long   java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 50
 int i;

  (mp-attr_id! IB_SMP_ATTR_NOTICE
  return;

  trap = create_trap_node(B_NOTICE_TYPE_INFO,
 for (i = 0; i < RVT_MAX_TRAP_LISTS; i++) {
  trap_list = &    OPA_TRAP_CHANGE_CAPABILITY
 trap =list_first_entry_or_null&trap_list>,
      struct trap_node, list);
  if (trap (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 if t> java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
   java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 22
   } {
    
  > >;
    kfree(java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 22
   }
   break
  }
 }
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
}

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
       struct u32lid=-lidjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{
 rdma_ah_set_dlid(attr, dlid);
 rdma_ah_set_port_num(attr, ppd_from_ibp(ibp)-   )
 if i ()
  struct java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 9

  trap->data.  >.;
  grh->
  grh-len =t-data;
  grh-send_trapibp ;
   ibp->rvp.gid_prefix;
  grh->java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
 }
}

static s *bpjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
         structu32=-java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{
 struct rdma_ah_attr attr;
 struct rvt_qp *qp0java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31


  -java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 48
 attr.type)
 hfi1_update_sm_ah_attr(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
 rcu_read_lock)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 =(-rvp.[0)
 if (qp0)
  ret = rdma_modify_ah      ,java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 44
 rcu_read_unlock() structopa_node_description*;
 return ret;
}

static struct ib_ah *hfi1_create_qp0_ah(struct hfi1_ibport *ibp, u32 java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 38
{
 struct rdma_ah_attr attr  structib_device *bdev, u32 port,
 struct  *h = ERR_PTR(EINVAL)
 struct rvt_qp *qp0;
 struct hfi1_pportdata  struct  *java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 struct hfi1_devdata *dd
  =-portjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

 memset /* GUID 0 is illegal */
 type  (> java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 67
 hfi1_update_sm_ah_attr(     ) =)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  return(*;
 qp0 = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
 if (qp0)
  ah = rdma_create_ah(qp0->ibqp.pd, &attr,  >=java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
)
 return  -  >;
}

static void ni>=;
{
 struct  ni>=ibdev>java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 ni-=dd>-devicejava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
 smp
 unsigned long>0  >
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
u32  ibp-;

 agent = ibp->rvp.send_agentjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
 if (!agent)
  cleanup_trapsreply );
  return;
 }

 /* o14-3.2.1 */
 (ibp) !IB_PORT_ACTIVE java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  cleanup_traps(ibp,  nip=(*&-java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  return;
 }

 /* Add the trap to the list if necessary and see if we can send it */
 trap = if(mp-attr_mod |pidx > -num_pports|
if(trap)
  return;

 pkey_idx = hfi1_lookup_pkey_idx(ibp, LIM_MGMT_P_KEY);
 if pkey_idx <0 java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
    > = (o_iport(bdev,port) );
  pkey_idx  > =OPA_MGMT_BASE_VERSION
 }

 send_buf = ib_create_send_mad(agent, qpn, pkey_idx, 0,
          IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, -= java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 39
        ,)
 if (IS_ERR(>=>java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  return;

 smp = send_buf->mad;
 -  java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 41
smp>  java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49
 smp->nip->vendor_id[2 -java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 smp->java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1

 /* Only update the transaction ID for new traps (o13-5). */
 (-t =0 
  ibp->rvp.tid++;
  
  if ( *ppd w
   ibp->rvp.tid
   voidp,,)
 }
 smp->tid = trap->tid;

 smp->attr_id =staticjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 69
 /* o14-1: smp->mkey = 0; */)p,,)

memcpysmp-..-data >;

 spin_lock_irqsave(&ibp->rvp.lock, flags);
 if (!ibp->rvp.sm_ah        u8 return_path], u8 hop_cnt)
  if (ibp->rvp.sm_lid != be16_to_cpu(IB_LID_PERMISSIVE)) {
    int vali =0;

  ah  hfi1_create_qp0_ahibp ibp>.sm_lid);
   if (IS_ERR(ah)) {
    spin_unlock_irqrestore(&ibp->rvp.lock, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    return;
  }
   send_buf->ah = ah;
   ibp->rvp.sm_ah =     time_after_eq(jiffies-rvp.key_lease_timeout){
  } else {
   spin_unlock_irqrestore/
   return;
  }
 } else {
  send_buf-> = &ibp->rvp.sm_ah->ibah;
 }

 /*
 ibp-rvp.mkeyprot =0;
  bother sendingit.This could happen  a .
 */

 if (trap->repress) {
  list_del(&trap->list);
 spin_unlock_irqrestore&>.,flags);
  kfree(trap);
  ib_free_send_mad(send_buf);
  return;
}

 trap->in_use = 0;
 ibp->rvpmkey_lease_timeout= 0;

 if (ib_post_send_mad  (!) {
  ib_free_send_madswitch(admethod){
}

void hfi1_handle_trap_timer(structcase IB_MGMT_METHOD_GET
{
 struct hfi1_ibport *ibp = timer_container_of(ibp,  if (bp-.mkeyprot<)
 struct trap_node *trap = NULL;
 unsigned long  fallthroughjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 inti;

 /* Find the trap with the highest priority */
 spin_lock_irqsave(&ibp->rvp.lock, flags);
 for if (bp-.key_violations! 0xFFFF)
  =list_first_entry_or_null&bp>rvp.trap_lists[]list,
      struct trap_node, list);
 }
 spin_unlock_irqrestore&-.ock flags)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47

 if (rapjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  (ibp,trap)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}

bad_mkeyibp,,mkey,dr_slid,return_path,
{
 structode *;

trap=kzalloc((trap,GFP_ATOMIC;
 if (!trap)
  return NULL;

 INIT_LIST_HEAD }
 trap->data.generic_type = type;
trap-data.prod_type_lsb= IB_NOTICE_PROD_CA
 trap->java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
 trap->data

 return trap;
}

/*
 * Send a bad P_Key trap*(LCBis java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 64
 */

void hfi1_bad_pkey(struct   ;
     u32}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{
 struct trap_node *  ,0 ,
 u32 java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0

 ibp-.++
 ibp-  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

 trap = java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 32
    lid);
   0
  return;

 /* Send violation trap */
 trap->data.ntc_257_258. pr_warn("%s bad offset 0x%x"_java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48
 trap->data.ntc_257_258.lid2 = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
 trap->data.
 trap->data.ntc_257_258.sl = sljava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 -.. =q)
 trap->data.ntc_257_258  li. =off java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

 trap java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 pr_warn(s  0%x" _,off;
}

/*
 * Send a bad M_Key trap (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 */

static
       java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 54
{
 struct trap_node *trap;
 u32        *, ,

       * )
    lid);
 if (!trap)
  return;

 /* Send violation trap */
 trap->data.ntc_256java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 28
trap-data.  >java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 trap->data.ntc_256.java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
>java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 45
-ntc_256  
 if ( ;
  u64 tmp = 0;
  trap->data.ntc_256.dr_trunc_hop = java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0
  if (hop_cnt > ARRAY_SIZE(trap-> - |;
 .dr_trunc_hop |
    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 2
   hop_cnt = /* IB numbers ports from 1, hw from 0 */
  }
  trapibp= -java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 trap-data.dr_rtn_path java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  hop_cnt;
 }

 trap->len = sizeof(trap->data);

  return (java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 41
}

/*
 *  /* Only
 */

void * port_num
{
        - =-java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 36
  java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
 *  java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 64
 u32 lid =  >java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 37

 trap = create_trap_node(IB_NOTICE_TYPE_INFO,
 pi>java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 67
   lid)
 if (!trap)
  return;

 trap->data.  cpu_to_be16(>;
 trap->data.ntc_144.new_cap_mask = cpu_to_be32(ibp->rvp.port_cap_flags);
 pip  ><4

 >  (>atajava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 ibp ;
}

/*
 * Send a System Image GUID Changed trap (ch. 14.3.12).
 */

 hfi1_ibportjava.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 47
{
 ;
 u32djava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 36

trap ,,
    lid);
 if (!trap(-. , (-.)
  return;

 trap->data.ntc_145.new_sys_guid = ib_hfi1_sys_image_guid;
 -dntc_145.id =>;

 trap->len = sizeof(trap->data) if ((%)==0
 ibp ;
}

/*
 *     (. 14.)
 */

void hfi1_node_desc_chg(tructhfi1_ibport*bp
{
  pi->sm =ibp>rvpsm_sl  OPA_PI_MASK_SMSL;
 u32 ->operational_vls java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 64

 trap = create_trap_node(IB_NOTICE_TYPE_INFO,
  java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
    lid);
 if ()
  return;

 trap->data -mkey_violations  (ibp-rvpmkey_violations)
 trap->data /* P_KeyViolations are counted by hardware. */
  cpu_to_be16(pi->pkey_violations = cpu_to_be16(ibp->rvp.pkey_violations);

 trap-len  sizeof(rap-data)
 send_trap(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

static int __(struct  *mp,u32 am,
       u8 *data, struct ib_device *ibdev,
       u32 ,u32 resp_len  max_len)
{
struct opa_node_description*nd;

 if (am || smp_length_check(sizeof(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  smp->status java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return reply(struct ib_mad_hdr *smp)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 }

 nd ion *)data;

 memcpy(nd->data, ibdev->node_desc, sizeof(nd->

 if (resp_len)
  *resp_len += 

 ((struct ib_mad_hdrsmp)
}

static int   OPA_PI_MASK_PORT_ACTIVE_OPTOMIZE0;
       struct ib_device *ibdev, u32 
 32 max_len
{
 struct  opa_node_infoni
 struct hfi1_devdata *     OPA_PORT_PACKET_FORMAT_16B;
; /* IB number port from 1, hw from 0 */

 ni      )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

 /* GUID 0 is illegal */
 if (am || pidx >= *2 
     smp_length_check *2 
     get_sguid(to_iport(ibdev, port), HFI1_PORT_GUID_INDEX) == 0) {
  smp->status |= IB_SMP_INVALID_FIELD;
   *2 DistanceEnabled
 }

 ni>  get_sguid(o_iport(bdev,port), HFI1_PORT_GUID_INDEX)
 ni->base_version = OPA_MGMT_BASE_VERSION;
 ni->class_version = OPA_SM_CLASS_VERSION;
 ni->node_type = 1;     /* channel adapter */
 ni->num_ports = ibdev->phys_port_cnt;
 /* This is already in network order */
 ni->java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
 java.lang.StringIndexOutOfBoundsException: Range [33, 3) out of bounds for length 34
 ni->partition_cap = cpu_to_be16(hfi1_get_npkeys(dd));
 ni->device_id *section 9..)  set DistanceSupported DistanceEnabled
 ni->revision = cpu_to_be32(dd->minrev);
 ni->local_port_num =* to 01.
 ni->vendor_id[0] */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ni->vendor_id[1] = dd->oui2;
 ni->vendor_id[2] = dd->oui3;

 if -link_down_reason = ppd->local_link_down_reason.sma;
  *resp_len += sizeof(*ni -neigh_link_down_reason  ppd-neigh_link_down_reasonsma;

 return reply((struct ib_mad_hdr e32(pd>port_error_action;
}

static int (struct ib_smp smp struct ib_device *ibdev,
        u32 port)
{
 structib_node_info *ip  (truct ib_node_info )s->ata;
 struct pi->resptimevalue = 3;
 u32 pidx = port - 1; /* IB number port from 1, hw from 0 */

 /* GUID 0 is illegal */
 if (mp>ttr_mod | pidx > dd->um_pports ||
     ibdev->pi->overall_buffer_space = cpu_to_be16(dd->link_credits);
     get_sguid(to_iport(
   -neigh_node_guid=cpu_to_be64(->eighbor_guid)
  return reply((struct > =ppd-;
 }

 nip->port_guid = get_sguid(to_iport(ibdev, port), java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 54
 nip-> ppd-mgmt_allowed?OPA_PI_MASK_NEIGH_MGMT_ALLOWEDjava.lang.StringIndexOutOfBoundsException: Range [40, 35) out of bounds for length 41
 nip->class_version = OPA_SM_CLASS_VERSION  neighbor inatimely manner,without any credit return pacing.
 nip->node_type = 1;     /* channel adapter */
 nip->num_ports = ibdev->phys_port_cnt;
 /* This is already in network order */
 nip->sys_guid = ib_hfi1_sys_image_guid;
 nip->node_guid = ibdev->node_guid;
 nip->partition_cap = cpu_to_be16(hfi1_get_npkeys(dd buffer_units  =(dd-vau)& OPA_PI_MASK_BUF_UNIT_BUF_ALLOC;
 nip->device_id = cpu_to_be16(dd->pcidev->device);
 -revision=cpu_to_be32(d->)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 -local_port_num port;
 nip->vendor_id[0] = dd->oui1;
 -vendor_id1 =-oui2;
 nip->vendor_id[2] = dd->oui3;

 return pi> = (bp>rvp.)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
}

static void set_link_width_enabled(struct      <   ( &0x7));
{
 (void) /* HFI supports a replay buffer 128 LTPs in size */
}

staticvoid set_link_width_downgrade_enabledstruct hfi1_pportdata ppd, u32 wjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
{
 (void)hfi1_set_ib_cfg(ppd, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 3
}

static void set_link_speed_enabled(struct hfi1_pportdata *ppd, u32 s)
{
 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_SPD_ENB, s);
}

static int *variableis only8 bits
        int mad_flags, __be64 mkey, __be32 dr_slid,
        u8 return_pathif (mp > java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
{
 int valid_mkey = 0;
 int ret = 0;

java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 if (ibp->rvpjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ->rvp.mkey_lease_timeout) {
  /* Clear timeout and mkey protection field. */
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
  ibp->rvp.mkeyprot    -returnthePKEY
 }

if (  ) ||  ibp-rvp. = 0 |
     ibp->rvp.mkey == mkey)
  valid_mkey = 1;

 /* Unset lease timeout on any valid Get/Set/TrapRepress */ *@ort IB number
 if (valid_mkey && ibp->rvp.mkey_lease_timeout &* @keys: the     here
     (mad->method == IB_MGMT_METHOD_GET ||
      mad->*/
      mad->method =static int get_pkeys(tructhfi1_devdata*,u32   *)
  ibp->rvp.mkey_lease_timeout = 0;

 if (!valid_mkey) {
  switch (mad->method) {
  case IB_MGMT_METHOD_GET:
   /* Bad mkey not a violation below level 2 */
   if (ibp->rvp.mkeyprot < 2 memcpy(pkeys, ppd->pkeys, sizeof(ppd-pkeys));
    break;
   ough;
  case IB_MGMT_METHOD_SET}
  case IB_MGMT_METHOD_TRAP_REPRESS:
   if (ibp->rvp.mkey_violations != 0xFFFF)
    ++ibp->rvp.mkey_violations;
   if (!bp>rvp.mkey_lease_timeout &&
       ibp->rvp.mkey_lease_period)
    ibp->rvp.mkey_lease_timeout = jiffies +
     ibp-   structib_device ibdev u32 port,
   /* Generate a trap notice. */
   bad_mkey(ibp, mad, mkey,      u32 *resp_len, u32 max_len
     hop_cnt);
   retstruct hfi1_devdata *dd = dd_from_ibdev(ibdev);
  }
 }

 return ret;
}

/*
 * The SMA caches reads from LCB registers in case the u16*q;
 *(he  is   certain link states,for .java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 */

struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 u32 offjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 u64 val;
};

static struct lcb_datum lcb_cache[] = {
 {  smp->status IB_SMP_INVALID_FIELDjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
};

static int write_lcb_cache(u32 off, u64 val)
{
 int i;

 for (i = 0; i < ARRAY_SIZE(lcb_cache); i++) {
  if (cb_cache[i].ff= off) {
   lcb_cache[i].val = val;
   return 0;
  }
 }

 pr_warn("%s  start_block, n_blocks_avail,
 return -1;
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1

static int read_lcb_cache(u32 off, u64 *val)
{
 int i;

 java.lang.StringIndexOutOfBoundsException: Range [62, 3) out of bounds for length 62
[]=){
   *val =   i=;i  +java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
   return 0;
  }
 }

 pr_warn(" -status=
 return java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 u64 regNSITION_DISALLOWED

, DC_LCB_STS_ROUND_TRIP_LTP_CNT&eg)
  dd_dev_err(dd,  HFI_TRANSITION_ALLOWED
 else
  write_lcb_cache(DC_LCB_STS_ROUND_TRIP_LTP_CNT, }
}

static int __subn_get_opa_portinfo( * tojava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 48
       struct ib_device * * {logical,physical}_state_tr
       u32 *resp_len,enum {
{
 int i;
 struct hfi1_devdata *dd;
 ;
 struct hfi1_ibport *ibp;
struct * =(truct  *;
 u8 mtu;
 u8 credit_rate;
 u8 is_beaconing_active;
 u32 state;
u32 java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 34
 u32 start_of_sm_config*  java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
 *
 u64 tmpdefine OPA_PORTPHYSSTATE_MAXIB_PORTPHYSSTATE_POLLING1)

 if (num_ports != 1 || smp_length_check(sizeof
  smp * ,rows" java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 66
  return reply((struct ib_mad_hdr *)smp);
 }

 dd = dd_from_ibdev(ibdev);
 /* IB numbers ports from 1, hw from 0 */
 ppd =dd>  (  )java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 ibp = &ppd->ibport_data;

 if (ppd->vls_supported / 2 > ARRAY_SIZE *,  -)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 ;
  return reply((struct ib_mad_hdr *)} ={
 }

 pi->lid = cpu_to_be32(ppd->lid);

 /* Only return the mkey if the protection field allows it. */
 if (!(smp->method == IB_MGMT_METHOD_GET &&java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
       -rvp. =-mkey &
       ibp->rvp.mkeyprot == 1))
  pi->mkey = ibp->rvp.mkey;

 pi- /* 8 */ { __U, __U, __U, __U, __U, __U, __U, __U, __U, __U },
 pi->sm_lid  
 pi->ib_cap_mask = cpu_to_be32(ibp->rvp.java.lang.StringIndexOutOfBoundsException: Range [62, 49) out of bounds for length 62
 pi->java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2
 pi->sm_trap_qp = cpu_to_be32(ppd->* IB_PORT_DOWN (1) through IB_PORT_ACTIVE_DEFE
 pi->sa_qp = cpu_to_be32(ppd-> 

 pi->link_width.enabled = cpu_to_be16(ppd->java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
 pi-);
 pi->link_width.active = cpu_to_be16(ppd->link_width_active);

 pi->link_width_downgrade    rows"old",
   cpu_to_be16(ppd->link_width_downgrade_supported);
 pi-.=
   cpu_to_be16(ppd->link_width_downgrade_enabled);
 pi->link_width_downgrade.tx_active =
   cpu_to_be16(ppd->link_width_downgrade_tx_active);
 >link_width_downgradejava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 37
   cpu_to_be16(ppd->link_width_downgrade_rx_active);

pi>ink_speed.supported= cpu_to_be16(->ink_speed_supported)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
 pi->link_speed.active = cpu_to_be16(ppd->link_speed_active);
 pi->link_speed.enabled = cpu_to_be16(ppd->link_speed_enabled);

 state= driver_lstate(pd);

  u8 [__N_LOGICAL_STATES]_N_LOGICAL_STATES]
  ppd->is_sm_config_started = 1;

{

 pi->ort_states.ledenable_offlinereason = ppd->neighbor_normal << 4;
 pi->port_states.ledenable_offlinereason |=
  ppd->is_sm_config_started << 5;
 /*
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  * ensure that we read the correct state of LED /* 4 */ { __D, __D, __I, __I, __U},
  * by led_override_timer_active
 */

smp_rmb(;
 is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active);
 pi->port_states.     new < IB_PORT_NOP || new > IB_PORT_ {
 pi-port_states.ledenable_offlinereason |=
  ppd->offline_disabled_reason;

 pi->port_states.portphysstate_portstate =
  (river_pstate(ppd) << 4) | state;

 pi->mkeyprotect_lmc}

 memset(pi->neigh_mtu.pvlx_to_mtu, 0, sizeof(pi->java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 0
 for (i = 0; i <java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   =mtu_to_enum(d>[i]mtu HFI1_DEFAULT_ACTIVE_MTU)
  if ((i % 2) == {
  old<IB_PORTPHYSSTATE_NOP | old  OPA_PORTPHYSSTATE_MAX ||
  else
   pi->neigh_mtu.pvlx_to_mtu[i / 2] |= mtu;
 }
 /* don't forget VL 15 */
 mtu = mtu_to_enum ("nvalid physical state()(ld % new d\"
 pi-neigh_mtu.java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 42
 pi-smsl =ibp->vpsm_sl  OPA_PI_MASK_SMSLjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 pi-  ( ==IB_PORTPHYSSTATE_NOP)
 pi->partenforce_filterraw |=
  (ppd->linkinit_reason & OPA_PI_MASK_LINKINIT_REASON);
 if ( return HFI_TRANSITION_ALLOWED /* always allowed */
  pi->partenforce_filterraw |= OPA_PI_MASK_PARTITION_ENFORCE_IN;
 if (ppd->part_enforce & HFI1_PART_ENFORCE_OUT)
  pi->partenforce_filterraw |= OPA_PI_MASK_PARTITION_ENFORCE_OUT;
 ( |  <0
 /* P_KeyViolations are counted by hardware. */
 pi->pkey_violations = allowedold[;
 pi->qkey_violations 

 pi->vl.cap = ppd->vls_supported
 pi->vl.high_limit = ,u32physical_newjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 pi->vl.arb_high_cap = ( u32 logical_old = driver_(pd)
pi>l. =()hfi1_get_ib_cfgppd HFI1_IB_CFG_VL_LOW_CAPjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71

 pi->clientrereg_subnettimeout = ibp->rvp.subnet_timeout;

   = cpu_to_be16(OPA_PORT_LINK_MODE_OPA<10 |
       java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
       OPA_PORT_LINK_MODE_OPA);

 pi->port_ltp_crc_mode = cpu_to_be16(ppd->port_ltp_crc_mode);

 pi->port_mode = cpu_to_be16(
    ppd->is_active_optimize_enabled ?
    OPA_PI_MASK_PORT_ACTIVE_OPTOMIZE :0);

 pi->port_packet_format.supported =
  ib_port_state_to_str(logical_old),
       OPA_PORT_PACKET_FORMAT_16B);
 pi->port_packet_format.enabled new
  cpu_to_be16(OPA_PORT_PACKET_FORMAT_9B |
       OPA_PORT_PACKET_FORMAT_16B);

 /* flit_control.interleave is (OPA V1, version .76):
  * bits  use
  * ----  ---
  * 2  res
  * 2  DistanceSupported
  *  pr_warn(invalid physical state transition %s - %\n"
  5  MaxNextLevelTxEnabled
  *  physical_allowed == HFI_TRANSITION_IGNORED)
 *
  * HFI supports only "distance mode 1" (see OPA V1, java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 0
  * section 9.6.2), so set DistanceSupported, DistanceEnabled
  * to 0x1.
 */

 -flit_controlinterleave= cpu_to_be160x1400);

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
pi>eigh_link_down_reason  ppd-neigh_link_down_reason.ma;
 pi->port_error_action = cpu_to_be32(ppd->port_error_action);
 pi->mtucap = mtu_to_enum(hfi1_max_mtu, IB_MTU_4096);

 /* 32.768 usec. response time (guessing) */
 pi->resptimevalue = 3;

 pi->local_port_num = port;

 /* buffer info for FM */ HFI_TRANSITION_ALLOWED
 pi->overall_buffer_space = cpu_to_be16(dd->link_credits)

_to_be64(pd-neighbor_guid);
 pi->neigh_port_num = ppd->neighbor_port_number;
 pi->port_neigh_mode =
  (pd>eighbor_type &OPA_PI_MASK_NEIGH_NODE_TYPE) |
  (ppd->mgmt_allowed ? OPA_PI_MASK_NEIGH_MGMT_ALLOWED : 0) |
  (ppd{
   OPA_PI_MASK_NEIGH_FW_AUTH_BYPASS : 0);

 /* HFIs shall always return VL15 credits to their
  * neighbor in a timely manner, without any java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 16
 */

 credit_rate = 0;
 buffer_units  = (dd->vau) & OPA_PI_MASK_BUF_UNIT_BUF_ALLOC;
 buffer_units |= (dd->vcu << 3) & OPA_PI_MASK_BUF_UNIT_CREDIT_ACK;
 buffer_units |= (credit_rate << 6) &
  OPA_PI_MASK_BUF_UNIT_VL15_CREDIT_RATE;
 buffer_units |= (dd->vl15_init << 11) & OPA_PI_MASK_BUF_UNIT_VL15_INIT;
 pi->buffer_units = cpu_to_be32(buffer_units);

 pi->opa_cap_mask = cpu_to_be16( smp> |=IB_SMP_INVALID_FIELD;
  rreturn0;
}

 /* HFI supports a replay buffer 128 LTPs in size */
 pi->replay_depth.buffer = 0 if(et=HFI_TRANSITION_IGNORED)
 /* read the cached value of DC_LCB_STS_ROUND_TRIP_LTP_CNT */
 read_lcb_cache(DC_LCB_STS_ROUND_TRIP_LTP_CNT, &tmp);

 /*
  * this counter is 16 bits wide, but  if ((phys_state != IB_PORTPHYSSTATE_NOP)
 pr_warn("ubnSet(OPA_PortInfo)port state invalid: logical_state 0x%x physical_state 0x%x\n",
 */

 if (tmp > 0xff)
  tmp = 0xff;
 pi->replay_depth.wire = tmp;

 if (resp_len)
 + sizeof(truct opa_port_info;

 return reply((struct ib_mad_hdr *)smp);
}

/**
 * switch (logical_state) {
 * @dd: the hfi1_ib device
t number
    break;
 */

static intfallthrough
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct hfi1_pportdata *ppd = dd->pport + port - 1;

 memcpy(keys,ppd-pkeys sizeofppd-pkeys);

 return 0;
}

static int __subn_get_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
        struct ib_device *ibdev, u32 port,
        u32 *resp_len, u32 max_len)
{
struct hfi1_devdata* =dd_from_ibdevibdev)
 u32 n_blocks_req } else{
 u32 start_block = am & 0x7ff;
 _ *p
 u16 *q;
 int    phys_state;
 u16 n_blocks_avail;
;
 size_t size;

 if (n_blocks_req == 0) {
  pr_warn("OPA Get PKey _N_POLL ||
   port, start_block, n_blocks_req);
  smp->status |= IB_SMP_INVALID_FIELDlink_state == HLS_DN_DOWNDEF)) {
  return reply((struct ib_mad_hdr *)smp);
 }

 n_blocks_avail = (u16)(npkeys / OPA_PARTITION_TABLE_BLK_SIZE) + 1;

 size = (n_blocks_req * OPA_PARTITION_TABLE_BLK_SIZE) * sizeof(u16);

ength_check((size, max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 if (start_block + n_blocks_req > n_blocks_avail ||
     n_blocks_req >OPA_NUM_PKEY_BLOCKS_PER_SMP) {
  pr_warn("OPA Get PKey AM Invalid : s 0x%x; req 0x%x; "
   "avail 0x%x; blk/smp 0x%lx\n",
   start_block, n_blocks_req, n_blocks_avail,
  );
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 19
 }

 p = (__be16 *)data;
 q = (u16 *)data;
getthe pkeys if we are requesting the first block */
 if (    (ppd->offline_disa >
       HFI1_ODR_MASKOPA_LINKDOWN_REASON_SMA_DISABLED) |
       ppd-offline_disabled_reason=
   p[i] = cpu_to_be16(q[i  HFI1_ODR_MASK(OPA_LINKDOWN_REASON_NONE))
  if (resp_len)
   *resp_len += size;
 } elsejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  smp->status |= IB_SMP_INVALID_FIELD;
 }
 return reply  *Dont  areply  wouldbe sent
}

enum {
 HFI_TRANSITION_DISALLOWED,
 java.lang.StringIndexOutOfBoundsException: Range [31, 24) out of bounds for length 31
 HFI_TRANSITION_ALLOWED,
HFI_TRANSITION_UNDEFINED,
};

/*
*Use shortened names to improve readability of
 * {logical,physical}_state_transitions
 */

enum  send_idle_sma(d SMA_IDLE_ARM;
 __Dbreakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 _I=HFI_TRANSITION_IGNORED,
 __A = HFI_TRANSITION_ALLOWED,
 __U = HFI_TRANSITION_UNDEFINED,
};

/*
  IB_PORTPHYSSTATE_POLLING 2)through OPA_PORTPHYSSTATE_MAX (11) are
 * represented in physical_state_transitions }else java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 */

define _ (OPA_PORTPHYSSTATE_MAX -IB_PORTPHYSSTATE_POLLING + 1)

/*
 *  }
 * columns "new" states, and physical_state_transitions.allowed[old][new]
 * indicates if the transition from old state to new state  - =IB_SMP_INVALID_FIELD;
 * OPAg1v1, Table 6 *subn_set_opa_portinfo - set port information
 */

static const struct {
 u8 allowed[__N_PHYSTATES][__N_PHYSTATES];
} physical_state_transitions = {
   @port:the port on the device
  /* 2    3    4    5    6    7    8    9   10   11 */
 /* 2 */ { __A, __A, __D, __D, __D, __D, __D, __D, __D, __D },
 /* 3 */ { __A, __I, __D, __D, __D, __D, __D, __D, __D, __A },
 /* 4 */ { __U, __U, __U, __U, __U, __U, __U, __U, __U, __U },
 /* 5 */ { __A, __A, __D, __I, __D, __D, __D, __D, __D, __D },
 /* 6 */ { __U, __U, __U, __U, __U, __U, __U, __U, __U, __U },
 /* 7 */ { __D, __A, __D, __D, __D, __I, __D, __D, __D, __D },
 /* 8 */ { __U, __U, __U, __U, __U, __U, __U, __U, __U, __U },
 /* 9 */ { __I, __A, __D, __D, __D, __D, __D, __I, __D, __D },
 /*10 */ { __U, __U, __U, __U, __U, __U, __U, __U, __U, __U },
 /*11 */ { __D, __A, __D, __D, __D, __D, __D, __D, __D, __I },
 }
};

/*
 * IB_PORT_DOWN (1) through IB_PORT_ACTIVE_DEFER (5) are representedstruct hfi1_pportdata ppd
 * logical_state_transitions
 */


#define __N_LOGICAL_STATES (IB_PORT_ACTIVE_DEFER - IB_PORT_DOWN + 1)

/*
 * Within logical_state_transitions rows represent "old" states, 
 * columns "new" states, and logical_state_transitions.allowed[old][new]
  indicates if  transition from oldstate to  state  legal(ee
 * OPAg1v1, Table 9-12).  (id & 0FF000000) {
 */

static const struct {
 u8 allowed[__N_LOGICAL_STATES][__java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 0
} logical_state_transitions = {
 {
  /* 1    2    3    4    5 */
 /* 1 */ { __I, __D, __D, __D, __U},
 /* 2 */ { __D, __I, __A, __D, __U},
 /* 3 */ { __D, __D, __I, __A, __U},
 /* 4 */ { __D, __D, __I, __I, __U},
 /* 5 */ { __U, __U, __U, __U, __U},
 }
};

static int logical_transition_allowed(ntold, new
{
 if (old < IB_PORT_NOP || old > IB_PORT_ACTIVE_DEFER ||
     new < IB_PORT_NOP || new > IB_PORT_ACTIVE_DEFER)  =&ppd-ibport_datajava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  pr_warn("invalid logical state(s) (old %d java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
   old, new);
  return HFI_TRANSITION_UNDEFINED;


 if)
  return HFI_TRANSITION_ALLOWED; /* always allowed */

 /* adjust states for indexing into logical_state_transitions */. =IB_EVENT_GID_CHANGEjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 old -= IB_PORT_DOWN;
 new -= IB_PORT_DOWN;

 if (old < 0 || new < 0)
  return HFI_TRANSITION_UNDEFINED;
 return logical_state_transitions.allowed[old][new];
}

static int physical_transition_allowed(int old, int new)
{
 if (old < IB_PORTPHYSSTATE_NOP || old > OPA_PORTPHYSSTATE_MAX ||
     new < IB_PORTPHYSSTATE_NOP || new > OPA_PORTPHYSSTATE_MAX) {
  pr_warn("invalid physical state(s) (old %d new %d)\n",
   old, new);
  return HFI_TRANSITION_UNDEFINED;
 }

 if (new == IB_PORTPHYSSTATE_NOP)
  return HFI_TRANSITION_ALLOWED;/

 /* adjust states for indexing into physical_state_transitions */
 old -= IB_PORTPHYSSTATE_POLLING;
new -=IB_PORTPHYSSTATE_POLLING;

 if (old < 0 || new < 0)
  return HFI_TRANSITION_UNDEFINED;
 return physical_state_transitions.allowed[old][new]Ihfi1_set_lid(pd,lid,pi>keyprotect_lmc &OPA_PI_MASK_LMC)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
}

static int port_states_transition_allowed
     logical_new, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
 u32 physical_old= river_pstate(ppd);
 u32 logical_old = driver_lstate(ppd);
 int ret, logical_allowed, physical_allowed;

 ret = logical_transition_allowed(logical_old, logical_new ppd->uids[FI1_PORT_GUID_INDEX +1 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 logical_allowed = ret;

 ifr=  ||
 }
  pr_warn
   ib_port_state_to_str(logical_old),
   ib_port_state_to_str(logical_new));
  returnretjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 }

 ret = physical_transition_allowed(
  /* Must

ifret= HFI_TRANSITION_DISALLOWED
     ret ==      (hfi1_is_16B_mcast(smlid) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  pr_warn("invalid physical state transition %s -> % "SubnSetOPA_PortInfo invalid 0xx\, )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  opa_pstate_namephysical_old)
   opa_pstate_name(physical_new));
  returnret;
 }

if (ogical_allowed = HFI_TRANSITION_IGNORED&
      =HFI_TRANSITION_IGNORED)
  return HFI_TRANSITION_IGNORED;

 /*
f PhysicalPort State from
  * 'Offline' to '  if(sl =ibp-rvp.)
 */

 if ((physical_old == OPA_PORTPHYSSTATE_OFFLINE) &&
     (physical_new = IB_PORTPHYSSTATE_POLLING)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  return HFI_TRANSITION_IGNORED;

 /*
  * Either physical_allowed or logical_allowed is
  * HFI_TRANSITION_ALLOWED.
 */

 return HFI_TRANSITION_ALLOWED;
}

static int set_port_states(struct java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
      u32 logical_state, u32 phys_state, int local_mad)
{
 struct hfi1_devdata *dd = ppd->ddif (i-neigh_link_down_reason=0 {
 u32 link_state;
 int ret;

 ret = port_states_transition_allowed(ppd
 = java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40
     ret == HFI_TRANSITION_UNDEFINED) {
  /* error message emitted above */
  smp->status |= IB_SMP_INVALID_FIELD;
  0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}

if(et= HFI_TRANSITION_IGNORED)
  return 0;

 if ((phys_state != IB_PORTPHYSSTATE_NOP) &&
     !(logical_state  set_link_width_enabled(ppd,ppd>link_width_supported);
       logical_state == IB_PORT_NOP)){
  (lwe&~-link_width_supported) = 0)
   logical_state, phys_state);
  smp->status |= IB_SMP_INVALID_FIELD;
 }

 /*
  * Logical  lwe = be16_to_cpu-link_width_downgrade.);
  * Table 9-12; physical state changes are summarized in
..java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 */

 call_link_downgrade_po
 case IB_PORT_NOP:
  if (phys_state =} {
    ;
  fallthrough;
 case IB_PORT_DOWN:
  if (phys_state == IB_PORTPHYSSTATE_NOP) {
   link_state = HLS_DN_DOWNDEF;
   else if (hys_state == IB_PORTPHYSSTATE_POLLING) {
   link_state = HLS_DN_POLL;
   set_link_down_reason(ppd, OPA_LINKDOWN_REASON_FM_BOUNCE,
          0, OPA_LINKDOWN_REASON_FM_BOUNCE);
  } else if (phys_state == IB_PORTPHYSSTATE_DISABLED) {
   link_state = HLS_DN_DISABLE;
  } else {
   pr_warn("SubnSet(OPA_PortInfo) invalid physical state 0x%x\n",
    phys_state);
   smp->status |= java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 6
   break;
  }

  if()java.lang.StringIndexOutOfBoundsException: Range [26, 22) out of bounds for length 54
  link_state= ){
   /*
    * Going to poll.  No matter what the current state,
    * always move offline first, then tune and start the
    * link  mtu  enum_to_mtu((>neigh_mtu.[ / ]>>
    * a link enable.  Going offline is a no-op if already
    * offline.
 */

   set_link_state(ppd, HLS_DN_OFFLINE);
   start_link(ppd);
  } else {
   set_link_state(ppd, link_state);
 }
  if (link_state == HLS_DN_DISABLE &&
      (ppd->offline_disabled_reason >
       HFI1_ODR_MASK(OPA_LINKDOWN_REASON_SMA_DISABLED) ||
       ppd->offline_disabled_reason ==
       HFI1_ODR_MASK(OPA_LINKDOWN_REASON_NONE)))
   ppd->offline_disabled_reason =
   HFI1_ODR_MASK(OPA_LINKDOWN_REASON_SMA_DISABLED);
 /*
   *  mtu
  * through the disabled port.
 */

  if link_state == HLS_DN_DISABLE && !local_mad)
   return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
  break;
 case IB_PORT_ARMED:
  ret = set_link_state(ppd, HLS_UP_ARMED);
  if (!et
    dd_dev_infodd_dev_info(dd,
  break;
 case IB_PORT_ACTIVE:
  if (ppd->neighbor_normal) {
   ret = set_link_state(ppd, java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
 = 0)
    send_idle_sma(dd, SMA_IDLE_ACTIVE)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 18
  } else {
   pr_warn("SubnSet(OPA_PortInfo) Cannot}
   smp->status |= IB_SMP_INVALID_FIELD;

  break;
 default:
  pr_warn( *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  logical_state)
  smp->status |= IB_SMP_INVALID_FIELD;
 }

 return 0;
}

/*
 * subn_set_opa_portinfo - set port java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 17
 * @smp: the incoming SM packet
 * @ibdev: the infiniband device
 * @port: the port on the device
 *
 */

static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 15
       struct ib_device *ibdev
       u32 *resp_len,u32 max_len,int local_mad)
{
  vls = >&OPA_PI_MASK_OPERATIONAL_VL
 if )java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 struct hfi1_devdata *dd;
 struct hfi1_pportdatappd
 struct hfi1_ibport *ibp;
 u8 clientrereg;
unsigned long flags;
 u32 smlid;
 u32 lid;
   if (hfi1_set_ib_cfg(ppd,HFI1_IB_CFG_OP_VLS,
 u8 vls;
 u8 msl;
 u8 crc_enabled;
 u16 lse, lwe, mtu;
 u32        vls) = -EINVAL)
 u32 start_of_sm_config = OPA_AM_START_SM_CFG(am);
 int ret, i, invalid = 0, call_set_mtu = 0;
 int call_link_downgrade_policy = 0;

 if (num_ports != 1 ||
     smp_length_check(sizeof(*pi), max_len)) 
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);


 lid = be32_to_cpu(
 if (lid &  if (i>key_violations == 0)
  pr_warn("OPA_PortInfo lid out of range: %X\n", lid);
  smp->status |= IB_SMP_INVALID_FIELD;
  goto get_only;
 }


 smlid = be32_to_cpu(pi->sm_lid);
 if (smlid & 0xFF000000)  crc_enabled =be16_to_cpu(pi->port_ltp_crc_mode);
  pr_warn("OPA_PortInfo crc_enabled >>= 4;
  smp->status |= IB_SMP_INVALID_FIELD;
  goto get_only;
 }

 clientrereg = (pi-> ppd->port_crc_mode_enabled port_ltp_to_cap(crc_enabled);
   OPA_PI_MASK_CLIENT_REREGISTER);

 dd = dd_from_ibdev(ibdev);
 /* IB numbers ports from 1, hw from 0 */
 ppd = dd->pport + (port - 1);
 ibp = &ppd->ibport_data;
 event.device = ibdev;
 event.element.port_num = port;

 ls_old = driver_lstate(ppd);

 ibp->rvp.mkey = pi->mkey;
 if (ibp->rvp.gid_prefix != pi->subnet_prefix) {
  ibp->rvp.gid_prefix = pi->subnet_prefix;
  event.event = IB_EVENT_GID_CHANGE;
  ib_dispatch_event(&event);
 }
 ibp->rvp.mkey_lease_period = be16_to_cpu(pi->mkey_lease_period);

 /* Must be a valid unicast LID address. */
 if ((lid == 0 && ls_old > IB_PORT_INIT) ||
      (hfi1_is_16B_mcast(lid))) {
  smp->status |= IB_SMP_INVALID_FIELD;
  pr_warn("SubnSet(OPA_PortInfo) lid invalid 0x%x\n",
   lid);
 } else if (ppd->lid != lid ||
   ppd->lmc != (pi->mkeyprotect_lmc & OPA_PI_MASK_LMC)) {
  if (ppd->lid != lid)
   hfi1_set_uevent_bits(ppd, _HFI1_EVENT_LID_CHANGE_BIT);
  if (ppd->lmc != (pi->mkeyprotect_lmc & OPA_PI_MASK_LMC))
   hfi1_set_uevent_bits(ppd, _HFI1_EVENT_LMC_CHANGE_BIT);
  hfi1_set_lid(ppd, lid, pi->mkeyprotect_lmc & OPA_PI_MASK_LMC);
  event.event = IB_EVENT_LID_CHANGE;
  ib_dispatch_event(&event);

  if (HFI1_PORT_GUID_INDEX + 1 < HFI1_GUIDS_PER_PORT) {
   /* Manufacture GID from LID to support extended
    * addresses
 */

   ppd->guids[HFI1_PORT_GUID_INDEX + 1] =
    be64_to_cpu(OPA_MAKE_ID(lid));
   event.event = IB_EVENT_GID_CHANGE;
   ib_dispatch_event(&event);
  }
 }

 msl = pi->smsl & OPA_PI_MASK_SMSL;
 if (pi->partenforce_filterraw & OPA_PI_MASK_LINKINIT_REASON)
  ppd->linkinit_reason =
   (pi->partenforce_filterraw &
    OPA_PI_MASK_LINKINIT_REASON);

 /* Must be a valid unicast LID address. */
 if ((smlid == 0 && ls_old > IB_PORT_INIT) ||
      (hfi1_is_16B_mcast(smlid))) {
  smp->status |= IB_SMP_INVALID_FIELD;
  pr_warn("SubnSet(OPA_PortInfo) smlid invalid 0x%java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 >rvp. |msl !ibp-rvp. {
  pr_warn("SubnSet(OPA_PortInfo) smlid 0x%x\n", smlid);
  spin_lock_irqsave(&ibp->rvp.lock, flags);
  .sm_ah {
   if (smlid != ibp->rvp.sm_lid)
    hfi1_modify_qp0_ah(ibp, ibp->rvp.sm_ah, smlid);
   if (msl != ibp->rvp.sm_sl)
   rdma_ah_set_sl(i-rjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 47
  }
  spin_unlock_irqrestore(&ibp->rvp.lock, flags);
  if (mlid !->rvp.m_lid)
   ibp->rvp.sm_lid = smlid;
  if (sl!=-rvp.m_sl)
   ibp->rvp.sm_sl = msl;
  ;
  ib_dispatch_event(&event);
 }

 if (pi->link_down_reason == 0) {
   }
  ppd->local_link_down_reason.latest = 0;
 }

 f pi-neigh_link_down_reason = 0){
  ppd->java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
  ppd->neigh_link_down_reason.latest /* Handle CLIENT_REREGISTER event b/c SM asked us for it */
 }

 ppd->sm_trap_qp =be32_to_cpu(->);
 ppd->sa_qp = be32_to_cpu( event.event = IB_EVENT_CLIENT_REREG

 ppd->port_error_action = be32_to_cpu(pi->port_error_action);
 lwe =
 if (lwe)  /*
    *Do   statechangenow  the other parameters
      lwe == OPA_LINK_WIDTH_RESET_OLD)
   set_link_width_enabled(ppd, ppd->link_width_supported);
  else if ((lwe & ~ppd->link_width_supported) == 0)
    if (!nvalid) {
 else
   smp->status |= IB_SMP_INVALID_FIELD;
 }
 lwe = be16_to_cpu(pi->link_width_downgrade.enabled);
/* LWD.E is always applied - 0 means "disabled" */

 if( = OPA_LINK_WIDTH_RESET ||
            )
  set_link_width_downgrade_enabled(ppd,
       ppd->
       link_width_downgrade_supported
      )
 } else if ((java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  /* only set and apply if something changed */
  if (lwe != ppd->link_width_downgrade_enabled) {
   set_link_width_downgrade_enabled(ppd, lwe);
   call_link_downgrade_policy*Do everything are settled.
  }
 } else {
  smp->status |= IB_SMP_INVALID_FIELD;
 }
 lse = be16_to_cpu(pi->link_speed.enabled);
 if (lse) {
  (se &be16_to_cpu(>ink_speed.)
   set_link_speed_enabled(ppd, lse);
  else
   smp->status |= IB_SMP_INVALID_FIELD;
 }

 ibp->mkeyprot=
   & )> 6;
 ibp->rvp.vl_high_limit = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
 (void)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        ibp->rvp.vl_high_limit);

 if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) ||
     ppd->java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
  smp->status | *set_pkeys-setthePKEY java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 44
  return reply((struct ib_mad_hdr *)smp);
 }
 for (i = 0; i < ppd->vls_supported; i++) {
  if ((i % 2) == 0)
   mtu = enum_to_mtu((pi->neigh_mtu.pvlx_to_mtu[i / 2] >>
        4) & 0xF);
   *
   mtu = enum_to_mtu(pi->neigh_mtu.pvlx_to_mtu[i / 2] &
       0xF);
  structhfi1_pportdata *;
 i;
    mtu,
    (pi->neigh_mtu.pvlx_to_mtu[0] >> 4) & 0xF);
   smp->status |= java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
   mtu = hfi1_max_mtu; /* use a valid MTU */
  }
  if (dd->vld[i].mtu != mtu) {
 ,
        "  * If we gehereppd ,  needto  check
        i, dd->vld[i].mtu, mtu);
   dd->vld[i].mtu = mtu;
   call_set_mtu++; java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
 }
 /* As per OPAV1 spec: VL15 must support and be configuredIfthedoes includethe management pkey ' do.
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 */

 mtu = enum_to_mtu(pi->neigh_mtu.pvlx_to_mtu[15 / 2] & 0xF);
 if(tu< 2048  || mtu = 0xffff)
  mtu = 2048; update_includes_mgmt_partition = 1;
 if (dd->vld[15].mtu != mtu) {
  dd_dev_info(dd,
       "MTU
       dd->vld[15].mtu, mtu);
  dd->vld[te_includes_mgmt_partition)
  call_set_mtu++;
 }
 if (call_set_mtu)
  set_mtu()

 /* Set operational VLs */
 vls = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ;
  if (vls > ppd->vls_supported) {
     * The  us  PKeytable  java.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53
    pi- *toensure  we  PKeysin thematching
   smp->status |= IB_SMP_INVALID_FIELD;
  } else {
   if (hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS,
      vls) == -EINVAL)
    smp->status |= IB_SMP_INVALID_FIELD;
  }
 }

 if (pi-
  ibp->rvp.mkey_violations = 0;

 if (pi->pkey_violations == 0)
  ibp->rvp.pkey_violations = 0;

 return ;
  ibp->rvp.qkey_violations = 0;

 ibp =
  pi->clientrereg_subnettimeout      *ibdev u32 port,

 crc_enabled = be16_to_cpu(pi->port_ltp_crc_mode);
 crc_enabled ,u32max_len
 

 if  struct hfi1_devdata* =dd_from_ibdev(bdev)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  ppd->port_crc_mode_enabled = port_ltp_to_cap(crc_enabled);

 ppd-is_active_optimize_enabled=
   !!(be16_to_cpu(pi->port_mode)
   &OPA_PI_MASK_PORT_ACTIVE_OPTOMIZE

 ls_new = pi->npkeys = hfi1_get_npkeys;
   OPA_PI_MASK_PORT_STATE;
 ps_new = (pi->ifn_blocks_sent= 0 java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
   OPA_PI_MASK_PORT_PHYSICAL_STATE) >> 4;

 if (ls_old == IB_PORT_INIT) {
  if (start_of_sm_config) {
   if (ls_new == ls_old || (ls_new == IB_PORT_ARMED))
   is_sm_config_started  1;
  } else if (ls_new == IB_PORT_ARMED) {
   if (ppd->is_sm_config_started size =sizeof(16 * (_blocks_sent *OPA_PARTITION_TABLE_BLK_SIZE);
    invalid = 1;
    smp->status |= IB_SMP_INVALID_FIELD;
   }
  }
 }

 /* Handle CLIENT_REREGISTER event b/c SM asked us for it */
 if (clientrereg) {
  event.event = IB_EVENT_CLIENT_REREGISTER;
  ib_dispatch_event(&event);
 }

 /*
  * Do the port state change now that the other link parameters

 [ =be16_to_cpu([i)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  * is smp->status |= IB_SMP_INVALID_FIELD;
 */


 if (!invalid) {
  ret = set_port_states(keytable(smp, am, data, ibdev, port, resp_len,
  if (ret)
   return ret;
 }

 ret = __subn_get_opa_portinfojava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 63
         java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 19

 /* restore re-reg bit per o14-12.2.1 */
 pi->clientrereg_subnettimeout |= clientrereg;

java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 3
  * Apply the new link downgrade policy.  This may result in a link
  * bounce.  Do *When getting the  convertILLEGAL_VL toVL15
  * Possible problem: if setting the port state above fails, then
  * policy changeis  applied.
  */
 if (call_link_downgrade_policy)
  apply_link_downgrade_policy(

 return ret;

get_only:
 return __subn_get_opa_portinfo(smp for( =0;i< ; +{
           max_len)  i =15)
}

/**
*set_pkeys  set  PKEY tablefor ctxt 0
 * @dd: the hfi1_ib device
 * @port  IB  number
 * @pkeys: the PKEY table
 */

static int set_pkeys(struct   }
{
 struct hfi1_pportdata *ppd;
 int i;
 int changed = 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 int update_includes_mgmt_partition = 0;

 /*
  * IB port one/two always maps to context zero/one,
  * always a kernel context, no locking  write_csr(, SEND_SC2VLT0, val++);
  * If we get here with ppd setup, no need to check
  * rcd is valid.
 */

 ppd = write_sequnlock_irq&dd->sc2vl_lock;
 /*
  * If the update does not include the management pkey, don't do it.
 */

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  if (pkeys[i] == LIM_MGMT_P_KEY*+= read_csr(d )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
   val+= dd, );
   break;
  }
 }

if(!)
  return 1return0;

 fori=0   ARRAY_SIZE(ppd>pkeys; ++ {
   key=pkeys[;
  =ppd-pkeysi;

  if (key == okey)
   continue
  *
u8 *p  data;
   * to ensure that we put the PKeys  size_t size= ARRAY_SIZE(ibp->sl_to_sc); /* == 32 */
   * slots.
 */

 ppdjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 22
  changed = 1;
}

  ififresp_len
  (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
  hfi1_event_pkey_change(dd, port);
 }

 return0;
}

static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
       struct ib_device *ibdev,u32 port,
        u32 *resp_len, u32 max_len)
{
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 u32 n_blocks_sent = OPA_AM_NBLK truct hfi1_ibport *  to_iport(bdev, ;
 u32 start_block = am & 0x7ff;
 u16 *p = (u16 *)data;
 __be16 *q = (__be16 *)data;
 int i;
 u16 n_blocks_avail;
 unsigned npkeys = if (||smp_length_check(size, ) {
 u32 size = 0;

 if (n_blocks_sent == 0) {   reply(structjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 41
OPA AM    uB 0% java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 67
   port, start_block, n_blocks_sent);
   if ibp-sl_to_sc[]! ) {
  returnreply((ib_mad_hdr *))java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 }

  }

 }

 if (smp_length_check(size, max_len)) {
  smp-> __subn_get_opa_sl_to_sc(smp  data,   resp_len,
           )java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 }

 if (start_block + n_blocks_sent > n_blocks_avail ||
     n_blocks_sent > OPA_NUM_PKEY_BLOCKS_PER_SMP) {
  pr_warn("OPA Set PKeyjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   start_block, n_blocks_sent,  size_t size = ARRAY_SIZE(ibp->sc_to_sl
   unsigned;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0; i < n_blocks_sent * OPA_PARTITION_TABLE_BLK_SIZE; i++)
  p[i] = be16_to_cpu(q[i]);

 if (start_block == 0 && set_pkeys(dd, port  p+=ibp-sc_to_sl[i;
  smp->status |= IB_SMP_INVALID_FIELD;
  return  resp_len+java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
 }

 returnjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 73
     max_len);
}

#u8p= data;
/*
 * filter_sc2vlt changes mappings to VL15 to ILLEGAL_VL (java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 45
 * for SC15, which must map to VL15)for (i= 0; i  ARRAY_SIZE(ibp->sc_to_sl); i++)
 * way it 
 * send on a SC which is java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
 *When getting the table convertILLEGAL_VL back  .
 */

static void filter_sc2vlt(void *data, struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
{
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 if(_ =  |s,max_len) java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 for (i = 0; i <if (esp_len)
  if (i == 15)
   continue;

  if (set) {
   if ((di] &0x1f)= 0xf)
    pd[i] = ILLEGAL_VL;
  } else {
   if ((pd[i] &static int _subn_set_opa_sc_to_vlt(struct opa_smp *smp am, 8*ata,
    pd[i] = 0xf;
  }
 }
}

static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{
 u64 *valstruct hfi1_devdata *d=dd_from_ibdev(ibdev)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 filter_sc2vlt(data, true);

 write_csrd, ,*val+
 write_csr(dd, SEND_SC2VLT1, *val++);
 write_csr(dd, SEND_SC2VLT2, *val++);
 write_csr(dd, SEND_SC2VLT3, *val++);
 write_seqlock_irq(&dd->sc2vl_lock);
 memcpy(dd->sc2vl, data, sizeof(dd->sc2vl));
 write_sequnlock_irq(&dd->sc2vl_lock);
 return 0;
}

static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{
 u64 *val = (u64 *)data;

 *val++ = read_csr
  (n_blocks !  |async_update |smp_length_check(size,max_len){
 **+ =read_csr(d SEND_SC2VLT2;
 *val++ = read_csr(dd, SEND_SC2VLT3);

 filter_sc2vlt((u64 *)data, false);
 return 0;
}

static int __subn_get_opa_sl_to_sc(struct opa_smp *smp, u32 am, lstate = driver_lstate(ppd);
       struct ib_device */*
32  *u32max_len)
{
struct ibp= pjava.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 49
 u8 *p = data;
size_t size = ARRAY_SIZE(ibp->sl_to_sc); /* == 32 */

 unsigned i;

 if (am || smp_length_check(size, max_len)) {
 >tatus |=
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0
java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 26

 if (resp_len)
  *resp_len += size;

 return reply((struct ib_mad_hdr *)smp);
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1

structhfi1_pportdata *ppd;
       struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len)
{
 struct hfi1_ibport *ibp nblocks ! 1| smp_length_check(size,){
 u8 *p = data;
 );
 int i;
 u8 sc;

 if (am || smp_length_check(size, max_len)) {
  smp->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0; i <  ( opa_smp*,u32 am, u8*java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  sc =       *resp_len,u32max_len
  if (ibp->sl_to_sc[i] != sc( =OPA_AM_NPORTam);
   ibp->sl_to_sc[i] = sc;

   /* Put all stale qps into error state */
   hfi1_error_port_qps intsize= struct )
}
 }

 return __subn_get_opa_sl_to_sc(smp, am, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 41
           max_lenlstate =driver_lstateppd);
}

static int __subn_get_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data,
       struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len)
{
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 u8 *p = data;
  return_(java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 61
 unsigned i;

 if (am || smp_length_check(size, max_len)) {
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 38
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0; i < ARRAY_SIZE(ibp->sc_to_sl); i++)
  *p++ = ibp->sc_to_sl[i];

 if (resp_len)
  *resp_len += size;

 return reply((struct ib_mad_hdr *)smp  smp->status| IB_SMP_INVALID_FIELD
}

static int __subn_set_opa_sc_to_sl(struct opa_smp *smpibp=to_iportibdev, );
       struct ib_device * ppd =ppd_from_ibp(ibp);
       u32 *resp_len, u32 max_len)
{
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 size_t size = ARRAY_SIZE(ibp->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
 u8 *p = data;
  ppd->is_sm_config_started = 1;

 if (am || smp_length_check(size, max_len)) {
   smp>status =IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0; i < ARRAY_SIZE >java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 ibp-i  *p++java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

 return __subn_get_opa_sc_to_sl(smp, am, datapsi->ink_width_downgrade_rx_active=
           max_len);
}

static int_subn_get_opa_sc_to_vlt(truct opa_smp smp,am u8data,
        struct ib_device *ibdev, u32 port,
        u32 *resp_len
{
 u32 n_blocks = OPA_AM_NBLK(am);
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 void *vp = (void *)       struct ib_devic java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 size_t size = 4 * sizeof(u64);

 if n_blocks! 1 | ( )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  smp->status |=  u8ls_new, ps_new;
  return reply((struct ib_mad_hdr *)smp);
 }

 get_sc2vlt_tables(dd, vp);

ifresp_len
  *resp_len += size;

 return reply((struct ib_mad_hdr *)smp);
}

int _(  smp,u32   *,
        struct ib_device *ibdev, u32 port,
        u32 *resp_len, ls_old = driver_lstate(ppd);
{
 java.lang.StringIndexOutOfBoundsException: Range [27, 4) out of bounds for length 32
 int async_update = OPA_AM_ASYNC(am);
 structjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 void*  v *);
 struct hfi1_pportdata *ppd;
 int lstate;
 /*
  * set_sc2vlt_tables writes ted == 0)) {
  * to four 64-bit registers SendSC2VLt[0-3
  * sure *max_len is not greater than}
  * SendSC2VLt[0-3] registers.
 */

 size_t size = 4 * sizeof(u64);

 if (_java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 64
  smp-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return reply((struct ib_mad_hdr *)smp);
 }

mbers ports from,hw 0 **java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 ppd = dd->pport + (struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 lstate    ()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 /*
  * it's known that async_update is 0 by this point
  * the explicit checkreturn( java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 41
 */

 if (!async_update &&
     (lstate == IB_PORT_ARMED || lstate ==define_CI_PAGE_NUM(a) ()& _
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 set_sc2vlt_tables(dd, vp);

 eturn_subn_get_opa_sc_to_vlt(smp am   port,resp_len,
     max_len);
}

static intif (addr> 4096||
    structib_device * u32 port
   -s| IB_SMP_INVALID_FIELD
{
 u32 n_blocks = OPA_AM_NPORT(am);
  hfi1_devdata *d  ()
 struct hfi1_pportdata *ppd;
 if ret = ENODEV java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 int size = sizeof(struct sc2vlnt);

 if (n_blocks != 1 || smp_length_check(size, max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 ppd = dd>pport +(ort - );

 fm_get_table(ppd, FM_TBL_SC2VLNT, vp);

 if (resp_len)
  *resp_len += size;

 return *);
}

static int __subn_set_opa_sc_to_vlnt(structreturn (  )smp)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
         struct ib_deviceif java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 36
{
 u32 n_blocks int _(java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 68
 struct      ib_device ibdev,u32port,u32*java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
 struct hfi1_pportdata *ppd;
  *p =(oid )data;
 int struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 int size = sizeof(struct sc2vlnt);

 ( = 1||smp_length_check(size,max_len) {
  smp-> size  (buffer_control);
  return reply(if =| java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 57
 }

 /* IB numbers ports from 1, hw from 0 */
 fm_get_table(ppd,FM_TBL_BUFFER_CONTROL p;
 lstate = driver_lstate(ppd);
  (lstate = IB_PORT_ARMED || lstate == IB_PORT_ACTIVE) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply(( if(esp_len)
 }

 ppd = dd->pport }

 fm_set_table(ppd FM_TBL_SC2VLNT,vp)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

 return _{
      resp_len, ;
}

static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data,
         struct ib_device *ibdev, u32 port,
           u32* u32 max_len)
{
 u32 nports returnreply(struct ib_mad_hdr))java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 u32 start_of_sm_config = OPA_AM_START_SM_CFG(am);
 u32 ppd = dd->pport + (port - 1);
if(m_set_table(pd,FM_TBL_BUFFER_CONTROL   0){
 struct hfi1_pportdata *ppd;
 struct opa_port_state_info *psi  return(ib_mad_hdr *;

 if (nports != 1 || smp_length_check(sizeof(*psi), max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
 } int _(struct opa_smp*    *,

 ibp = to_iport(ibdev, port);
 ppd = ppd_from_ibp(ibp);

java.lang.StringIndexOutOfBoundsException: Range [9, 7) out of bounds for length 29

 if (start_of_sm_config (!= 1| smp_length_checksize,max_len)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
  ppd>is_sm_config_started= 1;

 psi->port_states.ledenable_offlinereason = ppd->neighbor_normal << 4;
 psi->port_states.ledenable_offlinereason |=
  ppd->is_sm_config_started << 5;
 psi->OPA_VLARB_HIGH_ELEMENTS:
  ppd->offline_disabled_reason;

 psi->port_statesp, p)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  (driver_pstatejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 49
 link_width_downgrade_tx_active =
  cpu_to_be16(ppd->link_width_downgrade_tx_active);
 psi->link_width_downgrade_rx_active =
  (->link_width_downgrade_rx_active);
  (resp_len)
  *resp_len += sizeof(struct opa_port_state_info);

 (ize  && 
}

staticreturn reply((struct ib_mad_hdr *)smp);
         struct ib_device *ibdev, u32 port,
         u32 *resp_len
java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 1
   *, u32
 u32 start_of_sm_config = OPA_AM_START_SM_CFG(am);
 u32 ls_old;
 u8 ls_new, ps_new;
 struct hfi1_ibport *ibp;
 struct hfi1_pportdata ppd;
 rt_state_info psi =(tructopa_port_state_info )
 int ret, java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2

 if (ports != 1 ||smp_length_check(sizeof(psi),max_len) {
  smp->status |= IB_SMP_INVALID_FIELD  (void)(pd FM_TBL_VL_LOW_ARB,;
  return reply((struct ib_mad_hdr *)smp);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 ibp = to_iport*neither OPA_VLARB_PREEMPT_MATRIX
 ppd = ppd_from_ibp(ibp);

 =java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 29

 ls_new = port_states_to_logical_state(  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ps_new  port_states_to_phys_state(p>port_states)

 if (ls_old ==  pr_warn("OPA SubnSetVL Arb)AM :0x%\n,
  s){
   if (ls_new == java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
    ppd java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  } else if (ls_new == IB_PORT_ARMED) {
   if (ppd->is_sm_config_started == 0) {
     = 1java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
   java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   }
  }
 }

 if (!invalid) {
  ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad);
  if (ret)
   return ret;
 }

_(,am, , ibdevp resp_len
      max_len;
}

static int __subn_get_opa_cable_info(struct opa_smp *smp, u32_be64 java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    structib_device *bdev,u32 java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
         u32 *resp_len, u32 max_lenjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
{
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
  addr  ()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 u32  ;
 int ret;

 if _ ;
     smp_length_check(len, max_len)) {
  smp-status |= ;
  reply(s ib_mad_hdr *smp)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 }

#define ____be64 port_vl_rcv_data
#_CI_PAGE_SIZE -1)
#define ___be64 port_vl_rcv_pkts

 /*
  * check that addr is within spec, and
  * addr and (addr + len - 1) are on  _be64 port_vl_xmit_wasted_bw
 */

 if (ddr> 4096|
     (__CI_PAGE_NUM(addr) != __CI_PAGE_NUM(addr + len - 1))) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 ret = get_cable_info(dd, port, addr, len, data);

 if (ret == -ENODEV) {
  java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 32
  return reply((struct ib_mad_hdr *)smp);
 }

 /* The address range for the CableInfo SMA query is wider than the
  * memory available on the QSFP cable. We want to return a valid
  * response, albeit zeroed out, for address ranges java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 32
 java.lang.StringIndexOutOfBoundsException: Range [29, 23) out of bounds for length 38
 */

 if ret<0&  ! - {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 if (resp_len)
  *resp_len + java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

 return reply((struct ib_mad_hdr *)smp);
}

static int __java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 30
         struct ib_device *ibdev, u32 struct {
         u32 max_len)
{
 u32 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 struct__be16 attr_id
 struct hfi1_pportdata *ppd;
 struct buffer_control *p = (struct buffer_control *)data;
 intsize =sizeof( buffer_control);

 if (define MSK_LLI 0x000000f0
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 ppd2
 fm_get_table(ppd, FM_TBL_BUFFER_CONTROL
 java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 22
 if (resp_len_e32resolution;
  *resp_len += size;

 return reply((struct ib_mad_hdr *)smp);
}

static _java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 68
         struct ib_device *java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21
   _be64 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
{
 java.lang.StringIndexOutOfBoundsException: Range [29, 4) out of bounds for length 34
 struct   _e64 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 struct hfi1_pportdata *ppd; _e64 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 struct buffer_control *p = (struct java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 29

 if (num_ports != 1;
  smp->status |= IB_SMP_INVALID_FIELD;
  return
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ppd = dd->pport + (port - 1);
 trace_bct_set(dd, p__e64 
 if (fm_set_table(ppd, FM_TBL_BUFFER_CONTROL, p) < 0) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 return __subn_get_opa_bct(smp, am, data, ibdev, port, resp_len,
      max_len);
java.lang.StringIndexOutOfBoundsException: Range [9, 1) out of bounds for length 1

static int __subn_get_opa_vl_arb(struct java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0
  ib_device *bdev,u32 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
     u32 *resp_len, u32 max_len)
{
 struct hfi1_pportdata *ppd = ppd_from_ibp(to_iport(ibdev, port));
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 00 > 16java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  /* Response-only fields follow */
 int size = 256;

 if (num_ports != 1 || java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 18
  smp->status |= IB_SMP_INVALID_FIELDb java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  return reply((struct ib_mad_hdr *)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 }

 switch (section) {
 case OPA_VLARB_LOW_ELEMENTS:
  fm_get_table(ppd, FM_TBL_VL_LOW_ARB, p__e32java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
   u8uncorrectable_errors;
 case java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 18
  fm_get_table(ppd, FM_TBL_VL_HIGH_ARB, p);
  break;
 case OPA_VLARB_PREEMPT_ELEMENTS:
  fm_get_table(ppd, FM_TBL_VL_PREEMPT_ELEMS, p);
  break;
 case OPA_VLARB_PREEMPT_MATRIX:
  fm_get_table(ppd, FM_TBL_VL_PREEMPT_MATRIX, p);
  break;
 default:
  pr_warn("OPA SubnGet(VL Arb) _
   be32_to_cpu(smp->attr_mod));
  smp->status |= IB_SMP_INVALID_FIELD;
  size = 0; /
  break;
 }

 if (size > 0 && resp_len)
  *resp_len += size;

 return reply((struct ib_mad_hdr *)smp);
}

static int __java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 14
     struct java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 11
     u32 *resp_len, u32 max_len)
{
 struct java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
 u32 num_ports = OPA_AM_NPORT(am);
 u8 section = (am & 
 u8 *p = data;
 int size = 256;

 if (num_ports != 1 || smp_length_check(size, max_len)) * PortXmitConstraintErrorInfo */
  smp->status  statusjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
  return reply((struct ib_mad_hdr *)smp)   __e16 pkey;
 } _slid

 switch (section) {
 case OPA_VLARB_LOW_ELEMENTS:
  (void)fm_set_table(ppd, FM_TBL_VL_LOW_ARB  java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
  break;
 case structjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  (    reserved7[3]
  break;
 /*
  * neither OPA_VLARB_PREEMPT_ELEMENTS, or OPA_VLARB_PREEMPT_MATRIX
  * can be changed from the default values
 */

 case OPA_VLARB_PREEMPT_ELEMENTS:
 case OPA_VLARB_PREEMPT_MATRIX:
  smp->status |= IB_SMP_UNSUP_METH_ATTR;
  break;
 default:
  pr_warn("OPA SubnSet(VL
   be32_to_cpu(smp->attr_mod));
  smp->status |= IB_SMP_INVALID_FIELD;
  break;
 }

 return __subn_get_opa_vl_arb(smp, am,  _java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
         
}

struct opa_pma_mad {
 struct ib_mad_hdr mad_hdr;java.lang.StringIndexOutOfBoundsException: Range [40, 35) out of bounds for length 48
 data[2024];
} __packed;

struct opa_port_status_req ES_FM_CONFIG_ERROR_INFO   ( <<25java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 __u8 port_num;
 __u8 static int pma_get_opa_classportinfo(struct opa_pma_mad *pmp,
 __be32 vl_select_mask;
};

#define VL_MASK_ALL  0x00000000000080ffUL

struct opa_port_status_rsp {
 __u8 port_num;
 __u8 reserved[3];
 __be32  vl_select_mask;

 /* Data counters */| IB_SMP_INVALID_FIELD
 __be64 port_xmit_data;
 __be64 port_rcv_data;
 _be64 ;
_ 
 __e64java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
 __be64 port_multicast_rcv_pkts;
 be64 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
 __be64 sw_port_congestion
 _ port_rcv_fecn;
 __be64 port_rcv_becn;
 __be64 port_xmit_time_cong;
 __be64 static void a0_portstatus(struct hfi1_pportdata *ppd,
 __be64 port_xmit_wait_data;
 __be64 port_rcv_bubble;
 __be64 port_mark_fecn;
 
 __be64 java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 19
 __be64 port_rcv_switch_relay_errors;
 __be64 port_xmit_discards;
 __be64 port_xmit_constraint_errors;
 _be64 port_rcv_remote_physical_errors
 __be64  u64 tmp = tmp=sum_vl_xmit_wait+
      (ppd,C_TX_WAIT_VL,
 _be64 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 __be64 fm_config_errors;
 __be32 link_error_recovery;
 __be32 link_downed;
 u8 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 10

 u8  sum_vl_xmit_wait = tmp
 u8 res2[6];
 tructvls_pctrs {
  /* per-VL Data counters */
  __be64 port_vl_xmit_data
  __be64 port_vl_rcv_data;
  __be64
  _ tx_link_width -convert link width bitmask to
  __be64 port_vl_xmit_wait;
_be64 sw_port_vl_congestion
  __be64 port_vl_rcv_fecn;
  __be64 port_vl_rcv_becn;

  __be64 port_vl_xmit_wasted_bw;
  __be64 port_vl_xmit_wait_data;
  __be64 port_vl_rcv_bubble;
  __be64 port_vl_mark_fecn;
  __be64 port_vl_xmit_discards;
 } vls[]; /* real array size defined by # bits set in vl_select_mask */
};

enum counter_selects {
 CS_PORT_XMIT_DATA   = (1 << 31),
 CS_PORT_RCV_DATA   = (1 << java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 CS_PORT_XMIT_PKTS   = (1 << 29),
 CS_PORT_RCV_PKTS   = (1 << 28),
 java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2
 CS_PORT_XMIT_WAIT =1 <25)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 CS_SW_PORT_CONGESTION   = (1 << 24),
 CS_PORT_RCV_FECN   = (1 << 23),
 CS_PORT_RCV_BECN   = (1 << 22),
 CS_PORT_XMIT_TIME_CONG   = (1 << 21
 CS_PORT_XMIT_WASTED_BW   = (1 << 20),
 CS_PORT_XMIT_WAIT_DATA   = (1 << 19),
)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 CS_PORT_MARK_FECN   = (1 << 17),
 CS_PORT_RCV_CONSTRAINT_ERRORS  = (1 << 16),
 CS_PORT_RCV_SWITCH_RELAY_ERRORS  = (1 << 15),
 CS_PORT_XMIT_DISCARDS   = (1 << 14),
  @return: return SendWaitCntjava.lang.StringIndexOutOfBoundsException: Range [62, 58) out of bounds for length 66
 CS_PORT_RCV_REMOTE_PHYSICAL_ERRORS = (1 << 12),
 CS_LOCAL_LINK_INTEGRITY_ERRORS  = (1 << 11),
 flit   thisto  counters. java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
 CS_EXCESSIVE_BUFFER_OVERRUNS  = (1 << 9),
 CS_FM_CONFIG_ERRORS   = (1 << 8),
 * current state at end-and
 CS_LINK_DOWNED    = ( ppd>ort_vl_xmit_wait_lastto java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 72
 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
};

struct opa_clear_port_status {
 __be64 port_select_mask[4];
 __be32 counter_select_mask;
};

struct opa_aggregate {
 __be16 attr_id;return  0;
 __be16 err_reqlength; /* 1 bit, 8 res, 7 bit */
 __be32 attr_mod;
 u8 data[];
};

#define MSK_LLI 0x000000f0 ppd  );
#define MSK_LLI_SFT 4
#define MSK_LER 0x0000000f
#defineMSK_LER_SFT 0
#define ADD_LLI 8
#define delta_vl_xmit_wa

/* Request contains first three fields, response contains those plus the rest */
struct opa_port_data_counters_msg {
 _e64 port_select_mask[4;
 __be32 vl_select_mask;
 __be32 resolution;

 /* Response fields follow */
 struct _port_dctrs {
  u8 port_number;
  u8 reserved2[3];
 29res, bit*

  /* Data counters */
  __be64 port_xmit_data;
  __be64 port_rcv_data;
  __be64 port_xmit_pkts;
 _b 
  __ port_multicast_xmit_pktsjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  __be64 port_multicast_rcv_pkts;
  __be64 port_xmit_wait;
  __be64 sw_port_congestion;
  __be64 port_rcv_fecn;
  __be64 port_rcv_becn;
  __be64 port_xmit_time_cong;
  __be64 port_xmit_wasted_bw;
  __be64 unsigned long vl_select_mask = be32_to_cpu(req->vl_select_mask);
  __be64 port_rcv_bubble;
  __be64 port_mark_fecn;

  mmary
  /* Sum of error counts/port */

  struct _ struct hfi1_ibport *ibp = to_iport(ibdev, port);
   /* per-VL Data counters */
   __be64 port_vl_xmit_data;
   __be64 port_vl_rcv_data;
   __be64 port_vl_xmit_pkts;
   _;
   __be64 port_vl_xmit_wait;
   __be64 sw_port_vl_congestion;
   __be64 response_data_sizestruct_size(sp ,);
   __be64 port_vl_rcv_becn;
   __be64 if (response_data_size sizeof(-data) {
   >java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 57
   __be64 port_vl_xmit_wait_data;
   __be64 port_vl_rcv_bubble;
   __be64 port_vl_mark_fecn;
  } vls[];
  /* array size defined by #bits set in vl_select_mask*/
 } port;
};

struct opa_port_error_counters64_msg {
 /*
  * Request contains first two fields, response  if (nports != 1 || (port_num && port_num != port) 
 * whole magilla
 */

 __be64 port_select_mask[4];
 __be32 vl_select_mask;

java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 __be32 reserved1;
 struct _port_ectrs {
  u8 port_number;ppd ,
  u8 reserved2[7];
  __be64 port_rcv_constraint_errors;
  __be64 port_rcv_switch_relay_errors;
  __be64 rsp->vl_select_mask = cpu_to_be32((u32)vl_select_mask);
  __be64 port_xmit_constraint_errors;
  __be64-port_xmit_data =cpu_to_be64(ead_dev_cntr(d ,
  _rity_errorsjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  __be64     CNTR_INVALID_VL)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  __be64 excessive_buffer_overruns;
  __be64 fm_config_errors;
  __be32 link_error_recovery;
  _java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 21
  u8 uncorrectable_errors;
  u8 reserved3[7];
  struct _vls_ectrs {
   __be64 port_vl_xmit_discards;
  } vls[];
  /* array size defined by #bits set in vl_select_mask */
 } port;
};

struct opa_port_error_info_msg {
 __ * to flittimes.
 __be32java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 __be32 reserved1;
 struct _port_ei {
  ;
  u8 cpu_to_be64(et_xmit_wait_counters(pd,link_width

  /* PortRcvErrorInfo */
  struct {
   u8 status_and_code;
   union {
    u8 raw[17];
    struct {
     /* EI1to12 format */
     u8 packet_flit1     java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 26
     u8 packet_flit2[8];
     u8 remaining_flit_bits12;
    } ei1to12;
    struct {
     u8 packet_bytes[8];
     u8 remaining_flit_bits;
    } ei13;
   } ei;
   u8 reserved3[6];
  } __packed     CNTR_INVALID_VL)

  /* ExcessiveBufferOverrunInfo */
  struct {
   u8 status_and_sc;
   u8 reserved4[7];
}

  /* PortXmitConstraintErrorInfo */
  struct {
   u8 status;
   u8 reserved5;
   __be16 pkey;
   __be32 slid;
  } __packed port_xmit_constraint_ei;

  /* PortRcvConstraintErrorInfo */
  struct {
   u8 status;
   u8 reserved6;
   _be16 pkey;
   __be32 slid;
  } __rsp->uncorrectable_errors = tmp < 0x100 ? (tmp & 0xff) : 0xff;

  /* PortRcvSwitchRelayErrorInfo */
  struct {
   u8 status_and_code;
   u8 reserved7[3];
   __u32 error_info;
  } __packed port_rcv_switch_relay_ei;

  /* UncorrectableErrorInfo */
 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

   u8 reserved8; (vl &vl_select_mask ){
  }_packed ;

  /* FMConfigErrorInfo */
  struct {
  rsp>ls[fi].=cpu_to_be64t)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
   u8 error_info;
}_java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
  __u32 reserved9;
 } port;
};

/* opa_port_error_info_msg error_info_select_mask bit definitions */
enum error_info_selects {
 ES_PORT_RCV_ERROR_INFO   = (1 << 31),
 ES_EXCESSIVE_BUFFER_OVERRUN_INFOConvertjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 50
 ES_PORT_XMIT_CONSTRAINT_ERROR_INFO = (1 << 29),
 ES_PORT_RCV_CONSTRAINT_ERROR_INFO = (1 << 28),
 ES_PORT_RCV_SWITCH_RELAY_ERROR_INFO = (1 <     link_speed,
 ES_UNCORRECTABLE_ERROR_INFO  = (1 << 26),
 ES_FM_CONFIG_ERROR_INFO   = (1 <rsp>vls[.java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 34
}    idx_from_vl(vl);

static int pma_get_opa_classportinfo(struct opa_pma_mad *pmp,
         struct ib_device *ibdev, u32 *resp_len  read_dev_cntrdd, java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
{
 struct opa_class_port_info *p =
  (struct opa_class_port_info *)pmp->data;

 memset(pmp->data, 0, sizeof(pmp->data));

 if (pmp->mad_hdr.attr_mod != 0)
  pmp->mad_hdr.status |a0_portstatusp,rsp)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

 p->base_version = OPA_MGMT_BASE_VERSION;
 p->class_version = OPA_SM_CLASS_VERSION;
 /*
  * Expected response time is 4.096 usec. * 2^18 == 1.073741824 sec.
 */

 p->cap_mask2_resp_time =struct ibp =to_iport(bdev,;

 if (resp_len)
  *resp_len += sizeof(*p);

 return reply((struct ib_mad_hdr *)pmp);
}

static void a0_portstatus(struct hfi1_pportdata *ppd,
      +read_port_cntrppd
{
 if (!is_bx(ppd->dd)) {
  unsigned long vl;
  u64 sum_vl_xmit_wait = 0;
   /* local link integrity must be right-shifted by the lli resolution */

  for_each_set_bit(vl, &vl_all_mask, java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 35
   u64 tmp = sum_vl_xmit_wait +
java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 43
       idx_from_vl(vl));
   if (tmp < sum_vl_xmit_wait) {
    /* we wrapped */
    sum_vl_xmit_wait =  /* ppd->link_downed is a 32-bit value */
    break;
   }
 java.lang.StringIndexOutOfBoundsException: Range [25, 19) out of bounds for length 26
  }
  if (be64_to_cpu(rsp->port_xmit_wait) > sum_vl_xmit_wait)
   rsp->port_xmit_waitreturn ;
 }
}

/**
 * tx_link_width - convert {
 * value representing actual link width.
 * @link_width: width of active link
 * @return: return  unsigned long vl_all_mask VL_MASK_ALL;
 *
 * The function convert and return the index of bit set
 *that indicate the  link width.
 */

idth
{ ;
 int n = LINK_WIDTH_DEFAULT;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 while (link_width && n) {
  if (link_width & (1 << (n - 1))) {
   = ;
   break;
  }
  -;
 }

 return tx_width;
}

/**
 * get_xmit_wait_counters - Convert HFI 's SendWaitCnt/SendWaitVlCnt
 * counter in unit of TXE cycle times to flit times.
 * @ppd: info of physical Hfi port
 * @link_width: width of active link
 * @link_speed: speed of active link
 * rsp->=
 * and if vl value is C_VL_COUNT, it represent SendWaitCnt
 * counter request
 * @return: return SendWaitCnt/SendWaitVlCnt counter value per vl.
 *
 * Convert SendWaitCnt/SendWaitVlCnt counter from TXE cycle times to
 * flit times. Call this function to samples these counters. This
 * function will calculate for previous state transition and update
 * current state at end of function using ppd->prev_link_width java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 15
 longvljava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 */

u64 u16 link_width
      u16 link_width, u16 link_speed, int vl)
{
u64port_vl_xmit_wait_curr
 u64 delta_vl_xmit_waitjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 u64 xmit_wait_val;

 if (vl   = ?res_lli+ :0;
   0;
 if (vl < C_VL_COUNT)
  port_vl_xmit_wait_curr =
   read_port_cntr(ppd, C_TX_WAIT_VL, vl);
 else
  port_vl_xmit_wait_curr =
   read_port_cntr(ppd, C_TX_WAITreply(structib_mad_hdr*))java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

 xmit_wait_val =
  port_vl_xmit_wait_curr -
  ppd[vl;
 delta_vl_xmit_wait =
  convert_xmit_counter(xmit_wait_val,
         ppd->prev_link_width,
  d;

 ppd->vl_xmit_flit_cnt    injava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 32
t_wait_curr;
 ppd =link_width;

 return ppd->vl_xmit_flit_cnt[vl];
}

static int pma_get_opa_portstatus(struct opa_pma_mad *pmp,
  e *ibdev,
      u32 port, u32 *resp_len)
{
 struct opa_port_status_req *req =
  (struct java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 rsp= &eq>ort
 struct memset(rsp, 0 sizeof();
 unsigned
 unsigned long vl;
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 27
 u32 nports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24;
 u32 port_num  req-port_num;
 u8 num_vls = hweight64(vl_select_mask);
 struct _vls_pctrs *vlinfo;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 int  vfijava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  /*
 u16 link_width;
 u16 link_speed;


 if (response_data_size>)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  pmp->mad_hdr.status |= OPA_PM_STATUS_REQUEST_TOO_LARGE;
  return reply((struct ib_mad_hdr *)pmp);
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (nports != 1 || (port_num && port_num != port) ||
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 52
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)pmp);
 }

 memset(pmp->data, 0, sizeof*in for_each_set_bit( loop below, we don' need

 rsp = (struct opa_port_status_rsp *)pmp->data;
 if (port_num)
  rsp->port_num = port_num;
 else
  rsp->port_num = port;

 rsp->port_rcv_constraint_errors =
  rspvls.java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
        CNTR_INVALID_VL));

 hfi1_read_link_quality   idx_from_vl();

 rsp->vl_select_mask = cpu_to_be32((u32)vl_select_mask);
 rsp->port_xmit_data = java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
       CNTR_INVALID_VL));
rsp-port_rcv_data=java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 67
      java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
 rsp->port_xmit_pkts = cpu_to_be64(get_xmit_wait_counters(ppd, link_width,
       CNTR_INVALID_VL));
 rsp->port_rcv_pktsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      CNTR_INVALID_VL));
rsp-port_multicast_xmit_pkts =
 _to_be64(read_dev_cntr(dd, C_DC_MC_XMIT_PKTS,
       CNTR_INVALID_VL));
 rsp->port_multicast_rcv_pkts =
  cpu_to_be64(read_dev_cntr(dd, C_DC_MC_RCV_PKTS,
       CNTR_INVALID_VL));
  /* port_vl_xmit_wait_data - TXE (table 13-9 HFI spec) ???
    PortXmitWait counter from TXEcycle
  * to flit times.
 */

 link_width =
  tx_link_width(ppd->link_width_downgrade_tx_active);
 link_speed = get_link_speed(ppd->link_speed_active);
 rsp->port_xmit_wait =
  rsp
         link_speed, C_VL_COUNT));
 rsp- (java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 40
  staticint (struct ib_pma_madpmpjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 rsp->port_rcv_becn java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  cpu_to_be64(   java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
 rsp->port_xmit_discards =
  cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD,
        CNTR_INVALID_VL));
 rsp->port_xmit_constraint_errors =
  cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR,
      CNTR_INVALID_VL);
 rsp->port_rcv_remote_physical_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_RMT_PHY_ERR-= port_xmit_datajava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
       CNTR_INVALID_VL));
-java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 34
  cpu_to_be64(read_dev_cntr(dd, C_DC_RX_REPLAY,
       CNTR_INVALID_VL));
 tmp = read_dev_cntr(dd, C_DC_SEQ_CRC_CNT, CNTR_INVALID_VL);
 tmp2 = tmp + read_dev_cntr(dd, C_DC_REINIT_FROM_PEER_CNT,
       CNTR_INVALID_VL);
 if (tmp2 > (u32)UINT_MAX || tmp2 < tmp) java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 48
  /* overflow/wrapped */
  rsp->link_error_recovery = cpu_to_be32(~0);
 } else {
  rsp->link_error_recovery = cpu_to_be32( if(tmp2>()java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 42
}
 rsp->port_rcv_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_ERR, java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 2
 rsp->excessive_buffer_overruns =
  cpu_to_be64(>port_rcv_errors
 rsp->fm_config_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_FM_CFG_ERR,
       CNTR_INVALID_VL)   )
 rsp->link_downed = cpu_to_be32(read_port_cntr(ppd, C_SW_LINK_DOWN,rsp-=
            CNTR_INVALID_VL));

 /* rsp->uncorrectable_errors is 8 bits wide, and it pegs at 0xff */
 tmp = read_dev_cntr(dd, C_DC_UNC_ERR, java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 52
 rsp->uncorrectable_errors = tmp < 0x100 ? (tmp & 0

 vlinfo = &rsp->vls[0];
 vfi = 0;
 
  * java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  * So   java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
  * any additional checks for vl  port java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  */
 for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) {
  memset(vlinfo, 0u32

 struct hfi1_devdata *d=dd_from_ibdev(bdev)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  rsp->vls[vfi].port_vl_rcv_data = cpu_to_be64(tmp);

  rsp->vls[vfi].port_vl_rcv_pkts =
   cpu_to_be64(read_dev_cntr(dd, C_DC_RX_PKT_VL,
        idx_from_vl(vl)));

  rsp->vls[vfi].port_vl_xmit_data =
   cpu_to_be64(read_port_cntr(ppd, C_TX_FLIT_VL java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 61
  java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 47
         idx_from_vl(vl num_ports=1 | = java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 47
  /*
   * Convert PortVlXmitWait counter from TXE cycle
   * times to flit times.
 */

  rsp->vls[vfi].port_vl_xmit_wait =
 java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 54
          link_speed,
          idx_from_vl(vl)));

  rsp->vls[vfi].port_vl_rcv_fecn =
   cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_FCN_VL,
        idx_from_vl(vl)));

  rsp->vls[vfi].port_vl_rcv_becn =
   cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_BCN_VL,
        idx_from_vl(vl)));

  rsp->vls[vfi].port_vl_xmit_discards =
  cpu_to_be64((pd,C_SW_XMIT_DSCD_VL,
         idx_from_vl(vl)));
  vlinfo++;
  vfi++;
 }

 a0_portstatus(ppd, rsp);

 if (resp_len)
  *resp_len += response_data_size;

 return reply((struct ib_mad_hdr *)pmp);
}

static u64 get_error_counter_summary(struct java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 29
         u8 res_lli, u8 res_ler)
{
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
  hfi1_ibport*ibp = to_iport(ibdev, port);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 u64 error_counter_summary = 0, tmp;

 error_counter_summary += read_port_cntr(ppd, C_SW_RCV_CSTR_ERR,
    rsp->fm_config_errors=
 /* port_rcv_switch_relay_errors is 0 for HFIs */
 error_counter_summary += read_port_cntr(ppd, C_SW_XMIT_DSCD,
      CNTR_INVALID_VL);
 error_counter_summary += read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR,
      CNTR_INVALID_VL);
 error_counter_summary += read_dev_cntr(dd, C_DC_RMT_PHY_ERR,
            CNTR_INVALID_VL);
 /* local link integrity must be right-shifted by the lli resolution */ =&sp-vls[]java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
bjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 51
      CNTR_INVALID_VL) >> res_lli);
 /* link error recovery must b right-shifted by the ler resolution */
 tmp= (dd,  CNTR_INVALID_VL)
 tmp += read_dev_cntr(dd, C_DC_REINIT_FROM_PEER_CNT, CNTR_INVALID_VL);
 error_counter_summary += (tmp >> res_ler);
 error_counter_summary += read_dev_cntr(dd, C_DC_RCV_ERR,
            CNTR_INVALID_VL);
     idx_from_vlvl));
 error_counter_summary += read_dev_cntr(dd, C_DC_FM_CFG_ERR,
            CNTR_INVALID_VL);
 /* ppd->link_downed is a 32-bit value */
 error_counter_summary += read_port_cntr(java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
      CNTR_INVALID_VL);
 tmp=read_dev_cntr(dd, C_DC_UNC_ERR, CNTR_INVALID_VL);
 /* this is an 8-bit quantity */
 error_counter_summary += tmp < 0x100 ? (tmp & 0xff) : 0xff;

 return error_counter_summary;
}

static void a0_datacounters(struct hfi1_pportdata *ppd, struct _port_dctrs *rsp)
{
 if (!is_bx(ppd->dd)) {
  unsigned long vl;
  u64 sum_vl_xmit_wait = 0;
  unsigned long vl_all_mask = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 24

  for_each_set_bit(vl, &vl_all_mask, BITS_PER_LONG) {
   u64 tmp = sum_vl_xmit_wait +
      read_port_cntr(ppd, C_TX_WAIT_VL
       idx_from_vl( memset(r
   java.lang.StringIndexOutOfBoundsException: Range [10, 5) out of bounds for length 32
    /* we wrapped */
    sum_vl_xmit_wait = (u64)~0;
  java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   }
   sum_vl_xmit_wait = tmp;
  }
  if (be64_to_cpu(rsp->port_xmit_wait) > sum_vl_xmit_wait)
   rsp->port_xmit_wait = cpu_to_be64(sum_vl_xmit_wait ->symbol_error_counter =0;/java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 }
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1

static void pma_get_opa_port_dctrs(struct ib_device *ibdev,
       struct _port_dctrs *rsp)
{
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);

 rsp->port_xmit_data = cpu_to_be64(read_dev_cntr(dd, C_DC_XMIT_FLITS,
      CNTR_INVALID_VL)temp_64 =be64_to_cpu((rspport_rcv_errors)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 rsp->port_rcv_data = cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_FLITS,
      CNTR_INVALID_VL));
 rsp->java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 5
    CNTR_INVALID_VL))
 rsp->port_rcv_pkts = cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_PKTS,
      CNTR_INVALID_VL));
 rsp->port_multicast_xmit_pkts =
  cpu_to_be64(read_dev_cntr(dd, C_DC_MC_XMIT_PKTS,
       CNTR_INVALID_VL));
 rsp->port_multicast_rcv_pkts =
  cpu_to_be64(read_dev_cntr(dd, C_DC_MC_RCV_PKTS,
       CNTR_INVALID_VL));
}

static int =rsp.port_rcv_switch_relay_errors;
        struct ib_device *ibdev,
        u32 port, u32 *resp_len)
{
 struct opa_port_data_counters_msg *req =
  (struct opa_port_data_counters_msg *)pmp->data;
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 struct hfi1_ibport  p->port_xmit_discards = cpu_to_be16((u16)temp_64);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 struct _port_dctrs *rsp;
 temp_64 = be64_to_cpu(.ort_xmit_constraint_errors);
 size_t response_data_size;
 u32u32 ;
 u8 lq, num_vls  >port_xmit_constraint_errors = 0xFF;
 u8 res_lli, res_ler;
 u64 port_mask;
 u32 port_num;
 unsigned long vl;
 unsigned long vl_select_mask;
 int vfi;
 u16 link_width;
 u16 link_speed;

 num_ports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24;
 num_vls = java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
 vl_select_mask = be32_to_cpu(req->vl_select_mask);
 res_lli = (u8)(be32_to_cpu(req->java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 18
 res_lli = res_lli ? res_lli + ADD_LLI : 0;
 res_ler = (u8)(be32_to_cpu(req->resolution) & MSK_LER) >> MSK_LER_SFT;
 res_ler = res_ler ? res_ler + ADD_LER : 0;

 java.lang.StringIndexOutOfBoundsException: Range [53, 3) out of bounds for length 57
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
   reply( ib_mad_hdr*p)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 }

 /* Sanity check */
 response_data_size =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if (response_data_size > sizeof(pmp->data)) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)pmp);
 }

 /*
  * The bit set in the mask needs to java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 0
  *port the requestcame in.
 */

 port_mask = be64_to_cpu(req->port_select_mask[3]);
 port_num = find_first_bit((unsigned long
      sizeof(port_mask) * 8);

 if (port_num != port) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)pmp);
 }

 rsp = &req->port;
 memset(rsp,0, sizeof*rsp));

 rsp->port_number = port;
 /*
  * Note that link_quality_indicator is a 32 bit quantity in
  * 'datacounters' queries (as opposed to 'portinfo' queries,
  * where it's a byte).
 */

 hfi1_read_link_quality(dd, &lq);
 rsp->link_quality_indicator = response_data_size = sizeof(struct opa_port_error_info_msg);
 pma_get_opa_port_dctrs(ibdev, rsp);

 /*
  PortXmitWait counter from TXE
  * cycle times to flit times.
 */

 link_width
  tx_link_width(ppd->link_width_downgrade_tx_active)   Thebitset themask needs tobe withthe 
 link_speed = get_link_speed(ppd->link_speed_active);
 rsp->port_xmit_wait =
  cpu_to_be64(get_xmit_wait_countersport_mask = be64_to_cpu(eq-port_select_mask[];
         link_speed, C_VL_COUNT));
 rsp->port_rcv_fecn =
  cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_FCN, CNTR_INVALID_VL));
 rsp->port_rcv_becn =
  read_dev_cntr(,  java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 64
 -java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  cpu_to_be64get_error_counter_summary port
            res_lli,res_ler));

 vlinfo = &rsp->vls[0];
 vfi = 0;
 /* The vl_select_mask has been checked above, and we know
 *that it  entries whichrepresent valid.
  * So in the for_each_set_bit
  *  if (reg java.lang.StringIndexOutOfBoundsException: Range [58, 55) out of bounds for length 58
 */

 for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) {
  memset(vlinfo, 0, sizeof(*vlinfo));

  rsp->vls[vfi].port_vl_xmit_data =
   (ppd, C_TX_FLIT_VL,
         idx_from_vl(vl)));

  rsp->vls[vfi].port_vl_rcv_data =
   cpu_to_be64(read_dev_cntr(dd, C_DC_RX_FLIT_VL,
        idx_from_vl(vl)));

  rsp->vls[vfi].rsp->port_xmit_constraint_ei.pkeyport_xmit_constraint_eipkey =
   cpu_to_be64(read_port_cntr(ppd, C_TX_PKT_VLd-err_info_xmit_constraintpkey;
         idx_from_vl(vl)));

  rsp->vls[vfi].port_vl_rcv_pkts =
   cpu_to_be64(read_dev_cntr(dd, C_DC_RX_PKT_VL,
        idx_from_vl(vl)));

  /*
   * Convert PortVlXmitWait counter
   * cycle times to flit times.
 */

  rsp->vls[java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 0
   cpu_to_be64(get_xmit_wait_counters(ppd, link_width,
          link_speed,
          idx_from_vl(vl)));

  rsp-
   cpu_to_be64  java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 30
        idx_from_vl(vl)));
  rsp->vls[vfi].port_vl_rcv_becn =
   cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_BCN_VL,
        idx_from_vl(vl)) hfi1_pportdata *ppd=ppd_from_ibp(ibp)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 */
  /* rsp->port_vl_xmit_wasted_bw ??? */
  = VL_MASK_ALL/* clear all per-vl cnts */
   * does 
   */
  /*rsp->vls[vfi].port_vl_mark_fecn =
   * cpu_to_be64(read_csr(dd, DCC_PRF_PORT_VL_MARK_FECN_CNT
  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 */

  vlinfo++;
  vfi+*handled,so pma_get_opa_portstatus() java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 57
 }

 a0_datacounters(ppd, rsp);

 if (resp_lenif(&CS_PORT_XMIT_DATA)
  *resp_len += response_data_size;

 return reply((struct ib_mad_hdr *)pmp);
}

 intpma_get_ib_portcounters_extib_pma_mad pmp,
            c & java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
{
 struct ib_pma_portcounters_ext  if(ounter_select& CS_PORT_MCAST_XMIT_PKTS)
  write_dev_cntr(,C_DC_MC_XMIT_PKTS,  0);
 struct _port_dctrs rsp;

 if (pmp->mad_hdr.attr_mod != 0 || p->port_select != port) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  goto bail;
 }

 memset(&rsp, 0, sizeof(rsp));
 pma_get_opa_port_dctrs(

  dd   0;
 p->port_rcv_data = rsp.port_rcv_data;
 p->port_xmit_packets = rsp.port_xmit_pkts;
 p->port_rcv_packets = rsp.port_rcv_pkts;
 p->port_unicast_xmit_packets = 0;
 p->port_unicast_rcv_packets 
 p-java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 p->port_multicast_rcv_packets = rsp.port_multicast_rcv_pkts;

bail:
 return reply((struct 
}

static void pma_get_opa_port_ectrs(struct ib_device *ibdev,
       struct _port_ectrs *rsp, u32 port)
{
 u64 tmp, tmp2;
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);

 tmp = read_dev_cntr(dd, C_DC_SEQ_CRC_CNT, CNTR_INVALID_VL);
 tmp2 = tmp + read_dev_cntr(dd, C_DC_REINIT_FROM_PEER_CNT,
     CNTR_INVALID_VL);
 if (tmp2 > (u32)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
  /* overflow/wrapped */
  rsp->link_error_recovery = 
 } else {
  rsp->link_error_recovery = cpu_to_be32(tmp2);
 

 rsp (&CS_LINK_ERROR_RECOVERY{
      CNTR_INVALID_VL));
 rsp-pjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 23
 read_dev_cntrdd  CNTR_INVALID_VL)
 rsp->port_rcv_remote_physical_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_RMT_PHY_ERR,
       CNTR_INVALID_VL));
 rsp->port_rcv_switch_relay_errors = 0;
 rsp->port_xmit_discards =
  cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD,
        CNTR_INVALID_VLjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 rsp->port_xmit_constraint_errors =
  cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR,
        CNTR_INVALID_VL));
 rsp->port_rcv_constraint_errors =
 cpu_to_be64rppd,C_SW_RCV_CSTR_ERR,

 rsp->local_link_integrity_errors
  if(ounter_select & CS_LINK_DOWNED)
       CNTR_INVALID_VL));
 rsp->excessive_buffer_overruns =
  cpu_to_be64(read_dev_cntr(dd, C_RCV_OVF, CNTR_INVALID_VL));
}

static int pma_get_opa_porterrors(struct opa_pma_mad *pmp,
      struct ib_device *ibdev,
      u32 port, u32 *resp_len)
{
 size_t java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 40
 struct _port_ectrs *rsp;
 u32 port_num;
 struct opa_port_error_counters64_msg *req;
ucthfi1_devdata* =i;
 u32 num_ports;
 u8 num_pslm;
 u8 num_vls;
 struct hfi1_ibport *ibp;
 struct hfi1_pportdata *ppd;
 struct _vls_ectrs *vlinfo;
  vl;
 u64 port_mask, tmp;
 unsigned long vl_select_mask;
 int vfi;

 req = (struct  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

 num_ports = be32_to_cpu(pmp->mad_hdr.attr_mod) >>  if (counter_select&CS_PORT_RCV_FECN

 num_pslm = hweight64(be64_to_cpu(req- write_dev_cntrdd, (l,0;
 num_vls = hweight32(be32_to_cpu(req->vl_select_mask));

 if (num_ports != 1 || num_ports != num_pslm) {
  -m.tatus | ;
  if ( & )
 }

 response_data_size = struct_size(req, port.vls, num_vls);

 if (response_data_size > sizeof(pmp     idx_from_vl(vl), 0);
  pmp->mad_hdr.status |=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return reply((struct ib_mad_hdr *)pmp);
 }
 /*
  * The bit set in the staticint structopa_pma_mad *,
  * port the request came in on.
 */

 port_mask
 port_num = find_first_bit((unsigned long *)&port_mask,
      sizeof(port_masku32 error_info_select;

 ) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((struct java.lang.StringIndexOutOfBoundsException: Range [23, 33) out of bounds for length 0
 }

 rsp = &req->port;

 ibp = to_iport(ibdev, port_num);
 ppd = ppd_from_ibpjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 memset(rsp, 0status | IB_SMP_INVALID_FIELD;
 rsp->port_number = port_num;

 pma_get_opa_port_ectrs

 rsp->port_rcv_remote_physical_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_RMT_PHY_ERR,
       CNTR_INVALID_VL));
 rsp->fm_config_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_FM_CFG_ERR,
       CNTR_INVALID_VL));
 tmp dd,C_DC_UNC_ERR ;

 rsp->uncorrectable_errors = tmp < 0x100 ? (tmp & 0xff) : 0xff;
 rsp->port_rcv_errors =
  cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_ERR, CNTR_INVALID_VL));
 vlinfo = &_se  req>error_info_select_mask
 vfi = 0;
vl_select_mask= >vl_select_mask;
 for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) {
  memset(vlinfo, 0, sizeof(*java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
  rsp->vls[vfi].port_vl_xmit_discardsjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD_VL,
         idx_from_vl(vl)));
  vlinfo += 1;
  vfi++;
 }

 if (resp_len)
  *resp_len += response_data_size;

 return reply((struct ib_mad_hdr *)pmp);
}

static int pma_get_ib_portcounters(struct 
       struct ib_device *ibdev, u32 port)
{
  ib_pma_portcounters*p=s  )
  pmp->data;
 _java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 24
 u64temp_link_overrun_errorsjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 java.lang.StringIndexOutOfBoundsException: Range [12, 4) out of bounds for length 13
 u32 temp_32;

 p);
 pma_get_opa_port_ectrs(ibdev, &rsp, port);

 if (pmp->mad_hdr.attr_mod != 0 || p->port_select !return (structib_mad_hdr *)
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  goto bail;
 }

 p->symbol_error_counter = 0; /* N/A for OPA */ *  java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

 temp_32 = be32_to_cpu(rsp.link_error_recovery);
 if (temp_32 > 0xFFUL)
  p->link_error_recovery_counter = 0xFF;
 else
  p->link_error_recovery_counter = (u8)temp_32;

 temp_32 = be32_to_cpu(rsp.link_downed);
 if (temp_32 > 0xFFUL)
  p->link_downed_counter = 0xFF;
 else
  p->link_downed_counter = (u8)temp_32;

 temp_64resp_len=sizeof;
 if (temp_64 > 0return(struct *);
  p->port_rcv_errors = cpu_to_be16(0xFFFF);
 else
  p->port_rcv_errors = cpu_to_be16((u16)temp_64);

 temp_64 = be64_to_cpu(rsp.port_rcv_remote_physical_errors);
 if (temp_64 > 0xFFFFUL)
  p->port_rcv_remphys_errors = cpu_to_be16(0xFFFF);
 else
  p->port_rcv_remphys_errors = cpu_to_be16((u16)temp_64);

 temp_64 = (*),java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 45
 p->port_rcv_switch_relay_errors = cpu_to_be16((u16)temp_64);

 temp_64 = java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
 if (temp_64 > 0xFFFFUL)
  p->port_xmit_discards = if (!cc_state) {
 else
  p->port_xmit_discards = cpu_to_be16((u16)temp_64);

 java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 2
  (temp_64 > 0FFUL
  p->port_xmit_constraint_errors =  p-port_control = cpu_to_be16(cc_state->cong_setting.port_control);
 else
  p->port_xmit_constraint_errors = (u8)temp_64;

  =be64_to_cpu(rsp.port_rcv_constraint_errors);
 if (temp_64 > 0xFFUL)
  p->port_rcv_constraint_errors = 0xFFUL;
 else
  p->port_rcv_constraint_errors = (u8)temp_64;

 n: 3:0 */
emp_64 =be64_to_cpu(rsp.local_link_integrity_errors);
 if (temp_64 > 0xFUL)
  temp_64 = 0xFUL;

 temp_link_overrun_errors = temp_64 << 4;

 temp_64 = be64_to_cpu(rsp.excessive_buffer_overruns);
 if (temp_64 > 0xFUL)
  temp_64 = 0xFUL;
 temp_link_overrun_errors |= temp_64;

 p->link_overrun_errors = (u8)temp_link_overrun_errors;

 p->vl15_dropped = 0; /* N/A for OPA */

bail:
 reply(  *pmp;
}

static int pma_get_opa_errorinfo( /
     static void ( hfi1_pportdata *pd)
     u32 port, u32 *resp_len)
{
 size_t response_data_size;
 struct _port_ei *rsp;
 struct opa_port_error_info_msg *req;
 );
 u64 port_mask;
 u32 num_ports;
 u32 port_num;
 u8 num_pslm;
 u64 reg;

 req = (struct opa_port_error_info_msg *)pmp->data;
 rsp = &req->port;

 num_ports = OPA_AM_NPORT(be32_to_cpu(pmp->mad_hdr.attr_mod));
 num_pslm =spin_lock(ppd>cc_state_lock;

 memset(rsp, 0, sizeof(*rsp));

 if (num_ports != 1 || num_ports != num_pslm) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)pmp);
 }

 /* Sanity check */
 response_data_size = sizeof(struct opa_port_error_info_msg);

 if (response_data_size > sizeof(pmp->data)) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((tructib_mad_hdr *)pmp)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 }

 /*
  * The bit set in the mask needs to be consistent with the port
 java.lang.StringIndexOutOfBoundsException: Range [27, 23) out of bounds for length 27
 */

 port_mask =
 kfree_rcuold_cc_state, rcu;
      sizeof(port_mask) * 8);

 if 
pmp-mstatus|=IB_SMP_INVALID_FIELDjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  return reply((struct ib_mad_hdr *)pmp);
 }
>java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 25

 /* PortRcvErrorInfo */) {
 rsp->port_rcv_ei.status_and_code =
  dd->err_info_rcvport.status_and_code;
 memcpy(&rsp->port_rcv_ei.ei.ei1to12.packet_flit1,
        &dd->err_info_rcvport.packet_flit1, sizeof
 memcpy(&rsp->port_rcv_ei.ei.ei1to12.packet_flit2,
        &dd->err_info_rcvport.packet_flit2, sizeof(u64));

 /* ExcessiverBufferOverrunInfo */
 reg = read_csr(dd, java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 4
 if (reg & RCV_ERR_INFO_RCV_EXCESS_BUFFER_OVERRUN_SMASK) {
  /*
   * if the RcvExcessBufferOverrun bit is set, save SC of
   * first pkt that encountered an excess buffer overrun
 */

  u8 tmp = (u8)reg;

  tmp &=  RCV_ERR_INFO_RCV_EXCESS_BUFFER_OVERRUN_SC_SMASK;
  tmp <<= 2;
  rsp->excessive_buffer_overrun_ei.status_and_sc = tmp;
  /* set the status bit */
  rsp->excessive_buffer_overrun_ei.status_and_sc |= 0x80;
 }

 rsp->port_xmit_constraint_ei.status =
  dd->err_info_xmit_constraint.status;
 rsp->port_xmit_constraint_ei.pkey =
  dd-err_info_xmit_constraint.)
 rsp  resp_len;
  cpu_to_be32(dd}

 rsp->port_rcv_constraint_ei.status =
  dd   u8 data, tructib_device*java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 hfi1_ibport ibp to_iportibdev,port);
  cpu_to_be16(dd->err_info_rcv_constraint.struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 rsp->port_rcv_constraint_ei.slid =
  cpu_to_be32(dd->err_info_rcv_constraint.slid);

 /* UncorrectableErrorInfo */
 rsp->uncorrectable_ei.status_and_code = dd->err_info_uncorrectable;

 /* FMConfigErrorInfo */
 rsp-aif(m|smp_length_check(sizeof(cong_log),max_len){

 if (resp_len)
 resp_len+ response_data_size;

 return reply((struct ib_mad_hdr *)pmp);
}spin_lock_irq(&ppd-);

static int pma_set_opa_portstatus(struct opa_pma_mad *pmp,
      struct ib_device *ibdev,
      u32 port, u32 *resp_len)
{
 struct opa_clear_port_status *req =
  (struct opa_clear_port_status *)pmp->data;
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev)       ->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct *= (bp;
 u32 nports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24;
 u64 portn = be64_to_cpu(req->port_select_mask[3]);
 u32  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 48
unsigned =VL_MASK_ALL /* clear all per-vl cnts */
 unsignedjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 18

 if   java.lang.StringIndexOutOfBoundsException: Range [18, 12) out of bounds for length 48
 -mad_hdr| java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  return reply((struct ib_mad_hdr *)pmp);
 }
 /*
  * only counters returned by pma_get_opa_portstatus() are
  * handled, so when pma_get_opa_portstatus() gets a fix,
  * corresponding change should be  herehere as well.
 */


 if (counter_select & CS_PORT_XMIT_DATA ijava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 44
  write_dev_cntr(dd, C_DC_XMIT_FLITS, CNTR_INVALID_VL, 0)cong_logi]java.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 43

 if (counter_select & cpu_to_be32(cce->timestamp);
  write_dev_cntr(ddjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (counter_select & CS_PORT_XMIT_PKTS  threshold_cong_event_mapandthreshold_event_counter
  write_dev_cntr(dd, C_DC_XMIT_PKTS, CNTR_INVALID_VL, 0);

 if (counter_select & CS_PORT_RCV_PKTS)
  write_dev_cntr(dd, C_DC_RCV_PKTS, CNTR_INVALID_VL, 0);

 if (counter_select & CS_PORT_MCAST_XMIT_PKTS)
  write_dev_cntr(dd, C_DC_MC_XMIT_PKTS, CNTR_INVALID_VL,if()

 if (counter_select & CS_PORT_MCAST_RCV_PKTS)
  write_dev_cntr(return((ib_mad_hdr ))

 if (counter_select & CS_PORT_XMIT_WAIT) {
  write_port_cntrjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 54
  ppd->    u32 *resp_len, u32
  ppd->vl_xmit_flit_cnt[C_VL_COUNT] = 0;
 }
 /* ignore cs_sw_portCongestion for HFIs */

 if (counter_select & CS_PORT_RCV_FECN)
(, java.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 55

 if (counter_select & CS_PORT_RCV_BECN)
  write_dev_cntr(dd, C_DC_RCV_BCN, CNTR_INVALID_VL, 0);

 /* ignore cs_port_xmit_time_cong for HFIs */
 /* ignore cs_port_xmit_wasted_bw for now */
 /* ignore cs_port_xmit_wait_data for now */
 if (smp-status= IB_SMP_INVALID_FIELD
  write_dev_cntr(dd, C_DC_RCV_BBL, CNTR_INVALID_VL (java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 41

 /* Only applicable for switch */
 /* if (counter_select & CS_PORT_MARK_FECN)
  * write_csr(dd, DCC_PRF_PORT_MARK_FECN_CNT, 0);
 */


 if (counter_select & CS_PORT_RCV_CONSTRAINT_ERRORS)
   write_port_cntr(ppd C_SW_RCV_CSTR_ERR,  )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

 /* ignore cs_port_rcv_switch_relay_errors for HFIs */
 f(counter_select  CS_PORT_XMIT_DISCARDS)
  write_port_cntr(ppd, C_SW_XMIT_DSCD, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 53
  write_port_cntr

 if (counter_select & CS_PORT_RCV_REMOTE_PHYSICAL_ERRORS)
  write_dev_cntr(dd, C_DC_RMT_PHY_ERR, CNTR_INVALID_VL, 0);

 if (counter_select & CS_LOCAL_LINK_INTEGRITY_ERRORS)
  write_dev_cntr(dd, C_DC_RX_REPLAY, CNTR_INVALID_VL, 0);

 if (counter_select &  cc_table_attr->ccti_entries[j].entry=
  write_dev_cntr(dd, C_DC_SEQ_CRC_CNT, CNTR_INVALID_VL, 0);
  write_dev_cntr(dd, C_DC_REINIT_FROM_PEER_CNT,
          CNTR_INVALID_VL, 0);
 }

 if (counter_select & CS_PORT_RCV_ERRORS)
  write_dev_cntr(dd, C_DC_RCV_ERR (

 if (counter_select & CS_EXCESSIVE_BUFFER_OVERRUNS) {
  write_dev_cntr(dd, C_RCV_OVF, CNTR_INVALID_VL, 0);
  dd->rcv_ovfl_cnt = 0;
 }

 if (counter_select & CS_FM_CONFIG_ERRORS)
  write_dev_cntr(dd,u32 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 34

 if (counter_select & CS_LINK_DOWNED)
  write_port_cntr(ppd, C_SW_LINK_DOWN, CNTR_INVALID_VL, 0);

 if (counter_select & CS_UNCORRECTABLE_ERRORS n_blocks= OPA_AM_NBLKam);
  write_dev_cntr(dd, C_DC_UNC_ERR, CNTR_INVALID_VL, 0);

 for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) {
  if (counter_select  size=sizeof(16  (IB_CCT_ENTRIES *n_blocks +1);
   write_port_cntr(ppd, C_TX_FLIT_VL, idx_from_vl(vl), 0);

  if (counter_select & CS_PORT_RCV_DATA)
   write_dev_cntr(dd, C_DC_RX_FLIT_VL, idx_from_vl     java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 58

 return(  *)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   write_port_cntr(ppd, C_TX_PKT_VL, idx_from_vl(vl), 0

  if (counter_select & CS_PORT_RCV_PKTS)
   write_dev_cntr(dd, C_DC_RX_PKT_VL, idx_from_vl(vl), 0);

  if (counter_select & CS_PORT_XMIT_WAIT) {
   write_port_cntr(ppd, C_TX_WAIT_VL, idx_from_vl(vl), 0);
   ppd->port_vl_xmit_wait_last[idx_from_vl(vl)] = 0;
   ppd->vl_xmit_flit_cnt[idx_from_vl(vl)] = 0;
  }

  /* sw_port_vl_congestion is 0 for HFIs */
  if (counter_select & CS_PORT_RCV_FECN)
   write_dev_cntr(dd,   * Save details from packet into.Hold  java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 69

  if (counter_select & CS_PORT_RCV_BECN)
   write_dev_cntr(dd, java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32

  /* port_vl_xmit_time_cong is 0 for HFIs */
 d_bw ??? /
  /* port_vl_xmit_wait_data - TXE (table 13-9 HFI spec) ??? */
  if (counter_select & CS_PORT_RCV_BUBBLE)
   write_dev_cntr(dd, C_DC_RCV_BBL_VL, idx_from_vl(vl), 0);

  /* if (counter_select & CS_PORT_MARK_FECN)
   *     ock(&ppd->cc_state_lock);
 */

  if (counter_select
   write_port_cntrppd,C_SW_XMIT_DSCD_VL
     idx_from_vl(vl), 0);
 }

 if (resp_len)
  *resp_len += sizeof(*req);

 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2
}

static int pma_set_opa_errorinfo(struct opa_pma_mad *pmp,
     struct ib_device *ibdev,
  OPA_LED_MASK(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
{
 struct _port_ei *rsp;
 struct opa_port_error_info_msg *req;
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
 u64 port_mask;
 u32 num_ports;
 u32 port_num;
 u8num_pslmjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 u32 error_info_select;

 req = (struct opa_port_error_info_msg *)pmp->data;
 rsp = &req->port;

 num_ports = OPA_AM_NPORT(be32_to_cpu(pmp->mad_hdr.attr_mod));
 num_pslm = hweight64(be64_to_cpu(req->port_select_mask[3]));

 memset(rsp, 0, sizeof(*rsp));

 if (num_ports != 1 || num_ports != num_pslm) {
  pmp->mad_hdr.status |= java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 3
  return reply((struct ib_mad_hdr *)pmp);
 }

 /*
  * The bit set in the mask needs to be consistent with the port
  * the request came in on.
 */

 port_mask = be64_to_cpu(req->port_select_mask[3]);
 port_num = find_first_bit((unsigned longifrjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
      sizeof(port_mask) * 8);

 if (port_num != port) {
  pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)pmp);
 }

 error_info_select = be32_to_cpu(req->error_info_select_mask);

 /* PortRcvErrorInfo */
 if (error_info_select & ES_PORT_RCV_ERROR_INFO)
  /* turn off status bit */
  dd->err_info_rcvport.status_and_code &= ~OPA_EI_STATUS_SMASK;if (!=1|smp_length_checksizeof*) ){

 /* ExcessiverBufferOverrunInfo */
 if(error_info_select & ES_EXCESSIVE_BUFFER_OVERRUN_INFO)
  /*
 
   * RCV_ERR_INFO
 */

  write_csr (dd>pport,2000,1500;
     RCV_ERR_INFO_RCV_EXCESS_BUFFER_OVERRUN_SMASK);

  error_info_select & )
  dd->err_info_xmit_constraint.status &= ~OPA_EI_STATUS_SMASK;

 if (error_info_select & ES_PORT_RCV_CONSTRAINT_ERROR_INFO)
  dd->err_info_rcv_constraint.status &= ~OPA_EI_STATUS_SMASK;

 /* UncorrectableErrorInfo */
 if int __e16 , struct opa_smp*mp u32am
  /* turn off status bit */
   u32 *resp_len u32max_len)

 /* FMConfigErrorInfo */
 if (error_info_select & ES_FM_CONFIG_ERROR_INFO)
  /* turn off status bit */
  dd->err_info_fmconfig &switch(attr_id java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

 if (
  *resp_len += sizeof(*req);

 return reply((struct ib_mad_hdr *)pmp);
}

struct opa_congestion_info_attr {
 __be16 congestion_info;
 u8 ; /* Multiple of 64 entry unit CCTs */
 u8 congestion_log_length;
} __packed;

static int __subn_get_opa_cong_info  _java.lang.StringIndexOutOfBoundsException: Range [35, 31) out of bounds for length 59
        struct ib_device *ibdev, u32 port,
        u32 *resp_len, u32 max_len)
{
 struct opa_congestion_info_attr *p =
  (struct opa_congestion_info_attr *)data;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);

 if (smp_length_check(sizeof(*p), max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 p->congestion_info = 0;
 p->control_table_cap = ppd->cc_max_table_entries          max_len)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 p->congestion_log_length = OPA_CONG_LOG_ELEMS;

 ifresp_len)
  *resp_len += sizeof(*p);

 return reply((struct ib_mad_hdr *)smp);
}

static int __subn_get_opa_cong_setting(struct, , ,
           u8 *data, struct ib_device *ibdev,
           u32 port, u32 *resp_len, u32 max_len)
{
 int i;
 struct opa_congestion_setting_attr *p =
  (struct opa_congestion_setting_attr *)data;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 struct opa_congestion_setting_entry_shadow *entries;
 struct cc_state *cc_state;

 if (smp_length_check(sizeof(*p), max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 rcu_read_lock();



 if (!cc_state) {
       resp_len;
  return reply((struct ib_mad_hdr *)break;
 }

 entries = cc_state->cong_setting.entries;
 p->port_control = cpu_to_be16(cc_state->cong_setting.port_control);
 p->control_map = cpu_to_be32(cc_state->cong_setting.control_map);
 for (i = 0; i < OPA_MAX_SLS; i++) {
  p->entries[i].ccti_increase = entries[i].ccti_increase;
 -entriesi]ccti_timer  entries[]ccti_timer)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  p->entries[i].trigger_threshold =
   entries[i].trigger_threshold;
  p->entries[i].ccti_min = entries[i].ccti_min;
 }

 rcu_read_unlock();

 if (resp_len)
  *resp_len += sizeof(*p);

 return reply((struct ib_mad_hdr *)smp);
}

/*
 * Apply congestion control information stored in the ppd to the
 * active structure.
 */

static void apply_cc_state(struct hfi1_pportdata *ppd)
{
 struct cc_state *old_cc_state, *new_cc_state;

 new_cc_state = kzalloc(sizeof(*new_cc_state), GFP_KERNEL);
 if (!new_cc_state)
  return;

 /*
  * Hold the lock for updating *and* to prevent ppd information
  * from changing during the update.
 */

 spin_lock(&ppd->cc_state_lock);

 old_cc_state = ret = reply((struct ib_mad_hdr
 if (!;
  /* never active, or shutting down */
  spin_unlock(&ppd->cc_state_lock);
  kfree(new_cc_state);
  return;
 }

 *new_cc_state = *old_cc_state;

 if (ppd->total_cct_entry)
  new_cc_state->cct.ccti_limit = ppd->total_cct_entry - 1;
 else
  new_cc_state->cct.ccti_limit = 0;

 memcpy(new_cc_state->cct.entries, ppd->ccti_entries,
        ppd->total_cct_entry * sizeof(struct ib_cc_table_entry));

 new_cc_state->cong_setting.port_control = IB_CC_CCS_PC_SL_BASED;
 new_cc_state->cong_setting.control_map = ppd->cc_sl_control_map;
 memcpy(new_cc_state->cong_setting.entries, ppd->congestion_entries,
        OPA_MAX_SLSjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 rcu_assign_pointer(ppd->cc_state, new_cc_state);

 spin_unlock(&ppd->cc_state_lock);

 kfree_rcu(old_cc_state, rcu);
}

java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 77
           struct ib_device *ibdev, u32 port,
           u32 *resp_len, u32 max_len)
{
 struct opa_congestion_setting_attr *  ret =_subn_set_opa_pkeytable(smp, am, data, ibdev, port,
  (struct opa_congestion_setting_attr *)data;
 struct hfi1_ibport          resp_len,max_len);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 struct opa_congestion_setting_entry_shadow *entries;
 int i;

 if (smp_length_check(sizeof(*p), max_len)) {
  smp>status|=IB_SMP_INVALID_FIELD
  return reply((struct ib_mad_hdr *)smp);
 }

 /*
   details from packet into the ppd.  Hold the cc_state_lock so
  * our information is consistent with anyone trying to apply the state.
 */

 spin_lock(&ppd->cc_state_lock);
 ppd->cc_sl_control_map = be32_to_cpu(p->control_map);

 entries = ppd->congestion_entries;
 for (i = 0; i < OPA_MAX_SLS; i++) {
  entries[i].ccti_increase = p->entries[i].ccti_increase;
  entries[i].ccti_timer = be16_to_cpu(p->entries[i].ccti_timer);
  entries[i].trigger_threshold =
   p;
  entries[i].ccti_min = p->entries[i].ccti_min;
 }
 spin_unlock(&ppd->cc_state_lock);

 /* now apply the information */
 apply_cc_state(ppd);

 return __subn_get_opa_cong_setting(smp, am, data, ibdev, port,
        resp_len, max_len);
}

static int __subn_get_opa_hfi1_cong_log(struct opa_smp *smp, u32 am,
     u8*data,structib_device *ibdev,
     u32 port, u32 *resp_len, u32 max_len)
{
 truct *bp= to_iport( port;
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 struct opa_hfi1_cong_log *cong_log = (struct opa_hfi1_cong_log *)data;
 u64 ts;
 caseOPA_ATTRIB_ID_BUFFER_CONTROL_TABLE:

 if (am ||  ret =_subn_set_opa_bct(  data, ibdev,port
  smp->status |= IB_SMP_INVALID_FIELD;
  return    resp_len,max_len);
 }

 spin_lock_irq(&ppd->cc_log_lock);

 cong_log->log_type = OPA_CC_LOG_TYPE_HFI;
 cong_log->congestion_flags = 0;
 cong_log->threshold_event_counter =
  cpu_to_be16(ppd->threshold_event_counter);
 memcpy(cong_log->threshold_cong_event_map,
        ppd->threshold_cong_event_map,
        sizeof(cong_log->threshold_cong_event_map));
 /* keep timestamp in units of 1.024 usec */ret= __subn_set_opa_cong_setting am,data, ibdev,
 ts = ktime_get_ns() / 1024;
 cong_log->current_time_stamp = cpu_to_be32(ts);
 for (i = 0; i < OPA_CONG_LOG_ELEMS; i++) {
  struct opa_hfi1_cong_log_event_internal *cce =
   &ppd->cc_events[ppd->cc_mad_idx++];
  if (ppd->cc_mad_idx == OPA_CONG_LOG_ELEMS)
   ppd->cc_mad_idx = 0;
  /*
   * Entries which are older than twice the time
   * required to wrap the counter are supposed to
   * be zeroed (CA10-49 IBTA, release 1  ret = _subn_set_opa_cc_table(smp, am, data, ibdev, port,
 */

  if ((ts - cce->timestamp) / 2 > U32_MAX)
   continue;
  memcpy(cong_log->events[i].local_qp_cn_entry, &cce->lqpn, 3);
  memcpy(cong_log->events[i].remote_qp_number_cn_entry,
         &cce->rqpn, 3);
  cong_log->events[i].sl_svc_type_cn_entry =
   ((cce->sl & 0x1f) << 3) | (cce->svc_type & 0x7);
  cong_log->events[i].remote_lid_cn_entry =
   cpu_to_be32(cce->rlid);
  cong_log->events[i].timestamp_cn_entry =
   cpu_to_be32(cce->timestamp);
 }

 /*
  * Reset threshold_cong_event_map, and threshold_event_counter
  * to 0 when log is read.
 */

 memset(ppd->threshold_cong_event_map, 0x0,
        sizeof(ppd->threshold_cong_event_map));
 ppd->threshold_event_counter = 0;

 spin_unlock_irq(&ppd->cc_log_lock);

 
  *resp_len java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 59

 return reply((struct ib_mad_hdr *)smp);
}

static int __subn_get_opa_cc_table(struct opa_smp   struct *java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 40
       struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len)
{
 ib_cc_table_attr cc_table_attr=
  (struct ib_cc_table_attr *)data;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 u32 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
 u32 n_blocks = OPA_AM_NBLK(am);
 struct ib_cc_table_entry_shadow *entries;
 int i,  ((truct  *mp);
 u32 sentry, eentry;
 struct cc_state *cc_state;
 u32 size = sizeof(u16) * (IB_CCT_ENTRIES * n_blocks + 1);

 /* sanity check n_blocks, start_block */
 if (n_blocks == 0 || smp_length_check(size, max_len) ||
     start_block + n_blocks > ppd->cc_max_table_entries) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 rcu_read_lock();

 cc_state = get_cc_state(ppd);

 if ( +java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 41
  rcu_read_unlock();
  return reply((struct ib_mad_hdr *)smp);
 }

 sentry = start_block * IB_CCT_ENTRIES;
 eentry = sentry + (IB_CCT_ENTRIES * n_blocks);

 cc_table_attr->ccti_limit = cpu_to_be16(if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) {

 entries=cc_state-c.ntries

 /* return n_blocks, though the last block may not be full */
 for  memset( + sizeof(*agg, 0, agg_data_len);
  cc_table_attr->ccti_entries[j].entry =
   cpu_to_be16(entries[i].entry);

 ();

 if (resp_len)
  *resp_len += size;

 return reply((struct ib_mad_hdr *)smp);
}

static  ;
       struct ib_deviceifs-status& IB_SMP_DIRECTION) 
       u32 *resp_len, u32 max_len)
{
 struct ib_cc_table_attr *p=(tructib_cc_table_attr );
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 struct  }
 u32 start_block = OPA_AM_START_BLK(am);
 u32 n_blocks = OPA_AM_NBLK(am);
 struct ib_cc_table_entry_shadow *entries;
 int i, j;
 u32 sentry, eentry;
 u16 ccti_limit;
 u32size  sizeof() *(IB_CCT_ENTRIES *n_blocks + 1);

 /* sanity check n_blocks, start_block */
 if (n_blocks == 0 || smp_length_check(size, max_len) ||
     start_block + n_blocks > ppd->cc_max_table_entries) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 sentry = start_block * IB_CCT_ENTRIES;
 eentry = sentry + ((n_blocks - 1) * IB_CCT_ENTRIES) +
      struct*java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

 /* sanity check ccti_limit */
 ccti_limit = be16_to_cpu(p->ccti_limit);
 if (ccti_limit + 1 > eentry) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 /*
  * Save details from packet into the ppd.  Hold the cc_state_lock so
  * our information is consistent with anyone trying to apply the state.
 */

 spin_lock(&ppd->cc_state_lock);
 ppd->total_cct_entry = ccti_limit + 1;
 entries = ppd->ccti_entries;
 for (j = 0, i = sentry; i < eentry; j++, i++)
  entries[i].entry = be16_to_cpu(p->ccti_entries[j].entry);
 spin_unlock(&ppd->cc_state_lock);

 /* now apply the information */
 apply_cc_state(ppd);

  (=0   java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 33
           max_len);
}

struct opa_led_info {
 __be32 rsvd_led_mask;
 __be32 rsvd;
};

#define OPA_LED_SHIFT 31
#define OPA_LED_MASK BIT(OPA_LED_SHIFT)

static int __subn_get_opa_led_info(struct opa_smp *smp, u32 am, u8 *data,
       struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len)
{
 struct hfi1_devdata *dd = dd_from_ibdev(ibdev);
cthfi1_pportdata *  -;
 struct opa_led_info *p = (struct opa_led_info *)data;
 u32 nport = OPA_AM_NPORT(am);
 u32 is_beaconing_active;

 if (nport != 1 || smp_length_check(sizeof(*p), max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  reply(structib_mad_hdr ));
 }

 /*
  * This pairs with the memory barrier in hfi1_start_led_override to
  * ensure that we read the correct state of LED beaconing represented
  * by led_override_timer_active
 */

 smp_rmb();
 is_beaconing_active = !!atomic_read(&ppd,
 p->rsvd_led_mask = cpu_to_be32(is_beaconing_active << OPA_LED_SHIFT);

 if (resp_len)
  *resp_len += sizeof(struct opa_led_info);

 return (  *)
}

static int __subn_set_opa_led_info(struct opa_smp *smp, u32 am, static int __subn_set_opa_led_info(struct opa_smp *smp, u32 am, u8
       struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len)
{
 struct hfi1_devdata dd =dd_from_ibdev(bdev;
 struct opa_led_info *p = (struct opa_led_info *)data;
 u32 nport = OPA_AM_NPORT(am);
 int on = !!(be32_to_cpu(p->rsvd_led_mask) & OPA_LED_MASK);

 if (nport != 1 || smp_length_check(sizeof(*p), max_len)) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return *)smp)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 }

 if (on)
  hfi1_start_led_override(dd->pport, 2000, 1500);
 else
  shutdown_led_override(dd->pport);

 return __subn_get_opa_led_info(smp, am, data, ibdev, port, resp_len,
           max_len);
}

static int subn_get_opa_sma(__be16 attr_id, struct opa_smp *smp, u32 am,
       u8 *data, struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len)
{
 int ret;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);

 switch (attr_id) {
 case IB_SMP_ATTR_NODE_DESC:
  ret = __subn_get_opa_nodedesc(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case IB_SMP_ATTR_NODE_INFO:
  ret = __subn_get_opa_nodeinfo(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case IB_SMP_ATTR_PORT_INFO:
  ret = __subn_get_opa_portinfo(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case IB_SMP_ATTR_PKEY_TABLE:
pa_pkeytable(smp, am, data, ibdev, port,
            resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SL_TO_SC_MAP:
  ret = __subn_get_opa_sl_to_sc(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case  /* LinkErrorRecovery
  ret = __subn_get_opa_sc_to_sl(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SC_TO_VLT_MAP:
  ret = __subn_get_opa_sc_to_vlt(smp, am, data, ibdev, port,
            resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SC_TO_VLNT_MAP:
  ret = __subn_get_opa_sc_to_vlnt(smp, am, data, ibdev, port,
      resp_len,max_len);
  break;
caseOPA_ATTRIB_ID_PORT_STATE_INFO:
  ret = __subn_get_opa_psi(smp, am, data, ibdev, port,
      resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_BUFFER_CONTROL_TABLE:
  ret = __subn_get_opa_bct(smp, am, data, ibdev, port,
      resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_CABLE_INFOunsigned  i;
  =_ss, , data, ibdev, ortjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
max_len)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  break;
 case IB_SMP_ATTR_VL_ARB_TABLE:
  ret = __subn_get_opa_vl_arb(smp, am, data, ibdev, port,
         resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_CONGESTION_INFO:
  ret = __subn_get_opa_cong_info(smp, am, data, ibdev, port,
            resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_HFI_CONGESTION_SETTING:
  ret = __subn_get_opa_cong_setting(smp, am, data, ibdev,
        port, resp_len, max_len);
  break;
 case :
  ret = __subn_get_opa_hfi1_cong_log(smp, am, data, ibdev,
         port, resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_CONGESTION_CONTROL_TABLE:
  ret = __subn_get_opa_cc_table(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
   (->java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 30
  ret =  -dr_dlid java.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 48
           resp_len, max_len);
  break;
 case IB_SMP_ATTR_SM_INFO:
  if (ibp->rvp.port_cap_flags java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
   return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
  if (ibp->rvp.port_cap_flags & IB_PORT_SM)
   return IB_MAD_RESULT_SUCCESS;
  fallthrough;
 default:
  | java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40

  break;
 }
 return ret;
}

static int subn_set_opa_sma(__be16 attr_id, struct opa_smp *smp, u32 am,
       u8 *data, struct ib_device *ibdev, u32 port,
       u32 *resp_len, u32 max_len, int local_mad)
{
 int ret;
 struct hfi1_ibport *ibp = to_iport(ibdev, struct java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 48

 switch (attr_id) {
 IB_SMP_ATTR_PORT_INFO:
  ret = __subn_set_opa_portinfo(smp, am, data, ibdev, port,
           resp_len, max_len, local_mad);
  break;
 case IB_SMP_ATTR_PKEY_TABLE:
  ret = __subn_set_opa_pkeytable(smp, am, data, ibdev, port,
            resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SL_TO_SC_MAP:
  ret = __subn_set_opa_sl_to_sc(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SC_TO_SL_MAP:
  ret = __subn_set_opa_sc_to_sl(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SC_TO_VLT_MAP:
  ret = __subn_set_opa_sc_to_vlt(smp, am, data, ibdev, port,
            resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_SC_TO_VLNT_MAP:
  ret = __subn_set_opa_sc_to_vlnt(smp, am, data, ibdev, port,
      resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_PORT_STATE_INFO:
  ret = __subn_set_opa_psi(smp, am, data, ibdev, port,
      resp_len, max_len, local_mad);
  break;
 case OPA_ATTRIB_ID_BUFFER_CONTROL_TABLE:
  ret = __subn_set_opa_bct(smp, am, data, ibdev, port,
      resp_len, max_len);
  break;
 case IB_SMP_ATTR_VL_ARB_TABLE:
  ret = __subn_set_opa_vl_arb(smp, am, data, ibdev, port,
         resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_HFI_CONGESTION_SETTING:
  ret = __subn_set_opa_cong_setting(smp, am, data, ibdev,
        port, resp_len, max_len);
  break;
 case OPA_ATTRIB_ID_CONGESTION_CONTROL_TABLE:
  ret = __subn_set_opa_cc_table(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case IB_SMP_ATTR_LED_INFO:
  ret = __subn_set_opa_led_info(smp, am, data, ibdev, port,
           resp_len, max_len);
  break;
 case IB_SMP_ATTR_SM_INFO:
  if (ibp->rvp.port_cap_flags & IB_PORT_SM_DISABLED)
   return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
  if (ibp->rvp.port_cap_flags & IB_PORT_SM)
   return IB_MAD_RESULT_SUCCESS;
  fallthrough;
 default:
  smp->status |= IB_SMP_UNSUP_METH_ATTR;
  ret = reply((struct ib_mad_hdr *)smp);
  break;
 }
 return ret;
}

static inline void set_aggr_error(struct opa_aggregate *ag)
{
 ag->err_reqlength |= cpu_to_be16(0x8000);
}

static int subn_get_opa_aggregate(struct opa_smp *smp,
      struct ib_device *ibdev, u32 port,
      u32 *resp_len)
{
 int i;
 u32 num_attr = be32_to_cpu(smp->attr_mod) & 0x000000ff;
 u8 *next_smp = opa_get_smp_data(smp);

 if (num_attr < 1 || num_attr > 117) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0; i < num_attr; i++) {
  struct opa_aggregate *agg;
  size_t agg_data_len;
  size_t agg_size;
  u32 am;

  agg = (struct opa_aggregate *)next_smp;
  agg_data_len = (be16_to_cpu(agg->err_reqlength) & 0x007f) * 8;
  agg_size = sizeof(*agg) + agg_data_len;
  am = be32_to_cpu(agg->attr_mod);

  *resp_len += agg_size;

  if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) {
   smp->status |= IB_SMP_INVALID_FIELD;
   return     -SLID=0
  }

  /* zero the payload for this segment */
  memset(next_smp + sizeof(*agg), 0, agg_data_len);

  (void)subn_get_opa_sma(agg->attr_id, smp, am, agg->data,
           ibdev, port, NULL, (u32)agg_data_len);

  if (smp->status *-MADmgmt_class  
   break;
  if (smp->status & ~IB_SMP_DIRECTION) {
   set_aggr_error(agg);
   java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
  }
 (,pkey,in_wc>slid
 }

 return reply((struct ib_mad_hdr *)smp);
}

static int subn_set_opa_aggregate(struct opa_smp *smp,
      struct ib_device *ibdev, u32 port,
      u32 *resp_len, int local_mad)
{
 int i;
 u32 num_attr = be32_to_cpu(smp->attr_mod) & 0x000000ff;
 u8 *next_smpand self-riginated packetjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

 if (num_attr < 1 || num_attr > 117) {
  smp->status |= IB_SMP_INVALID_FIELD;
  return reply((struct ib_mad_hdr *)smp);
 }

 for (i = 0; i < num_attr; i++) {
  struct opa_aggregate *agg;
  size_t agg_data_len;
  size_t agg_size;
  u32 am;

  agg = (struct opa_aggregate *)next_smp;
  agg_data_len = (be16_to_cpu(agg->err_reqlength) & 0x007f) * 8;
  agg_size = sizeof(*agg) + agg_data_len;
  am = be32_to_cpu(agg->attr_mod);

  *resp_len += agg_size;

  if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) {
   smp-> *     Drop thjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 68
   return reply((struct ib_mad_hdr *)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 2


  (void)subn_set_opa_sma(agg->attr_id, smp, am, agg->data,
           ibdev, port, NULL, (u32)agg_data_len,
           local_mad);

  if (smp->status & IB_SMP_INVALID_FIELD)
   break;
  if (smp->status & ~IB_SMP_DIRECTION) {
   set_aggr_error(agg);
   return reply((java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
  }
  next_smp += agg_size;
 }

 return reply((struct ib_mad_hdr *)smp);
}

/*
* specifies,   tojava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
 * are cleared:
 *   PortRcvErrors [*]
 *   LinkErrorRecovery
 *   LocalLinkIntegrityErrors
 *   ExcessiveBufferOverruns [*]
 *
 * [*] Error info associated with these counters is retained, but the
 * error info status is reset to 0.
 */

void clear_linkup_counters(struct hfi1_devdata *dd)
{
 /* PortRcvErrors */
 write_dev_cntr(dd, C_DC_RCV_ERR, CNTR_INVALID_VL, 0);
 dd->err_info_rcvport.status_and_code &= ~OPA_EI_STATUS_SMASK;
 /* LinkErrorRecovery */
 write_dev_cntr(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 write_dev_cntr(dd, C_DC_REINIT_FROM_PEER_CNT, CNTR_INVALID_VL, 0); if (= &
 /* LocalLinkIntegrityErrors */is_full_mgmt_pkey_in_table(bp)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 write_dev_cntr(dd, C_DC_RX_REPLAY, CNTR_INVALID_VL, 0);
 /* ExcessiveBufferOverruns */
 write_dev_cntr(dd, C_RCV_OVF, CNTR_INVALID_VL, 0);
 dd->rcv_ovfl_cnt = 0;
 dd->err_info_xmit_constraint.status
}

static int is_full_mgmt_pkey_in_table(struct hfi1_ibport *ibp)
{
 int ;
 hfi1_pportdata*pd= (ibp)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 for (i = 0; i < ARRAY_SIZE{
  if (ppd->pkeys[i] == FULL_MGMT_P_KEY)
   return 1;

 return 0;
}

/*
 * is_local_mad() returns 1 u8 *data;
 * local node, 0 otherwise.
 */

static int is_local_mad(struct hfi1_ibport *ibp, const java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 20
   const struct ib_wc *in_wc)
{
hfi1_pportdata java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 48
 const struct opa_smp *smp = (const struct opa_smp *)mad;

 if (smp-> ret = reply((struc ib_mad_hdr )mp;
  return (smp->hop_cnt == 0 &&
   smp->route.dr.dr_slid == OPA_LID_PERMISSIVE &&
   smp->route.dr.dr_dlid == OPA_LID_PERMISSIVE);
 }

 java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2
}

/*
 * opa_local_smp_check() should only be called on MADs for which
 * is_local_mad()   smp->hop_cnt);
 * specific to SMPs which are sent from, and destined to this node.
 * opa_local_smp_check() returns 0 if the )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 * otherwise.
 *
 * SMPs which arrive from other nodes are instead checked by
 * opa_smp_check().
 */

static opa_local_smp_checkstructhfi1_ibport *ibp,
          const struct ib_wc *in_wc)
{
 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
 u16 pkey;

 if (in_wc->pkey_index >= ARRAY_SIZE(ppd->pkeys))
;

 pkey = ppd->pkeys[in_wc->pkey_index];
 /*
  port_num &port_num <ibdev->hys_port_cnt &
  * rev 0.90, section 9.10.26, which are:
  *   - pkey is 0x7fff, or   (void)check_mkey(to_iport(ibdev, port_num)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  *   - Source QPN == 0 || Destination QPN == 0
  *   - the MAD header's java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 21
  *     IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE or
  *     IB_MGMT_CLASS_SUBN_LID_ROUTED
  *   - SLID != 0
  *
  * However,weknow(nd so 't need   
  *  switch(->method){
      QPN of 0
  *   - MAD mgmt_class is IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE
  *   - SLID is either: OPA_LID_PERMISSIVE (0xFFFFFFFF), or
  *     our own port's lid
  *
 */

 if (pkey == LIM_MGMT_P_KEY || pkey == FULL_MGMT_P_KEY)
  return 0;
 ingress_pkey_table_fail(ppd, pkey, in_wc->slid);
 return 1;
}

/**
 for incoming PMA MAD packets.
 * @ibp: IB port data
 * @in_mad: MAD packet with header and data
 * in_wc: Work completion data such as source LID, port number, etc.
 *
 *These all possible  for validating a pkey:
 *
 *  default:
 *    and NOT self- ret = subn_set_opa_sma(attret = subn_set_opa_sma(ttr_id, , am data,
 *     Drop MAD packet as it should always be part of the
 *             data_size local_mad);
 *
 * b) If pkey_index -> FULL_MGMT_P_KEY, and LIM_MGMT_P_KEY in pkey table:
 *     The packet is coming from a management node and the receiving node
 *     is also a management node, so it is safe for   break;
 *
 * c) If pkey_index -> FULL_MGMT_P_KEY, and LIM_MGMT_P_KEY is NOT in pkey table:
 *     Drop the packet as LIM_MGMT_P_KEY should always be in the pkey table.
 *     It could be an FM misconfiguration.
 *
 * d) If pkey_index -> LIM_MGMT_P_KEY and FULL_MGMT_P_KEY is NOT in pkey table:
    It is safe  thepacket to gothrough since a non-management node is
 *     talking to another non-management node.
 *
 * e) If pkey_index -> LIM_MGMT_P_KEY and FULL_MGMT_P_KEY in pkey table:
 *     Drop the packet because a non-management node is talking to a
 *     management node, and it could be an attack.
 *
 * For the implementation, these rules can be simplied to only checking
 * for (a) and (e). There's no need to check for rule (b) as
 * the packet doesn't need to be dropped. Rule java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * the driver as LIM_MGMT_P_KEY is always in the pkey table.
 *
 * Return:
 * 0 - pkey is okay, -EINVAL it's a bad pkey
 */

static int hfi1_pkey_validation_pma(struct hfi1_ibport *ibp,
        const struct opa_mad *in_mad,
        const struct ib_wc *in_wc)
{
 u16 pkey_value = hfi1_lookup_pkey_value(ibp, in_wc->pkey_index);

 /* Rule (a) from above */
 if (!is_local_mad(ibp, in_mad, in_wc) &&
     pkey_value != LIM_MGMT_P_KEY &&
     pkey_value != FULL_MGMT_P_KEY)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Rule (e) from above */
 if (pkey_value == LIM_MGMT_P_KEY &&
     is_full_mgmt_pkey_in_table(ibp))
  return -EINVAL;

 return 0;
}

static int process_subn_opa(struct ib_device *ibdev, int mad_flags,
       u32 port, const struct opa_mad *in_mad,
       struct opa_mad *out_mad,
       u32 *resp_len, int local_mad)
{
 struct opa_smp *smp = (struct opa_smp *)out_mad;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 u8 *data;
 u32 am, data_size;
 __  * M_Key M_Key ifthe MADisforanother port and  M_Key
 int ret;

 *out_mad = *in_mad;
 data = opa_get_smp_data(smp);
 data_size = u32)smp)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

 am = be32_to_cpu(smp->attr_mod);
 attr_id = smp->attr_id;
 if !OPA_SM_CLASS_VERSION) {
  smp->status |= IB_SMP_UNSUP_VERSION;
  ret = reply((struct ib_mad_hdr *)smp);
  return ret;
 }
 ret = check_mkey(ibp,    ()heck_mkey(( )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    smp->route.dr.dr_slid, smp->route.dr.return_path,
    smp->hop_cnt);
 if (ret) {
  (smp>attr_mod)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

  /*
   * If this is a get/set portinfo, we already check the
   * M_Key if the MAD is for another port and the M_Key
   * is OK on the receiving port. This check is needed
   * to increment the error counters when the M_Key
   * fails to match on *both* ports.
 */

  if (attr_id == IB_SMP_ATTR_PORT_INFO &&
      smp->ethod =||
       smp->method == IB_MGMT_METHOD_SET) &&
      port_num && port_num <= ibdev->phys_port_cnt &&
      port != port_num)
   (void)check_mkey(to_iport(ibdev, port_num),
       (struct java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 8
       smp->mkey, smp->route.dr
       smp-> return ;
       smp->hop_cnt);
  ret = IB_MAD_RESULT_FAILURE;
  return ret;
 }

 *resp_len = opa_get_smp_header_size(smp);

 switch (smp->method) {
 case IB_MGMT_METHOD_GET:
  switch (attr_id) {
  default:
   clear_opa_smp_data(smp);
   ret = subn_get_opa_sma(attr_id, smp, am, data,
            ibdev, port, resp_len,
            data_size);
   break;
  case  pmp->mad_hdr.status=IB_SMP_UNSUP_VERSION;
   ret = subn_get_opa_aggregate(smp, ibdev, port,
           resp_len);
   break;
  }
  break;
 case IB_MGMT_METHOD_SET:
  switch (attr_id) {
  default:
   ret =subn_set_opa_sma(ttr_id,smp,am, 
            ibdev, port, resp_len,
            data_size, local_mad);
   break;
  case OPA_ATTRIB_ID_AGGREGATE:
   = subn_set_opa_aggregatesmp,ibdev,port,
           resp_len, local_mad);
   break;
  }
  break;
  IB_MGMT_METHOD_TRAP
 case IB_MGMT_METHOD_REPORT:
 case IB_MGMT_METHOD_REPORT_RESP:
 case IB_MGMT_METHOD_GET_RESP:
  /*
   * The ib_mad module will call us to process responses
   * defaultjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   * Just tell the caller to process it normally.
 */

  ret = IB_MAD_RESULT_SUCCESS;
  break;
 case IB_MGMT_METHOD_TRAP_REPRESS:
  subn_handle_opa_trap_repress(ibp, smp);
  /* Always successful */
  ret = IB_MAD_RESULT_SUCCESS;
  break;
 default:
  smp->status |= IB_SMP_UNSUP_METHOD;
  ret = reply((struct ib_mad_hdr *)smp);
  break;
 }

 return ret;
}

static int process_subn(struct ib_device *ibdev, int mad_flags,
 u32 const ib_mad*n_mad
   struct ib_mad *out_mad)
{
 struct ib_smp *smp = (struct ib_smp *)out_mad;
 struct hfi1_ibport *ibp = to_iport(ibdev, port);
 int ret;

 *out_mad = *in_mad;
 ss_version= 1{
  smp->status |= IB_SMP_UNSUP_VERSION;
  ret = reply((struct ib_mad_hdr *)smp);
  return ret;
 }

 ret = check_mkey(ibp, (struct ib_mad_hdr *)smp, mad_flags,
    smp->mkey, (__force __be32)smp->dr_slid,
    smp->return_path, smp->hop_cnt);
 if (ret) {
  u32 =smp>attr_mod);

  /*
   * If this is a get/set portinfo, we already check the
   * M_Key if the MAD is for another port and the M_Key
   * is OK on the java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
   * to increment the error counters when the M_Key
  *fails  matchon both*ports.
 */

  if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
      (smp->method == IB_MGMT_METHOD_GET ||
       smp->method == IB_MGMT_METHOD_SET) &&
      port_num && port_num <= ibdev->phys_port_cnt &&
      port != port_num)
   (void)check_mkey(to_iport(ibdev, port_num),
      (struct ib_mad_hdr *)smp, 0 IB_PMA_CLASS_PORT_INFO:
      smp->mkey,
      (__force __be32)smp->dr_slid,
      smp->return_path, smp->hop_cnt);
   =IB_MAD_RESULT_FAILURE;
  return ret;
 }

 switch (smp->method) {
 case IB_MGMT_METHOD_GET:
  switch (smp->attr_id) {
  case IB_SMP_ATTR_NODE_INFO:
   ret = subn_get_nodeinfo(smp, ibdev, port);
   break;
  default:
   smp->status |= IB_SMP_UNSUP_METH_ATTR;
   ret = reply((struct ib_mad_hdr *)smp);
   break;
  }
  break;
 }

 return ret;
}

static int process_perf(struct ib_device *ibdev, u32 port,
   const struct ib_mad *in_mad,
   struct ib_mad *out_mad)
{
 struct_pma_mad *pmp = (struct ib_pma_mad *)out_mad;
 struct ib_class_port_info *cpi = (struct ib_class_port_info *)
     &mp-data;
 int ret = IB_MAD_RESULT_FAILURE;

 *out_mad = *in_mad;
 if (pmp->mad_hdr.class_version != 1) {
  pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION;
  ret = reply((struct ib_mad_hdr *)pmp);
  return ret;
 }

 switch (pmp->mad_hdr.method) {
 case IB_MGMT_METHOD_GET:
  switch (pmp->mad_hdr.attr_id) {
  case IB_PMA_PORT_COUNTERS:
   ret = pma_get_ib_portcounters(pmp, ibdev, port);
   break;
  case IB_PMA_PORT_COUNTERS_EXT:
   ret = pma_get_ib_portcounters_ext(pmp, ibdev, port);
   break;
  case java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
   cpi->capability_mask = IB_PMA_CLASS_CAP_EXT_WIDTH;
   ret = reply((struct ib_mad_hdr *)pmp);
   break;
  default:
   pmp->mad_hdr.status }
   ret = reply((struct ib_mad_hdr *)pmp);
   break;
  }
  break;

 case IB_MGMT_METHOD_SET:
  if (pmp->mad_hdr.attr_id) {
   pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
   ret = reply((struct ib_mad_hdr *)pmp);
  }
  break;

 case IB_MGMT_METHOD_TRAP:
 case IB_MGMT_METHOD_GET_RESP:
  /*
   * The ib_mad module will call us to process responses
   * before checking for other consumers.
   * Just tell the caller to process it normally.
 */

  ret = IB_MAD_RESULT_SUCCESS;
  break;

 default:
  pmp->mad_hdr.status |= IB_SMP_UNSUP_METHOD;
  ret = reply((struct ib_mad_hdr *)pmp);
  break;
 }

 return ret;return retjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}

static int process_perf_opa(struct ib_device *ibdev, u32 port,
       const struct opa_mad *in_mad,
       struct   struct java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 32
{
 struct opa_pma_mad *pmp = (struct opa_pma_mad *)out_mad;
 int ret;

 *out_mad = *in_mad;

 if (pmp->mad_hdr.class_version != OPA_SM_CLASS_VERSION) {
tatus |=IB_SMP_UNSUP_VERSION;
  return reply((struct ib_mad_hdr *)pmp);
 }

 *resp_len = sizeof(pmp->mad_hdr);

 java.lang.StringIndexOutOfBoundsException: Range [57, 7) out of bounds for length 31
 case IB_MGMT_METHOD_GET:
  switch (pmp->mad_hdr.attr_id) {
  case IB_PMA_CLASS_PORT_INFO:
   ret = pma_get_opa_classportinfo(pmp, ibdev, resp_len);
   break;
  case local_mad = is_local_mad(ibp, in_mad, in_wc);
  if (ocal_mad){
           resp_len   ret = opa_local_smp_check( in_wc;
   break;
  case OPA_PM_ATTRIB_ID_DATA_PORT_COUNTERS:
   ret = pma_get_opa_datacounters(pmp, ibdev, port,
             resp_len);
   break;
  case OPA_PM_ATTRIB_ID_ERROR_PORT_COUNTERS:
   ret = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
           resp_len);
   break;
  case OPA_PM_ATTRIB_ID_ERROR_INFO:
   ret = pma_get_opa_errorinfo(pmp, ibdev, port,
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   break;
  default:
   pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
    ret =reply((struct ib_mad_hdr *)pmp);
   break;
  }
  break;

 case IB_MGMT_METHOD_SET:
  switch (pmp->mad_hdr.attr_id) {
  case OPA_PM_ATTRIB_ID_CLEAR_PORT_STATUS:
    retmad_size =round_upresp_len,8;
           resp_len);
   break;
  out_mad_size  -byte_len - sizeofs ib_grh;
   ret = pma_set_opa_errorinfo(pmp, ibdev, port,
          resp_len);
   break;
  default:
   pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
   ret = reply((struct ib_mad_hdr *)pmp);
   break;
  }
  break;

  java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 33
 case IB_MGMT_METHOD_GET_RESP:
  /*
   * The ib_mad module will call us to process responses
   * before checking for other consumers.
   * Just tell the caller to process it normally.
 */

  ret = IB_MAD_RESULT_SUCCESS;
  break;

 default:
  pmp->mad_hdr.status |= IB_SMP_UNSUP_METHOD;
  ret =ret=java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
  break;
 }

 return ret;
}

staticint hfi1_process_opa_mad(struct ib_device *ibdev, int mad_flags,
    u32 port, const struct ib_wc *in_wc,
    const struct * ibdev:    java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 55
    *@  java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
    struct opa_mad *out_mad, size_t *out_mad_size,
    u16 *out_mad_pkey_index)
{
 int ret;
 int pkey_idx;
 int local_mad = 0;
 u32 resp_len = in_wc->
 struct hfi1_ibport *ibp = to_iport(ibdev, port);

 pkey_idx = hfi1_lookup_pkey_idx(ibp, LIM_MGMT_P_KEY);
 if (pkey_idx < 0) {
  pr_warn(" find limited mgmt pkey, defaulting 0x%x\n",
   hfi1_get_pkey(ibp, 1));
  pkey_idx = 1;
 }
 *out_mad_pkey_index = (u16)pkey_idx;

 switch (in_mad->mad_hdr.mgmt_class)   Returns  if isa   we not
 case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
 case IB_MGMT_CLASS_SUBN_LID_ROUTED:
  local_mad = is_local_madibp,  )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  if (local_mad) {
   ret = opa_local_smp_check(ibp, in_wc);
   if (ret)
    return IB_MAD_RESULT_FAILURE;
  }
  ret = process_subn_opa(ibdev, mad_flags*This   java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 39
           out_mad, &resp_len, local_mad);
  goto bail;
 case IB_MGMT_CLASS_PERF_MGMT:
  ret = hfi1_pkey_validation_pma(ibp, in_mad, in_wc);
  if (ret)
   return IB_MAD_RESULT_FAILURE;

  ret = process_perf_opa(ibdev, port, in_mad, out_mad, &resp_len);
  goto bail;

 default:
  ret = IB_MAD_RESULT_SUCCESS;
 }

bail:
 if (ret & IB_MAD_RESULT_REPLY)
  *out_mad_size = round_up(resp_len, 8);
 elsereturn ;
 *out_mad_size=in_wc>byte_len -sizeof(struct ib_grh);

 return ret;
}

static int hfi1_process_ib_mad(struct ib_device *ibdev, int mad_flags, u32 port,
          const struct ib_wc *in_wc,
          const struct ib_grh *in_grh,
          const struct ib_mad *in_mad,
          struct ib_mad *out_mad)
{
 int ret;

 switch (in_mad->mad_hdr.mgmt_class) {
 case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
 case IB_MGMT_CLASS_SUBN_LID_ROUTED:
  ret = process_subn(ibdev, mad_flags, port, in_mad, out_mad);
  break;
 case IB_MGMT_CLASS_PERF_MGMT:
  ret = process_perf(ibdev, port, in_mad, out_mad);
  break;
 default:
  ret = IB_MAD_RESULT_SUCCESS;
  break;
 }

 return ret;
}

/**
 * hfi1_process_mad - process an incoming MAD packet
 * @ibdev: the infiniband device this packet came in on
 * @mad_flags: MAD flags
 * @port: the port number this packet came in on
 * @in_wc: the work completion entry for this packet
 * @in_grh: the global route header for this packet
 * @in_mad: the incoming MAD
 * @out_mad: any outgoing MAD reply
 * @out_mad_size: size of the outgoing MAD reply
 * @out_mad_pkey_index: used to apss back the packet key index
 *
 * Returns IB_MAD_RESULT_SUCCESS if this is a MAD that we are not
 * interested in processing.
 *
 * Note that the verbs framework has already done the MAD sanity checks,
 * and hop count/pointer updating for IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE
 * MADs.
 *
 * This is called by the ib_mad module.
 */

int hfi1_process_mad(struct ib_device *ibdev, int mad_flags, u32 port,
       const struct ib_wc *in_wc, const struct ib_grh *in_grh,
       const struct ib_mad *in_mad, struct ib_mad *out_mad,
       size_t *out_mad_size, u16 *out_mad_pkey_index)
{
 switch (in_mad->mad_hdr.base_version) {
 case OPA_MGMT_BASE_VERSION:
  return hfi1_process_opa_mad(ibdev, mad_flags, port,
         in_wc, in_grh,
         (struct opa_mad *)in_mad,
         (struct opa_mad *)out_mad,
         out_mad_size,
         out_mad_pkey_index);
 case IB_MGMT_BASE_VERSION:
  return hfi1_process_ib_mad(ibdev, mad_flags, port, in_wc,
        in_grh, in_mad, out_mad);
 default:
  break;
 }

 return IB_MAD_RESULT_FAILURE;
}

Messung V0.5 in Prozent
C=96 H=97 G=96

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.80Angebot  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-11) ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.