PERFORCE change 126450 for review
Kip Macy
kmacy at FreeBSD.org
Sat Sep 15 14:06:52 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126450
Change 126450 by kmacy at kmacy_home:ethng on 2007/09/15 21:06:41
pass ref to iovappend to avoid lookup
Affected files ...
.. //depot/projects/ethng/src/sys/dev/cxgb/sys/mvec.h#3 edit
.. //depot/projects/ethng/src/sys/dev/cxgb/sys/uipc_mvec.c#2 edit
Differences ...
==== //depot/projects/ethng/src/sys/dev/cxgb/sys/mvec.h#3 (text+ko) ====
@@ -78,7 +78,7 @@
}
static __inline void
-m_iovappend(struct mbuf *m, uint8_t *cl, int size, int len, int offset)
+m_iovappend(struct mbuf *m, uint8_t *cl, int size, int len, int offset, volatile uint32_t *ref)
{
struct mbuf_vec *mv = mtomv(m);
struct mbuf_iovec *iov;
@@ -96,6 +96,7 @@
iov->mi_base = cl;
iov->mi_len = len;
iov->mi_offset = offset;
+ iov->mi_refcnt = ref;
m->m_pkthdr.len += len;
m->m_len += len;
mv->mv_count++;
@@ -128,6 +129,8 @@
{
struct mbuf *n = m->m_next;
+ prefetch(n);
+
m->m_pkthdr.rss_hash = 0;
if (m->m_flags & M_IOVEC)
==== //depot/projects/ethng/src/sys/dev/cxgb/sys/uipc_mvec.c#2 (text+ko) ====
@@ -79,6 +79,7 @@
{
int i, offset, type, first, len;
uint8_t *cl;
+ volatile uint32_t *ref;
struct mbuf *m0, *head = NULL;
struct mbuf_vec *mv;
@@ -101,6 +102,7 @@
type = mbuf_vec_get_type(mv, i);
cl = mv->mv_vec[i].mi_base;
offset = mv->mv_vec[i].mi_offset;
+ ref = mv->mv_vec[i].mi_refcnt;
len = mv->mv_vec[i].mi_len;
if (__predict_false(type == EXT_MBUF)) {
m0 = (struct mbuf *)cl;
@@ -118,10 +120,10 @@
}
m0->m_flags = 0;
- m_cljset(m0, (uint8_t *)cl, type);
+ m_cljset(m0, (uint8_t *)cl, type, ref);
m0->m_len = mv->mv_vec[i].mi_len;
if (offset)
- m_adj(m0, offset);
+ m->m_data += offset;
skip_cluster:
m0->m_next = head;
m->m_len -= m0->m_len;
@@ -129,11 +131,12 @@
}
offset = mv->mv_vec[first].mi_offset;
cl = mv->mv_vec[first].mi_base;
+ ref = mv->mv_vec[first].mi_refcnt;
type = mbuf_vec_get_type(mv, first);
m->m_flags &= ~(M_IOVEC);
- m_cljset(m, cl, type);
+ m_cljset(m, cl, type, ref);
if (offset)
- m_adj(m, offset);
+ m->m_data += offset;
m->m_next = head;
head = m;
M_SANITY(m, 0);
More information about the p4-projects
mailing list