summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/smbsrv/mbuf.h
diff options
context:
space:
mode:
authorGordon Ross <gwr@nexenta.com>2013-06-26 16:05:44 -0400
committerGordon Ross <gwr@nexenta.com>2015-11-06 12:22:30 -0500
commita90cf9f29973990687fa61de9f1f6ea22e924e40 (patch)
tree42f77e59c4470ef6d2ba3118ba6c75e43686c398 /usr/src/uts/common/smbsrv/mbuf.h
parentb24e356b384ccc80805e7150979de2373d44347c (diff)
downloadillumos-joyent-a90cf9f29973990687fa61de9f1f6ea22e924e40.tar.gz
6399 SMB2 support
Portions contributed by: Alek Pinchuk <alek@nexenta.com> Portions contributed by: Kevin Crowe <kevin.crowe@nexenta.com> Portions contributed by: Matt Barden <Matt.Barden@nexenta.com> Reviewed by: Alek Pinchuk <alek@nexenta.com> Reviewed by: Bayard Bell <bayard.bell@nexenta.com> Reviewed by: Dan Fields <dan.fields@nexenta.com> Reviewed by: Daniel Borek <daniel.borek@nexenta.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com> Reviewed by: Matt Barden <matt.barden@nexenta.com> Reviewed by: Yuri Pankov <Yuri.Pankov@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/smbsrv/mbuf.h')
-rw-r--r--usr/src/uts/common/smbsrv/mbuf.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/usr/src/uts/common/smbsrv/mbuf.h b/usr/src/uts/common/smbsrv/mbuf.h
index 4b66be8715..0bec3a1a5a 100644
--- a/usr/src/uts/common/smbsrv/mbuf.h
+++ b/usr/src/uts/common/smbsrv/mbuf.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -61,28 +61,20 @@
#define _SMBSRV_MBUF_H
/*
- * PBSHORTCUT This file should be removed from the PB port but is required
- * for now to get it to compile. This file has also been modified.
+ * This mbuf simulation should be replaced with (native) mblk_t support.
*/
#include <sys/types.h>
#include <sys/param.h>
-#include <sys/list.h>
+#include <sys/kmem.h>
#include <smbsrv/string.h>
-#include <smbsrv/alloc.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MSIZE 256
-#define MCLBYTES 2048
-#define MCLSHIFT 11
-#define MCLOFSET (MCLBYTES - 1)
-
-#define NBPG 4096
-#define CLBYTES NBPG
-#define PB_PAGESIZE 4096
+#define MCLBYTES 8192
/*
* Mbufs are of a single size, MSIZE (machine/machparam.h), which
@@ -120,8 +112,6 @@ struct pkthdr {
};
-/* XXX probably do not need m_ext */
-
/* description of external storage mapped into mbuf, valid if M_EXT set */
struct m_ext {
caddr_t ext_buf; /* start of buffer */
@@ -209,7 +199,7 @@ typedef struct mbuf {
*/
#define MGET(m, how, type) { \
- m = MEM_ZALLOC("mbuf", sizeof (struct mbuf)); \
+ m = smb_mbuf_alloc(); \
(m)->m_next = (struct mbuf *)NULL; \
(m)->m_nextpkt = (struct mbuf *)NULL; \
(m)->m_data = (m)->m_dat; \
@@ -218,7 +208,7 @@ typedef struct mbuf {
}
#define MGETHDR(m, how, type) { \
- m = MEM_ZALLOC("mbuf", sizeof (struct mbuf)); \
+ m = smb_mbuf_alloc(); \
(m)->m_type = (MT_HEADER); \
(m)->m_next = (struct mbuf *)NULL; \
(m)->m_nextpkt = (struct mbuf *)NULL; \
@@ -226,15 +216,13 @@ typedef struct mbuf {
(m)->m_flags = M_PKTHDR; \
}
-extern int mclref();
-extern int mclrefnoop();
#define MCLGET(m, how) \
{ \
- (m)->m_ext.ext_buf = MEM_ZALLOC("mbuf", MCLBYTES); \
+ (m)->m_ext.ext_buf = smb_mbufcl_alloc(); \
(m)->m_data = (m)->m_ext.ext_buf; \
(m)->m_flags |= M_EXT; \
(m)->m_ext.ext_size = MCLBYTES; \
- (m)->m_ext.ext_ref = mclref; \
+ (m)->m_ext.ext_ref = smb_mbufcl_ref; \
}
/*
@@ -251,7 +239,7 @@ extern int mclrefnoop();
} \
(nn) = (m)->m_next; \
(m)->m_next = 0; \
- MEM_FREE("mbuf", m); \
+ smb_mbuf_free(m); \
}
@@ -268,7 +256,6 @@ extern int mclrefnoop();
typedef struct mbuf_chain {
uint32_t mbc_magic;
- list_node_t mbc_lnd;
volatile uint32_t flags; /* Various flags */
struct mbuf_chain *shadow_of; /* I'm shadowing someone */
mbuf_t *chain; /* Start of chain */
@@ -276,9 +263,15 @@ typedef struct mbuf_chain {
int32_t chain_offset; /* Current offset into chain */
} mbuf_chain_t;
+mbuf_t *smb_mbuf_alloc(void);
+void smb_mbuf_free(mbuf_t *);
+
+void *smb_mbufcl_alloc(void);
+void smb_mbufcl_free(void *);
+int smb_mbufcl_ref(void *, uint_t, int);
+
mbuf_t *m_free(mbuf_t *);
void m_freem(mbuf_t *);
-int mbc_moveout(mbuf_chain_t *, caddr_t, int, int *);
void smb_mbc_init(void);
void smb_mbc_fini(void);
mbuf_chain_t *smb_mbc_alloc(uint32_t);