Date: Sat, 27 Sep 2014 20:39:25 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272225 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <201409272039.s8RKdPsA064329@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Sat Sep 27 20:39:24 2014 New Revision: 272225 URL: http://svnweb.freebsd.org/changeset/base/272225 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Sat Sep 27 20:39:24 2014 (r272225) @@ -510,7 +510,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ ipoib_dbg(priv, "cm recv error " "(status=%d, wrid=%d vend_err %x)\n", wc->status, wr_id, wc->vendor_err); - ++dev->if_ierrors; + if_inc_counter(dev, IFCOUNTER_IERRORS, 1); if (has_srq) goto repost; else { @@ -542,7 +542,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ * this packet and reuse the old buffer. */ ipoib_dbg(priv, "failed to allocate receive buffer %d\n", wr_id); - ++dev->if_ierrors; + if_inc_counter(dev, IFCOUNTER_IERRORS, 1); memcpy(&rx_ring[wr_id], &saverx, sizeof(saverx)); goto repost; } @@ -554,8 +554,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ ipoib_dma_mb(priv, mb, wc->byte_len); - ++dev->if_ipackets; - dev->if_ibytes += mb->m_pkthdr.len; + if_inc_counter(dev, IFCOUNTER_IPACKETS, 1); + if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len); mb->m_pkthdr.rcvif = dev; proto = *mtod(mb, uint16_t *); @@ -615,7 +615,7 @@ void ipoib_cm_send(struct ipoib_dev_priv if (unlikely(mb->m_pkthdr.len > tx->mtu)) { ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", mb->m_pkthdr.len, tx->mtu); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); ipoib_cm_mb_too_long(priv, mb, IPOIB_CM_MTU(tx->mtu)); return; } @@ -635,7 +635,7 @@ void ipoib_cm_send(struct ipoib_dev_priv tx_req->mb = mb; if (unlikely(ipoib_dma_map_tx(priv->ca, (struct ipoib_tx_buf *)tx_req, priv->cm.num_frags))) { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); if (tx_req->mb) m_freem(tx_req->mb); return; @@ -643,7 +643,7 @@ void ipoib_cm_send(struct ipoib_dev_priv if (unlikely(post_send(priv, tx, tx_req, tx->tx_head & (ipoib_sendq_size - 1)))) { ipoib_warn(priv, "post_send failed\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); ipoib_dma_unmap_tx(priv->ca, (struct ipoib_tx_buf *)tx_req); m_freem(mb); } else { @@ -681,7 +681,7 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ ipoib_dma_unmap_tx(priv->ca, (struct ipoib_tx_buf *)tx_req); /* FIXME: is this right? Shouldn't we only increment on success? */ - ++dev->if_opackets; + if_inc_counter(dev, IFCOUNTER_OPACKETS, 1); m_freem(tx_req->mb); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Sat Sep 27 20:39:24 2014 (r272225) @@ -250,8 +250,8 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_p ipoib_dma_unmap_rx(priv, &saverx); ipoib_dma_mb(priv, mb, wc->byte_len); - ++dev->if_ipackets; - dev->if_ibytes += mb->m_pkthdr.len; + if_inc_counter(dev, IFCOUNTER_IPACKETS, 1); + if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len); mb->m_pkthdr.rcvif = dev; m_adj(mb, sizeof(struct ib_grh) - INFINIBAND_ALEN); eh = mtod(mb, struct ipoib_header *); @@ -344,7 +344,7 @@ static void ipoib_ib_handle_tx_wc(struct ipoib_dma_unmap_tx(priv->ca, tx_req); - ++dev->if_opackets; + if_inc_counter(dev, IFCOUNTER_OPACKETS, 1); m_freem(tx_req->mb); @@ -487,7 +487,7 @@ ipoib_send(struct ipoib_dev_priv *priv, phead = mtod(mb, void *); if (mb->m_len < hlen) { ipoib_warn(priv, "linear data too small\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); return; } @@ -496,7 +496,7 @@ ipoib_send(struct ipoib_dev_priv *priv, if (unlikely(mb->m_pkthdr.len - IPOIB_ENCAP_LEN > priv->mcast_mtu)) { ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", mb->m_pkthdr.len, priv->mcast_mtu); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); ipoib_cm_mb_too_long(priv, mb, priv->mcast_mtu); return; } @@ -517,7 +517,7 @@ ipoib_send(struct ipoib_dev_priv *priv, tx_req = &priv->tx_ring[priv->tx_head & (ipoib_sendq_size - 1)]; tx_req->mb = mb; if (unlikely(ipoib_dma_map_tx(priv->ca, tx_req, IPOIB_UD_TX_SG))) { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); if (tx_req->mb) m_freem(tx_req->mb); return; @@ -539,7 +539,7 @@ ipoib_send(struct ipoib_dev_priv *priv, priv->tx_head & (ipoib_sendq_size - 1), address->ah, qpn, tx_req, phead, hlen))) { ipoib_warn(priv, "post_send failed\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); --priv->tx_outstanding; ipoib_dma_unmap_tx(priv->ca, tx_req); m_freem(mb); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Sep 27 20:39:24 2014 (r272225) @@ -665,7 +665,7 @@ ipoib_unicast_send(struct mbuf *mb, stru } else __path_add(priv, path); } else { - ++priv->dev->if_oerrors; + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); m_freem(mb); } @@ -680,7 +680,7 @@ ipoib_unicast_send(struct mbuf *mb, stru path->queue.ifq_len < IPOIB_MAX_PATH_REC_QUEUE) { _IF_ENQUEUE(&path->queue, mb); } else { - ++priv->dev->if_oerrors; + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); m_freem(mb); } } Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sat Sep 27 20:39:24 2014 (r272225) @@ -70,7 +70,7 @@ static void ipoib_mcast_free(struct ipoi tx_dropped = mcast->pkt_queue.ifq_len; _IF_DRAIN(&mcast->pkt_queue); /* XXX Locking. */ - dev->if_oerrors += tx_dropped; + if_inc_counter(dev, IFCOUNTER_OERRORS, tx_dropped); kfree(mcast); } @@ -255,7 +255,7 @@ ipoib_mcast_sendonly_join_complete(int s mcast->mcmember.mgid.raw, ":", status); /* Flush out any queued packets */ - priv->dev->if_oerrors += mcast->pkt_queue.ifq_len; + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, mcast->pkt_queue.ifq_len); _IF_DRAIN(&mcast->pkt_queue); /* Clear the busy flag so we try again */ @@ -617,7 +617,7 @@ ipoib_mcast_send(struct ipoib_dev_priv * if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) || !priv->broadcast || !test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); return; } @@ -632,7 +632,7 @@ ipoib_mcast_send(struct ipoib_dev_priv * if (!mcast) { ipoib_warn(priv, "unable to allocate memory for " "multicast structure\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); goto out; } @@ -647,7 +647,7 @@ ipoib_mcast_send(struct ipoib_dev_priv * if (mcast->pkt_queue.ifq_len < IPOIB_MAX_MCAST_QUEUE) { _IF_ENQUEUE(&mcast->pkt_queue, mb); } else { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409272039.s8RKdPsA064329>