From 4b8c406aee5ff24aea2b32170a2d27f2d248ace3 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 3 Oct 2008 10:27:42 +0000 Subject: [PATCH 01/16] Adjust for recent devd(8) import. --- etc/Makefile | 5 +++-- etc/rc.d/Makefile | 4 ++-- share/man/man5/rc.conf.5 | 19 +++++++++++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index 9f3aa6428a..ea4857f8e5 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,6 +1,6 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 # $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $ -# $DragonFly: src/etc/Makefile,v 1.216 2008/09/01 20:54:35 dillon Exp $ +# $DragonFly: src/etc/Makefile,v 1.217 2008/10/03 10:27:42 swildner Exp $ .if !defined(NO_SENDMAIL) SUBDIR= sendmail @@ -26,7 +26,8 @@ BINUPDATE+=${.CURDIR}/../usr.bin/mail/misc/mail.rc \ # BIN1= amd.map auth.conf \ crontab csh.cshrc csh.login csh.logout \ - devices.conf dhclient.conf dm.conf dntpd.conf ftpusers group \ + devd.conf devices.conf dhclient.conf dm.conf dntpd.conf \ + ftpusers group \ hosts hosts.allow host.conf hosts.equiv hosts.lpd \ inetd.conf login.access login.conf \ motd modems networks newsyslog.conf \ diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index dd66bb4b37..0ede6d0c9d 100644 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -1,10 +1,10 @@ # $NetBSD: Makefile,v 1.16 2001/01/14 15:37:22 minoura Exp $ # $FreeBSD: src/etc/rc.d/Makefile,v 1.20 2003/06/29 05:15:57 mtm Exp $ -# $DragonFly: src/etc/rc.d/Makefile,v 1.30 2008/10/03 00:26:21 hasso Exp $ +# $DragonFly: src/etc/rc.d/Makefile,v 1.31 2008/10/03 10:27:42 swildner Exp $ .include -# note: bgfsk, devd, devfs, and lomac left out (from 5.0) +# note: bgfsk, devfs, and lomac left out (from 5.0) # FILES= DAEMON LOGIN NETWORKING SERVERS abi accounting addswap adjkerntz \ amd apm apmd atm1 atm2.sh atm3.sh \ diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 492a383296..ef078567fc 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -23,8 +23,8 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.197 2003/07/28 13:56:00 mbr Exp $ -.\" $DragonFly: src/share/man/man5/rc.conf.5,v 1.59 2008/08/30 17:50:43 swildner Exp $ -.Dd January 30, 2008 +.\" $DragonFly: src/share/man/man5/rc.conf.5,v 1.60 2008/10/03 10:27:42 swildner Exp $ +.Dd October 3, 2008 .Dt RC.CONF 5 .Os .Sh NAME @@ -149,6 +149,20 @@ is set to these are the flags to pass to the .Xr battd 8 daemon. +.It Va devd_enable +.Pq Vt bool +Run +.Xr devd 8 +to handle device added, removed or unknown events from the kernel. +.It Va devd_flags +.Pq Vt str +If +.Va devd_enable +is set to +.Dq Li YES , +these are the flags to pass to the +.Xr devd 8 +daemon. .It Va sensorsd_enable .Pq Vt bool Set to @@ -2838,6 +2852,7 @@ has not completed within the specified time (in seconds). .Xr btconfig 8 , .Xr bthcid 8 , .Xr cron 8 , +.Xr devd 8 , .Xr dhclient 8 , .Xr dntpd 8 , .Xr ftpd 8 , -- 2.41.0 From a0f5bc41952a924a3163ca4603bfb7b36d78ba67 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 3 Oct 2008 10:30:43 +0000 Subject: [PATCH 02/16] Bump .Dd --- sbin/devd/devd.8 | 4 ++-- sbin/devd/devd.conf.5 | 4 ++-- share/man/man4/devctl.4 | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/devd/devd.8 b/sbin/devd/devd.8 index 29b88a6481..e54d05c0ef 100644 --- a/sbin/devd/devd.8 +++ b/sbin/devd/devd.8 @@ -24,9 +24,9 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/sbin/devd/devd.8,v 1.17 2006/09/17 22:49:26 ru Exp $ -.\" $DragonFly: src/sbin/devd/devd.8,v 1.1 2008/10/03 00:26:21 hasso Exp $ +.\" $DragonFly: src/sbin/devd/devd.8,v 1.2 2008/10/03 10:30:43 swildner Exp $ .\" -.Dd November 24, 2005 +.Dd October 2, 2008 .Dt DEVD 8 .Os .Sh NAME diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 4d06ff3103..25d3718d7e 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/sbin/devd/devd.conf.5,v 1.11 2006/10/24 20:20:41 ru Exp $ -.\" $DragonFly: src/sbin/devd/devd.conf.5,v 1.1 2008/10/03 00:26:21 hasso Exp $ +.\" $DragonFly: src/sbin/devd/devd.conf.5,v 1.2 2008/10/03 10:30:43 swildner Exp $ .\" .\" The section on comments was taken from named.conf.5, which has the .\" following copyright: @@ -42,7 +42,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd October 25, 2006 +.Dd October 2, 2008 .Dt DEVD.CONF 5 .Os .Sh NAME diff --git a/share/man/man4/devctl.4 b/share/man/man4/devctl.4 index 5b9ace3829..291e1ea94e 100644 --- a/share/man/man4/devctl.4 +++ b/share/man/man4/devctl.4 @@ -23,9 +23,9 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/devctl.4,v 1.5 2006/08/04 07:56:32 yar Exp $ -.\" $DragonFly: src/share/man/man4/devctl.4,v 1.1 2008/10/03 00:26:21 hasso Exp $ +.\" $DragonFly: src/share/man/man4/devctl.4,v 1.2 2008/10/03 10:30:43 swildner Exp $ .\" -.Dd February 11, 2003 +.Dd October 2, 2008 .Dt DEVCTL 4 .Os .Sh NAME -- 2.41.0 From 8dfecc5f0b84d0ac8f83fef3416809e7c28e9518 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 3 Oct 2008 10:32:10 +0000 Subject: [PATCH 03/16] Remove extra comma and bump .Dd --- share/man/man4/acpi_thinkpad.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/acpi_thinkpad.4 b/share/man/man4/acpi_thinkpad.4 index 58daa8c2b4..f183f646ff 100644 --- a/share/man/man4/acpi_thinkpad.4 +++ b/share/man/man4/acpi_thinkpad.4 @@ -24,9 +24,9 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.\" $DragonFly: src/share/man/man4/acpi_thinkpad.4,v 1.5 2008/10/03 00:47:36 hasso Exp $ +.\" $DragonFly: src/share/man/man4/acpi_thinkpad.4,v 1.6 2008/10/03 10:32:10 swildner Exp $ .\" -.Dd August 28, 2008 +.Dd October 2, 2008 .Dt ACPI_THINKPAD 4 .Os .Sh NAME @@ -53,7 +53,7 @@ driver provides support for hotkeys and other components of IBM/Lenovo Thinkpad laptops. The main purpose of this driver is to provide an interface, accessible via -.Xr sysctl 8 , +.Xr sysctl 8 and .Xr devd 8 , through which applications can determine the status of -- 2.41.0 From 06627c8a33e099b51579210f6a567848309d74f4 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 3 Oct 2008 10:33:49 +0000 Subject: [PATCH 04/16] Re-add some previously removed docs about devd(8) notifies. --- share/man/man4/acpi_thermal.4 | 42 ++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/share/man/man4/acpi_thermal.4 b/share/man/man4/acpi_thermal.4 index 40c1cfda07..9613cc14fd 100644 --- a/share/man/man4/acpi_thermal.4 +++ b/share/man/man4/acpi_thermal.4 @@ -23,9 +23,9 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/acpi_thermal.4,v 1.6 2004/02/03 04:18:55 njl Exp $ -.\" $DragonFly: src/share/man/man4/acpi_thermal.4,v 1.2 2006/07/23 07:47:12 swildner Exp $ +.\" $DragonFly: src/share/man/man4/acpi_thermal.4,v 1.3 2008/10/03 10:33:49 swildner Exp $ .\" -.Dd December 27, 2003 +.Dd October 3, 2008 .Dt ACPI_THERMAL 4 .Os .Sh NAME @@ -39,7 +39,9 @@ The driver provides the thermal management features of the ACPI module. This driver has a .Xr sysctl 8 -interface. +interface and a +.Xr devd 8 +notification interface. The sysctls export properties of each ACPI thermal zone object. .Pp There can be multiple thermal zones in a system. @@ -85,6 +87,40 @@ For example, 300.0K is represented by the integer 3000. To convert to units of Centigrade, the formula is .Li "(x - 2731.5) / 10" . +.Sh NOTIFIES +Notifies are passed to userland via +.Xr devd 8 . +See +.Pa /etc/devd.conf +and +.Xr devd.conf 5 +for examples. +The +.Nm +driver sends events with the following attributes: +.Pp +.Bl -tag -width "subsystem" -compact +.It system +.Li ACPI +.It subsystem +.Li Thermal +.It type +The fully qualified thermal zone object path as in the ASL. +.It notify +An integer designating the event: +.Pp +.Bl -tag -width indent -compact +.It Li 0x80 +Current temperature has changed. +.It Li 0x81 +One or more trip points (_ACx, _PSV) have changed. +.It Li 0x82 +One or more device lists (_ALx, _PSL, _TZD) have changed. +.It Li 0xcc +Non-standard notify that the system will shutdown if the temperature +stays above _CRT or _HOT for one more poll cycle. +.El +.El .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 -- 2.41.0 From 29ae01ddf1f5129f47dba1986bc0e27ee362241e Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 3 Oct 2008 10:46:41 +0000 Subject: [PATCH 05/16] ether_demux() is now ether_demux_oncpu(). --- sbin/ipfw/ipfw.8 | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index a91084cbd2..d4dea436b9 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,8 +1,8 @@ .\" .\" $FreeBSD: src/sbin/ipfw/ipfw.8,v 1.63.2.33 2003/02/04 01:36:02 brueffer Exp $ -.\" $DragonFly: src/sbin/ipfw/ipfw.8,v 1.18 2008/09/02 11:50:45 matthias Exp $ +.\" $DragonFly: src/sbin/ipfw/ipfw.8,v 1.19 2008/10/03 10:46:41 swildner Exp $ .\" -.Dd September 2, 2008 +.Dd October 3, 2008 .Dt IPFW 8 .Os .Sh NAME @@ -321,16 +321,16 @@ in the protocol stack, under control of several sysctl variables. These places and variables are shown below, and it is important to have this picture in mind in order to design a correct ruleset. .Bd -literal -offset indent - ^ to upper layers V - | | - +----------->-----------+ - ^ V - [ip_input] [ip_output] net.inet.ip.fw.enable=1 - | | - ^ V -[ether_demux] [ether_output_frame] net.link.ether.ipfw=1 - ^ V - | to devices | + ^ to upper layers V + | | + +------------>------------+ + ^ V + [ip_input] [ip_output] net.inet.ip.fw.enable=1 + | | + ^ V +[ether_demux_oncpu] [ether_output_frame] net.link.ether.ipfw=1 + ^ V + | to devices | .Ed .Pp As can be noted from the above picture, the number of @@ -344,7 +344,7 @@ for inspection. E.g., incoming packets will include the MAC header when .Nm is invoked from -.Fn ether_demux , +.Fn ether_demux_oncpu , but the same packets will have the MAC header stripped off when .Nm is invoked from @@ -368,7 +368,7 @@ differentiate among the possible places. .Cm skipto rules can be useful here, as an example: .Bd -literal -offset indent -# packets from ether_demux +# packets from ether_demux_oncpu ipfw add 10 skipto 1000 all from any to any layer2 in # packets from ip_input ipfw add 10 skipto 2000 all from any to any not layer2 in @@ -942,7 +942,10 @@ packet is found. .It Cm layer2 Matches only layer2 packets, i.e. those passed to .Nm -from ether_demux() and ether_output_frame(). +from +.Fn ether_demux_oncpu +and +.Fn ether_output_frame . .It Cm limit Bro Cm src-addr | src-port | dst-addr | dst-port Brc Ar N The firewall will only allow .Ar N @@ -1687,7 +1690,7 @@ does not implement sets of rules. .Nm ipfw1 does not implement filtering on MAC header fields, nor is it invoked on packets from -.Fn ether_demux +.Fn ether_demux_oncpu and .Fn ether_output_frame . The sysctl variable -- 2.41.0 From 0827fa7a79ced1a71cef822a635534c4f51fa847 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Fri, 3 Oct 2008 11:35:25 +0000 Subject: [PATCH 06/16] Print hardware revision during attach --- sys/dev/netif/re/if_re.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c index c3d01480c8..f2a6302bfe 100644 --- a/sys/dev/netif/re/if_re.c +++ b/sys/dev/netif/re/if_re.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $ - * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.57 2008/10/03 10:12:35 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.58 2008/10/03 11:35:25 sephe Exp $ */ /* @@ -1234,6 +1234,7 @@ re_attach(device_t dev) break; } } + device_printf(dev, "hardware rev. 0x%08x\n", hwrev); sc->re_eewidth = 6; re_read_eeprom(sc, (caddr_t)&re_did, 0, 1); -- 2.41.0 From 809a273d9dce644ac043f696b8cacc649e66b381 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Fri, 3 Oct 2008 12:30:07 +0000 Subject: [PATCH 07/16] Don't allocate space for empty banners. Makes me able to connect various network equipment again. Obtained-from: OpenBSD CVS --- crypto/openssh-5/sshconnect2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssh-5/sshconnect2.c b/crypto/openssh-5/sshconnect2.c index 389bec9e43..868f26931a 100644 --- a/crypto/openssh-5/sshconnect2.c +++ b/crypto/openssh-5/sshconnect2.c @@ -383,7 +383,7 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt) debug3("input_userauth_banner"); raw = packet_get_string(&len); lang = packet_get_string(NULL); - if (options.log_level >= SYSLOG_LEVEL_INFO) { + if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO) { if (len > 65536) len = 65536; msg = xmalloc(len * 4); /* max expansion from strnvis() */ -- 2.41.0 From 043ecbf0c4caab66f0476f5ef784598c1f7d49bd Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Fri, 3 Oct 2008 14:07:02 +0000 Subject: [PATCH 08/16] Transmit csum offload does not work at all on certain hardware revision once frame length exceeds certain threshold (different parts seems to have different thresholds). Borrow code from ip_output to do software csum, if transmit csum offloading is enabled and frame length exceeds hardware's threshold. 8169, 8169S, 8169SB and 8168B are tested, while 8169S and 8169SB does not seem to have this bug. --- sys/dev/netif/re/if_re.c | 90 ++++++++++++++++++++++++++++++------- sys/dev/netif/re/if_revar.h | 8 +++- 2 files changed, 82 insertions(+), 16 deletions(-) diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c index f2a6302bfe..8d89de91fb 100644 --- a/sys/dev/netif/re/if_re.c +++ b/sys/dev/netif/re/if_re.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $ - * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.58 2008/10/03 11:35:25 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.59 2008/10/03 14:07:02 sephe Exp $ */ /* @@ -111,12 +111,15 @@ * driver is 7422 bytes. */ +#define _IP_VHL + #include "opt_polling.h" #include #include #include #include +#include #include #include #include @@ -137,6 +140,8 @@ #include #include +#include + #include #include @@ -197,20 +202,22 @@ static const struct re_type re_devs[] = { }; static const struct re_hwrev re_hwrevs[] = { - { RE_HWREV_8139CPLUS, RE_8139CPLUS, RE_F_HASMPC, "C+" }, - { RE_HWREV_8168_SPIN1, RE_8169, RE_F_PCIE, "8168" }, - { RE_HWREV_8168_SPIN2, RE_8169, RE_F_PCIE, "8168" }, - { RE_HWREV_8168_SPIN3, RE_8169, RE_F_PCIE, "8168" }, - { RE_HWREV_8168C, RE_8169, RE_F_PCIE, "8168C" }, - { RE_HWREV_8169, RE_8169, RE_F_HASMPC, "8169" }, - { RE_HWREV_8169S, RE_8169, RE_F_HASMPC, "8169S" }, - { RE_HWREV_8110S, RE_8169, RE_F_HASMPC, "8110S" }, - { RE_HWREV_8169_8110SB, RE_8169, RE_F_HASMPC, "8169SB" }, - { RE_HWREV_8169_8110SC, RE_8169, 0, "8169SC" }, - { RE_HWREV_8100E, RE_8169, RE_F_HASMPC, "8100E" }, - { RE_HWREV_8101E, RE_8169, RE_F_PCIE, "8101E" }, - { RE_HWREV_8102EL, RE_8169, RE_F_PCIE, "8102EL" }, - { 0, 0, 0, NULL } + { RE_HWREV_8139CPLUS, RE_8139CPLUS, RE_F_HASMPC, 0, "C+" }, + { RE_HWREV_8168_SPIN1, RE_8169, RE_F_PCIE, 0, "8168" }, + { RE_HWREV_8168_SPIN2, RE_8169, + RE_F_PCIE | RE_F_JUMBO_SWCSUM, RE_SWCSUM_LIM_8168B, "8168" }, + { RE_HWREV_8168_SPIN3, RE_8169, RE_F_PCIE, 0, "8168" }, + { RE_HWREV_8168C, RE_8169, RE_F_PCIE, 0, "8168C" }, + { RE_HWREV_8169, RE_8169, + RE_F_HASMPC | RE_F_JUMBO_SWCSUM, RE_SWCSUM_LIM_8169, "8169" }, + { RE_HWREV_8169S, RE_8169, RE_F_HASMPC, 0, "8169S" }, + { RE_HWREV_8110S, RE_8169, RE_F_HASMPC, 0, "8110S" }, + { RE_HWREV_8169_8110SB, RE_8169, RE_F_HASMPC, 0, "8169SB" }, + { RE_HWREV_8169_8110SC, RE_8169, 0, 0, "8169SC" }, + { RE_HWREV_8100E, RE_8169, RE_F_HASMPC, 0, "8100E" }, + { RE_HWREV_8101E, RE_8169, RE_F_PCIE, 0, "8101E" }, + { RE_HWREV_8102EL, RE_8169, RE_F_PCIE, 0, "8102EL" }, + { 0, 0, 0, 0, NULL } }; static int re_probe(device_t); @@ -1231,6 +1238,7 @@ re_attach(device_t dev) if (hw_rev->re_rev == hwrev) { sc->re_type = hw_rev->re_type; sc->re_flags = hw_rev->re_flags; + sc->re_swcsum_lim = hw_rev->re_swcsum_lim; break; } } @@ -1930,6 +1938,58 @@ re_encap(struct re_softc *sc, struct mbuf **m_head, int *idx0) if (m->m_pkthdr.csum_flags & CSUM_UDP) csum_flags |= RE_TDESC_CMD_UDPCSUM; + if (m->m_pkthdr.len > sc->re_swcsum_lim && + (m->m_pkthdr.csum_flags & (CSUM_DELAY_IP | CSUM_DELAY_DATA)) && + (sc->re_flags & RE_F_JUMBO_SWCSUM)) { + struct ether_header *eh; + struct ip *ip; + u_short offset; + + m = m_pullup(m, sizeof(struct ether_header *)); + if (m == NULL) { + *m_head = NULL; + return ENOBUFS; + } + eh = mtod(m, struct ether_header *); + + /* XXX */ + if (eh->ether_type == ETHERTYPE_VLAN) + offset = sizeof(struct ether_vlan_header); + else + offset = sizeof(struct ether_header); + + m = m_pullup(m, offset + sizeof(struct ip *)); + if (m == NULL) { + *m_head = NULL; + return ENOBUFS; + } + ip = (struct ip *)(mtod(m, uint8_t *) + offset); + + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + u_short csum; + + offset += IP_VHL_HL(ip->ip_vhl) << 2; + csum = in_cksum_skip(m, ntohs(ip->ip_len), offset); + if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) + csum = 0xffff; + offset += m->m_pkthdr.csum_data; /* checksum offset */ + *(u_short *)(m->m_data + offset) = csum; + + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } + if (m->m_pkthdr.csum_flags & CSUM_DELAY_IP) { + ip->ip_sum = 0; + if (ip->ip_vhl == IP_VHL_BORING) { + ip->ip_sum = in_cksum_hdr(ip); + } else { + ip->ip_sum = + in_cksum(m, IP_VHL_HL(ip->ip_vhl) << 2); + } + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_IP; + } + *m_head = m; /* 'm' may be changed by above two m_pullup() */ + } + /* * With some of the RealTek chips, using the checksum offload * support in conjunction with the autopadding feature results diff --git a/sys/dev/netif/re/if_revar.h b/sys/dev/netif/re/if_revar.h index 24fb07cb37..d5dbe61190 100644 --- a/sys/dev/netif/re/if_revar.h +++ b/sys/dev/netif/re/if_revar.h @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.42 2004/05/24 19:39:23 jhb Exp $ - * $DragonFly: src/sys/dev/netif/re/if_revar.h,v 1.6 2008/10/03 10:12:35 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_revar.h,v 1.7 2008/10/03 14:07:02 sephe Exp $ */ struct re_chain_data { @@ -69,6 +69,7 @@ struct re_hwrev { uint32_t re_rev; int re_type; /* RE_{8139CPLUS,8169} */ uint32_t re_flags; /* see RE_F_ */ + int re_swcsum_lim; const char *re_desc; }; @@ -140,6 +141,7 @@ struct re_softc { int suspended; /* 0 = normal 1 = suspended */ int re_link; int re_eewidth; + int re_swcsum_lim; #ifdef DEVICE_POLLING int rxcycles; #endif @@ -160,6 +162,10 @@ struct re_softc { #define RE_F_HASMPC 0x1 #define RE_F_PCIE 0x2 +#define RE_F_JUMBO_SWCSUM 0x4 + +#define RE_SWCSUM_LIM_8169 2038 +#define RE_SWCSUM_LIM_8168B 2082 #define RE_TX_MODERATION_IS_ENABLED(sc) \ ((sc)->re_tx_ack == RE_ISR_TIMEOUT_EXPIRED) -- 2.41.0 From 81ffa61829c745f8b20765499ea57c9360ff13de Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Fri, 3 Oct 2008 14:14:10 +0000 Subject: [PATCH 09/16] Free sysctl tree during detach --- sys/dev/netif/re/if_re.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c index 8d89de91fb..f5b953822c 100644 --- a/sys/dev/netif/re/if_re.c +++ b/sys/dev/netif/re/if_re.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $ - * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.59 2008/10/03 14:07:02 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.60 2008/10/03 14:14:10 sephe Exp $ */ /* @@ -1395,6 +1395,9 @@ re_detach(device_t dev) device_delete_child(dev, sc->re_miibus); bus_generic_detach(dev); + if (sc->re_sysctl_tree != NULL) + sysctl_ctx_free(&sc->re_sysctl_ctx); + if (sc->re_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->re_irq); if (sc->re_res) { -- 2.41.0 From 483bb69bee9bbe2505b49906a7623e0cd57fa86c Mon Sep 17 00:00:00 2001 From: Thomas Nikolajsen Date: Fri, 3 Oct 2008 18:55:57 +0000 Subject: [PATCH 10/16] - fix description of time (cleanup): suffix is mandantory - describe period use (cleanup) - use `cyclefile' everywhere, not cycle file --- sbin/hammer/hammer.8 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sbin/hammer/hammer.8 b/sbin/hammer/hammer.8 index 26e5d3378e..f93c4a71cd 100644 --- a/sbin/hammer/hammer.8 +++ b/sbin/hammer/hammer.8 @@ -30,7 +30,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $DragonFly: src/sbin/hammer/hammer.8,v 1.51 2008/09/30 23:13:08 dillon Exp $ +.\" $DragonFly: src/sbin/hammer/hammer.8,v 1.52 2008/10/03 18:55:57 thomas Exp $ .Dd September 28, 2008 .Dt HAMMER 8 .Os @@ -99,7 +99,8 @@ write out the current object id so the next run can pick up where it left off. If .Nm -runs to completion it will delete the cyclefile. +runs to completion it will delete +.Ar cyclefile . .It Fl f Ar blkdev[:blkdev]* Specify the volumes making up a .Nm HAMMER @@ -113,7 +114,8 @@ The default is five seconds. Decrease verbosement. May be specified multiple times. .It Fl t Ar seconds When pruning and reblocking you can tell the utility to stop after a -certain period of time. This option is used along with the cycle file +certain period of time. This option is used along with the +.Fl c Ar cyclefile option to prune or reblock a portion of the file system incrementally. .It Fl v Increase verboseness. May be specified multiple times. @@ -211,17 +213,17 @@ reblock <1/3 max-runtime> recopy <1/3 max-runtime> Defaults are: -snapshots 1d 60d # 0 60d for PFS /tmp, /var/tmp, /usr/obj +snapshots 1d 60d # 0d 60d for PFS /tmp, /var/tmp, /usr/obj prune 1d 5m reblock 1d 5m recopy 30d 10m .Ed .Pp -Time is in seconds, it can be given with a suffix of +Time is given with a suffix of .Cm d , .Cm h , .Cm m -and +or .Cm s meaning day, hour, minute and second. A snapshots period of 0 disables snapshot generation and prunes using @@ -229,6 +231,10 @@ A snapshots period of 0 disables snapshot generation and prunes using if no snapshots exists. A prune max-runtime of 0 means unlimited. .Pp +If period hasn't passed since previous +.Ar cleanup +run nothing is done. +For example a day has passed when midnight is passed (localtime). It is recommended to run .Ar cleanup once a day, depending on the configured period, @@ -625,7 +631,7 @@ The source may be a master or slave PFS, and the target must be a slave PFS. .Pp This command also established full duplex communication and turns on the two-way protocol feature which automatically negotiates transaction id ranges -without having to use a cycle file. +without having to use a cyclefile. If the operation completes successfully the target PFS's .Ar sync-end-tid will -- 2.41.0 From 51a388aaaf4529e38406671c735b4cfb6fa0a939 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 3 Oct 2008 19:56:11 +0000 Subject: [PATCH 11/16] Silence remaining "'packed' attribute ignored for field of type..." warnings. Verified-with: md5 --- sys/boot/pc32/libi386/biospnp.c | 56 +++-- usr.bin/doscmd/dos.h | 356 ++++++++++++++++---------------- usr.bin/doscmd/ems.h | 48 ++--- usr.bin/doscmd/xms.h | 10 +- 4 files changed, 234 insertions(+), 236 deletions(-) diff --git a/sys/boot/pc32/libi386/biospnp.c b/sys/boot/pc32/libi386/biospnp.c index f78fa69de5..77d0c17ca3 100644 --- a/sys/boot/pc32/libi386/biospnp.c +++ b/sys/boot/pc32/libi386/biospnp.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.9 2003/08/25 23:28:31 obrien Exp $ - * $DragonFly: src/sys/boot/pc32/libi386/biospnp.c,v 1.4 2003/11/10 06:08:36 dillon Exp $ + * $DragonFly: src/sys/boot/pc32/libi386/biospnp.c,v 1.5 2008/10/03 19:56:10 swildner Exp $ */ /* @@ -37,8 +37,6 @@ #include #include -#define __packed __attribute__((__packed__)) - static int biospnp_init(void); static void biospnp_enumerate(void); @@ -50,38 +48,38 @@ struct pnphandler biospnphandler = struct pnp_ICstructure { - u_int8_t pnp_signature[4] __packed; - u_int8_t pnp_version __packed; - u_int8_t pnp_length __packed; - u_int16_t pnp_BIOScontrol __packed; - u_int8_t pnp_checksum __packed; - u_int32_t pnp_eventflag __packed; - u_int16_t pnp_rmip __packed; - u_int16_t pnp_rmcs __packed; - u_int16_t pnp_pmip __packed; - u_int32_t pnp_pmcs __packed; - u_int8_t pnp_OEMdev[4] __packed; - u_int16_t pnp_rmds __packed; - u_int32_t pnp_pmds __packed; -}; + u_int8_t pnp_signature[4]; + u_int8_t pnp_version; + u_int8_t pnp_length; + u_int16_t pnp_BIOScontrol; + u_int8_t pnp_checksum; + u_int32_t pnp_eventflag; + u_int16_t pnp_rmip; + u_int16_t pnp_rmcs; + u_int16_t pnp_pmip; + u_int32_t pnp_pmcs; + u_int8_t pnp_OEMdev[4]; + u_int16_t pnp_rmds; + u_int32_t pnp_pmds; +} __packed; struct pnp_devNode { - u_int16_t dn_size __packed; - u_int8_t dn_handle __packed; - u_int8_t dn_id[4] __packed; - u_int8_t dn_type[3] __packed; - u_int16_t dn_attrib __packed; - u_int8_t dn_data[1] __packed; -}; + u_int16_t dn_size; + u_int8_t dn_handle; + u_int8_t dn_id[4]; + u_int8_t dn_type[3]; + u_int16_t dn_attrib; + u_int8_t dn_data[1]; +} __packed; struct pnp_isaConfiguration { - u_int8_t ic_revision __packed; - u_int8_t ic_nCSN __packed; - u_int16_t ic_rdport __packed; - u_int16_t ic_reserved __packed; -}; + u_int8_t ic_revision; + u_int8_t ic_nCSN; + u_int16_t ic_rdport; + u_int16_t ic_reserved; +} __packed; static struct pnp_ICstructure *pnp_Icheck = NULL; static u_int16_t pnp_NumNodes; diff --git a/usr.bin/doscmd/dos.h b/usr.bin/doscmd/dos.h index 978d826cfe..e518e6acef 100644 --- a/usr.bin/doscmd/dos.h +++ b/usr.bin/doscmd/dos.h @@ -30,7 +30,7 @@ * BSDI dos.h,v 2.2 1996/04/08 19:32:28 bostic Exp * * $FreeBSD: src/usr.bin/doscmd/dos.h,v 1.2.2.1 2002/04/25 11:04:51 tg Exp $ - * $DragonFly: src/usr.bin/doscmd/dos.h,v 1.2 2003/06/17 04:29:25 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/dos.h,v 1.3 2008/10/03 19:56:11 swildner Exp $ */ /* @@ -119,48 +119,48 @@ typedef struct { * use the first 21 bytes. */ typedef struct { - u_char drive __attribute__ ((packed)); - u_char pattern[11] __attribute__ ((packed)); - u_char flag __attribute__ ((packed)); - u_char reserved1[4] __attribute__ ((packed)); - search_t *searchptr __attribute__ ((packed)); - u_char attr __attribute__ ((packed)); - u_short time __attribute__ ((packed)); - u_short date __attribute__ ((packed)); - u_long size __attribute__ ((packed)); - u_char name[13] __attribute__ ((packed)); -}/* __attribute__((__packed__))*/ find_block_t; + u_char drive; + u_char pattern[11]; + u_char flag; + u_char reserved1[4]; + search_t *searchptr; + u_char attr; + u_short time; + u_short date; + u_long size; + u_char name[13]; +} __packed find_block_t; /* * DOS directory entry structure */ typedef struct { - u_char name[8] __attribute__ ((packed)); - u_char ext[3] __attribute__ ((packed)); - u_char attr __attribute__ ((packed)); - u_char reserved[10] __attribute__ ((packed)); - u_short time __attribute__ ((packed)); - u_short date __attribute__ ((packed)); - u_short start __attribute__ ((packed)); - u_long size __attribute__ ((packed)); -} dosdir_t; + u_char name[8]; + u_char ext[3]; + u_char attr; + u_char reserved[10]; + u_short time; + u_short date; + u_short start; + u_long size; +} __packed dosdir_t; /* * The Current Drive Structure */ typedef struct { - u_char path[0x43] __attribute__ ((packed)); - u_short flag __attribute__ ((packed)); - u_short dpb_off __attribute__ ((packed)); - u_short dpb_seg __attribute__ ((packed)); - u_short redirector_off __attribute__ ((packed)); - u_short redirector_seg __attribute__ ((packed)); - u_char paramter_int21[2] __attribute__ ((packed)); - u_short offset __attribute__ ((packed)); - u_char dummy __attribute__ ((packed)); - u_char ifs_driver[4] __attribute__ ((packed)); - u_char dummy2[2] __attribute__ ((packed)); -}/* __attribute__((__packed__))*/ CDS; + u_char path[0x43]; + u_short flag; + u_short dpb_off; + u_short dpb_seg; + u_short redirector_off; + u_short redirector_seg; + u_char paramter_int21[2]; + u_short offset; + u_char dummy; + u_char ifs_driver[4]; + u_char dummy2[2]; +} __packed CDS; #define CDS_remote 0x8000 #define CDS_ready 0x4000 @@ -173,162 +173,162 @@ typedef struct { * The List of Lists (used to get the CDS and a few other numbers) */ typedef struct { - u_char dummy1[0x16] __attribute__ ((packed)); - u_short cds_offset __attribute__ ((packed)); - u_short cds_seg __attribute__ ((packed)); - u_char dummy2[6] __attribute__ ((packed)); - u_char numberbdev __attribute__ ((packed)); - u_char lastdrive __attribute__ ((packed)); -} LOL; + u_char dummy1[0x16]; + u_short cds_offset; + u_short cds_seg; + u_char dummy2[6]; + u_char numberbdev; + u_char lastdrive; +} __packed LOL; /* * The System File Table */ typedef struct { -/*00*/ u_short nfiles __attribute__ ((packed)); /* Number file handles referring to this file */ -/*02*/ u_short open_mode __attribute__ ((packed)); /* Open mode (bit 15 -> by FCB) */ -/*04*/ u_char attribute __attribute__ ((packed)); -/*05*/ u_short info __attribute__ ((packed)); /* 15 -> remote, 14 -> dont set date */ -/*07*/ u_char ddr_dpb[4] __attribute__ ((packed)); /* Device Driver Header/Drive Paramter Block */ -/*0b*/ u_short fd __attribute__ ((packed)); -/*0d*/ u_short time __attribute__ ((packed)); -/*0f*/ u_short date __attribute__ ((packed)); -/*11*/ u_long size __attribute__ ((packed)); -/*15*/ u_long offset __attribute__ ((packed)); -/*19*/ u_short rel_cluster __attribute__ ((packed)); -/*1b*/ u_short abs_cluster __attribute__ ((packed)); -/*1d*/ u_char dir_sector[2] __attribute__ ((packed)); -/*1f*/ u_char dir_entry __attribute__ ((packed)); -/*20*/ u_char name[8] __attribute__ ((packed)); -/*28*/ u_char ext[3] __attribute__ ((packed)); -/*2b*/ u_char sharesft[4] __attribute__ ((packed)); -/*2f*/ u_char sharenet[2] __attribute__ ((packed)); -/*31*/ u_short psp __attribute__ ((packed)); -/*33*/ u_char share_off[2] __attribute__ ((packed)); -/*35*/ u_char local_end[2] __attribute__ ((packed)); -/*37*/ u_char ifd_driver[4] __attribute__ ((packed)); -} /*__attribute__((__packed__))*/ SFT; +/*00*/ u_short nfiles; /* Number file handles referring to this file */ +/*02*/ u_short open_mode; /* Open mode (bit 15 -> by FCB) */ +/*04*/ u_char attribute; +/*05*/ u_short info; /* 15 -> remote, 14 -> dont set date */ +/*07*/ u_char ddr_dpb[4]; /* Device Driver Header/Drive Paramter Block */ +/*0b*/ u_short fd; +/*0d*/ u_short time; +/*0f*/ u_short date; +/*11*/ u_long size; +/*15*/ u_long offset; +/*19*/ u_short rel_cluster; +/*1b*/ u_short abs_cluster; +/*1d*/ u_char dir_sector[2]; +/*1f*/ u_char dir_entry; +/*20*/ u_char name[8]; +/*28*/ u_char ext[3]; +/*2b*/ u_char sharesft[4]; +/*2f*/ u_char sharenet[2]; +/*31*/ u_short psp; +/*33*/ u_char share_off[2]; +/*35*/ u_char local_end[2]; +/*37*/ u_char ifd_driver[4]; +} __packed SFT; /* * Format of PCDOS 4.01 swappable data area * (Sorry, but you need a wide screen to make this look nice) */ typedef struct { - u_char err_crit __attribute__ ((packed)); /* 00h BYTE critical error flag */ - u_char InDOS __attribute__ ((packed)); /* 01h BYTE InDOS flag (count of active INT 21 calls) */ - u_char err_drive __attribute__ ((packed)); /* 02h BYTE ??? drive number or FFh */ - u_char err_locus __attribute__ ((packed)); /* 03h BYTE locus of last error */ - u_short err_code __attribute__ ((packed)); /* 04h WORD extended error code of last error */ - u_char err_suggest __attribute__ ((packed)); /* 06h BYTE suggested action for last error */ - u_char err_class __attribute__ ((packed)); /* 07h BYTE class of last error */ - u_short err_di __attribute__ ((packed)); - u_short err_es __attribute__ ((packed)); /* 08h DWORD ES:DI pointer for last error */ - u_short dta_off __attribute__ ((packed)); - u_short dta_seg __attribute__ ((packed)); /* 0Ch DWORD current DTA */ - u_short psp __attribute__ ((packed)); /* 10h WORD current PSP */ - u_short int_23_sp __attribute__ ((packed)); /* 12h WORD stores SP across an INT 23 */ - u_short wait_status __attribute__ ((packed)); /* 14h WORD return code from last process termination (zerod after reading with AH=4Dh) */ - u_char current_drive __attribute__ ((packed)); /* 16h BYTE current drive */ - u_char break_flag __attribute__ ((packed)); /* 17h BYTE extended break flag */ - u_char unknown1[2] __attribute__ ((packed)); /* 18h 2 BYTEs ??? */ - u_short int_21_ax __attribute__ ((packed)); /* 1Ah WORD value of AX on call to INT 21 */ - u_short net_psp __attribute__ ((packed)); /* 1Ch WORD PSP segment for sharing/network */ - u_short net_number __attribute__ ((packed)); /* 1Eh WORD network machine number for sharing/network (0000h = us) */ - u_short first_mem __attribute__ ((packed)); /* 20h WORD first usable memory block found when allocating memory */ - u_short best_mem __attribute__ ((packed)); /* 22h WORD best usable memory block found when allocating memory */ - u_short last_mem __attribute__ ((packed)); /* 24h WORD last usable memory block found when allocating memory */ - u_char unknown[10] __attribute__ ((packed)); /* 26h 2 BYTEs ??? (don't seem to be referenced) */ - u_char monthday __attribute__ ((packed)); /* 30h BYTE day of month */ - u_char month __attribute__ ((packed)); /* 31h BYTE month */ - u_short year __attribute__ ((packed)); /* 32h WORD year - 1980 */ - u_short days __attribute__ ((packed)); /* 34h WORD number of days since 1-1-1980 */ - u_char weekday __attribute__ ((packed)); /* 36h BYTE day of week (0 = Sunday) */ - u_char unknown2[3] __attribute__ ((packed)); /* 37h BYTE ??? */ - u_char ddr_head[30] __attribute__ ((packed)); /* 38h 30 BYTEs device driver request header */ - u_short ddre_ip __attribute__ ((packed)); - u_short ddre_cs __attribute__ ((packed)); /* 58h DWORD pointer to device driver entry point (used in calling driver) */ - u_char ddr_head2[22] __attribute__ ((packed)); /* 5Ch 22 BYTEs device driver request header */ - u_char ddr_head3[30] __attribute__ ((packed)); /* 72h 30 BYTEs device driver request header */ - u_char unknown3[6] __attribute__ ((packed)); /* 90h 6 BYTEs ??? */ - u_char clock_xfer[6] __attribute__ ((packed)); /* 96h 6 BYTEs CLOCK$ transfer record (see AH=52h) */ - u_char unknown4[2] __attribute__ ((packed)); /* 9Ch 2 BYTEs ??? */ - u_char filename1[128] __attribute__ ((packed)); /* 9Eh 128 BYTEs buffer for filename */ - u_char filename2[128] __attribute__ ((packed)); /* 11Eh 128 BYTEs buffer for filename */ - u_char findfirst[21] __attribute__ ((packed)); /* 19Eh 21 BYTEs findfirst/findnext search data block (see AH=4Eh) */ - u_char foundentry[32] __attribute__ ((packed)); /* 1B3h 32 BYTEs directory entry for found file */ - u_char cds[88] __attribute__ ((packed)); /* 1D3h 88 BYTEs copy of current directory structure for drive being accessed */ - u_char fcbname[11] __attribute__ ((packed)); /* 22Bh 11 BYTEs ??? FCB-format filename */ - u_char unknown5 __attribute__ ((packed)); /* 236h BYTE ??? */ - u_char wildcard[11] __attribute__ ((packed)); /* 237h 11 BYTEs wildcard destination specification for rename (FCB format) */ - u_char unknown6[11] __attribute__ ((packed)); /* 242h 2 BYTEs ??? */ - u_char attrmask __attribute__ ((packed)); /* 24Dh BYTE attribute mask for directory search??? */ - u_char open_mode __attribute__ ((packed)); /* 24Eh BYTE open mode */ - u_char unknown7[3] __attribute__ ((packed)); /* 24fh BYTE ??? */ - u_char virtual_dos __attribute__ ((packed)); /* 252h BYTE flag indicating how DOS function was invoked (00h = direct INT 20/INT 21, FFh = server call AX=5D00h) */ - u_char unknown8[9] __attribute__ ((packed)); /* 253h BYTE ??? */ - u_char term_type __attribute__ ((packed)); /* 25Ch BYTE type of process termination (00h-03h) */ - u_char unknown9[3] __attribute__ ((packed)); /* 25Dh BYTE ??? */ - u_short dpb_off __attribute__ ((packed)); - u_short dpb_seg __attribute__ ((packed)); /* 260h DWORD pointer to Drive Parameter Block for critical error invocation */ - u_short int21_sf_off __attribute__ ((packed)); - u_short int21_sf_seg __attribute__ ((packed)); /* 264h DWORD pointer to stack frame containing user registers on INT 21 */ - u_short store_sp __attribute__ ((packed)); /* 268h WORD stores SP??? */ - u_short dosdpb_off __attribute__ ((packed)); - u_short dosdpb_seg __attribute__ ((packed)); /* 26Ah DWORD pointer to DOS Drive Parameter Block for ??? */ - u_short disk_buf_seg __attribute__ ((packed)); /* 26Eh WORD segment of disk buffer */ - u_short unknown10[4] __attribute__ ((packed)); /* 270h WORD ??? */ - u_char media_id __attribute__ ((packed)); /* 278h BYTE Media ID byte returned by AH=1Bh,1Ch */ - u_char unknown11 __attribute__ ((packed)); /* 279h BYTE ??? (doesn't seem to be referenced) */ - u_short unknown12[2] __attribute__ ((packed)); /* 27Ah DWORD pointer to ??? */ - u_short sft_off __attribute__ ((packed)); - u_short sft_seg __attribute__ ((packed)); /* 27Eh DWORD pointer to current SFT */ - u_short cds_off __attribute__ ((packed)); - u_short cds_seg __attribute__ ((packed)); /* 282h DWORD pointer to current directory structure for drive being accessed */ - u_short fcb_off __attribute__ ((packed)); - u_short fcb_seg __attribute__ ((packed)); /* 286h DWORD pointer to caller's FCB */ - u_short unknown13[2] __attribute__ ((packed)); /* 28Ah WORD ??? */ - u_short jft_off __attribute__ ((packed)); - u_short jft_seg __attribute__ ((packed)); /* 28Eh DWORD pointer to a JFT entry in process handle table (see AH=26h) */ - u_short filename1_off __attribute__ ((packed)); /* 292h WORD offset in DOS CS of first filename argument */ - u_short filename2_off __attribute__ ((packed)); /* 294h WORD offset in DOS CS of second filename argument */ - u_short unknown14[12] __attribute__ ((packed)); /* 296h WORD ??? */ - u_short file_offset_lo __attribute__ ((packed)); - u_short file_offset_hi __attribute__ ((packed)); /* 2AEh DWORD offset in file??? */ - u_short unknown15 __attribute__ ((packed)); /* 2B2h WORD ??? */ - u_short partial_bytes __attribute__ ((packed)); /* 2B4h WORD bytes in partial sector */ - u_short number_sectors __attribute__ ((packed)); /* 2B6h WORD number of sectors */ - u_short unknown16[3] __attribute__ ((packed)); /* 2B8h WORD ??? */ - u_short nbytes_lo __attribute__ ((packed)); - u_short nbytes_hi __attribute__ ((packed)); /* 2BEh DWORD number of bytes appended to file */ - u_short qpdb_off __attribute__ ((packed)); - u_short qpdb_seg __attribute__ ((packed)); /* 2C2h DWORD pointer to ??? disk buffer */ - u_short asft_off __attribute__ ((packed)); - u_short asft_seg __attribute__ ((packed)); /* 2C6h DWORD pointer to ??? SFT */ - u_short int21_bx __attribute__ ((packed)); /* 2CAh WORD used by INT 21 dispatcher to store caller's BX */ - u_short int21_ds __attribute__ ((packed)); /* 2CCh WORD used by INT 21 dispatcher to store caller's DS */ - u_short temporary __attribute__ ((packed)); /* 2CEh WORD temporary storage while saving/restoring caller's registers */ - u_short prevcall_off __attribute__ ((packed)); - u_short prevcall_seg __attribute__ ((packed)); /* 2D0h DWORD pointer to prev call frame (offset 264h) if INT 21 reentered also switched to for duration of INT 24 */ - u_char unknown17[9] __attribute__ ((packed)); /* 2D4h WORD ??? */ - u_short ext_action __attribute__ ((packed)); /* 2DDh WORD multipurpose open action */ - u_short ext_attr __attribute__ ((packed)); /* 2DFh WORD multipurpose attribute */ - u_short ext_mode __attribute__ ((packed)); /* 2E1h WORD multipurpose mode */ - u_char unknown17a[9] __attribute__ ((packed)); - u_short lol_ds __attribute__ ((packed)); /* 2ECh WORD stores DS during call to [List-of-Lists + 37h] */ - u_char unknown18[5] __attribute__ ((packed)); /* 2EEh WORD ??? */ - u_char usernameptr[4] __attribute__ ((packed)); /* 2F3h DWORD pointer to user-supplied filename */ - u_char unknown19[4] __attribute__ ((packed)); /* 2F7h DWORD pointer to ??? */ - u_char lol_ss[2] __attribute__ ((packed)); /* 2FBh WORD stores SS during call to [List-of-Lists + 37h] */ - u_char lol_sp[2] __attribute__ ((packed)); /* 2FDh WORD stores SP during call to [List-of-Lists + 37h] */ - u_char lol_flag __attribute__ ((packed)); /* 2FFh BYTE flag, nonzero if stack switched in calling [List-of-Lists+37h] */ - u_char searchdata[21] __attribute__ ((packed)); /* 300h 21 BYTEs FindFirst search data for source file(s) of a rename operation (see AH=4Eh) */ - u_char renameentry[32] __attribute__ ((packed)); /* 315h 32 BYTEs directory entry for file being renamed */ - u_char errstack[331] __attribute__ ((packed)); /* 335h 331 BYTEs critical error stack */ - u_char diskstack[384] __attribute__ ((packed)); /* 480h 384 BYTEs disk stack (functions greater than 0Ch, INT 25, INT 26) */ - u_char iostack[384] __attribute__ ((packed)); /* 600h 384 BYTEs character I/O stack (functions 01h through 0Ch) */ - u_char int_21_08_flag __attribute__ ((packed)); /* 780h BYTE flag affecting AH=08h (see AH=64h) */ - u_char unknown20[11] __attribute__ ((packed)); /* 781h BYTE ??? looks like a drive number */ -} /*__attribute__((__packed__))*/ SDA; + u_char err_crit; /* 00h BYTE critical error flag */ + u_char InDOS; /* 01h BYTE InDOS flag (count of active INT 21 calls) */ + u_char err_drive; /* 02h BYTE ??? drive number or FFh */ + u_char err_locus; /* 03h BYTE locus of last error */ + u_short err_code; /* 04h WORD extended error code of last error */ + u_char err_suggest; /* 06h BYTE suggested action for last error */ + u_char err_class; /* 07h BYTE class of last error */ + u_short err_di; + u_short err_es; /* 08h DWORD ES:DI pointer for last error */ + u_short dta_off; + u_short dta_seg; /* 0Ch DWORD current DTA */ + u_short psp; /* 10h WORD current PSP */ + u_short int_23_sp; /* 12h WORD stores SP across an INT 23 */ + u_short wait_status; /* 14h WORD return code from last process termination (zerod after reading with AH=4Dh) */ + u_char current_drive; /* 16h BYTE current drive */ + u_char break_flag; /* 17h BYTE extended break flag */ + u_char unknown1[2]; /* 18h 2 BYTEs ??? */ + u_short int_21_ax; /* 1Ah WORD value of AX on call to INT 21 */ + u_short net_psp; /* 1Ch WORD PSP segment for sharing/network */ + u_short net_number; /* 1Eh WORD network machine number for sharing/network (0000h = us) */ + u_short first_mem; /* 20h WORD first usable memory block found when allocating memory */ + u_short best_mem; /* 22h WORD best usable memory block found when allocating memory */ + u_short last_mem; /* 24h WORD last usable memory block found when allocating memory */ + u_char unknown[10]; /* 26h 2 BYTEs ??? (don't seem to be referenced) */ + u_char monthday; /* 30h BYTE day of month */ + u_char month; /* 31h BYTE month */ + u_short year; /* 32h WORD year - 1980 */ + u_short days; /* 34h WORD number of days since 1-1-1980 */ + u_char weekday; /* 36h BYTE day of week (0 = Sunday) */ + u_char unknown2[3]; /* 37h BYTE ??? */ + u_char ddr_head[30]; /* 38h 30 BYTEs device driver request header */ + u_short ddre_ip; + u_short ddre_cs; /* 58h DWORD pointer to device driver entry point (used in calling driver) */ + u_char ddr_head2[22]; /* 5Ch 22 BYTEs device driver request header */ + u_char ddr_head3[30]; /* 72h 30 BYTEs device driver request header */ + u_char unknown3[6]; /* 90h 6 BYTEs ??? */ + u_char clock_xfer[6]; /* 96h 6 BYTEs CLOCK$ transfer record (see AH=52h) */ + u_char unknown4[2]; /* 9Ch 2 BYTEs ??? */ + u_char filename1[128]; /* 9Eh 128 BYTEs buffer for filename */ + u_char filename2[128]; /* 11Eh 128 BYTEs buffer for filename */ + u_char findfirst[21]; /* 19Eh 21 BYTEs findfirst/findnext search data block (see AH=4Eh) */ + u_char foundentry[32]; /* 1B3h 32 BYTEs directory entry for found file */ + u_char cds[88]; /* 1D3h 88 BYTEs copy of current directory structure for drive being accessed */ + u_char fcbname[11]; /* 22Bh 11 BYTEs ??? FCB-format filename */ + u_char unknown5; /* 236h BYTE ??? */ + u_char wildcard[11]; /* 237h 11 BYTEs wildcard destination specification for rename (FCB format) */ + u_char unknown6[11]; /* 242h 2 BYTEs ??? */ + u_char attrmask; /* 24Dh BYTE attribute mask for directory search??? */ + u_char open_mode; /* 24Eh BYTE open mode */ + u_char unknown7[3]; /* 24fh BYTE ??? */ + u_char virtual_dos; /* 252h BYTE flag indicating how DOS function was invoked (00h = direct INT 20/INT 21, FFh = server call AX=5D00h) */ + u_char unknown8[9]; /* 253h BYTE ??? */ + u_char term_type; /* 25Ch BYTE type of process termination (00h-03h) */ + u_char unknown9[3]; /* 25Dh BYTE ??? */ + u_short dpb_off; + u_short dpb_seg; /* 260h DWORD pointer to Drive Parameter Block for critical error invocation */ + u_short int21_sf_off; + u_short int21_sf_seg; /* 264h DWORD pointer to stack frame containing user registers on INT 21 */ + u_short store_sp; /* 268h WORD stores SP??? */ + u_short dosdpb_off; + u_short dosdpb_seg; /* 26Ah DWORD pointer to DOS Drive Parameter Block for ??? */ + u_short disk_buf_seg; /* 26Eh WORD segment of disk buffer */ + u_short unknown10[4]; /* 270h WORD ??? */ + u_char media_id; /* 278h BYTE Media ID byte returned by AH=1Bh,1Ch */ + u_char unknown11; /* 279h BYTE ??? (doesn't seem to be referenced) */ + u_short unknown12[2]; /* 27Ah DWORD pointer to ??? */ + u_short sft_off; + u_short sft_seg; /* 27Eh DWORD pointer to current SFT */ + u_short cds_off; + u_short cds_seg; /* 282h DWORD pointer to current directory structure for drive being accessed */ + u_short fcb_off; + u_short fcb_seg; /* 286h DWORD pointer to caller's FCB */ + u_short unknown13[2]; /* 28Ah WORD ??? */ + u_short jft_off; + u_short jft_seg; /* 28Eh DWORD pointer to a JFT entry in process handle table (see AH=26h) */ + u_short filename1_off; /* 292h WORD offset in DOS CS of first filename argument */ + u_short filename2_off; /* 294h WORD offset in DOS CS of second filename argument */ + u_short unknown14[12]; /* 296h WORD ??? */ + u_short file_offset_lo; + u_short file_offset_hi; /* 2AEh DWORD offset in file??? */ + u_short unknown15; /* 2B2h WORD ??? */ + u_short partial_bytes; /* 2B4h WORD bytes in partial sector */ + u_short number_sectors; /* 2B6h WORD number of sectors */ + u_short unknown16[3]; /* 2B8h WORD ??? */ + u_short nbytes_lo; + u_short nbytes_hi; /* 2BEh DWORD number of bytes appended to file */ + u_short qpdb_off; + u_short qpdb_seg; /* 2C2h DWORD pointer to ??? disk buffer */ + u_short asft_off; + u_short asft_seg; /* 2C6h DWORD pointer to ??? SFT */ + u_short int21_bx; /* 2CAh WORD used by INT 21 dispatcher to store caller's BX */ + u_short int21_ds; /* 2CCh WORD used by INT 21 dispatcher to store caller's DS */ + u_short temporary; /* 2CEh WORD temporary storage while saving/restoring caller's registers */ + u_short prevcall_off; + u_short prevcall_seg; /* 2D0h DWORD pointer to prev call frame (offset 264h) if INT 21 reentered also switched to for duration of INT 24 */ + u_char unknown17[9]; /* 2D4h WORD ??? */ + u_short ext_action; /* 2DDh WORD multipurpose open action */ + u_short ext_attr; /* 2DFh WORD multipurpose attribute */ + u_short ext_mode; /* 2E1h WORD multipurpose mode */ + u_char unknown17a[9]; + u_short lol_ds; /* 2ECh WORD stores DS during call to [List-of-Lists + 37h] */ + u_char unknown18[5]; /* 2EEh WORD ??? */ + u_char usernameptr[4]; /* 2F3h DWORD pointer to user-supplied filename */ + u_char unknown19[4]; /* 2F7h DWORD pointer to ??? */ + u_char lol_ss[2]; /* 2FBh WORD stores SS during call to [List-of-Lists + 37h] */ + u_char lol_sp[2]; /* 2FDh WORD stores SP during call to [List-of-Lists + 37h] */ + u_char lol_flag; /* 2FFh BYTE flag, nonzero if stack switched in calling [List-of-Lists+37h] */ + u_char searchdata[21]; /* 300h 21 BYTEs FindFirst search data for source file(s) of a rename operation (see AH=4Eh) */ + u_char renameentry[32];/* 315h 32 BYTEs directory entry for file being renamed */ + u_char errstack[331]; /* 335h 331 BYTEs critical error stack */ + u_char diskstack[384]; /* 480h 384 BYTEs disk stack (functions greater than 0Ch, INT 25, INT 26) */ + u_char iostack[384]; /* 600h 384 BYTEs character I/O stack (functions 01h through 0Ch) */ + u_char int_21_08_flag; /* 780h BYTE flag affecting AH=08h (see AH=64h) */ + u_char unknown20[11]; /* 781h BYTE ??? looks like a drive number */ +} __packed SDA; struct exehdr { u_short magic; diff --git a/usr.bin/doscmd/ems.h b/usr.bin/doscmd/ems.h index f210b9e998..78b8900d0d 100644 --- a/usr.bin/doscmd/ems.h +++ b/usr.bin/doscmd/ems.h @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/doscmd/ems.h,v 1.3 1999/08/28 01:00:13 peter Exp $ - * $DragonFly: src/usr.bin/doscmd/ems.h,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/ems.h,v 1.3 2008/10/03 19:56:11 swildner Exp $ */ #ifndef EMS_H @@ -243,9 +243,9 @@ typedef union { */ typedef struct { - u_short handle __attribute__ ((packed)); /* handle */ - u_short npages __attribute__ ((packed)); /* pages allocated */ -} EMShandlepage; + u_short handle; /* handle */ + u_short npages; /* pages allocated */ +} __packed EMShandlepage; /* * EMS map/unmap multiple, only used to pass information to and from @@ -253,10 +253,10 @@ typedef struct { */ typedef struct { - u_short log __attribute__ ((packed)); /* logical page number */ - u_short phys __attribute__ ((packed)); /* physical page (position) or - segment address inside frame */ -} EMSmapunmap; + u_short log; /* logical page number */ + u_short phys; /* physical page (position) or + segment address inside frame */ +} __packed EMSmapunmap; /* * EMS handle directory, only used to pass information to and from @@ -264,10 +264,10 @@ typedef struct { */ typedef struct { - u_short log __attribute__ ((packed)); /* logical page number */ - Hname name __attribute__ ((packed)); /* Handle name */ + u_short log; /* logical page number */ + Hname name; /* Handle name */ -} EMShandledir; +} __packed EMShandledir; /* * Structure for get/set page map: This structure is used to save and @@ -288,9 +288,9 @@ typedef struct { */ typedef struct { - u_short segm __attribute__ ((packed)); /* segment address inside frame */ - u_short phys __attribute__ ((packed)); /* physical page (position) */ -} EMSaddrarray; + u_short segm; /* segment address inside frame */ + u_short phys; /* physical page (position) */ +} __packed EMSaddrarray; /* * EMS move memory call structure, only used to pass information to and from @@ -298,17 +298,17 @@ typedef struct { */ typedef struct { - u_long length __attribute__ ((packed)); /* length of region */ + u_long length; /* length of region */ #define EMS_MOVE_CONV 0 #define EMS_MOVE_EMS 1 - u_char src_type __attribute__ ((packed)); /* source type (0,1) */ - u_short src_handle __attribute__ ((packed)); /* source handle */ - u_short src_offset __attribute__ ((packed)); /* source offset */ - u_short src_seg __attribute__ ((packed)); /* source type */ - u_char dst_type __attribute__ ((packed)); /* destination type (0,1) */ - u_short dst_handle __attribute__ ((packed)); /* destination handle */ - u_short dst_offset __attribute__ ((packed)); /* destination offset */ - u_short dst_seg __attribute__ ((packed)); /* destination type */ -} EMSmovemem; + u_char src_type; /* source type (0,1) */ + u_short src_handle; /* source handle */ + u_short src_offset; /* source offset */ + u_short src_seg; /* source type */ + u_char dst_type; /* destination type (0,1) */ + u_short dst_handle; /* destination handle */ + u_short dst_offset; /* destination offset */ + u_short dst_seg; /* destination type */ +} __packed EMSmovemem; #endif /* EMS_H */ diff --git a/usr.bin/doscmd/xms.h b/usr.bin/doscmd/xms.h index 09ff361c84..f74c354069 100644 --- a/usr.bin/doscmd/xms.h +++ b/usr.bin/doscmd/xms.h @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/doscmd/xms.h,v 1.2 1999/08/28 01:00:27 peter Exp $ - * $DragonFly: src/usr.bin/doscmd/xms.h,v 1.2 2003/06/17 04:29:26 dillon Exp $ + * $DragonFly: src/usr.bin/doscmd/xms.h,v 1.3 2008/10/03 19:56:11 swildner Exp $ */ #ifndef XMS_H @@ -113,10 +113,10 @@ struct EMM { struct XMSinfo { u_char handle; /* the handle */ - u_char num_locks __attribute__ ((packed)); /* number of locks */ - u_long size __attribute__ ((packed)); /* size of memory */ - u_long phys_addr __attribute__ ((packed)); /* "physical" address */ -}; + u_char num_locks; /* number of locks */ + u_long size; /* size of memory */ + u_long phys_addr; /* "physical" address */ +} __packed; /* * Handle management inside the emulator for extendend memory pages, -- 2.41.0 From 2010519f8812aade73eba2d879e798639f8c1b68 Mon Sep 17 00:00:00 2001 From: Thomas Nikolajsen Date: Fri, 3 Oct 2008 20:09:12 +0000 Subject: [PATCH 12/16] Start sentence on new line. --- sbin/hammer/hammer.8 | 166 ++++++++++++++++++++++--------------------- 1 file changed, 85 insertions(+), 81 deletions(-) diff --git a/sbin/hammer/hammer.8 b/sbin/hammer/hammer.8 index f93c4a71cd..52a0a524f5 100644 --- a/sbin/hammer/hammer.8 +++ b/sbin/hammer/hammer.8 @@ -30,7 +30,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $DragonFly: src/sbin/hammer/hammer.8,v 1.52 2008/10/03 18:55:57 thomas Exp $ +.\" $DragonFly: src/sbin/hammer/hammer.8,v 1.53 2008/10/03 20:09:12 thomas Exp $ .Dd September 28, 2008 .Dt HAMMER 8 .Os @@ -66,8 +66,8 @@ The options are as follows: Get help. .It Fl 2 Tell the mirror commands to use a 2-way protocol, which allows -automatic negotiation of transaction id ranges. This option is -automatically enabled by the +automatic negotiation of transaction id ranges. +This option is automatically enabled by the .Ar mirror-copy command. .It Fl r @@ -81,13 +81,11 @@ The bandwidth may be suffixed with .Sq m , or .Sq g -to specify -values in kilobytes, megabytes, and gigabytes per second. +to specify values in kilobytes, megabytes, and gigabytes per second. .It Fl c Ar cyclefile When pruning and reblocking you can instruction .Nm -to start at the -object id stored in the specified file. +to start at the object id stored in the specified file. If the file does not exist .Nm will start at the beginning. @@ -95,8 +93,7 @@ If .Nm is told to run for a specific period of time and is unable to complete the operation it will -write out the current object id so the next run can pick up where it left -off. +write out the current object id so the next run can pick up where it left off. If .Nm runs to completion it will delete @@ -111,14 +108,17 @@ minimum delay after a batch ends before the next batch is allowed to start. The default is five seconds. .It Fl q -Decrease verbosement. May be specified multiple times. +Decrease verbosement. +May be specified multiple times. .It Fl t Ar seconds When pruning and reblocking you can tell the utility to stop after a -certain period of time. This option is used along with the +certain period of time. +This option is used along with the .Fl c Ar cyclefile option to prune or reblock a portion of the file system incrementally. .It Fl v -Increase verboseness. May be specified multiple times. +Increase verboseness. +May be specified multiple times. .El .Pp The commands are as follows: @@ -128,8 +128,8 @@ The commands are as follows: Generates a guaranteed, formal 64 bit transaction id representing the current state of the specified .Nm HAMMER -file system. The file system will -be synced to the media. +file system. +The file system will be synced to the media. .Pp If the .Ar quick @@ -162,7 +162,8 @@ Show the modification history for file's inode and data. .\" ==== show ==== .It Ar show -Dump the B-tree. This command needs the +Dump the B-tree. +This command needs the .Fl f flag. .\" .It Ar blockmap @@ -179,8 +180,7 @@ output as 0. .It Ar namekey32 Ar filename Generate the top 32 bits of a .Nm HAMMER -64 bit directory hash for the specified -file name. +64 bit directory hash for the specified file name. .\" ==== cleanup ==== .It Ar cleanup Op Ar filesystem ... This is a meta-command which executes snapshot, pruning, and reblocking @@ -237,8 +237,7 @@ run nothing is done. For example a day has passed when midnight is passed (localtime). It is recommended to run .Ar cleanup -once a day, depending on the configured period, -from a +once a day, depending on the configured period, from a .Xr cron 8 job. For example: @@ -257,7 +256,7 @@ Reblocking and recopy runs are each broken down into three separate functions (btree, inodes and data) and are thus by default limited to 15 and 30 minutes respectively. Also note that this directive will by default disable snapshots on -the following PFSs: +the following PFS's: .Pa /tmp , .Pa /var/tmp and @@ -292,9 +291,9 @@ and all history after the latest snapshot, but all other history is deleted. .Pp The target directory is expected to contain softlinks pointing to -snapshots of the file systems you wish to retain. The directory is scanned -non-recursively and the mount points and transaction ids stored in the -softlinks are extracted and sorted. +snapshots of the file systems you wish to retain. +The directory is scanned non-recursively and the mount points and +transaction ids stored in the softlinks are extracted and sorted. The file system is then explicitly pruned according to what is found. Cleaning out portions of the file system is as simple as removing a softlink and then running the @@ -306,8 +305,9 @@ containing the @@ snapshot id extension. Currently the scanned softlink directory must contain softlinks pointing to a single .Nm HAMMER -mount. The softlinks may specify absolute or relative -paths. Softlinks must use 20-character (@@0x%016llx) transaction ids, +mount. +The softlinks may specify absolute or relative paths. +Softlinks must use 20-character (@@0x%016llx) transaction ids, as might be returned from .Dq Nm Ar synctid filesystem . .Pp @@ -317,8 +317,8 @@ file system and each PFS in it have to be pruned separately. .Pp Note that pruning a file system may not immediately free-up space, though typically some space will be freed if a large number of records are -pruned out. The file system must be reblocked to completely recover all -available space. +pruned out. +The file system must be reblocked to completely recover all available space. .Pp Example, lets say your snapshot directory contains the following links: .Bd -literal -offset indent @@ -338,12 +338,14 @@ command on this directory, then the .Nm HAMMER .Pa /usr/obj mount will be pruned to retain the above three snapshots. -In addition, history for modifications made to the file system older than the oldest -snapshot will be destroyed and history for potentially fine-grained modifications made -to the file system more recently than the most recent snapshot will be -retained. -.Pp -If you then delete the snap2 softlink and rerun the +In addition, history for modifications made to the file system older than +the oldest snapshot will be destroyed and history for potentially fine-grained +modifications made to the file system more recently than the most recent +snapshot will be retained. +.Pp +If you then delete the +.Pa snap2 +softlink and rerun the .Ar prune command, history for modifications pertaining to that snapshot would be destroyed. @@ -363,8 +365,7 @@ argument and creates a symlink in the directory provided by pointing to the snapshot. If .Ar snapshot-dir -is not a directory, it is assumed to be a format string -passed to +is not a directory, it is assumed to be a format string passed to .Xr strftime 3 with the current time as parameter. If @@ -415,8 +416,9 @@ This command also has the effect of reordering all elements, effectively defragmenting the file system. .Pp The default fill percentage is 100% and will cause the file system to be -completely defragmented. All specified element types will be reallocated -and rewritten. If you wish to quickly free up space instead try specifying +completely defragmented. +All specified element types will be reallocated and rewritten. +If you wish to quickly free up space instead try specifying a smaller fill percentage, such as 90% or 80% (the .Sq % suffix is not needed). @@ -433,8 +435,8 @@ The file system would thus be defragmented over long period of time. .Pp It is recommended that separate invocations be used for each data type. B-tree nodes, inodes, and directories are typically the most important -elements needing defragmentation. Data can be defragmented over a longer -period of time. +elements needing defragmentation. +Data can be defragmented over a longer period of time. .Pp Reblocking is a per PFS operation, so a .Nm HAMMER @@ -443,7 +445,7 @@ file system and each PFS in it have to be reblocked separately. .It Ar pfs-status Ar dirpath ... Retrieve the mirroring configuration parameters for the specified .Nm HAMMER -file systems or pseudo-filesystems. +file systems or pseudo-filesystems (PFS's). .\" ==== pfs-master ==== .It Ar pfs-master Ar dirpath Op options Create a pseudo-filesystem (PFS) inside a @@ -474,7 +476,9 @@ first mirroring operation with it as the target (its root directory will not exist until then). .Pp Access to the pfs-slave via the special softlink, -as described in the PFS NOTES below, allows +as described in the +.Sx PFS NOTES +below, allows .Nm HAMMER to dynamically modify the snapshot transaction id by returning a dynamic result @@ -491,10 +495,12 @@ Removing the softlink will not destroy the underlying PFS. Update the configuration parameters for an existing .Nm HAMMER file system -or pseudo-filesystem. Options that may be specified: +or pseudo-filesystem. +Options that may be specified: .Bl -tag -width indent .It sync-beg-tid=0x16llx -This is the automatic snapshot access starting transaction id for mirroring slaves. +This is the automatic snapshot access starting transaction id for +mirroring slaves. This parameter is normally updated automatically by the .Ar mirror-write directive. @@ -512,29 +518,29 @@ This parameter is normally updated automatically by the .Ar mirror-write directive. .Pp -Manually modifying this field is dangerous and can result in a broken -mirror. +Manually modifying this field is dangerous and can result in a broken mirror. .It shared-uuid= -Set the shared UUID for this file system. All mirrors must have the same -shared UUID. For safety purposes the +Set the shared UUID for this file system. +All mirrors must have the same shared UUID. +For safety purposes the .Ar mirror-write -directives will refuse -to operate on a target with a different shared UUID. +directives will refuse to operate on a target with a different shared UUID. .Pp Changing the shared UUID on an existing, non-empty mirroring target, -including an empty but not completely pruned target, can lead -to corruption of the mirroring target. +including an empty but not completely pruned target, +can lead to corruption of the mirroring target. .It unique-uuid= -Set the unique UUID for this file system. This UUID should not be used -anywhere else, even on exact copies of the file system. +Set the unique UUID for this file system. +This UUID should not be used anywhere else, +even on exact copies of the file system. .It label= Set a descriptive label for this file system. .It snapshots= Specify the snapshots directory which .Nm .Ar cleanup -will use to manage -this PFS. The snapshots directory does not need to be configured for +will use to manage this PFS. +The snapshots directory does not need to be configured for PFS masters and will default to .Pa /snapshots . .Pp @@ -556,29 +562,28 @@ is the base file system, and .Pa is an appropriate label. -You can control snapshot -retention on your slave independent of the master. +You can control snapshot retention on your slave independent of the master. .It snapshots-clear Zero out the snapshots directory path for this PFS. .El .\" ==== pfs-upgrade ==== .It Ar pfs-upgrade Ar dirpath -Upgrade a PFS from slave to master operation. The PFS will be rolled back -to the current end synchronization tid (removing any partial synchronizations), -and will then becomes writable. +Upgrade a PFS from slave to master operation. +The PFS will be rolled back to the current end synchronization tid +(removing any partial synchronizations), and will then become writable. .Pp .Em WARNING! .Nm HAMMER currently supports only single masters and using -this command can easily result in file system corruption if you don't -know what you are doing. +this command can easily result in file system corruption +if you don't know what you are doing. .Pp This directive will refuse to run if any programs have open descriptors in the PFS, including programs chdir'd into the PFS. .\" ==== pfs-downgrade ==== .It Ar pfs-downgrade Ar dirpath -Downgrade a master PFS from master to slave operation. The PFS becomes -read-only and access will be locked to its +Downgrade a master PFS from master to slave operation +The PFS becomes read-only and access will be locked to its .Ar sync-end-tid . .Pp This directive will refuse to run if any programs have open descriptors @@ -612,15 +617,15 @@ A .Ar mirror-read can be piped into a .Ar mirror-dump -to dump an ascii -representation of the mirroring stream. +to dump an ASCII representation of the mirroring stream. .\" ==== mirror-copy ==== .It Ar mirror-copy Ar [[user@]host:]filesystem Ar [[user@]host:]filesystem This is a shortcut which pipes a .Ar mirror-read command to a .Ar mirror-write -command. If a remote host specification is made the program forks a +command. +If a remote host specification is made the program forks a .Xr ssh 1 and execs the .Ar mirror-read @@ -630,20 +635,20 @@ on the appropriate host. The source may be a master or slave PFS, and the target must be a slave PFS. .Pp This command also established full duplex communication and turns on -the two-way protocol feature which automatically negotiates transaction id ranges -without having to use a cyclefile. +the two-way protocol feature which automatically negotiates transaction id +ranges without having to use a cyclefile. If the operation completes successfully the target PFS's .Ar sync-end-tid -will -be updated. Note that you must re-chdir into the target PFS to see the -updated information. If you do not you will still be in the previous snapshot. +will be updated. +Note that you must re-chdir into the target PFS to see the updated information. +If you do not you will still be in the previous snapshot. .\" ==== mirror-stream ==== .It Ar mirror-stream Ar [[user@]host:]filesystem Ar [[user@]host:]filesystem This command works similarly to .Ar mirror-copy but does not exit unless the pipe is broken. -This command will resume the mirroring operation whenever the master is -synced. The command is commonly used with +This command will resume the mirroring operation whenever the master is synced. +The command is commonly used with .Fl i Ar delay and .Fl b Ar bandwidth @@ -654,12 +659,11 @@ basis. .Sh PSEUDO FILESYSTEM (PFS) NOTES The root of a PFS is not hooked into the primary .Nm HAMMER -file system as a -directory. +file system as a directory. Instead, .Nm HAMMER -creates a special softlink called "@@PFS%05d" (exactly 10 -characters long) in the primary +creates a special softlink called "@@PFS%05d" (exactly 10 characters long) +in the primary .Nm HAMMER file system. .Nm HAMMER @@ -675,10 +679,10 @@ If the PFS is a slave the link reflects the last completed snapshot, and the contents of the link will change when the next snapshot is completed, and so forth. .Pp -PFS support is currently very new and experimental. The +PFS support is currently very new and experimental. +The .Nm -utility -employs numerous safeties to reduce user foot-shooting. +utility employs numerous safeties to reduce user foot-shooting. The .Ar mirror-copy directive requires that the target be configured as a slave and that the -- 2.41.0 From a668cf6a5302833559ac27364c20141c3f30f77c Mon Sep 17 00:00:00 2001 From: Thomas Nikolajsen Date: Fri, 3 Oct 2008 21:26:28 +0000 Subject: [PATCH 13/16] - adjust boot command description for booting from root of boot-only file system - improve markup - fix exmaple of dummy s0 partition to use enough space for disklabel --- sbin/gpt/gpt.8 | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/sbin/gpt/gpt.8 b/sbin/gpt/gpt.8 index 8a74ec40d8..062ab16906 100644 --- a/sbin/gpt/gpt.8 +++ b/sbin/gpt/gpt.8 @@ -23,9 +23,9 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $ -.\" $DragonFly: src/sbin/gpt/gpt.8,v 1.13 2008/09/06 10:03:45 thomas Exp $ +.\" $DragonFly: src/sbin/gpt/gpt.8,v 1.14 2008/10/03 21:26:28 thomas Exp $ .\" -.Dd September 3, 2008 +.Dd October 3, 2008 .Os .Dt GPT 8 .Sh NAME @@ -169,19 +169,17 @@ and hacks in a special .Sq slice 1 in the PMBR which aliases it. The PMBR is further modified to add the necessary boot code. -You can then disklabel GPT partition #0 and mount it, placing the boot -directory and kernel within. -The boot directory must be a sub-directory, e.g.\& -.Pa /mnt/boot -in -.Pa da8s0a . -You must also add a -.Dq vfs.root.mountfrom="filesystem:device" -line to -.Pa /mnt/boot/loader.conf -to point to the actual root mount. -For example, -.Dq ufs:da8s1a . +You can then disklabel GPT partition #0 and mount it, placing the contents of +.Pa /boot +directory within. +You must add a line to +.Pa loader.conf , +like +.Bd -literal -offset indent +vfs.root.mountfrom="ufs:da8s1a" +.Ed +.Pp +which point to the actual root mount. .Pp Your root partition may be another GPT partition and you may use a 64 bit disklabel within that partition if you desire. @@ -391,7 +389,7 @@ which is assumed in the examples below, it can be found using: .Pp To add a dummy GPT partition 0: .Pp -.Dl "gpt add -i0 -s1 ad6" +.Dl "gpt add -i0 -s16 ad6" .Pp You might want to do this to not use slice 0 for data; when GPT is not used on a disk, slice 0 is the compatibility slice, -- 2.41.0 From 5f82fbca88963f2a87ef0cff1d889e09ae79b99d Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sat, 4 Oct 2008 09:57:14 +0000 Subject: [PATCH 14/16] How buggy this little piece of code could be? Repair strnvis() buffersize of 4*n+1, with termination gauranteed by the function. Obtained-from: OpenBSD --- crypto/openssh-5/sshconnect2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/openssh-5/sshconnect2.c b/crypto/openssh-5/sshconnect2.c index 868f26931a..f6405922f0 100644 --- a/crypto/openssh-5/sshconnect2.c +++ b/crypto/openssh-5/sshconnect2.c @@ -386,8 +386,8 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt) if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO) { if (len > 65536) len = 65536; - msg = xmalloc(len * 4); /* max expansion from strnvis() */ - strnvis(msg, raw, len * 4, VIS_SAFE|VIS_OCTAL); + msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */ + strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL); fprintf(stderr, "%s", msg); xfree(msg); } -- 2.41.0 From 089dc1b72138e0e2b92e1433079b5fb09e6711e9 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sat, 4 Oct 2008 10:36:21 +0000 Subject: [PATCH 15/16] - For relative newer parts (8168B), setting MTPS (max transmit packet size) according to MTU makes jumbo frame + TX csum offloading work. However, for old ones (8169), setting MTPS does not have much effect. - Reduce max jumbo frame size from 9018 to 7440 (according to DS) - Fix MTU setting in re_ioctl --- sys/dev/netif/re/if_re.c | 85 ++++++++++++++++++++++++++----------- sys/dev/netif/re/if_rereg.h | 6 ++- sys/dev/netif/re/if_revar.h | 8 ++-- 3 files changed, 68 insertions(+), 31 deletions(-) diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c index f5b953822c..b05c8fa980 100644 --- a/sys/dev/netif/re/if_re.c +++ b/sys/dev/netif/re/if_re.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $ - * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.60 2008/10/03 14:14:10 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.61 2008/10/04 10:36:21 sephe Exp $ */ /* @@ -202,22 +202,46 @@ static const struct re_type re_devs[] = { }; static const struct re_hwrev re_hwrevs[] = { - { RE_HWREV_8139CPLUS, RE_8139CPLUS, RE_F_HASMPC, 0, "C+" }, - { RE_HWREV_8168_SPIN1, RE_8169, RE_F_PCIE, 0, "8168" }, - { RE_HWREV_8168_SPIN2, RE_8169, - RE_F_PCIE | RE_F_JUMBO_SWCSUM, RE_SWCSUM_LIM_8168B, "8168" }, - { RE_HWREV_8168_SPIN3, RE_8169, RE_F_PCIE, 0, "8168" }, - { RE_HWREV_8168C, RE_8169, RE_F_PCIE, 0, "8168C" }, - { RE_HWREV_8169, RE_8169, - RE_F_HASMPC | RE_F_JUMBO_SWCSUM, RE_SWCSUM_LIM_8169, "8169" }, - { RE_HWREV_8169S, RE_8169, RE_F_HASMPC, 0, "8169S" }, - { RE_HWREV_8110S, RE_8169, RE_F_HASMPC, 0, "8110S" }, - { RE_HWREV_8169_8110SB, RE_8169, RE_F_HASMPC, 0, "8169SB" }, - { RE_HWREV_8169_8110SC, RE_8169, 0, 0, "8169SC" }, - { RE_HWREV_8100E, RE_8169, RE_F_HASMPC, 0, "8100E" }, - { RE_HWREV_8101E, RE_8169, RE_F_PCIE, 0, "8101E" }, - { RE_HWREV_8102EL, RE_8169, RE_F_PCIE, 0, "8102EL" }, - { 0, 0, 0, 0, NULL } + { RE_HWREV_8139CPLUS, RE_8139CPLUS, RE_F_HASMPC, + ETHERMTU, ETHERMTU }, + + { RE_HWREV_8168_SPIN1, RE_8169, RE_F_PCIE, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8168_SPIN2, RE_8169, RE_F_PCIE, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8168_SPIN3, RE_8169, RE_F_PCIE, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8168C, RE_8169, RE_F_PCIE, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8169, RE_8169, RE_F_HASMPC, + RE_SWCSUM_LIM_8169, RE_JUMBO_MTU }, + + { RE_HWREV_8169S, RE_8169, RE_F_HASMPC, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8110S, RE_8169, RE_F_HASMPC, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8169_8110SB, RE_8169, RE_F_HASMPC, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8169_8110SC, RE_8169, 0, + RE_JUMBO_MTU, RE_JUMBO_MTU }, + + { RE_HWREV_8100E, RE_8169, RE_F_HASMPC, + ETHERMTU, ETHERMTU }, + + { RE_HWREV_8101E, RE_8169, RE_F_PCIE, + ETHERMTU, ETHERMTU }, + + { RE_HWREV_8102EL, RE_8169, RE_F_PCIE, + ETHERMTU, ETHERMTU }, + + { 0, 0, 0, 0, 0 } }; static int re_probe(device_t); @@ -1234,11 +1258,13 @@ re_attach(device_t dev) re_reset(sc); hwrev = CSR_READ_4(sc, RE_TXCFG) & RE_TXCFG_HWREV; - for (hw_rev = re_hwrevs; hw_rev->re_desc != NULL; hw_rev++) { + for (hw_rev = re_hwrevs; hw_rev->re_type != 0; hw_rev++) { if (hw_rev->re_rev == hwrev) { + sc->re_hwrev = hwrev; sc->re_type = hw_rev->re_type; sc->re_flags = hw_rev->re_flags; sc->re_swcsum_lim = hw_rev->re_swcsum_lim; + sc->re_maxmtu = hw_rev->re_maxmtu; break; } } @@ -1283,7 +1309,6 @@ re_attach(device_t dev) ifp = &sc->arpcom.ac_if; ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = re_ioctl; ifp->if_start = re_start; @@ -1942,8 +1967,7 @@ re_encap(struct re_softc *sc, struct mbuf **m_head, int *idx0) csum_flags |= RE_TDESC_CMD_UDPCSUM; if (m->m_pkthdr.len > sc->re_swcsum_lim && - (m->m_pkthdr.csum_flags & (CSUM_DELAY_IP | CSUM_DELAY_DATA)) && - (sc->re_flags & RE_F_JUMBO_SWCSUM)) { + (m->m_pkthdr.csum_flags & (CSUM_DELAY_IP | CSUM_DELAY_DATA))) { struct ether_header *eh; struct ip *ip; u_short offset; @@ -2228,7 +2252,7 @@ re_init(void *xsc) struct ifnet *ifp = &sc->arpcom.ac_if; struct mii_data *mii; uint32_t rxcfg = 0; - int error; + int error, framelen; ASSERT_SERIALIZED(ifp->if_serializer); @@ -2306,7 +2330,13 @@ re_init(void *xsc) } else CSR_WRITE_4(sc, RE_TXCFG, RE_TXCFG_CONFIG); - CSR_WRITE_1(sc, RE_EARLY_TX_THRESH, 16); + framelen = RE_FRAMELEN(ifp->if_mtu); + if (framelen < RE_FRAMELEN_2K) { + CSR_WRITE_1(sc, RE_EARLY_TX_THRESH, + howmany(RE_FRAMELEN_2K, 128)); + } else { + CSR_WRITE_1(sc, RE_EARLY_TX_THRESH, howmany(framelen, 128)); + } CSR_WRITE_4(sc, RE_RXCFG, RE_RXCFG_CONFIG); @@ -2450,10 +2480,15 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) switch(command) { case SIOCSIFMTU: - if (ifr->ifr_mtu > RE_JUMBO_MTU) + if (ifr->ifr_mtu > sc->re_maxmtu) { error = EINVAL; - ifp->if_mtu = ifr->ifr_mtu; + } else if (ifp->if_mtu != ifr->ifr_mtu) { + ifp->if_mtu = ifr->ifr_mtu; + if (ifp->if_flags & IFF_RUNNING) + ifp->if_init(sc); + } break; + case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) re_init(sc); diff --git a/sys/dev/netif/re/if_rereg.h b/sys/dev/netif/re/if_rereg.h index 5cc1abe357..a132999bee 100644 --- a/sys/dev/netif/re/if_rereg.h +++ b/sys/dev/netif/re/if_rereg.h @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.42 2004/05/24 19:39:23 jhb Exp $ - * $DragonFly: src/sys/dev/netif/re/if_rereg.h,v 1.10 2008/09/29 20:27:38 dillon Exp $ + * $DragonFly: src/sys/dev/netif/re/if_rereg.h,v 1.11 2008/10/04 10:36:21 sephe Exp $ */ /* @@ -563,8 +563,10 @@ struct re_stats { #define RE_ADDR_LO(y) ((uint64_t) (y) & 0xFFFFFFFF) #define RE_ADDR_HI(y) ((uint64_t) (y) >> 32) -#define RE_JUMBO_FRAMELEN 9018 +#define RE_JUMBO_FRAMELEN 7440 #define RE_JUMBO_MTU (RE_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) +#define RE_FRAMELEN_2K 2048 +#define RE_FRAMELEN(mtu) (mtu + ETHER_HDR_LEN + ETHER_CRC_LEN) #define RE_TIMEOUT 1000 diff --git a/sys/dev/netif/re/if_revar.h b/sys/dev/netif/re/if_revar.h index d5dbe61190..101097abcc 100644 --- a/sys/dev/netif/re/if_revar.h +++ b/sys/dev/netif/re/if_revar.h @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.42 2004/05/24 19:39:23 jhb Exp $ - * $DragonFly: src/sys/dev/netif/re/if_revar.h,v 1.7 2008/10/03 14:07:02 sephe Exp $ + * $DragonFly: src/sys/dev/netif/re/if_revar.h,v 1.8 2008/10/04 10:36:21 sephe Exp $ */ struct re_chain_data { @@ -70,7 +70,7 @@ struct re_hwrev { int re_type; /* RE_{8139CPLUS,8169} */ uint32_t re_flags; /* see RE_F_ */ int re_swcsum_lim; - const char *re_desc; + int re_maxmtu; }; #define RE_8139CPLUS 3 @@ -128,6 +128,7 @@ struct re_softc { int re_eecmd_read; uint8_t re_stats_no_timeout; int re_txthresh; + uint32_t re_hwrev; struct re_chain_data re_cdata; struct re_list_data re_ldata; struct callout re_timer; @@ -142,6 +143,7 @@ struct re_softc { int re_link; int re_eewidth; int re_swcsum_lim; + int re_maxmtu; #ifdef DEVICE_POLLING int rxcycles; #endif @@ -162,10 +164,8 @@ struct re_softc { #define RE_F_HASMPC 0x1 #define RE_F_PCIE 0x2 -#define RE_F_JUMBO_SWCSUM 0x4 #define RE_SWCSUM_LIM_8169 2038 -#define RE_SWCSUM_LIM_8168B 2082 #define RE_TX_MODERATION_IS_ENABLED(sc) \ ((sc)->re_tx_ack == RE_ISR_TIMEOUT_EXPIRED) -- 2.41.0 From 82c6f048340d9efd4c6d7a56eb3ded220982e7cc Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sat, 4 Oct 2008 11:21:10 +0000 Subject: [PATCH 16/16] Recheck ifnet.if_bpf after we hold the BGL --- sys/net/if_loop.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 0bf18d2451..6136d91d58 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -32,7 +32,7 @@ * * @(#)if_loop.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_loop.c,v 1.47.2.9 2004/02/08 08:40:24 silby Exp $ - * $DragonFly: src/sys/net/if_loop.c,v 1.25 2008/09/06 06:09:42 sephe Exp $ + * $DragonFly: src/sys/net/if_loop.c,v 1.26 2008/10/04 11:21:10 sephe Exp $ */ /* @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -209,13 +210,20 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen) } if (ifp->if_bpf) { + get_mplock(); + + /* Re-check */ + if (ifp->if_bpf == NULL) + goto rel; + if (ifp->if_bpf->bif_dlt == DLT_NULL) { uint32_t bpf_af = (uint32_t)af; bpf_ptap(ifp->if_bpf, m, &bpf_af, 4); - } - else { + } else { bpf_mtap(ifp->if_bpf, m); } +rel: + rel_mplock(); } /* Strip away media header */ -- 2.41.0