PERFORCE change 119315 for review
Kip Macy
kmacy at FreeBSD.org
Sun May 6 02:12:31 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119315
Change 119315 by kmacy at kmacy_vt-x:opentoe_init on 2007/05/06 02:12:12
move mbufq routines into separate header
Affected files ...
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_adapter.h#16 edit
.. //depot/projects/opentoe/sys/dev/cxgb/sys/mbufq.h#1 add
Differences ...
==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_adapter.h#16 (text+ko) ====
@@ -60,62 +60,12 @@
#include <dev/pci/pcivar.h>
#include <dev/cxgb/ulp/toecore/toedev.h>
+#include <dev/cxgb/sys/mbufq.h>
+
struct adapter;
struct sge_qset;
extern int cxgb_debug;
-/*
- * Put here for now until a more appropriate place is found
- */
-struct mbuf_head {
- struct mbuf *head;
- struct mbuf *tail;
- uint32_t qlen;
- struct mtx lock;
-};
-
-static __inline void
-mbufq_init(struct mbuf_head *l)
-{
- l->head = l->tail = NULL;
-}
-
-static __inline int
-mbufq_empty(struct mbuf_head *l)
-{
- return (l->head == NULL);
-}
-
-static __inline void
-mbufq_tail(struct mbuf_head *l, struct mbuf *m)
-{
- l->qlen++;
- l->tail->m_nextpkt = m;
- l->tail = m;
-}
-
-static __inline struct mbuf *
-mbufq_dequeue(struct mbuf_head *l)
-{
- struct mbuf *m;
-
- m = l->head;
- if (m) {
- if (m == l->tail)
- l->tail = NULL;
- l->head = m->m_nextpkt;
- l->qlen--;
- }
-
- return (m);
-}
-
-static __inline struct mbuf *
-mbufq_peek(struct mbuf_head *l)
-{
- return (l->head);
-}
-
struct port_info {
struct adapter *adapter;
struct ifnet *ifp;
More information about the p4-projects
mailing list