Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154835978
D24204.id70003.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D24204.id70003.diff
View Options
Index: sys/kern/uipc_sockbuf.c
===================================================================
--- sys/kern/uipc_sockbuf.c
+++ sys/kern/uipc_sockbuf.c
@@ -112,6 +112,33 @@
for (m = m0; m != end; m = m->m_next) {
MPASS((m->m_flags & M_NOTREADY) == 0);
+ n = m->m_next;
+#ifdef KERN_TLS
+ /* try to coalesce adjacent ktls mbuf hdr/trailers */
+ if ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 &&
+ (m->m_flags & M_NOMAP) &&
+ (n->m_flags & M_NOMAP) &&
+ !mbuf_has_tls_session(m) &&
+ !mbuf_has_tls_session(n)) {
+ struct mbuf_ext_pgs *mpgs, *npgs;
+ int hdr_len, trail_len;
+
+ mpgs = m->m_ext.ext_pgs;
+ npgs = n->m_ext.ext_pgs;
+ hdr_len = npgs->hdr_len;
+ trail_len = mpgs->trail_len;
+ if (trail_len != 0 && hdr_len != 0 &&
+ trail_len + hdr_len <= MBUF_PEXT_TRAIL_LEN) {
+ /* copy n's header to m's trailer */
+ memcpy(&mpgs->trail[trail_len], npgs->hdr,
+ hdr_len);
+ mpgs->trail_len += hdr_len;
+ m->m_len += hdr_len;
+ npgs->hdr_len = 0;
+ n->m_len -= hdr_len;
+ }
+ }
+#endif
/* Compress small unmapped mbufs into plain mbufs. */
if ((m->m_flags & M_NOMAP) && m->m_len <= MLEN &&
@@ -130,9 +157,8 @@
* into the trailing space of 'n'. Here, the roles
* are reversed and 'n' is the next mbuf after 'm'
* that is being copied into the trailing space of
- * 'm'.
+ * 'm'. Note that 'n' is initialized above.
*/
- n = m->m_next;
while ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 &&
M_WRITABLE(m) &&
(m->m_flags & M_NOMAP) == 0 &&
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 1:39 PM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32520168
Default Alt Text
D24204.id70003.diff (1 KB)
Attached To
Mode
D24204: KTLS: Coalesce adjacent TLS trailers & headers to improve PCIe bus efficiency
Attached
Detach File
Event Timeline
Log In to Comment