Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2015 14:58:55 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276824 - in head/sys/ofed/drivers/infiniband/ulp: ipoib sdp
Message-ID:  <201501081458.t08Ewt83018003@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Jan  8 14:58:54 2015
New Revision: 276824
URL: https://svnweb.freebsd.org/changeset/base/276824

Log:
  Use the M_SIZE() macro when possible.
  
  MFC after:	3 days
  Suggested by:	rwatson@

Modified:
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
  head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c

Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c	Thu Jan  8 14:45:54 2015	(r276823)
+++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c	Thu Jan  8 14:58:54 2015	(r276824)
@@ -117,8 +117,7 @@ ipoib_alloc_map_mb(struct ipoib_dev_priv
 	if (mb == NULL)
 		return (NULL);
 	for (i = 0, m = mb; m != NULL; m = m->m_next, i++) {
-		m->m_len = (m->m_flags & M_EXT) ? m->m_ext.ext_size :
-		    ((m->m_flags & M_PKTHDR) ? MHLEN : MLEN);
+		m->m_len = M_SIZE(m);
 		mb->m_pkthdr.len += m->m_len;
 		rx_req->mapping[i] = ib_dma_map_single(priv->ca,
 		    mtod(m, void *), m->m_len, DMA_FROM_DEVICE);

Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	Thu Jan  8 14:45:54 2015	(r276823)
+++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	Thu Jan  8 14:58:54 2015	(r276824)
@@ -116,8 +116,7 @@ sdp_post_recv(struct sdp_sock *ssk)
 		return -1;
 	}
 	for (m = mb; m != NULL; m = m->m_next) {
-		m->m_len = (m->m_flags & M_EXT) ? m->m_ext.ext_size :
-                        ((m->m_flags & M_PKTHDR) ? MHLEN : MLEN);
+		m->m_len = M_SIZE(m);
 		mb->m_pkthdr.len += m->m_len;
 	}
 	h = mtod(mb, struct sdp_bsdh *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501081458.t08Ewt83018003>