Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/ipp/ipgpc/classifierddi.c
          +++ new/usr/src/uts/common/ipp/ipgpc/classifierddi.c
↓ open down ↓ 405 lines elided ↑ open up ↑
 406  406          callout_pos = priv->proc;
 407  407          ill_idx = priv->ill_index;
 408  408  
 409  409          /* If we don't get an M_DATA, then return an error */
 410  410          if (mp->b_datap->db_type != M_DATA) {
 411  411                  if ((mp->b_cont != NULL) &&
 412  412                      (mp->b_cont->b_datap->db_type == M_DATA)) {
 413  413                          mp = mp->b_cont; /* jump over the M_CTL into M_DATA */
 414  414                  } else {
 415  415                          ipgpc0dbg(("ipgpc_invoke_action: no data\n"));
 416      -                        atomic_add_64(&ipgpc_epackets, 1);
      416 +                        atomic_inc_64(&ipgpc_epackets);
 417  417                          return (EINVAL);
 418  418                  }
 419  419          }
 420  420  
 421  421          /*
 422  422           * Translate the callout_pos into the direction the packet is traveling
 423  423           */
 424  424          if (callout_pos != IPP_LOCAL_IN) {
 425  425                  if (callout_pos & IPP_LOCAL_OUT) {
 426  426                          callout_pos = IPP_LOCAL_OUT;
↓ open down ↓ 51 lines elided ↑ open up ↑
 478  478  
 479  479          /* classify this packet */
 480  480          out_class = ipgpc_classify(af, &pkt);
 481  481  
 482  482          if (ipgpc_debug > 3) {
 483  483                  end = gethrtime(); /* stop timer */
 484  484          }
 485  485  
 486  486          /* ipgpc_classify will only return NULL if a memory error occured */
 487  487          if (out_class == NULL) {
 488      -                atomic_add_64(&ipgpc_epackets, 1);
      488 +                atomic_inc_64(&ipgpc_epackets);
 489  489                  return (ENOMEM);
 490  490          }
 491  491  
 492  492          ipgpc1dbg(("ipgpc_invoke_action: class = %s", out_class->class_name));
 493  493          /* print time to classify(..) */
 494  494          ipgpc2dbg(("ipgpc_invoke_action: time = %lld nsec\n", (end - start)));
 495  495  
 496  496          if ((rc = ipp_packet_add_class(packet, out_class->class_name,
 497  497              out_class->next_action)) != 0) {
 498      -                atomic_add_64(&ipgpc_epackets, 1);
      498 +                atomic_inc_64(&ipgpc_epackets);
 499  499                  ipgpc0dbg(("ipgpc_invoke_action: ipp_packet_add_class " \
 500  500                      "failed with error %d", rc));
 501  501                  return (rc);
 502  502          }
 503  503          return (ipp_packet_next(packet, IPP_ACTION_CONT));
 504  504  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX