Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107035257
D37126.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D37126.diff
View Options
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -464,13 +464,14 @@
uma_zone_t ips_zone;
uma_zone_t ips_portzone;
uma_init ips_pcbinit;
+ size_t ips_size;
const char * ips_zone_name;
const char * ips_portzone_name;
const char * ips_infolock_name;
const char * ips_hashlock_name;
};
-#define INPCBSTORAGE_DEFINE(prot, lname, zname, iname, hname) \
+#define INPCBSTORAGE_DEFINE(prot, ppcb, lname, zname, iname, hname) \
static int \
prot##_inpcb_init(void *mem, int size __unused, int flags __unused) \
{ \
@@ -480,6 +481,7 @@
return (0); \
} \
static struct inpcbstorage prot = { \
+ .ips_size = sizeof(struct ppcb), \
.ips_pcbinit = prot##_inpcb_init, \
.ips_zone_name = zname, \
.ips_portzone_name = zname " ports", \
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -551,7 +551,7 @@
struct inpcbstorage *pcbstor = arg;
pcbstor->ips_zone = uma_zcreate(pcbstor->ips_zone_name,
- sizeof(struct inpcb), NULL, inpcb_dtor, pcbstor->ips_pcbinit,
+ pcbstor->ips_size, NULL, inpcb_dtor, pcbstor->ips_pcbinit,
inpcb_fini, UMA_ALIGN_PTR, UMA_ZONE_SMR);
pcbstor->ips_portzone = uma_zcreate(pcbstor->ips_portzone_name,
sizeof(struct inpcbport), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -182,7 +182,7 @@
}
#endif /* INET */
-INPCBSTORAGE_DEFINE(ripcbstor, "rawinp", "ripcb", "rip", "riphash");
+INPCBSTORAGE_DEFINE(ripcbstor, inpcb, "rawinp", "ripcb", "rip", "riphash");
static void
rip_init(void *arg __unused)
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1148,7 +1148,7 @@
#define ISN_LOCK() mtx_lock(&isn_mtx)
#define ISN_UNLOCK() mtx_unlock(&isn_mtx)
-INPCBSTORAGE_DEFINE(tcpcbstor, "tcpinp", "tcp_inpcb", "tcp", "tcphash");
+INPCBSTORAGE_DEFINE(tcpcbstor, inpcb, "tcpinp", "tcp_inpcb", "tcp", "tcphash");
/*
* Take a value and get the next power of 2 that doesn't overflow.
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -170,9 +170,9 @@
struct mbuf *, struct thread *, int);
#endif
-INPCBSTORAGE_DEFINE(udpcbstor, "udpinp", "udp_inpcb", "udp", "udphash");
-INPCBSTORAGE_DEFINE(udplitecbstor, "udpliteinp", "udplite_inpcb", "udplite",
- "udplitehash");
+INPCBSTORAGE_DEFINE(udpcbstor, inpcb, "udpinp", "udp_inpcb", "udp", "udphash");
+INPCBSTORAGE_DEFINE(udplitecbstor, inpcb, "udpliteinp", "udplite_inpcb",
+ "udplite", "udplitehash");
static void
udp_vnet_init(void *arg __unused)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 7:31 AM (12 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15740661
Default Alt Text
D37126.diff (2 KB)
Attached To
Mode
D37126: inpcb: allow to provide protocol specific pcb size
Attached
Detach File
Event Timeline
Log In to Comment