Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108212951
D20317.id57563.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
D20317.id57563.diff
View Options
Index: sys/netinet/netdump/netdump_client.c
===================================================================
--- sys/netinet/netdump/netdump_client.c
+++ sys/netinet/netdump/netdump_client.c
@@ -114,6 +114,8 @@
/* Must be at least as big as the chunks dumpsys() gives us. */
static unsigned char nd_buf[MAXDUMPPGS * PAGE_SIZE];
+static off_t nd_tx_offset;
+static off_t nd_buf_offset;
static uint32_t nd_seqno;
static int dump_failed, have_gw_mac;
static void (*drv_if_input)(struct ifnet *, struct mbuf *);
@@ -944,6 +946,12 @@
virtual, (uintmax_t)offset, length);
if (virtual == NULL) {
+ if (nd_buf_offset != 0) {
+ error = netdump_send(NETDUMP_VMCORE, nd_tx_offset, nd_buf, nd_buf_offset);
+ if (error != 0) {
+ dump_failed = 1;
+ }
+ }
if (dump_failed != 0)
printf("failed to dump the kernel core\n");
else if (netdump_send(NETDUMP_FINISHED, 0, NULL, 0) != 0)
@@ -956,12 +964,19 @@
if (length > sizeof(nd_buf))
return (ENOSPC);
- memmove(nd_buf, virtual, length);
- error = netdump_send(NETDUMP_VMCORE, offset, nd_buf, length);
- if (error != 0) {
- dump_failed = 1;
- return (error);
+ if (nd_buf_offset + length > sizeof(nd_buf)) {
+ error = netdump_send(NETDUMP_VMCORE, nd_tx_offset, nd_buf, nd_buf_offset);
+ if (error != 0) {
+ dump_failed = 1;
+ return (error);
+ }
+ nd_buf_offset = 0;
+ nd_tx_offset = offset;
}
+
+ memmove(nd_buf + nd_buf_offset, virtual, length);
+ nd_buf_offset += length;
+
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 23, 5:26 PM (7 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16059748
Default Alt Text
D20317.id57563.diff (1 KB)
Attached To
Mode
D20317: Netdump: coalesce writes less than buffer size for more efficient use of network
Attached
Detach File
Event Timeline
Log In to Comment