Re: svn: head/sys/netinet
Won't this break whole lot of third-party software, which expects FreeBSD to be slightly different in this regards? Just curious. -Maxim On 10/7/2011 6:43 AM, Andre Oppermann wrote: Author: andre Date: Fri Oct 7 13:43:01 2011 New Revision: 226105 URL: http://svn.freebsd.org/changeset/base/226105 Log: Add back the IP header length to the total packet length field on raw IP sockets. It was deducted in ip_input() in preparation for protocols interested only in the payload. On raw sockets the IP header should be delivered as it at came in from the network except for the byte order swaps in some fields. This brings us in line with all other OS'es that provide raw IP sockets. Reported by: Matthew Cini Sarreo MFC after: 3 days Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c == --- head/sys/netinet/raw_ip.c Fri Oct 7 13:16:21 2011(r226104) +++ head/sys/netinet/raw_ip.c Fri Oct 7 13:43:01 2011(r226105) @@ -289,6 +289,13 @@ rip_input(struct mbuf *m, int off) last = NULL; ifp = m->m_pkthdr.rcvif; + /* +* Add back the IP header length which was +* removed by ip_input(). Raw sockets do +* not modify the packet except for some +* byte order swaps. +*/ + ip->ip_len += off; hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr, ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229049 - head/sbin/bsdlabel
Author: sobomax Date: Sat Dec 31 00:09:33 2011 New Revision: 229049 URL: http://svn.freebsd.org/changeset/base/229049 Log: Use in-label sectorsize to determine position of the label when writing label into a file image. The most common use - putting disklabel into ISO file. Before this change the label would always go to the offset 512, while geom_part code expects it to be in the 1st sector (i.e. 2048 incase of ISO). BSD disklabels provide good and lightweight way to logically split livecds. It is non-intrusive as far as ISO9660 goes (both boot-wise and metadata-wise) and completely transparent to anything but BSD, so you can have BSD-specific area appended after regular ISO. And with a little bit of GEOM trickery you can do even more interesting stuff with it. For example we make "hybrid" bootable CDs using this method. We create bootable ISO with kernel and such and append UFS image compressed with UZIP and it works like a charm. We put label based on the offsef of the BSD part into the ISO. The kernel boots off normal ISO9660 part, tastes label attaches it, tastes UZIP, attaches it and finally mounts UFS using GEOM_LABEL. This provides much better way of eliminating waste than doing "crunched" build. MFC after:1 month Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c == --- head/sbin/bsdlabel/bsdlabel.c Sat Dec 31 00:03:13 2011 (r229048) +++ head/sbin/bsdlabel/bsdlabel.c Sat Dec 31 00:09:33 2011 (r229049) @@ -400,7 +400,7 @@ writelabel(void) for (i = 0; i < lab.d_npartitions; i++) if (lab.d_partitions[i].p_size) lab.d_partitions[i].p_offset += lba_offset; - bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * secsize, + bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * lab.d_secsize, lp); fd = open(specname, O_RDWR); @@ -434,7 +434,7 @@ writelabel(void) gctl_ro_param(grq, "class", -1, "BSD"); gctl_ro_param(grq, "geom", -1, pname); gctl_ro_param(grq, "label", 148+16*8, - bootarea + labeloffset + labelsoffset * secsize); + bootarea + labeloffset + labelsoffset * lab.d_secsize); errstr = gctl_issue(grq); if (errstr != NULL) { warnx("%s", errstr); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/netinet
On 12/30/2011 12:02 PM, Gleb Smirnoff wrote: On Fri, Dec 30, 2011 at 11:23:45AM -0800, Maxim Sobolev wrote: M> Won't this break whole lot of third-party software, which expects M> FreeBSD to be slightly different in this regards? Just curious. Yes it does. And until FreeBSD 10.0-RELEASE there is time to fix this software (at least in ports). The MFC to stable/9 of r226105 was back out. Well, I am just curious how critical it is to get it resolved and is there any way to avoid ABI breakage. Software compiled for 9.x won't run on 10.x even when fitted with the proper compat libs, as far as I can tell and not all software can be easily recompiled. There are also other places where BSD have subtle differences with almost any other nix flavor out there. Not accepting sun_len = 0 in the unix domain sockets is one of those places that comes to mind. Other systems just do strlen() of sun_path, while BSD does EINVAL. And we've been living with this for decades. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/netinet
On 12/30/2011 4:17 PM, Maxim Sobolev wrote: M> Won't this break whole lot of third-party software, which expects M> FreeBSD to be slightly different in this regards? Just curious. Yes it does. And until FreeBSD 10.0-RELEASE there is time to fix this software (at least in ports). The MFC to stable/9 of r226105 was back out. Well, I am just curious how critical it is to get it resolved and is there any way to avoid ABI breakage. Software compiled for 9.x won't run on 10.x even when fitted with the proper compat libs, as far as I can tell and not all software can be easily recompiled. P.S. It should be trivial to put some COMPAT_8/COMPAT_9 shims based on the version of the ELF image (i.e. detect if the binary is < than FreeBSD 10. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/netinet
On 12/30/2011 11:52 PM, Kostik Belousov wrote: On Fri, Dec 30, 2011 at 04:25:09PM -0800, Maxim Sobolev wrote: > On 12/30/2011 4:17 PM, Maxim Sobolev wrote: > >>M> Won't this break whole lot of third-party software, which expects > >>M> FreeBSD to be slightly different in this regards? Just curious. > >> > >>Yes it does. And until FreeBSD 10.0-RELEASE there is time to fix > >>this software (at least in ports). > >> > >>The MFC to stable/9 of r226105 was back out. > > > >Well, I am just curious how critical it is to get it resolved and is > >there any way to avoid ABI breakage. Software compiled for 9.x won't run > >on 10.x even when fitted with the proper compat libs, as far as I can > >tell and not all software can be easily recompiled. > > P.S. It should be trivial to put some COMPAT_8/COMPAT_9 shims based on > the version of the ELF image (i.e. detect if the binary is< than > FreeBSD 10. What exactly do you mean by 'version of the ELF image' ? ABI note tag ? What do you propose to do if older call comes from dso, or a library statically linked in the main binary ? Well, 9.x binary would be linked to 9.x library and vice versa. So I don't see any problems either way. [ssp-root@jood1 /home/ssp]$ file /bin/sh /bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 8.2 (802510), stripped Technically yes, 10.x binary can open 9.x DSO and we won't know, but I don't think this situation would happen in real life. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215342 - in stable/8/sys: arm/at91 arm/xscale/ixp425 dev/ae dev/an dev/ath dev/bwi dev/bwn dev/ce dev/cm dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed dev/ep dev/ex dev/fe dev/ie dev/i...
Author: sobomax Date: Mon Nov 15 17:48:13 2010 New Revision: 215342 URL: http://svn.freebsd.org/changeset/base/215342 Log: MFC r207554: Add new tunable 'net.link.ifqmaxlen' to set default send interface queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. Modified: stable/8/sys/arm/at91/if_ate.c stable/8/sys/arm/xscale/ixp425/if_npe.c stable/8/sys/dev/ae/if_ae.c stable/8/sys/dev/an/if_an.c stable/8/sys/dev/ath/if_ath.c stable/8/sys/dev/bwi/if_bwi.c stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/ce/if_ce.c stable/8/sys/dev/cm/smc90cx6.c stable/8/sys/dev/cp/if_cp.c stable/8/sys/dev/cs/if_cs.c stable/8/sys/dev/ctau/if_ct.c stable/8/sys/dev/cx/if_cx.c stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/ed/if_ed.c stable/8/sys/dev/ep/if_ep.c stable/8/sys/dev/ex/if_ex.c stable/8/sys/dev/fe/if_fe.c stable/8/sys/dev/ie/if_ie.c stable/8/sys/dev/iicbus/if_ic.c stable/8/sys/dev/ipw/if_ipw.c stable/8/sys/dev/iwi/if_iwi.c stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/le/lance.c stable/8/sys/dev/malo/if_malo.c stable/8/sys/dev/mwl/if_mwl.c stable/8/sys/dev/my/if_my.c stable/8/sys/dev/nxge/if_nxge.c stable/8/sys/dev/pdq/pdq_ifsubr.c stable/8/sys/dev/ppbus/if_plip.c stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c stable/8/sys/dev/sbni/if_sbni.c stable/8/sys/dev/smc/if_smc.c stable/8/sys/dev/sn/if_sn.c stable/8/sys/dev/snc/dp83932.c stable/8/sys/dev/usb/net/uhso.c stable/8/sys/dev/usb/net/usb_ethernet.c stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_uath.c stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_urtw.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/dev/vx/if_vx.c stable/8/sys/dev/wi/if_wi.c stable/8/sys/dev/wl/if_wl.c stable/8/sys/dev/wpi/if_wpi.c stable/8/sys/dev/xe/if_xe.c stable/8/sys/mips/adm5120/if_admsw.c stable/8/sys/net/if.c stable/8/sys/net/if_ef.c stable/8/sys/net/if_gif.c stable/8/sys/net/if_gre.c stable/8/sys/net/if_stf.c stable/8/sys/net80211/ieee80211.c stable/8/sys/netgraph/ng_eiface.c stable/8/sys/netgraph/ng_fec.c stable/8/sys/netgraph/ng_iface.c stable/8/sys/netgraph/ng_tty.c stable/8/sys/pci/if_rl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/arm/at91/if_ate.c == --- stable/8/sys/arm/at91/if_ate.c Mon Nov 15 17:40:48 2010 (r215341) +++ stable/8/sys/arm/at91/if_ate.c Mon Nov 15 17:48:13 2010 (r215342) @@ -274,8 +274,8 @@ ate_attach(device_t dev) ifp->if_ioctl = ateioctl; ifp->if_init = ateinit; ifp->if_baudrate = 1000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_timer = 0; ifp->if_linkmib = &sc->mibdata; Modified: stable/8/sys/arm/xscale/ixp425/if_npe.c == --- stable/8/sys/arm/xscale/ixp425/if_npe.c Mon Nov 15 17:40:48 2010 (r215341) +++ stable/8/sys/arm/xscale/ixp425/if_npe.c Mon Nov 15 17:48:13 2010 (r215342) @@ -359,7 +359,7 @@ npe_attach(device_t dev) ifp->if_ioctl = npeioctl; ifp->if_init = npeinit; IFQ_SET_MAXLEN(&ifp->if_snd, sc->txdma.nbuf - 1); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof(sc->mibdata); Modified: stable/8/sys/dev/ae/if_ae.c == --- stable/8/sys/dev/ae/if_ae.c Mon Nov 15 17:40:48 2010(r215341) +++ stable/8/sys/dev/ae/if_ae.c Mon Nov 15 17:48:13 2010(r215342) @@ -375,7 +375,7 @@ ae_attach(device_t dev) ifp->if_init = ae_init; ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; ifp->if_hwassist = 0; - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { M
svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d...
Author: sobomax Date: Tue Nov 16 04:40:03 2010 New Revision: 215368 URL: http://svn.freebsd.org/changeset/base/215368 Log: MFC r207554: Add new tunable 'net.link.ifqmaxlen' to set default send interface queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. Modified: stable/7/sys/arm/at91/if_ate.c stable/7/sys/arm/xscale/ixp425/if_npe.c stable/7/sys/contrib/dev/oltr/if_oltr.c stable/7/sys/dev/ae/if_ae.c stable/7/sys/dev/an/if_an.c stable/7/sys/dev/ar/if_ar.c stable/7/sys/dev/arl/if_arl.c stable/7/sys/dev/ath/if_ath.c stable/7/sys/dev/awi/awi.c stable/7/sys/dev/ce/if_ce.c stable/7/sys/dev/cm/smc90cx6.c stable/7/sys/dev/cnw/if_cnw.c stable/7/sys/dev/cp/if_cp.c stable/7/sys/dev/cs/if_cs.c stable/7/sys/dev/ctau/if_ct.c stable/7/sys/dev/cx/if_cx.c stable/7/sys/dev/cxgb/cxgb_main.c stable/7/sys/dev/ed/if_ed.c stable/7/sys/dev/ep/if_ep.c stable/7/sys/dev/ex/if_ex.c stable/7/sys/dev/ie/if_ie.c stable/7/sys/dev/iicbus/if_ic.c stable/7/sys/dev/ipw/if_ipw.c stable/7/sys/dev/iwi/if_iwi.c stable/7/sys/dev/le/lance.c stable/7/sys/dev/malo/if_malo.c stable/7/sys/dev/my/if_my.c stable/7/sys/dev/nxge/if_nxge.c stable/7/sys/dev/pdq/pdq_ifsubr.c stable/7/sys/dev/ppbus/if_plip.c stable/7/sys/dev/ral/rt2560.c stable/7/sys/dev/ral/rt2661.c stable/7/sys/dev/ray/if_ray.c stable/7/sys/dev/sbni/if_sbni.c stable/7/sys/dev/sbsh/if_sbsh.c stable/7/sys/dev/sn/if_sn.c stable/7/sys/dev/snc/dp83932.c stable/7/sys/dev/sr/if_sr.c stable/7/sys/dev/usb/if_aue.c stable/7/sys/dev/usb/if_axe.c stable/7/sys/dev/usb/if_cdce.c stable/7/sys/dev/usb/if_cue.c stable/7/sys/dev/usb/if_kue.c stable/7/sys/dev/usb/if_rue.c stable/7/sys/dev/usb/if_rum.c stable/7/sys/dev/usb/if_udav.c stable/7/sys/dev/usb/if_ural.c stable/7/sys/dev/usb/if_zyd.c stable/7/sys/dev/usb/udbp.c stable/7/sys/dev/vx/if_vx.c stable/7/sys/dev/wi/if_wi.c stable/7/sys/dev/wl/if_wl.c stable/7/sys/dev/wpi/if_wpi.c stable/7/sys/dev/xe/if_xe.c stable/7/sys/i4b/capi/capi_l4if.c stable/7/sys/i4b/driver/i4b_ing.c stable/7/sys/i4b/driver/i4b_isppp.c stable/7/sys/i4b/driver/i4b_trace.c stable/7/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c stable/7/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c stable/7/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c stable/7/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c stable/7/sys/i4b/layer1/isic/i4b_bchan.c stable/7/sys/i4b/layer1/itjc/i4b_itjc_pci.c stable/7/sys/i4b/layer1/iwic/i4b_iwic_bchan.c stable/7/sys/i4b/layer4/i4b_i4bdrv.c stable/7/sys/net/if.c stable/7/sys/net/if_ef.c stable/7/sys/net/if_gif.c stable/7/sys/net/if_gre.c stable/7/sys/net/if_ppp.c stable/7/sys/net/if_stf.c stable/7/sys/netatalk/ddp_usrreq.c stable/7/sys/netgraph/ng_eiface.c stable/7/sys/netgraph/ng_fec.c stable/7/sys/netgraph/ng_iface.c stable/7/sys/netgraph/ng_tty.c stable/7/sys/netinet/ip_input.c stable/7/sys/netinet6/ip6_input.c stable/7/sys/netipx/ipx_input.c stable/7/sys/pci/if_rl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/arm/at91/if_ate.c == --- stable/7/sys/arm/at91/if_ate.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/arm/at91/if_ate.c Tue Nov 16 04:40:03 2010 (r215368) @@ -231,8 +231,8 @@ ate_attach(device_t dev) ifp->if_ioctl = ateioctl; ifp->if_init = ateinit; ifp->if_baudrate = 1000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_timer = 0; ifp->if_linkmib = &sc->mibdata; Modified: stable/7/sys/arm/xscale/ixp425/if_npe.c == --- stable/7/sys/arm/xscale/ixp425/if_npe.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/arm/xscale/ixp425/if_npe.c Tue Nov 16 04:40:03 2010 (r215368) @@ -335,7 +335,7 @@ npe_attach(device_t dev) ifp->if_ioctl = npeioctl; ifp->if_init = npeinit; IFQ_SET_MAXLEN(&ifp->if_snd, sc->txdma.nbuf - 1); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof(sc->mibdata); Modified: stable/7/sys/contrib/dev/oltr/if_oltr.c
svn commit: r215400 - stable/7/sys/netipx
Author: sobomax Date: Tue Nov 16 15:02:53 2010 New Revision: 215400 URL: http://svn.freebsd.org/changeset/base/215400 Log: Fix build problem introduced in r215368 MFC when IPX is enabled. Submitted by: des Modified: stable/7/sys/netipx/ipx_input.c Modified: stable/7/sys/netipx/ipx_input.c == --- stable/7/sys/netipx/ipx_input.c Tue Nov 16 14:08:21 2010 (r215399) +++ stable/7/sys/netipx/ipx_input.c Tue Nov 16 15:02:53 2010 (r215400) @@ -119,7 +119,6 @@ struct mtx ipxpcb_list_mtx; struct ipxpcbhead ipxpcb_list; struct ipxpcbhead ipxrawpcb_list; -static int ipxqmaxlen = ifqmaxlen; static struct ifqueue ipxintrq; long ipx_pexseq; /* Locked with ipxpcb_list_mtx. */ @@ -151,7 +150,7 @@ ipx_init(void) ipx_hostmask.sipx_addr.x_net = ipx_broadnet; ipx_hostmask.sipx_addr.x_host = ipx_broadhost; - ipxintrq.ifq_maxlen = ipxqmaxlen; + ipxintrq.ifq_maxlen = ifqmaxlen; mtx_init(&ipxintrq.ifq_mtx, "ipx_inq", NULL, MTX_DEF); netisr_register(NETISR_IPX, ipxintr, &ipxintrq, NETISR_MPSAFE); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed
On 11/16/2010 5:11 AM, Dag-Erling Smørgrav wrote: That's not going to fly. Should be fixed in r215400. Sorry about that. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts T/F: +1-646-651-1110 Web: http://www.sippysoft.com MSN: sa...@sippysoft.com Skype: SippySoft ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed
On 11/16/2010 8:12 AM, Bruce Evans wrote: This was quite low for yestdeay's uses (starting in about 1995), but today it is little missed since only yesterday's low-end hardware uses it. Most of today's interfaces are 1Gbps, and for this it is almost essential for the hardware to have a ring buffer with > 50 entries, so most of today's drivers ignore ifqmaxlen and set the queue length to the almost equally bogus value of the ring buffer size (-1). I set it to about 1 instead in bge and em (1 is too large, but fixes streaming under certain loads when hz is small). One of those interfaces is if_rl, which is still quite popular these days and supports speeds up to 1gbps (which I believe triggered this change). But in general I agree, unfortunately FreeBSD network subsystem is tuned for yesteday's speeds. We are seeing lot of lookups and other issues under high PPS. I wish somebody could stand and pick up the task of cleaning it up and re-tuning eventually for 2010. We could probably even sponsor in part such a work (anyone). Apart from interface tuning for Gbps speeds, another area that needs more work is splitting up memory pool for the IPC from the memory pool for the other networking. Today's software is highly distributed and rock-solid IPC is a must for the FreeBSD being a solid server application platform. That's OK when under the load we drop some packets, but it's not OK when extreme network activity can bring down communications between application and database system within the host itself. And that's exactly what can happen in FreeBSD. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts T/F: +1-646-651-1110 Web: http://www.sippysoft.com MSN: sa...@sippysoft.com Skype: SippySoft ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r226711 - head/sbin/fsck
Author: sobomax Date: Tue Oct 25 01:46:42 2011 New Revision: 226711 URL: http://svn.freebsd.org/changeset/base/226711 Log: Add new option -c to specify alternatve location of the /etc/fstab file. MFC after:1 month Modified: head/sbin/fsck/fsck.8 head/sbin/fsck/fsck.c Modified: head/sbin/fsck/fsck.8 == --- head/sbin/fsck/fsck.8 Tue Oct 25 00:34:39 2011(r226710) +++ head/sbin/fsck/fsck.8 Tue Oct 25 01:46:42 2011(r226711) @@ -41,6 +41,7 @@ .Op Fl B | F .Op Fl T Ar fstype : Ns Ar fsoptions .Op Fl t Ar fstype +.Op Fl c Ar fstab .Oo Ar special | node Oc ... .Sh DESCRIPTION The @@ -117,6 +118,10 @@ Check if the .Dq clean flag is set in the superblock and skip file system checks if file system was properly dismounted and marked clean. +.It Fl c Ar fstab +Specify the +.Pa fstab +file to use. .It Fl d Debugging mode. Just print the commands without executing them. Modified: head/sbin/fsck/fsck.c == --- head/sbin/fsck/fsck.c Tue Oct 25 00:34:39 2011(r226710) +++ head/sbin/fsck/fsck.c Tue Oct 25 01:46:42 2011(r226711) @@ -96,6 +96,7 @@ main(int argc, char *argv[]) int i, rval = 0; const char *vfstype = NULL; char globopt[3]; + const char *etc_fstab; globopt[0] = '-'; globopt[2] = '\0'; @@ -103,7 +104,8 @@ main(int argc, char *argv[]) TAILQ_INIT(&selhead); TAILQ_INIT(&opthead); - while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1) + etc_fstab = NULL; + while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:c:")) != -1) switch (i) { case 'B': if (flags & CHECK_BACKGRD) @@ -160,6 +162,10 @@ main(int argc, char *argv[]) vfstype = optarg; break; + case 'c': + etc_fstab = optarg; + break; + case '?': default: usage(); @@ -169,6 +175,9 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (etc_fstab != NULL) + setfstab(etc_fstab); + if (argc == 0) return checkfstab(flags, isok, checkfs); @@ -571,7 +580,7 @@ static void usage(void) { static const char common[] = - "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]"; + "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype] [-c fstab]"; (void)fprintf(stderr, "usage: %s %s [special | node] ...\n", getprogname(), common); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r226712 - head/sbin/swapon
Author: sobomax Date: Tue Oct 25 01:47:33 2011 New Revision: 226712 URL: http://svn.freebsd.org/changeset/base/226712 Log: Add new option -F to specify alternative location of the /etc/fstab file. MFC after:1 month Modified: head/sbin/swapon/swapon.8 head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.8 == --- head/sbin/swapon/swapon.8 Tue Oct 25 01:46:42 2011(r226711) +++ head/sbin/swapon/swapon.8 Tue Oct 25 01:47:33 2011(r226712) @@ -35,8 +35,14 @@ .Nm swapon , swapoff , swapctl .Nd "specify devices for paging and swapping" .Sh SYNOPSIS -.Nm swapon Fl aq | Ar -.Nm swapoff Fl aq | Ar +.Nm swapon +.Oo Fl F Ar fstab +.Oc +.Fl aq | Ar +.Nm swapoff +.Oo Fl F Ar fstab +.Oc +.Fl aq | Ar .Nm swapctl .Op Fl AghklmsU .Oo @@ -99,6 +105,18 @@ must move swapped pages out of the devic lead to high system loads for a period of time, depending on how much data has been swapped out to that device. .Pp +Other options supported by both +.Nm swapon +and +.Nm swapoff +are as follows: +.Bl -tag -width indent +.It Fl F Ar fstab +Specify the +.Pa fstab +file to use. +.El +.Pp The .Nm swapctl utility exists primarily for those familiar with other Modified: head/sbin/swapon/swapon.c == --- head/sbin/swapon/swapon.c Tue Oct 25 01:46:42 2011(r226711) +++ head/sbin/swapon/swapon.c Tue Oct 25 01:47:33 2011(r226712) @@ -70,6 +70,7 @@ main(int argc, char **argv) int stat; int ch, doall; int sflag = 0, lflag = 0, hflag = 0, qflag = 0; + const char *etc_fstab; if ((ptr = strrchr(argv[0], '/')) == NULL) ptr = argv[0]; @@ -80,7 +81,8 @@ main(int argc, char **argv) orig_prog = which_prog; doall = 0; - while ((ch = getopt(argc, argv, "AadghklmqsU")) != -1) { + etc_fstab = NULL; + while ((ch = getopt(argc, argv, "AadghklmqsUF:")) != -1) { switch(ch) { case 'A': if (which_prog == SWAPCTL) { @@ -132,6 +134,9 @@ main(int argc, char **argv) usage(); } break; + case 'F': + etc_fstab = optarg; + break; case '?': default: usage(); @@ -140,6 +145,8 @@ main(int argc, char **argv) argv += optind; stat = 0; + if (etc_fstab != NULL) + setfstab(etc_fstab); if (which_prog == SWAPON || which_prog == SWAPOFF) { if (doall) { while ((fsp = getfsent()) != NULL) { @@ -210,7 +217,7 @@ usage(void) switch(orig_prog) { case SWAPON: case SWAPOFF: - fprintf(stderr, "-aq | file ...\n"); + fprintf(stderr, "[-F fstab] -aq | file ...\n"); break; case SWAPCTL: fprintf(stderr, "[-AghklmsU] [-a file ... | -d file ...]\n"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217714 - head/sbin/fdisk
Author: sobomax Date: Sat Jan 22 05:21:20 2011 New Revision: 217714 URL: http://svn.freebsd.org/changeset/base/217714 Log: Warn user when value entered is greated than the amount supported by the MBR for the given parameter and set that parameter to the maximum value instead of just truncating the most significant part silently. Could happen for example if the capacity of the device is more than 2TB, so that the number of sectors is greater than 2Mib. MFC after:1 month Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c == --- head/sbin/fdisk/fdisk.c Sat Jan 22 01:48:12 2011(r217713) +++ head/sbin/fdisk/fdisk.c Sat Jan 22 05:21:20 2011(r217714) @@ -62,7 +62,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp) if (decimal(str, &tmp, ans)) ans = tmp +#define Decimal(str, ans, tmp, size) if (decimal(str, &tmp, ans, size)) ans = tmp #define RoundCyl(x) x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +247,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt); +static int decimal(const char *str, int *num, int deflt, int size); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +572,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp); - Decimal("start", partp->dp_start, tmp); - Decimal("size", partp->dp_size, tmp); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ)); + Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start)); + Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size)); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +586,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp); - Decimal("beginning head", thd, tmp); - Decimal("beginning sector", tsec, tmp); + Decimal("beginning cylinder", tcyl, tmp, sizeof(partp->dp_scyl)); + Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd)); + Decimal("beginning sector", tsec, tmp, sizeof(partp->dp_ssect)); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +596,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp); - Decimal("ending head", thd, tmp); - Decimal("ending sector", tsec, tmp); + Decimal("ending cylinder", tcyl, tmp, sizeof(partp->dp_ecyl)); + Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd)); + Decimal("ending sector", tsec, tmp, sizeof(partp->dp_esect)); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -647,7 +647,7 @@ change_active(int which) setactive: do { new = active; - Decimal("active partition", new, tmp); + Decimal("active partition", new, tmp, 0); if (new < 1 || new > 4) { printf("Active partition number must be in range 1-4." " Try again.\n"); @@ -677,9 +677,9 @@ get_params_to_use() { do { - Decimal("BIOS's idea of #cylinders", dos_cyls, tmp); - Decimal("BIOS's idea of #heads", dos_heads, tmp); - Decimal("BIOS's idea of #sectors", dos_sectors, tmp); + Decimal("BIOS's idea of #cylinders", dos_cyls, tmp, 0); + Decimal("BIOS's idea of #heads", dos_heads, tmp, 0); + Decimal("BIOS's idea of #sectors", dos_sectors, tmp, 0); dos_cylsecs = dos_heads * dos_sectors; print_params(); } @@ -915,11 +915,16 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt) +decimal(const char *str, int *num, in
svn commit: r217771 - head/sbin/fdisk
Author: sobomax Date: Mon Jan 24 07:16:20 2011 New Revision: 217771 URL: http://svn.freebsd.org/changeset/base/217771 Log: o Cylinder numbers are 10 bits in the MBR; o Sector numbers are only 6 bits in the MBR; o bde'cize name of the local variable. Submitted by: bde Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c == --- head/sbin/fdisk/fdisk.c Mon Jan 24 06:46:03 2011(r217770) +++ head/sbin/fdisk/fdisk.c Mon Jan 24 07:16:20 2011(r217771) @@ -62,7 +62,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp, size) if (decimal(str, &tmp, ans, size)) ans = tmp +#define Decimal(str, ans, tmp, nbits) if (decimal(str, &tmp, ans, nbits)) ans = tmp #define RoundCyl(x) x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +247,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt, int size); +static int decimal(const char *str, int *num, int deflt, int nbits); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +572,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ)); - Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start)); - Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size)); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ) * 8); + Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start) * 8); + Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size) * 8); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +586,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp, sizeof(partp->dp_scyl)); - Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd)); - Decimal("beginning sector", tsec, tmp, sizeof(partp->dp_ssect)); + Decimal("beginning cylinder", tcyl, tmp, 10); + Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd) * 8); + Decimal("beginning sector", tsec, tmp, 6); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +596,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp, sizeof(partp->dp_ecyl)); - Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd)); - Decimal("ending sector", tsec, tmp, sizeof(partp->dp_esect)); + Decimal("ending cylinder", tcyl, tmp, 10); + Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd) * 8); + Decimal("ending sector", tsec, tmp, 6); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -915,16 +915,16 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt, int size) +decimal(const char *str, int *num, int deflt, int nbits) { - long long acc = 0, maxval; + long long acc = 0, limit; int c; char *cp; - if (size == 0) { - size = sizeof(*num); + if (nbits == 0) { + nbits = sizeof(*num) * 8; } - maxval = (long long)1 << (size * 8); + limit = (long long)1 << nbits; while (1) { printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); @@ -941,7 +941,7 @@ decimal(const char *str, int *num, int d return 0; while ((c = *cp++)) { if (c <= '9' && c >= '0') { - if (acc < maxval) + if (acc < limit) acc = acc * 10 + c - '0'; } else break; @@ -949,8 +949,8 @@ decimal(const char *str, int *num, int d if (c == ' ' || c == '\t') while ((c = *cp) && (c == ' ' || c == '\t')) cp++;
Re: svn commit: r217714 - head/sbin/fdisk
On 1/23/2011 10:25 PM, Warner Losh wrote: In case it wasn't clear from Bruce's long explaination, parts of this are technically wrong and need to be reverted or fixed. Yes, I know. Sorry for the delay, I've been away for a weekend. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217808 - head/sbin/fdisk
Author: sobomax Date: Tue Jan 25 04:35:07 2011 New Revision: 217808 URL: http://svn.freebsd.org/changeset/base/217808 Log: Supply maximum value as an argument to the decimal() function instead of supplying number of bits. Submitted by: bde Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c == --- head/sbin/fdisk/fdisk.c Tue Jan 25 01:26:25 2011(r217807) +++ head/sbin/fdisk/fdisk.c Tue Jan 25 04:35:07 2011(r217808) @@ -49,7 +49,10 @@ __FBSDID("$FreeBSD$"); int iotest; -#define NOSECTORS ((u_int32_t)-1) +#define NO_DISK_SECTORS ((u_int32_t)-1) +#define NO_TRACK_CYLINDERS 1023 +#define NO_TRACK_HEADS 255 +#define NO_TRACK_SECTORS 63 #define LBUF 100 static char lbuf[LBUF]; @@ -62,7 +65,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp, nbits) if (decimal(str, &tmp, ans, nbits)) ans = tmp +#define Decimal(str, ans, tmp, maxval) if (decimal(str, &tmp, ans, maxval)) ans = tmp #define RoundCyl(x) x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +250,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt, int nbits); +static int decimal(const char *str, int *num, int deflt, uint32_t maxval); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +575,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ) * 8); - Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start) * 8); - Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size) * 8); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, 255); + Decimal("start", partp->dp_start, tmp, NO_DISK_SECTORS); + Decimal("size", partp->dp_size, tmp, NO_DISK_SECTORS); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +589,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp, 10); - Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd) * 8); - Decimal("beginning sector", tsec, tmp, 6); + Decimal("beginning cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); + Decimal("beginning head", thd, tmp, NO_TRACK_HEADS); + Decimal("beginning sector", tsec, tmp, NO_TRACK_SECTORS); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +599,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp, 10); - Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd) * 8); - Decimal("ending sector", tsec, tmp, 6); + Decimal("ending cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); + Decimal("ending head", thd, tmp, NO_TRACK_HEADS); + Decimal("ending sector", tsec, tmp, NO_TRACK_SECTORS); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -915,16 +918,12 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt, int nbits) +decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0, limit; + long long acc = 0; int c; char *cp; - if (nbits == 0) { - nbits = sizeof(*num) * 8; - } - limit = (long long)1 << nbits; while (1) { printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); @@ -941,7 +940,7 @@ decimal(const char *str, int *num, int d return 0; while ((c = *cp++)) { if (c <= '9' && c >= '0') { - if (acc < limit) + if (maxval > 0 && acc <= maxval) acc = acc * 10 + c - '0'; } else break; @@ -949,10 +948,11 @@ decimal(const char *str, int *num, int d if (c == ' ' || c == '\t')
svn commit: r218944 - head/usr.sbin/newsyslog
Author: sobomax Date: Tue Feb 22 09:11:47 2011 New Revision: 218944 URL: http://svn.freebsd.org/changeset/base/218944 Log: Make code more friendly to the non-C99 compilers - don't allocate local variables in the `for' loop declaration. This allows trunk newsyslog.c to be compiled on 7.x. This change should be no-op from the functional POV. Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Tue Feb 22 08:21:22 2011 (r218943) +++ head/usr.sbin/newsyslog/newsyslog.c Tue Feb 22 09:11:47 2011 (r218944) @@ -1450,6 +1450,7 @@ delete_oldest_timelog(const struct conf_ const char *cdir; struct tm tm; DIR *dirp; + int c; oldlogs = malloc(MAX_OLDLOGS * sizeof(struct oldlog_entry)); max_logcnt = MAX_OLDLOGS; @@ -1514,7 +1515,7 @@ delete_oldest_timelog(const struct conf_ continue; } - for (int c = 0; c < COMPRESS_TYPES; c++) + for (c = 0; c < COMPRESS_TYPES; c++) if (strcmp(s, compress_type[c].suffix) == 0) valid = 1; if (valid != 1) { @@ -1629,8 +1630,9 @@ get_logfile_suffix(const char *logfile) { struct stat st; char zfile[MAXPATHLEN]; + int c; - for (int c = 0; c < COMPRESS_TYPES; c++) { + for (c = 0; c < COMPRESS_TYPES; c++) { (void) strlcpy(zfile, logfile, MAXPATHLEN); (void) strlcat(zfile, compress_type[c].suffix, MAXPATHLEN); if (lstat(zfile, &st) == 0) @@ -1653,6 +1655,7 @@ do_rotate(const struct conf_entry *ent) struct stat st; struct tm tm; time_t now; + int c; flags = ent->flags; free_or_keep = FREE_ENT; @@ -1703,7 +1706,7 @@ do_rotate(const struct conf_entry *ent) delete_oldest_timelog(ent, dirpart); else { /* name of oldest log */ - for (int c = 0; c < COMPRESS_TYPES; c++) { + for (c = 0; c < COMPRESS_TYPES; c++) { (void) snprintf(zfile1, sizeof(zfile1), "%s%s", file1, compress_type[c].suffix); if (noaction) @@ -1889,12 +1892,13 @@ do_zipwork(struct zipwork_entry *zwork) int errsav, fcount, zstatus; pid_t pidzip, wpid; char zresult[MAXPATHLEN]; + int c; pgm_path = NULL; strlcpy(zresult, zwork->zw_fname, sizeof(zresult)); if (zwork != NULL && zwork->zw_conf != NULL && zwork->zw_conf->compress > COMPRESS_NONE) - for (int c = 1; c < COMPRESS_TYPES; c++) { + for (c = 1; c < COMPRESS_TYPES; c++) { if (zwork->zw_conf->compress == c) { pgm_path = compress_type[c].path; (void) strlcat(zresult, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r223143 - head/sbin/hastd
Author: sobomax Date: Thu Jun 16 08:31:06 2011 New Revision: 223143 URL: http://svn.freebsd.org/changeset/base/223143 Log: Revert r222688. Requested by: Mikolaj Golub Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c == --- head/sbin/hastd/proto_common.c Thu Jun 16 07:27:13 2011 (r223142) +++ head/sbin/hastd/proto_common.c Thu Jun 16 08:31:06 2011 (r223143) @@ -194,8 +194,6 @@ int proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) { ssize_t done; - size_t total_done, recvsize; - unsigned char *dp; PJDLOG_ASSERT(sock >= 0); @@ -212,19 +210,9 @@ proto_common_recv(int sock, unsigned cha PJDLOG_ASSERT(data != NULL); PJDLOG_ASSERT(size > 0); - total_done = 0; - dp = data; do { - recvsize = size - total_done; - recvsize = recvsize < MAX_SEND_SIZE ? recvsize : MAX_SEND_SIZE; - done = recv(sock, dp, recvsize, MSG_WAITALL); - if (done == -1 && errno == EINTR) - continue; - if (done <= 0) - break; - total_done += done; - dp += done; - } while (total_done < size); + done = recv(sock, data, size, MSG_WAITALL); + } while (done == -1 && errno == EINTR); if (done == 0) { return (ENOTCONN); } else if (done < 0) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r224292 - stable/8/sbin/natd
Author: sobomax Date: Sun Jul 24 18:03:02 2011 New Revision: 224292 URL: http://svn.freebsd.org/changeset/base/224292 Log: MFC: 220736, 220806, 220808 If we can retrieve interface address sleep for one second and try again. This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. Do this only in background, dynamic mode. Reminded by: brian Modified: stable/8/sbin/natd/natd.c Directory Properties: stable/8/sbin/natd/ (props changed) Modified: stable/8/sbin/natd/natd.c == --- stable/8/sbin/natd/natd.c Sun Jul 24 17:52:35 2011(r224291) +++ stable/8/sbin/natd/natd.c Sun Jul 24 18:03:02 2011(r224292) @@ -111,7 +111,7 @@ static void Usage (void); static char* FormatPacket (struct ip*); static voidPrintPacket (struct ip*); static voidSyslogPacket (struct ip*, int priority, const char *label); -static voidSetAliasAddressFromIfName (const char *ifName); +static int SetAliasAddressFromIfName (const char *ifName); static voidInitiateShutdown (int); static voidShutdown (int); static voidRefreshAddr (int); @@ -156,6 +156,7 @@ int main (int argc, char** argv) struct sockaddr_in addr; fd_set readMask; int fdMax; + int rval; /* * Initialize packet aliasing software. * Done already here to be able to alter option bits @@ -301,8 +302,17 @@ int main (int argc, char** argv) mip->assignAliasAddr = 1; } - else - SetAliasAddressFromIfName (mip->ifName); + else { + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) + sleep(1); + } while (rval == EAGAIN); + if (rval != 0) + exit(1); + } } } @@ -531,7 +541,8 @@ static void DoGlobal (int fd) #if 0 if (mip->assignAliasAddr) { - SetAliasAddressFromIfName (mip->ifName); + if (SetAliasAddressFromIfName (mip->ifName) != 0) + exit(1); mip->assignAliasAddr = 0; } #endif @@ -634,10 +645,18 @@ static void DoAliasing (int fd, int dire socklen_t addrSize; struct ip* ip; charmsgBuf[80]; + int rval; if (mip->assignAliasAddr) { - - SetAliasAddressFromIfName (mip->ifName); + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) + sleep(1); + } while (rval == EAGAIN); + if (rval != 0) + exit(1); mip->assignAliasAddr = 0; } /* @@ -867,7 +886,7 @@ static char* FormatPacket (struct ip* ip return buf; } -static void +static int SetAliasAddressFromIfName(const char *ifn) { size_t needed; @@ -951,14 +970,19 @@ SetAliasAddressFromIfName(const char *if } } } - if (sin == NULL) - errx(1, "%s: cannot get interface address", ifn); + if (sin == NULL) { + warnx("%s: cannot get interface address", ifn); + free(buf); + return EAGAIN; + } LibAliasSetAddress(mla, sin->sin_addr); syslog(LOG_INFO, "Aliasing to %s, mtu %d bytes", inet_ntoa(sin->sin_addr), mip->ifMTU); free(buf); + + return 0; } void Quit (const char* msg) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r224301 - stable/8/sys/geom/label
Author: sobomax Date: Mon Jul 25 00:17:20 2011 New Revision: 224301 URL: http://svn.freebsd.org/changeset/base/224301 Log: MFC: Strip any leading slashes before feeding the label to the geom_label code. Some linux distros put mount point into the ext2fs labels, such as '/', or '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code. Modified: stable/8/sys/geom/label/g_label_ext2fs.c Directory Properties: stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/geom/label/g_label_ext2fs.c == --- stable/8/sys/geom/label/g_label_ext2fs.cSun Jul 24 23:44:16 2011 (r224300) +++ stable/8/sys/geom/label/g_label_ext2fs.cMon Jul 25 00:17:20 2011 (r224301) @@ -53,6 +53,7 @@ g_label_ext2fs_taste(struct g_consumer * { struct g_provider *pp; e2sb_t *fs; + char *s_volume_name; g_topology_assert_not(); pp = cp->provider; @@ -74,13 +75,18 @@ g_label_ext2fs_taste(struct g_consumer * goto exit_free; } + s_volume_name = fs->s_volume_name; + /* Terminate label */ + s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; + + if (s_volume_name[0] == '/') + s_volume_name += 1; + /* Check for volume label */ - if (fs->s_volume_name[0] == '\0') + if (s_volume_name[0] == '\0') goto exit_free; - /* Terminate label */ - fs->s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; - strlcpy(label, fs->s_volume_name, size); + strlcpy(label, s_volume_name, size); exit_free: g_free(fs); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r224302 - stable/8/sys/amd64/amd64
Author: sobomax Date: Mon Jul 25 01:42:51 2011 New Revision: 224302 URL: http://svn.freebsd.org/changeset/base/224302 Log: MFC: re-work dump progress indicator to work better with more than few gigs of RAM. Modified: stable/8/sys/amd64/amd64/minidump_machdep.c Modified: stable/8/sys/amd64/amd64/minidump_machdep.c == --- stable/8/sys/amd64/amd64/minidump_machdep.c Mon Jul 25 00:17:20 2011 (r224301) +++ stable/8/sys/amd64/amd64/minidump_machdep.c Mon Jul 25 01:42:51 2011 (r224302) @@ -69,7 +69,7 @@ static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress; +static size_t counter, progress, dumpsize; CTASSERT(sizeof(*vm_page_dump) == 8); @@ -101,6 +101,40 @@ blk_flush(struct dumperinfo *di) return (error); } +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < 10; i++) { + if (sofar < progress_track[i].min_per || sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -137,7 +171,7 @@ blk_write(struct dumperinfo *di, char *p counter += len; progress -= len; if (counter >> 24) { - printf(" %ld", PG2MB(progress >> PAGE_SHIFT)); + report_progress(progress, dumpsize); counter &= (1<<24) - 1; } #ifdef SW_WATCHDOG @@ -180,7 +214,6 @@ static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { - uint64_t dumpsize; uint32_t pmapsize; vm_offset_t va; int error; @@ -300,8 +333,8 @@ minidumpsys(struct dumperinfo *di) mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump leader */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r224306 - stable/8/usr.sbin/newsyslog
Author: sobomax Date: Mon Jul 25 07:45:22 2011 New Revision: 224306 URL: http://svn.freebsd.org/changeset/base/224306 Log: MFC: Add new modifier - "R", path to executable to run after rotatiion instead of sending signal. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c == --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 25 07:14:59 2011 (r224305) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 25 07:45:22 2011 (r224306) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); /*process when trimming this file. */ #defineCE_CREATE 0x0100 /* Create the log file if it does not exist. */ #defineCE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ +#defineCE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #defineMIN_PID 5 /* Don't touch pids lower than this */ #defineMAX_PID 9 /* was lower, see /usr/include/sys/proc.h */ @@ -154,7 +155,7 @@ const struct compress_types compress_typ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ - char *pid_file; /* PID file */ + char *pid_cmd_file; /* PID or command file */ char *r_reason; /* The reason this file is being rotated */ int firstcreate;/* Creating log for the first time (-C). */ int rotate; /* Non-zero if this file should be rotated */ @@ -178,7 +179,8 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_tsw_pid;/* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - char sw_fname[1]; /* file the PID was read from */ + int run_cmd; /* run command or send PID to signal */ + char sw_fname[1]; /* file the PID was read from or shell cmd */ }; struct zipwork_entry { @@ -384,9 +386,9 @@ init_entry(const char *fname, struct con err(1, "strdup for %s", fname); if (src_entry != NULL) { - tempwork->pid_file = NULL; - if (src_entry->pid_file) - tempwork->pid_file = strdup(src_entry->pid_file); + tempwork->pid_cmd_file = NULL; + if (src_entry->pid_cmd_file) + tempwork->pid_cmd_file = strdup(src_entry->pid_cmd_file); tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -406,7 +408,7 @@ init_entry(const char *fname, struct con tempwork->def_cfg = src_entry->def_cfg; } else { /* Initialize as a "do-nothing" entry */ - tempwork->pid_file = NULL; + tempwork->pid_cmd_file = NULL; tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -441,9 +443,9 @@ free_entry(struct conf_entry *ent) ent->log = NULL; } - if (ent->pid_file != NULL) { - free(ent->pid_file); - ent->pid_file = NULL; + if (ent->pid_cmd_file != NULL) { + free(ent->pid_cmd_file); + ent->pid_cmd_file = NULL; } if (ent->r_reason != NULL) { @@ -1291,6 +1293,9 @@ no_trimat: case 'n': working->flags |= CE_NOSIGNAL; break; + case 'r': + working->flags |= CE_PID2CMD; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; @@ -1324,10 +1329,10 @@ no_trimat: *parse = '\0'; } - working->pid_file = NULL; + working->pid_cmd_file = NULL; if (q && *q) { if (*q == '/') - working->pid_file = strdup(q); + working->pid_cmd_file = strdup(q); else if (isdigit(*q)) goto got_sig; else @@ -1364,16 +1369,16 @@ no_trimat: if ((working->flags & CE_NOSIGNAL) == CE_NOSIGNAL) { /* * This config-entry specified 'n' for nosignal, -* see if it also specified an explicit pid_file. +* see if it also specified an explicit pid_c
svn commit: r219400 - head/sys/geom/label
Author: sobomax Date: Tue Mar 8 17:00:31 2011 New Revision: 219400 URL: http://svn.freebsd.org/changeset/base/219400 Log: Some linux distros put mount point into the ext2fs labels, such as '/', or '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code, such as any program that uses pwlib. Strip any leading slashes before feeding the label to the geom_label code. Sponsored by: Sippy Software, Inc. MFC after:1 week Modified: head/sys/geom/label/g_label_ext2fs.c Modified: head/sys/geom/label/g_label_ext2fs.c == --- head/sys/geom/label/g_label_ext2fs.cTue Mar 8 14:18:21 2011 (r219399) +++ head/sys/geom/label/g_label_ext2fs.cTue Mar 8 17:00:31 2011 (r219400) @@ -53,6 +53,7 @@ g_label_ext2fs_taste(struct g_consumer * { struct g_provider *pp; e2sb_t *fs; + char *s_volume_name; g_topology_assert_not(); pp = cp->provider; @@ -74,13 +75,18 @@ g_label_ext2fs_taste(struct g_consumer * goto exit_free; } + s_volume_name = fs->s_volume_name; + /* Terminate label */ + s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; + + if (s_volume_name[0] == '/') + s_volume_name += 1; + /* Check for volume label */ - if (fs->s_volume_name[0] == '\0') + if (s_volume_name[0] == '\0') goto exit_free; - /* Terminate label */ - fs->s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; - strlcpy(label, fs->s_volume_name, size); + strlcpy(label, s_volume_name, size); exit_free: g_free(fs); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r219400 - head/sys/geom/label
On 3/8/2011 9:36 AM, Jaakko Heinonen wrote: Some linux distros put mount point into the ext2fs labels, such as '/', or > '/boot', which confuses the devfs code and can cause userland programs to > fail reading /dev/ext2fs directory with weird error code, such as any > program that uses pwlib. Do you still see such behavior after r214063? > Strip any leading slashes before feeding the label to the geom_label code. make_dev*() should strip redundant slashes since r213526. I have only observed this issue with 7.4. It looks like r213526 might work as well, but unfortunately this revision is not directly applicable to the 7-STABLE. Do you have any plans to MFC it into 7.x? -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r219400 - head/sys/geom/label
On 3/9/2011 7:19 AM, Jaakko Heinonen wrote: On 2011-03-08, Maxim Sobolev wrote: > On 3/8/2011 9:36 AM, Jaakko Heinonen wrote: > >> Some linux distros put mount point into the ext2fs labels, such as '/', or > >>> '/boot', which confuses the devfs code and can cause userland programs to > >>> fail reading /dev/ext2fs directory with weird error code, such as any > >>> program that uses pwlib. > > I have only observed this issue with 7.4. OK, good to know. Head version of devfs should not have the problems you described in the commit message. > It looks like r213526 might work as well, but unfortunately this > revision is not directly applicable to the 7-STABLE. Do you have any > plans to MFC it into 7.x? I don't have plans to MFC it to stable/7. r213526 is related to larger set of devfs changes I committed last year. OK, so what should I do to resolve the issue in question? Should I go forward and MFC less generic patch to geom_label code to strip out the leading slashes from the ext2fs labels? -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r219400 - head/sys/geom/label
On 3/9/2011 11:04 AM, Jaakko Heinonen wrote: On 2011-03-09, Maxim Sobolev wrote: > OK, so what should I do to resolve the issue in question? Should I go > forward and MFC less generic patch to geom_label code to strip out the > leading slashes from the ext2fs labels? I am not against merging it. Maybe revert the hack in head after merging? OK, sure. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220736 - head/sbin/natd
Author: sobomax Date: Sun Apr 17 06:05:37 2011 New Revision: 220736 URL: http://svn.freebsd.org/changeset/base/220736 Log: If we can retrieve interface address sleep for one second and try again. This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. MFC after:2 weeks Modified: head/sbin/natd/natd.c Modified: head/sbin/natd/natd.c == --- head/sbin/natd/natd.c Sun Apr 17 02:44:51 2011(r220735) +++ head/sbin/natd/natd.c Sun Apr 17 06:05:37 2011(r220736) @@ -111,7 +111,7 @@ static void Usage (void); static char* FormatPacket (struct ip*); static voidPrintPacket (struct ip*); static voidSyslogPacket (struct ip*, int priority, const char *label); -static voidSetAliasAddressFromIfName (const char *ifName); +static int SetAliasAddressFromIfName (const char *ifName); static voidInitiateShutdown (int); static voidShutdown (int); static voidRefreshAddr (int); @@ -156,6 +156,7 @@ int main (int argc, char** argv) struct sockaddr_in addr; fd_set readMask; int fdMax; + int rval; /* * Initialize packet aliasing software. * Done already here to be able to alter option bits @@ -301,8 +302,15 @@ int main (int argc, char** argv) mip->assignAliasAddr = 1; } - else - SetAliasAddressFromIfName (mip->ifName); + else { + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (rval == -2) + sleep(1); + } while (rval == -2); + if (rval != 0) + exit(1); + } } } @@ -531,7 +539,8 @@ static void DoGlobal (int fd) #if 0 if (mip->assignAliasAddr) { - SetAliasAddressFromIfName (mip->ifName); + if (SetAliasAddressFromIfName (mip->ifName) != 0) + exit(1); mip->assignAliasAddr = 0; } #endif @@ -634,10 +643,16 @@ static void DoAliasing (int fd, int dire socklen_t addrSize; struct ip* ip; charmsgBuf[80]; + int rval; if (mip->assignAliasAddr) { - - SetAliasAddressFromIfName (mip->ifName); + do { + rval = SetAliasAddressFromIfName (mip->ifName); + if (rval == -2) + sleep(1); + } while (rval == -2); + if (rval != 0) + exit(1); mip->assignAliasAddr = 0; } /* @@ -867,7 +882,7 @@ static char* FormatPacket (struct ip* ip return buf; } -static void +static int SetAliasAddressFromIfName(const char *ifn) { size_t needed; @@ -951,14 +966,19 @@ SetAliasAddressFromIfName(const char *if } } } - if (sin == NULL) - errx(1, "%s: cannot get interface address", ifn); + if (sin == NULL) { + warnx("%s: cannot get interface address", ifn); + free(buf); + return -2; + } LibAliasSetAddress(mla, sin->sin_addr); syslog(LOG_INFO, "Aliasing to %s, mtu %d bytes", inet_ntoa(sin->sin_addr), mip->ifMTU); free(buf); + + return 0; } void Quit (const char* msg) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220736 - head/sbin/natd
On 4/18/2011 11:13 AM, Gleb Smirnoff wrote: This looks like a hack and better place for this hack would be shell scripts rather than nat daemon. Well, I am not sure how would you apply shell script in such case. The problem with the original code is that natd just silently exits, leaving machine without a network connection. For some reason this problem started after upgrade from 7.4 to 8.2, perhaps there is some changes in the dhclient which allows it to run is parallel with other start-up activity. And I don't see any problem with natd waiting indefinitely on the interface to acquire IP address, it's no better and no worse than the current behavior when the natd simply bails out. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220736 - head/sbin/natd
On 4/18/2011 12:42 PM, Garrett Cooper wrote: +1 -- in particular because this will affect all cases, and not just the dhclient-acquired IP external NIC case as the above commit message notes. Well, as I already said I don't see any problem with natd waiting on interface to get IP address in all cases. This is no better or no worse than just bailing out, except it will make things working automatically once IP address has been provisioned. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220736 - head/sbin/natd
On 4/18/2011 2:46 PM, Maxim Sobolev wrote: Well, as I already said I don't see any problem with natd waiting on interface to get IP address in all cases. This is no better or no worse than just bailing out, except it will make things working automatically once IP address has been provisioned. Garrett, Gleb, One way to resolve this would be to add a new flag for the natd, which will enable the new behaviour and set that flag from the rc.d/natd, so anybody else who relies on the natd exiting on no address condition can have it as well. What do you think? -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220806 - head/sbin/natd
Author: sobomax Date: Mon Apr 18 23:15:29 2011 New Revision: 220806 URL: http://svn.freebsd.org/changeset/base/220806 Log: Only wait for the IP to appear on the interface if natd is running in the background. Suggested by: Garrett Cooper Use EAGAIN instead of magic value of -2 to report this condition from the SetAliasAddressFromIfName routine. MFC after:2 weeks Modified: head/sbin/natd/natd.c Modified: head/sbin/natd/natd.c == --- head/sbin/natd/natd.c Mon Apr 18 23:12:41 2011(r220805) +++ head/sbin/natd/natd.c Mon Apr 18 23:15:29 2011(r220806) @@ -305,9 +305,9 @@ int main (int argc, char** argv) else { do { rval = SetAliasAddressFromIfName (mip->ifName); - if (rval == -2) + if (background != 0 && rval == EAGAIN) sleep(1); - } while (rval == -2); + } while (background != 0 && rval == EAGAIN); if (rval != 0) exit(1); } @@ -648,9 +648,9 @@ static void DoAliasing (int fd, int dire if (mip->assignAliasAddr) { do { rval = SetAliasAddressFromIfName (mip->ifName); - if (rval == -2) + if (background != 0 && rval == EAGAIN) sleep(1); - } while (rval == -2); + } while (background != 0 && rval == EAGAIN); if (rval != 0) exit(1); mip->assignAliasAddr = 0; @@ -969,7 +969,7 @@ SetAliasAddressFromIfName(const char *if if (sin == NULL) { warnx("%s: cannot get interface address", ifn); free(buf); - return -2; + return EAGAIN; } LibAliasSetAddress(mla, sin->sin_addr); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220736 - head/sbin/natd
On 4/18/2011 3:26 PM, Garrett Cooper wrote: And I don't see any problem with natd waiting indefinitely on the interface to acquire IP address, it's no better and no worse than the current behavior when the natd simply bails out. If it does this when backgrounded, that seems ok. If it blocks foregrounded like this, that's not acceptable. Makes sense. I've checked in the patch, thanks! -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220736 - head/sbin/natd
On 4/18/2011 3:12 PM, YongHyeon PYUN wrote: SYNCDHCP may restore old behavior of dhclient. Thanks, but I would rather not. -dynamic kinda suggests that the interface can go up and down, so if natd running in the background can handle this condition gracefully instead of silently exit this would be a better approach IMHO. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r220808 - head/sbin/natd
Author: sobomax Date: Mon Apr 18 23:45:50 2011 New Revision: 220808 URL: http://svn.freebsd.org/changeset/base/220808 Log: Furthermore condition IP waiting behaviour also on -dynamic flag. This should preserve POLA in all other cases (foreground || non-dynamic). MFC after:2 weeks Modified: head/sbin/natd/natd.c Modified: head/sbin/natd/natd.c == --- head/sbin/natd/natd.c Mon Apr 18 23:35:16 2011(r220807) +++ head/sbin/natd/natd.c Mon Apr 18 23:45:50 2011(r220808) @@ -305,9 +305,11 @@ int main (int argc, char** argv) else { do { rval = SetAliasAddressFromIfName (mip->ifName); - if (background != 0 && rval == EAGAIN) + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) sleep(1); - } while (background != 0 && rval == EAGAIN); + } while (rval == EAGAIN); if (rval != 0) exit(1); } @@ -648,9 +650,11 @@ static void DoAliasing (int fd, int dire if (mip->assignAliasAddr) { do { rval = SetAliasAddressFromIfName (mip->ifName); - if (background != 0 && rval == EAGAIN) + if (background == 0 || dynamicMode == 0) + break; + if (rval == EAGAIN) sleep(1); - } while (background != 0 && rval == EAGAIN); + } while (rval == EAGAIN); if (rval != 0) exit(1); mip->assignAliasAddr = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r221069 - head/sys/amd64/amd64
Author: sobomax Date: Tue Apr 26 16:14:55 2011 New Revision: 221069 URL: http://svn.freebsd.org/changeset/base/221069 Log: With the typical memory size of the system in tenth of gigabytes counting memory being dumped in 16MB increments is somewhat silly. Especially if the dump fails and everything you've got for debugging is screen filled with numbers in 16 decrements... Replace that with percentage-based progress with max 10 updates all fitting into one line. Collapse other very "useful" piece of crash information (total ram) into the same line to save some more space. MFC after:1 week Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c == --- head/sys/amd64/amd64/minidump_machdep.c Tue Apr 26 15:11:13 2011 (r221068) +++ head/sys/amd64/amd64/minidump_machdep.c Tue Apr 26 16:14:55 2011 (r221069) @@ -62,7 +62,7 @@ static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress; +static size_t counter, progress, dumpsize; CTASSERT(sizeof(*vm_page_dump) == 8); @@ -94,6 +94,40 @@ blk_flush(struct dumperinfo *di) return (error); } +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < 10; i++) { + if (sofar < progress_track[i].min_per || sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -130,7 +164,7 @@ blk_write(struct dumperinfo *di, char *p counter += len; progress -= len; if (counter >> 24) { - printf(" %ld", PG2MB(progress >> PAGE_SHIFT)); + report_progress(progress, dumpsize); counter &= (1<<24) - 1; } if (ptr) { @@ -170,7 +204,6 @@ static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { - uint64_t dumpsize; uint32_t pmapsize; vm_offset_t va; int error; @@ -290,8 +323,8 @@ minidumpsys(struct dumperinfo *di) mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump leader */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r221873 - head/usr.sbin/newsyslog
Author: sobomax Date: Sat May 14 03:00:55 2011 New Revision: 221873 URL: http://svn.freebsd.org/changeset/base/221873 Log: Add new modifier - "R", when it is specified the path to pid file will be considered as a path to a binary or a shell script to be executed after rotation has been completed instead of sending signal to the process id in that file. Sponsored by: Sippy Software, Inc. From the: FreeBSD hacking lounge at BSDCan Modified: head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Sat May 14 02:28:26 2011 (r221872) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 14 03:00:55 2011 (r221873) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); /*process when trimming this file. */ #defineCE_CREATE 0x0100 /* Create the log file if it does not exist. */ #defineCE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ +#defineCE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #defineMIN_PID 5 /* Don't touch pids lower than this */ #defineMAX_PID 9 /* was lower, see /usr/include/sys/proc.h */ @@ -154,7 +155,7 @@ const struct compress_types compress_typ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ - char *pid_file; /* PID file */ + char *pid_cmd_file; /* PID or command file */ char *r_reason; /* The reason this file is being rotated */ int firstcreate;/* Creating log for the first time (-C). */ int rotate; /* Non-zero if this file should be rotated */ @@ -178,7 +179,8 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_tsw_pid;/* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - char sw_fname[1]; /* file the PID was read from */ + int run_cmd; /* run command or send PID to signal */ + char sw_fname[1]; /* file the PID was read from or shell cmd */ }; struct zipwork_entry { @@ -384,9 +386,9 @@ init_entry(const char *fname, struct con err(1, "strdup for %s", fname); if (src_entry != NULL) { - tempwork->pid_file = NULL; - if (src_entry->pid_file) - tempwork->pid_file = strdup(src_entry->pid_file); + tempwork->pid_cmd_file = NULL; + if (src_entry->pid_cmd_file) + tempwork->pid_cmd_file = strdup(src_entry->pid_cmd_file); tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -406,7 +408,7 @@ init_entry(const char *fname, struct con tempwork->def_cfg = src_entry->def_cfg; } else { /* Initialize as a "do-nothing" entry */ - tempwork->pid_file = NULL; + tempwork->pid_cmd_file = NULL; tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -441,9 +443,9 @@ free_entry(struct conf_entry *ent) ent->log = NULL; } - if (ent->pid_file != NULL) { - free(ent->pid_file); - ent->pid_file = NULL; + if (ent->pid_cmd_file != NULL) { + free(ent->pid_cmd_file); + ent->pid_cmd_file = NULL; } if (ent->r_reason != NULL) { @@ -1291,6 +1293,9 @@ no_trimat: case 'n': working->flags |= CE_NOSIGNAL; break; + case 'r': + working->flags |= CE_PID2CMD; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; @@ -1324,10 +1329,10 @@ no_trimat: *parse = '\0'; } - working->pid_file = NULL; + working->pid_cmd_file = NULL; if (q && *q) { if (*q == '/') - working->pid_file = strdup(q); + working->pid_cmd_file = strdup(q); else if (isdigit(*q)) goto got_sig; else @@ -1364,16 +1369,16 @@ no_trimat: if ((working->flags & CE_NOSIGNAL) == CE_NOSIGNAL) { /* * This config-entry specified 'n' for nosignal, -
svn commit: r222688 - head/sbin/hastd
Author: sobomax Date: Sat Jun 4 16:01:30 2011 New Revision: 222688 URL: http://svn.freebsd.org/changeset/base/222688 Log: Read from the socket using the same max buffer size as we use while sending. What happens otherwise is that the sender splits all the traffic into 32k chunks, while the receiver is waiting for the whole packet. Then for a certain packet sizes, particularly 66607 bytes in my case, the communication stucks to secondary is expecting to read one chunk of 66607 bytes, while primary is sending two chunks of 32768 bytes and third chunk of 1071. Probably due to TCP windowing and buffering the final chunk gets stuck somewhere, so neither server not client can make any progress. This patch also protect from short reads, as according to the manual page there are some cases when MSG_WAITALL can give less data than expected. MFC after:3 days Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c == --- head/sbin/hastd/proto_common.c Sat Jun 4 15:22:01 2011 (r222687) +++ head/sbin/hastd/proto_common.c Sat Jun 4 16:01:30 2011 (r222688) @@ -194,6 +194,8 @@ int proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) { ssize_t done; + size_t total_done, recvsize; + unsigned char *dp; PJDLOG_ASSERT(sock >= 0); @@ -210,9 +212,19 @@ proto_common_recv(int sock, unsigned cha PJDLOG_ASSERT(data != NULL); PJDLOG_ASSERT(size > 0); + total_done = 0; + dp = data; do { - done = recv(sock, data, size, MSG_WAITALL); - } while (done == -1 && errno == EINTR); + recvsize = size - total_done; + recvsize = recvsize < MAX_SEND_SIZE ? recvsize : MAX_SEND_SIZE; + done = recv(sock, dp, recvsize, MSG_WAITALL); + if (done == -1 && errno == EINTR) + continue; + if (done <= 0) + break; + total_done += done; + dp += done; + } while (total_done < size); if (done == 0) { return (ENOTCONN); } else if (done < 0) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r222688 - head/sbin/hastd
On 6/4/2011 9:33 AM, Bjoern A. Zeeb wrote: I don't know about the hast internal protocol but the above reads kind of wrong to me. Hmm, not sure what exactly is wrong? Sender does 3 writes to the TCP socket - 32k, 32k and 1071 bytes, while receiver does one recv(MSG_WAITALL) with the size of 66607. So I suspect sender's kernel does deliver two 32k packets and fills up receiver's buffer or something. And the remaining 1071 bytes stay somewhere in sender's kernel indefinitely, while recv() cannot complete in receiver's. Using the same size when doing recv() solves the issue for me. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r222688 - head/sbin/hastd
On 6/6/2011 3:57 AM, Vadim Goncharov wrote: Hi Maxim Sobolev! On Sat, 04 Jun 2011 10:02:55 -0700; Maxim Sobolev wrote: I don't know about the hast internal protocol but the above reads kind of wrong to me. Hmm, not sure what exactly is wrong? Sender does 3 writes to the TCP socket - 32k, 32k and 1071 bytes, while receiver does one recv(MSG_WAITALL) with the size of 66607. So I suspect sender's kernel does deliver two 32k packets and fills up receiver's buffer or something. And the remaining 1071 bytes stay somewhere in sender's kernel indefinitely, while recv() cannot complete in receiver's. Using the same size when doing recv() solves the issue for me. I'm also don't know the hast internal protocol, but the very need to adjust some *user* buffers while using _TCP_ is pretty strange: TCP doesn't depend on sender's behavior only. May be setsockopt(SO_RCVBUF) needs to be used. Also, why recv() is ever there on TCP, instead of read() ? Is that blocking or non-blocking read? In the latter case kqueue(2) is very usfeul. MSG_WAITALL might be an issue here. I suspect receiver's kernel can't dequeue two 32k packets until the last chunk arrives. I don't have a time to look into it in detail unfortunately. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r222688 - head/sbin/hastd
On 6/9/2011 6:10 AM, Mikolaj Golub wrote: >>> Hmm, not sure what exactly is wrong? Sender does 3 writes to the TCP >>> socket - 32k, 32k and 1071 bytes, while receiver does one >>> recv(MSG_WAITALL) with the size of 66607. So I suspect sender's kernel >>> does deliver two 32k packets and fills up receiver's buffer or >>> something. And the remaining 1071 bytes stay somewhere in sender's >>> kernel indefinitely, while recv() cannot complete in receiver's. Using >>> the same size when doing recv() solves the issue for me. With MSG_WAITALL, if data to receive are larger than receive buffer, after receiving some part of data it is drained to user buffer and the protocol is notified (sending window update) that there is some space in the receive buffer. So, normally, there should not be an issue with the scenario described above. But there was a race in soreceive_generic(), I believe I have fixed in r222454, when the connection could stall in sbwait. Do you still observe the issue with only r222454 applied? The patch makes things slightly better, but it appears that there are still some "magic" buffer sizes that got stuck somewhere. Particularly 66607 bytes in my case. You can probably easily reproduce the issue by creating large disk with data of various kind (i.e. FreeBSD UFS with source/object code for example), enabling compression and setting block size to 128kb. Then at least if you run this scenario over WAN it should stuck from time to time when hitting that "magic" size. One can probably easily write simple test case in C with server part sending 32k, 32k and 1071 bytes and receiver reading the whole message with WAITALL. Unfortunately I am overloaded right now, so it's unlikely that I would do it. MS> MSG_WAITALL might be an issue here. I suspect receiver's kernel can't MS> dequeue two 32k packets until the last chunk arrives. I don't have a MS> time to look into it in detail unfortunately. Sorry, but I think your patch is wrong. If even it fixes the issue for you, actually I think it does not fix but hides a real problem we have to address. Receiving the whole chunk at once should be more effectively because we do one syscall instead of several. Also, if you receive in smaller chunks no need to set MSG_WAITALL at all. Besides, with your patch I am observing hangs on primary startup in init_remote->primary_connect->proto_connection_recv->proto_common_recv The primary worker process asks the parent to connect to the secondary. After establishing the connection the parent sends connection protocol name and descriptor to the worker (proto_connection_send/proto_connection_recv). The issue here is that in proto_connection_recv() the size of protoname is unknown, so it calls proto_common_recv() with size = 127, larger than protoname ("tcp"). It worked previously because after sending protoname proto_connection_send() sends the descriptor calling sendmsg(). This is data of different type and it makes recv() return although only 4 bytes of 127 requested were received. With your patch, after receiving these 4 bytes it returns back to recv() waiting for rest 123 bytes and gets stuck forever. Don't you observe this? It is strange, because for me it hangs on every start up. I am seeing this on yesterday current. Yes, you are right. It appears that I did not test new code on primary, only on secondary. Which explains why I did not see that issue. Can you please try the following patch and let me know if it solves the issue for you? http://sobomax.sippysoft.com/hastd.diff -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r222688 - head/sbin/hastd
On 6/9/2011 12:23 PM, Pawel Jakub Dawidek wrote: I strongly disagree with this patch. The whole proto API is now clean and elegant. Well, addition of the single flag to indicate that we are waiting for exact amount of data or just *some* date doesn't make it unclear or non-elegant. In fact it makes that API more versatile, so that you can let network layer know exactly what are you trying to achieve. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64
Christoph Mallon wrote: Sorry for the long essay, but I deem it important to tell how compilers work these day. Good point, maybe it would make sense to compress it somewhat and add to the style(9)? -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head: sbin/ipfw sys sys/amd64/include/xen sys/arm/arm sys/contrib/pf sys/dev/ata sys/dev/cxgb sys/dev/sound/usb sys/dev/usb sys/dev/usb/bluetooth sys/dev/usb/controller sys...
Paolo Pisati wrote: Author: piso Date: Wed Apr 1 20:23:47 2009 New Revision: 190633 URL: http://svn.freebsd.org/changeset/base/190633 Log: Implement an ipfw action to reassemble ip packets: reass. Heh, nice name, isn't it? At first I thought it was an april fools joke as well. ;-) -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190980 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb i386/i386
Author: sobomax Date: Sun Apr 12 23:06:23 2009 New Revision: 190980 URL: http://svn.freebsd.org/changeset/base/190980 Log: MFC: Make machdep.hyperthreading_allowed working. Approved by:re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/mp_machdep.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/mp_machdep.c Modified: stable/7/sys/amd64/amd64/mp_machdep.c == --- stable/7/sys/amd64/amd64/mp_machdep.c Sun Apr 12 22:16:14 2009 (r190979) +++ stable/7/sys/amd64/amd64/mp_machdep.c Sun Apr 12 23:06:23 2009 (r190980) @@ -153,6 +153,7 @@ struct cpu_info { int cpu_present:1; int cpu_bsp:1; int cpu_disabled:1; + int cpu_hyperthread:1; } static cpu_info[MAX_APIC_ID + 1]; int cpu_apic_ids[MAXCPU]; @@ -355,11 +356,6 @@ cpu_mp_start(void) ("BSP's APIC ID doesn't match boot_cpu_id")); cpu_apic_ids[0] = boot_cpu_id; - assign_cpu_ids(); - - /* Start each Application Processor */ - start_all_aps(); - /* Setup the initial logical CPUs info. */ logical_cpus = logical_cpus_mask = 0; if (cpu_feature & CPUID_HTT) @@ -407,6 +403,11 @@ cpu_mp_start(void) hyperthreading_cpus = logical_cpus; } + assign_cpu_ids(); + + /* Start each Application Processor */ + start_all_aps(); + set_interrupt_apic_ids(); /* Last, setup the cpu topology now that we have probed CPUs */ @@ -421,18 +422,26 @@ void cpu_mp_announce(void) { int i, x; + const char *hyperthread; /* List CPUs */ printf(" cpu0 (BSP): APIC ID: %2d\n", boot_cpu_id); for (i = 1, x = 0; x <= MAX_APIC_ID; x++) { if (!cpu_info[x].cpu_present || cpu_info[x].cpu_bsp) continue; + if (cpu_info[x].cpu_hyperthread) { + hyperthread = "/HT"; + } else { + hyperthread = ""; + } if (cpu_info[x].cpu_disabled) - printf(" cpu (AP): APIC ID: %2d (disabled)\n", x); + printf(" cpu (AP%s): APIC ID: %2d (disabled)\n", + hyperthread, x); else { KASSERT(i < mp_ncpus, ("mp_ncpus and actual cpus are out of whack")); - printf(" cpu%d (AP): APIC ID: %2d\n", i++, x); + printf(" cpu%d (AP%s): APIC ID: %2d\n", i++, + hyperthread, x); } } } @@ -638,11 +647,28 @@ assign_cpu_ids(void) { u_int i; + TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", + &hyperthreading_allowed); + /* Check for explicitly disabled CPUs. */ for (i = 0; i <= MAX_APIC_ID; i++) { if (!cpu_info[i].cpu_present || cpu_info[i].cpu_bsp) continue; + if (hyperthreading_cpus > 1 && i % hyperthreading_cpus != 0) { + cpu_info[i].cpu_hyperthread = 1; +#if defined(SCHED_ULE) + /* +* Don't use HT CPU if it has been disabled by a +* tunable. +*/ + if (hyperthreading_allowed == 0) { + cpu_info[i].cpu_disabled = 1; + continue; + } +#endif + } + /* Don't use this CPU if it has been disabled by a tunable. */ if (resource_disabled("lapic", i)) { cpu_info[i].cpu_disabled = 1; @@ -1229,6 +1255,16 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN if (error || !req->newptr) return (error); +#ifdef SCHED_ULE + /* +* SCHED_ULE doesn't allow enabling/disabling HT cores at +* run-time. +*/ + if (allowed != hyperthreading_allowed) + return (ENOTSUP); + return (error); +#endif + if (allowed) hlt_cpus_mask &= ~hyperthreading_cpus_mask; else @@ -1273,8 +1309,6 @@ cpu_hlt_setup(void *dummy __unused) * of hlt_logical_cpus. */ if (hyperthreading_cpus_mask) { - TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", - &hyperthreading_allowed); SYSCTL_ADD_PROC(&logical_cpu_clist, SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW, Modified: stable/7/sys/i386/i386/mp_machdep.c =
svn commit: r190981 - in stable/7/sys: . boot/i386/btx/btxldr contrib/pf dev/cxgb
Author: sobomax Date: Sun Apr 12 23:10:01 2009 New Revision: 190981 URL: http://svn.freebsd.org/changeset/base/190981 Log: MFC: Respect RBX_MUTE flag from boot[012]. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/btx/btxldr/btxldr.S stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/i386/btx/btxldr/btxldr.S == --- stable/7/sys/boot/i386/btx/btxldr/btxldr.S Sun Apr 12 23:06:23 2009 (r190980) +++ stable/7/sys/boot/i386/btx/btxldr/btxldr.S Sun Apr 12 23:10:01 2009 (r190981) @@ -15,6 +15,9 @@ * $FreeBSD$ */ +#defineRBX_MUTE0x10/* -m */ +#defineOPT_SET(opt)(1 << (opt)) + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. @@ -64,6 +67,8 @@ * BTX program loader for ELF clients. */ start: cld # String ops inc + testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument + setnz muted # for RBX_MUTE, set flag movl $m_logo,%esi # Identify call putstr # ourselves movzwl BDA_MEM,%eax # Get base memory @@ -288,7 +293,9 @@ putstr: lodsb # Load char /* * Output character AL to the console. */ -putchr:pusha # Save +putchr:testb $1,muted # Check muted + jnz putchr.5# do a nop + pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute movl $BDA_POS,%ebx # BDA pointer @@ -325,7 +332,7 @@ putchr.3: cmpb $SCR_ROW,%dh # Beyond sc movb $SCR_ROW-1,%dh # Bottom line putchr.4: movw %dx,(%ebx) # Update position popa# Restore - ret # To caller +putchr.5: ret # To caller /* * Convert EAX, AX, or AL to hex, saving the result to [EDI]. */ @@ -390,6 +397,12 @@ m_segs:.asciz "text segment: offset=" .asciz " memsz=\0\n" m_done:.asciz "Loading complete\n" #endif + +/* + * Flags + */ +muted: .byte 0x0 + /* * Uninitialized data area. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r263756 - head/usr.bin/kdump
Author: sobomax Date: Tue Mar 25 23:37:57 2014 New Revision: 263756 URL: http://svnweb.freebsd.org/changeset/base/263756 Log: Make `-R', `-T' and `-E' options mutially non-exclusive. It is often useful to see two or three types at the same time when inspecting the dump. MFC after:1 month Sponsored by: Sippy Software, Inc. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Tue Mar 25 23:30:35 2014(r263755) +++ head/usr.bin/kdump/kdump.c Tue Mar 25 23:37:57 2014(r263756) @@ -117,6 +117,11 @@ void limitfd(int fd); void usage(void); void ioctlname(unsigned long, int); +#defineTIMESTAMP_NONE 0x0 +#defineTIMESTAMP_ABSOLUTE 0x1 +#defineTIMESTAMP_ELAPSED 0x2 +#defineTIMESTAMP_RELATIVE 0x4 + int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0, abiflag = 0; const char *tracefile = DEF_TRACEFILE; @@ -254,6 +259,8 @@ main(int argc, char *argv[]) setlocale(LC_CTYPE, ""); + timestamp = TIMESTAMP_NONE; + while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1) switch (ch) { case 'A': @@ -284,16 +291,16 @@ main(int argc, char *argv[]) suppressdata = 1; break; case 'E': - timestamp = 3; /* elapsed timestamp */ + timestamp |= TIMESTAMP_ELAPSED; break; case 'H': threads = 1; break; case 'R': - timestamp = 2; /* relative timestamp */ + timestamp |= TIMESTAMP_RELATIVE; break; case 'T': - timestamp = 1; + timestamp |= TIMESTAMP_ABSOLUTE; break; case 't': trpoints = getpoints(optarg); @@ -567,7 +574,7 @@ void dumpheader(struct ktr_header *kth) { static char unknown[64]; - static struct timeval prevtime, temp; + static struct timeval prevtime, prevtime_e, temp; const char *type; switch (kth->ktr_type) { @@ -631,19 +638,26 @@ dumpheader(struct ktr_header *kth) else printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); - if (timestamp) { - if (timestamp == 3) { - if (prevtime.tv_sec == 0) - prevtime = kth->ktr_time; - timevalsub(&kth->ktr_time, &prevtime); +if (timestamp) { + if (timestamp & TIMESTAMP_ABSOLUTE) { + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); + } + if (timestamp & TIMESTAMP_ELAPSED) { + if (prevtime_e.tv_sec == 0) + prevtime_e = kth->ktr_time; + timevalsub(&kth->ktr_time, &prevtime_e); + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); + timevaladd(&kth->ktr_time, &prevtime_e); } - if (timestamp == 2) { + if (timestamp & TIMESTAMP_RELATIVE) { temp = kth->ktr_time; timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); } - printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, - kth->ktr_time.tv_usec); } printf("%s ", type); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/9: . usr.bin/xinstall
Hmm, I believe this breaks build for me. Any ideas why? ===> usr.bin/xinstall (all) cc -O2 -pipe -I/usr/src/usr.bin/xinstall/../../contrib/mtree -I/usr/src/usr.bin/xinstall/../../lib/libnetbsd -I/usr/src/usr.bin/xinstall/../../lib/libmd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/usr.bin/xinstall/xinstall.c cc1: warnings being treated as errors /usr/src/usr.bin/xinstall/xinstall.c: In function 'metadata_log': /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: implicit declaration of function 'strsvis' /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: nested extern declaration of 'strsvis' *** [xinstall.o] Error code 1 Stop in /usr/src/usr.bin/xinstall. *** [all] Error code 1 uname -a FreeBSD dal09 9.1-RELEASE FreeBSD 9.1-RELEASE #2: Thu Dec 27 09:39:03 UTC 2012 root@pioneer:/usr/obj/usr/src91/sys/SSP-PRODUCTION9_X64 amd64 On 3/15/2013 8:19 AM, Brooks Davis wrote: Author: brooks Date: Fri Mar 15 15:19:33 2013 New Revision: 248331 URL: http://svnweb.freebsd.org/changeset/base/248331 Log: MFC all changes to install(1) through r246784. Notable functional changes are: r245617: Introduce six new options from NetBSD: * -MLog metadata in mtree format. * -DLog paths relative to . * -h Log digest of type . * -T Specify which mtree tags to log. * -l Create hard or symbolic links (allows logging). * -U Install without root privileges (owner, group, mode, and flags can be logged via -M NOTE: In the interest of compatibility with NetBSD and because it is the obvious letter, the nearly useless -M option (disable mmap) has been repurposed. Sponsored by:DARPA, AFRL Obtained from: NetBSD Reviewed by: bz r245312: Implement the -N option which allows an alternate passwd and group file to be used. This is useful for installing on systems where a user or group does not currently exist. Sponsored by:DARPA, AFRL Obtained from: NetBSD Modified: stable/9/UPDATING (contents, props changed) stable/9/usr.bin/xinstall/Makefile stable/9/usr.bin/xinstall/install.1 stable/9/usr.bin/xinstall/xinstall.c Directory Properties: stable/9/usr.bin/xinstall/ (props changed) Modified: stable/9/UPDATING == --- stable/9/UPDATING Fri Mar 15 14:53:29 2013(r248330) +++ stable/9/UPDATING Fri Mar 15 15:19:33 2013(r248331) @@ -11,6 +11,15 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130315: + The install(1) option -M has changed meaning and now takes an + argument that is a file or path to append logs to. In the + unlikely event that -M was the last option on the command line + and the command line contained at least two files and a target + directory the first file will have logs appended to it. The -M + option served little practical purpose in the last decade so it's + used expected to be extremely rare. + 20130225: A new compression method (lz4) has been merged to. Please refer to zpool-features(7) for more information. Modified: stable/9/usr.bin/xinstall/Makefile == --- stable/9/usr.bin/xinstall/Makefile Fri Mar 15 14:53:29 2013 (r248330) +++ stable/9/usr.bin/xinstall/Makefile Fri Mar 15 15:19:33 2013 (r248331) @@ -3,6 +3,16 @@ PROG= xinstall PROGNAME= install +SRCS= xinstall.c getid.c MAN= install.1 +.PATH: ${.CURDIR}/../../contrib/mtree +.PATH: ${.CURDIR}/../../lib/libmd +CFLAGS+= -I${.CURDIR}/../../contrib/mtree +CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd +CFLAGS+= -I${.CURDIR}/../../lib/libmd + +DPADD+=${LIBMD} +LDADD+=-lmd + .include Modified: stable/9/usr.bin/xinstall/install.1 == --- stable/9/usr.bin/xinstall/install.1 Fri Mar 15 14:53:29 2013 (r248330) +++ stable/9/usr.bin/xinstall/install.1 Fri Mar 15 15:19:33 2013 (r248331) @@ -28,7 +28,7 @@ .\" From: @(#)install.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 6, 2006 +.Dd January 18, 2013 .Dt INSTALL 1 .Os .Sh NAME @@ -36,31 +36,50 @@ .Nd install binaries .Sh SYNOPSIS .Nm -.Op Fl bCcMpSsv +.Op Fl bCcpSsUv .Op Fl B Ar suffix +.Op Fl D Ar destdir .Op Fl f Ar flags .Op Fl g Ar
svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib
Author: sobomax Date: Mon Oct 15 08:21:49 2012 New Revision: 241576 URL: http://svn.freebsd.org/changeset/base/241576 Log: Add per-second scheduling into the cron(8). Right now it's only available via the new @every_second shortcut. ENOTIME to implement crontab(5) format extensions to allow more flexible scheduling. In order to address some concerns expressed by Terry Lambert while discussing the topic few years ago, about per-second cron possibly causing some bad effects on /etc/crontab by stat()ing it every second instead of every minute now (i.e. atime update), only check that database needs to be reloaded on every 60-th loop run. This should be close enough to the current behaviour. Add "@every_minute" shortcut while I am here. MFC after:1 month Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c == --- head/usr.sbin/cron/cron/cron.c Mon Oct 15 07:57:55 2012 (r241575) +++ head/usr.sbin/cron/cron/cron.c Mon Oct 15 08:21:49 2012 (r241576) @@ -98,6 +98,7 @@ main(argc, argv) char*argv[]; { cron_db database; + int runnum; ProgramName = argv[0]; @@ -149,21 +150,24 @@ main(argc, argv) load_database(&database); run_reboot_jobs(&database); cron_sync(); + runnum = 0; while (TRUE) { # if DEBUGGING /* if (!(DebugFlags & DTEST)) */ # endif /*DEBUGGING*/ cron_sleep(&database); - load_database(&database); + if (runnum % 60 == 0) + load_database(&database); /* do this iteration */ cron_tick(&database); - /* sleep 1 minute + /* sleep 1 second */ - TargetTime += 60; + TargetTime += 1; + runnum += 1; } } @@ -194,22 +198,23 @@ cron_tick(db) static time_t diff = 0, /* time difference in seconds from the last offset change */ difflimit = 0; /* end point for the time zone correction */ struct tm otztm; /* time in the old time zone */ - int otzminute, otzhour, otzdom, otzmonth, otzdow; + int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; register struct tm *tm = localtime(&TargetTime); - register intminute, hour, dom, month, dow; + register intsecond, minute, hour, dom, month, dow; register user *u; register entry *e; /* make 0-based values out of these so we can use them as indicies */ + second = tm->tm_sec -FIRST_SECOND; minute = tm->tm_min -FIRST_MINUTE; hour = tm->tm_hour -FIRST_HOUR; dom = tm->tm_mday -FIRST_DOM; month = tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH; dow = tm->tm_wday -FIRST_DOW; - Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n", - getpid(), minute, hour, dom, month, dow)) + Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d,%d)\n", + getpid(), second, minute, hour, dom, month, dow)) if (dst_enabled && last_time != 0 && TargetTime > last_time /* exclude stepping back */ @@ -262,6 +267,7 @@ cron_tick(db) /* make 0-based values out of these so we can use them as indicies */ + otzsecond = otztm.tm_sec -FIRST_SECOND; otzminute = otztm.tm_min -FIRST_MINUTE; otzhour = otztm.tm_hour -FIRST_HOUR; otzdom = otztm.tm_mday -FIRST_DOM; @@ -283,7 +289,8 @@ cron_tick(db) e->uid, e->gid, e->cmd)) if ( diff != 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { - if (bit_test(e->minute, otzminute) + if (bit_test(e->second, otzsecond) +&& bit_test(e->minute, otzminute) && bit_test(e->hour, otzhour) && bit_test(e->month, otzmonth) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) @@ -302,7 +309,8 @@ cron_tick(db) continue; } - if (bit_test(e->minute, minute) + if (bit_test(e->second, second) +&& bit_test(e->minute, minute) && bit_test(e->hour, hour) && bit_test(e->month, month) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) Modified: head/usr.sbin/cron/cron
Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib
On 10/15/2012 6:07 PM, Xin Li wrote: Because it's not guaranteed to work on every filesystems? But yes I think it would be a good idea to implement it and use it when all filesystems used to store crontabs supports it. I considered it, but it seems inadequate for things like: # mv /etc /etc.old # mv /etc.new /etc -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib
On 10/15/2012 4:26 PM, Adrian Chadd wrote: Maybe crontab should be using a command via a socket to reload, rather than stat'ing files.. Simple signal would do. kqueuing the file is not as easy, but this would complicate logic as you would need to look at renames, removes etc. I really doubt that it can catch things like renaming the whole directory at the upper level and replacing it with something else. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts Tel: +1-646-651-1110 Fax: +1-866-857-6942 Web: http://www.sippysoft.com MSN: sa...@sippysoft.com Skype: SippySoft ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib
On 10/15/2012 1:44 PM, Ian Lepore wrote: It appears to, which I don't think is a bad thing at all. But the way it waits is to wake up, do some work, and go back to sleep for an integer 1 second. That will occasionally lead to a second in which no wakeup happens, as the "do some work" part always takes some fraction of a second. Right, I will look into it. I believe the reason why we cannot "sleep until the next event" is that time can go back and forth in the meantime (e.g. ntpd / ntpdate), so that amount you think you can sleep can change while you are already sleeping. It should not be that hard to change it to wake up every 60 seconds if there is no per-second activity planned. Also I think some more logic necessary to ignore seconds in comparison, unless it's "every x seconds" job. Otherwise we might loose job set up for 00:00:00 by waking up say 00:00:00:01, not at 00:00:00:00 due to paging, network latency (e.g. running off nfs), etc. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib
On 10/15/2012 9:40 PM, Adrian Chadd wrote: Gah, I think there's quite a lot of push back on this. Maxim, would you please consider reverting this patch? Can we have a discussion on the best way to do this, taking various things like embedded and power-saving systems into effect? I am working on improved version, so that in the absence of @every_second it would revert to the previous behavior. Even though I seriously doubt that few thousand additional CPU cycles every second would make any measurable differences in any practical application. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r241618 - head/usr.sbin/cron/lib
Author: sobomax Date: Tue Oct 16 21:34:02 2012 New Revision: 241618 URL: http://svn.freebsd.org/changeset/base/241618 Log: Properly handle non-keyword case by setting e->second to 0. Modified: head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/lib/entry.c == --- head/usr.sbin/cron/lib/entry.c Tue Oct 16 20:24:54 2012 (r241617) +++ head/usr.sbin/cron/lib/entry.c Tue Oct 16 21:34:02 2012 (r241618) @@ -222,6 +222,7 @@ load_entry(file, error_func, pw, envp) } } else { Debug(DPARS, ("load_entry()...about to parse numerics\n")) + bit_set(e->second, 0); ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE, PPC_NULL, ch, file); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r241625 - head/usr.sbin/cron/cron
Author: sobomax Date: Wed Oct 17 00:44:34 2012 New Revision: 241625 URL: http://svn.freebsd.org/changeset/base/241625 Log: o Use nanosleep(2) to sleep exact amount of time till the next second, not multiple of 1 second, which results in actual time to drift back and forth every run within 1 second of the actual action has been set for. Suggested by: Ian Lepore o Schedule the first run in 1 second after starting up, not on the boundary of the next minute, which results in the every_second jobs not being run. Modified: head/usr.sbin/cron/cron/cron.c Modified: head/usr.sbin/cron/cron/cron.c == --- head/usr.sbin/cron/cron/cron.c Wed Oct 17 00:33:10 2012 (r241624) +++ head/usr.sbin/cron/cron/cron.c Wed Oct 17 00:44:34 2012 (r241625) @@ -341,37 +341,73 @@ cron_tick(db) */ static void cron_sync() { +#if 0 register struct tm *tm; +#endif - TargetTime = time((time_t*)0); + TargetTime = time((time_t*)0) + 1; +#if 0 tm = localtime(&TargetTime); TargetTime += (60 - tm->tm_sec); +#endif } +static int +timeval_subtract(struct timespec *result, struct timeval *x, struct timeval *y) +{ + int nsec; + + /* Perform the carry for the later subtraction by updating y. */ + if (x->tv_usec < y->tv_usec) { + nsec = (y->tv_usec - x->tv_usec) / 100 + 1; + y->tv_usec -= 100 * nsec; + y->tv_sec += nsec; + } + if (x->tv_usec - y->tv_usec > 100) { + nsec = (x->tv_usec - y->tv_usec) / 100; + y->tv_usec += 100 * nsec; + y->tv_sec -= nsec; + } + + /* tv_nsec is certainly positive. */ + result->tv_sec = x->tv_sec - y->tv_sec; + result->tv_nsec = (x->tv_usec - y->tv_usec) * 1000; + + /* Return difference in seconds */ + return (x->tv_sec - y->tv_sec); +} static void cron_sleep(db) cron_db *db; { - int seconds_to_wait = 0; + int seconds_to_wait; + int rval; + struct timeval ctime, ttime; + struct timespec stime, remtime; /* * Loop until we reach the top of the next minute, sleep when possible. */ for (;;) { - seconds_to_wait = (int) (TargetTime - time((time_t*)0)); + gettimeofday(&ctime, NULL); + ttime.tv_sec = TargetTime; + ttime.tv_usec = 0; + timeval_subtract(&stime, &ttime, &ctime); /* * If the seconds_to_wait value is insane, jump the cron */ - if (seconds_to_wait < -600 || seconds_to_wait > 600) { + if (stime.tv_sec < -600 || stime.tv_sec > 600) { cron_clean(db); cron_sync(); continue; } + seconds_to_wait = (stime.tv_nsec > 0) ? stime.tv_sec + 1 : stime.tv_sec; + Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n", getpid(), (long)TargetTime, seconds_to_wait)) @@ -380,13 +416,19 @@ cron_sleep(db) * to run, break */ - if (seconds_to_wait <= 0) + if (stime.tv_sec < 0) break; if (job_runqueue() == 0) { Debug(DSCH, ("[%d] sleeping for %d seconds\n", getpid(), seconds_to_wait)) - sleep(seconds_to_wait); + for (;;) { + rval = nanosleep(&stime, &remtime); + if (rval == 0 || errno != EINTR) + break; + stime.tv_sec = remtime.tv_sec; + stime.tv_nsec = remtime.tv_nsec; + } } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241625 - head/usr.sbin/cron/cron
On 10/17/2012 10:48 AM, Konstantin Belousov wrote: The cron daemon in HEAD is not functional, i.e. no jobs are executed at all. Reverting r241625 r241618 r241576 gives me the expected behaviour. P.S. I do not remember a single commit from you which did not failed on tinderbox, or was not found buggy later. Should be fixed already in the latest HEAD. Please check and let me know if you still have some issues (send crontab entry which is not getting executed). The particular issue has been fixed in the r241618. Thanks! -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241625 - head/usr.sbin/cron/cron
OK, thanks guys for valuable suggestions. Am I correct that the general suggestion is to use clock_gettime(CLOCK_REALTIME) instead of the gettimeofday(), and fix few types here and there? -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241625 - head/usr.sbin/cron/cron
Also, I have avoided using FP, since the old code doesn't, and some of the smaller systems we run on (arm, mips) might not have FPU unit, so it might have a problem with that. And I am still working on new version to revert to 60-seconds polling by default. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r241649 - in head/usr.sbin/cron: cron crontab lib
Author: sobomax Date: Wed Oct 17 20:45:48 2012 New Revision: 241649 URL: http://svn.freebsd.org/changeset/base/241649 Log: Revert latest changes to cron, until better version is worked out (I hope). Requested by: few Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c == --- head/usr.sbin/cron/cron/cron.c Wed Oct 17 20:23:07 2012 (r241648) +++ head/usr.sbin/cron/cron/cron.c Wed Oct 17 20:45:48 2012 (r241649) @@ -98,7 +98,6 @@ main(argc, argv) char*argv[]; { cron_db database; - int runnum; ProgramName = argv[0]; @@ -150,24 +149,21 @@ main(argc, argv) load_database(&database); run_reboot_jobs(&database); cron_sync(); - runnum = 0; while (TRUE) { # if DEBUGGING /* if (!(DebugFlags & DTEST)) */ # endif /*DEBUGGING*/ cron_sleep(&database); - if (runnum % 60 == 0) - load_database(&database); + load_database(&database); /* do this iteration */ cron_tick(&database); - /* sleep 1 second + /* sleep 1 minute */ - TargetTime += 1; - runnum += 1; + TargetTime += 60; } } @@ -198,23 +194,22 @@ cron_tick(db) static time_t diff = 0, /* time difference in seconds from the last offset change */ difflimit = 0; /* end point for the time zone correction */ struct tm otztm; /* time in the old time zone */ - int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; + int otzminute, otzhour, otzdom, otzmonth, otzdow; register struct tm *tm = localtime(&TargetTime); - register intsecond, minute, hour, dom, month, dow; + register intminute, hour, dom, month, dow; register user *u; register entry *e; /* make 0-based values out of these so we can use them as indicies */ - second = tm->tm_sec -FIRST_SECOND; minute = tm->tm_min -FIRST_MINUTE; hour = tm->tm_hour -FIRST_HOUR; dom = tm->tm_mday -FIRST_DOM; month = tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH; dow = tm->tm_wday -FIRST_DOW; - Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d,%d)\n", - getpid(), second, minute, hour, dom, month, dow)) + Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n", + getpid(), minute, hour, dom, month, dow)) if (dst_enabled && last_time != 0 && TargetTime > last_time /* exclude stepping back */ @@ -267,7 +262,6 @@ cron_tick(db) /* make 0-based values out of these so we can use them as indicies */ - otzsecond = otztm.tm_sec -FIRST_SECOND; otzminute = otztm.tm_min -FIRST_MINUTE; otzhour = otztm.tm_hour -FIRST_HOUR; otzdom = otztm.tm_mday -FIRST_DOM; @@ -289,8 +283,7 @@ cron_tick(db) e->uid, e->gid, e->cmd)) if ( diff != 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { - if (bit_test(e->second, otzsecond) -&& bit_test(e->minute, otzminute) + if (bit_test(e->minute, otzminute) && bit_test(e->hour, otzhour) && bit_test(e->month, otzmonth) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) @@ -309,8 +302,7 @@ cron_tick(db) continue; } - if (bit_test(e->second, second) -&& bit_test(e->minute, minute) + if (bit_test(e->minute, minute) && bit_test(e->hour, hour) && bit_test(e->month, month) && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR)) Modified: head/usr.sbin/cron/cron/cron.h == --- head/usr.sbin/cron/cron/cron.h Wed Oct 17 20:23:07 2012 (r241648) +++ head/usr.sbin/cron/cron/cron.h Wed Oct 17 20:45:48 2012 (r241649) @@ -124,10 +124,6 @@ LineNumber = ln; \ } -#defineFIRST_SECOND0 -#defineLAST_SECOND 59 -#defineSECOND_COUNT(LAST_SECOND - FIRST_SECOND + 1) - #defineFIRST_MINUTE0 #defineLAST_MINUTE 59 #defineMINU
Re: svn commit: r241625 - head/usr.sbin/cron/cron
On 10/17/2012 1:18 PM, Konstantin Belousov wrote: As I said, a reversal of all three commits makes the cron(8) operate correctly. Done, sorry. Do you mind if I send you latest version of the patch later for testing? Thanks! -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r241651 - head/usr.sbin/cron/cron
Author: sobomax Date: Wed Oct 17 21:26:35 2012 New Revision: 241651 URL: http://svn.freebsd.org/changeset/base/241651 Log: Remove harmless, but superfluous local change that creeped in along with the r241649. Modified: head/usr.sbin/cron/cron/cron.h Modified: head/usr.sbin/cron/cron/cron.h == --- head/usr.sbin/cron/cron/cron.h Wed Oct 17 21:19:27 2012 (r241650) +++ head/usr.sbin/cron/cron/cron.h Wed Oct 17 21:26:35 2012 (r241651) @@ -176,7 +176,6 @@ typedef struct _entry { #defineWHEN_REBOOT 0x04 #defineRUN_AT 0x08 #defineNOT_UNTIL 0x10 -#defineSECONDS_COUNT 0x20 time_t lastrun; } entry; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r241672 - in head/usr.sbin/cron: cron lib
Author: sobomax Date: Thu Oct 18 06:27:03 2012 New Revision: 241672 URL: http://svn.freebsd.org/changeset/base/241672 Log: Fully backout latest changes. Pointy hat to:sobomax Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c == --- head/usr.sbin/cron/cron/cron.c Thu Oct 18 01:14:22 2012 (r241671) +++ head/usr.sbin/cron/cron/cron.c Thu Oct 18 06:27:03 2012 (r241672) @@ -333,73 +333,37 @@ cron_tick(db) */ static void cron_sync() { -#if 0 register struct tm *tm; -#endif - TargetTime = time((time_t*)0) + 1; -#if 0 + TargetTime = time((time_t*)0); tm = localtime(&TargetTime); TargetTime += (60 - tm->tm_sec); -#endif } -static int -timeval_subtract(struct timespec *result, struct timeval *x, struct timeval *y) -{ - int nsec; - - /* Perform the carry for the later subtraction by updating y. */ - if (x->tv_usec < y->tv_usec) { - nsec = (y->tv_usec - x->tv_usec) / 100 + 1; - y->tv_usec -= 100 * nsec; - y->tv_sec += nsec; - } - if (x->tv_usec - y->tv_usec > 100) { - nsec = (x->tv_usec - y->tv_usec) / 100; - y->tv_usec += 100 * nsec; - y->tv_sec -= nsec; - } - - /* tv_nsec is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_nsec = (x->tv_usec - y->tv_usec) * 1000; - - /* Return difference in seconds */ - return (x->tv_sec - y->tv_sec); -} static void cron_sleep(db) cron_db *db; { - int seconds_to_wait; - int rval; - struct timeval ctime, ttime; - struct timespec stime, remtime; + int seconds_to_wait = 0; /* * Loop until we reach the top of the next minute, sleep when possible. */ for (;;) { - gettimeofday(&ctime, NULL); - ttime.tv_sec = TargetTime; - ttime.tv_usec = 0; - timeval_subtract(&stime, &ttime, &ctime); + seconds_to_wait = (int) (TargetTime - time((time_t*)0)); /* * If the seconds_to_wait value is insane, jump the cron */ - if (stime.tv_sec < -600 || stime.tv_sec > 600) { + if (seconds_to_wait < -600 || seconds_to_wait > 600) { cron_clean(db); cron_sync(); continue; } - seconds_to_wait = (stime.tv_nsec > 0) ? stime.tv_sec + 1 : stime.tv_sec; - Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n", getpid(), (long)TargetTime, seconds_to_wait)) @@ -408,19 +372,13 @@ cron_sleep(db) * to run, break */ - if (stime.tv_sec < 0) + if (seconds_to_wait <= 0) break; if (job_runqueue() == 0) { Debug(DSCH, ("[%d] sleeping for %d seconds\n", getpid(), seconds_to_wait)) - for (;;) { - rval = nanosleep(&stime, &remtime); - if (rval == 0 || errno != EINTR) - break; - stime.tv_sec = remtime.tv_sec; - stime.tv_nsec = remtime.tv_nsec; - } + sleep(seconds_to_wait); } } } Modified: head/usr.sbin/cron/lib/entry.c == --- head/usr.sbin/cron/lib/entry.c Thu Oct 18 01:14:22 2012 (r241671) +++ head/usr.sbin/cron/lib/entry.c Thu Oct 18 06:27:03 2012 (r241672) @@ -187,7 +187,6 @@ load_entry(file, error_func, pw, envp) bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); - bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); } else { ecode = e_timespec; goto eof; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241625 - head/usr.sbin/cron/cron
Guys, The latest version of the patch against current HEAD is available here: http://sobomax.sippysoft.com/cron.diff Any comments/suggestions are appreciated. This version should default to previous behaviour of waking up every 60 seconds unless there is @every_second entry in the cron. Konstantin, can you please put it for testing to your boxes? Please make sure to do `make clean' after applying it, as libcron is not listed as a dependency for cron, so it's possible that some changes may not be picked up. Thanks! -Maxim On 10/17/2012 1:18 PM, Konstantin Belousov wrote: On Wed, Oct 17, 2012 at 01:07:20PM -0700, Maxim Sobolev wrote: On 10/17/2012 10:48 AM, Konstantin Belousov wrote: The cron daemon in HEAD is not functional, i.e. no jobs are executed at all. Reverting r241625 r241618 r241576 gives me the expected behaviour. P.S. I do not remember a single commit from you which did not failed on tinderbox, or was not found buggy later. Should be fixed already in the latest HEAD. Please check and let me know if you still have some issues (send crontab entry which is not getting executed). The particular issue has been fixed in the r241618. Well, as I noted above, I had r241618 applied, since I needed to revert it. For me, neither the standard entries from /etc/crontab, nor the following user crontab: * * * * * /usr/bin/limits -a >/tmp/1.txt are not executing. In particular, the /tmp/1.txt file was not created, and the cron.log was empty. As I said, a reversal of all three commits makes the cron(8) operate correctly. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r241625 - head/usr.sbin/cron/cron
On 10/22/2012 9:35 AM, Eitan Adler wrote: Why? Can this be fixed if this is not intended? Well, I see libcron in the DPADD for the cron(8), so I think as far as normal buildworld is concerned things are good. It's just that if you build the cron only manually, it's not recompiled automatically. Maybe one need to do make depend or something. -Maxim [sobomax@pioneer ~/projects/FreeBSD/head/usr.sbin/cron]$ make ===> lib (all) Warning: Object directory not changed from original /usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/lib ===> cron (all) Warning: Object directory not changed from original /usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/cron ===> crontab (all) Warning: Object directory not changed from original /usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/crontab [sobomax@pioneer ~/projects/FreeBSD/head/usr.sbin/cron]$ touch lib/entry.c [sobomax@pioneer ~/projects/FreeBSD/head/usr.sbin/cron]$ make ===> lib (all) Warning: Object directory not changed from original /usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/lib cc -O2 -pipe -I/usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/lib/../cron -DLOGIN_CAP -DPAM -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c entry.c building static cron library ranlib libcron.a ===> cron (all) Warning: Object directory not changed from original /usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/cron ===> crontab (all) Warning: Object directory not changed from original /usr/home/sobomax/projects/FreeBSD/head/usr.sbin/cron/crontab [sobomax@pioneer ~/projects/FreeBSD/head/usr.sbin/cron]$ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r242101 - in head/usr.sbin/cron: cron crontab lib
Author: sobomax Date: Thu Oct 25 22:54:29 2012 New Revision: 242101 URL: http://svn.freebsd.org/changeset/base/242101 Log: Second attempt to add @every_second keyword support. Due to multiple requests, default to the previous 60-seconds scheduling method unless there is any @every_second entries to conserve CPU cycles and power. This change also improves scheduling in the default mode by running as close to the beginning of the minnute as possible by replacing sleep(3) with nanosleep(2). Previously, the tasks would run anywhere within the first second of the minute and that offset drifted back and forth each time cron(8) was engaged. MFC after:1 month Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c == --- head/usr.sbin/cron/cron/cron.c Thu Oct 25 21:22:05 2012 (r242100) +++ head/usr.sbin/cron/cron/cron.c Thu Oct 25 22:54:29 2012 (r242101) @@ -35,9 +35,9 @@ static const char rcsid[] = static voidusage(void), run_reboot_jobs(cron_db *), - cron_tick(cron_db *), - cron_sync(void), - cron_sleep(cron_db *), + cron_tick(cron_db *, int), + cron_sync(int), + cron_sleep(cron_db *, int), cron_clean(cron_db *), #ifdef USE_SIGCHLD sigchld_handler(int), @@ -45,6 +45,8 @@ staticvoidusage(void), sighup_handler(int), parse_args(int c, char *v[]); +static int run_at_secres(cron_db *); + static time_t last_time = 0; static int dst_enabled = 0; struct pidfh *pfh; @@ -98,6 +100,9 @@ main(argc, argv) char*argv[]; { cron_db database; + int runnum; + int secres1, secres2; + struct tm *tm; ProgramName = argv[0]; @@ -147,23 +152,47 @@ main(argc, argv) database.tail = NULL; database.mtime = (time_t) 0; load_database(&database); + secres1 = secres2 = run_at_secres(&database); run_reboot_jobs(&database); - cron_sync(); + cron_sync(secres1); + runnum = 0; while (TRUE) { # if DEBUGGING /* if (!(DebugFlags & DTEST)) */ # endif /*DEBUGGING*/ - cron_sleep(&database); + cron_sleep(&database, secres1); - load_database(&database); + if (secres1 == 0 || runnum % 60 == 0) { + load_database(&database); + secres2 = run_at_secres(&database); + if (secres2 != secres1) { + secres1 = secres2; + if (secres1 != 0) { + runnum = 0; + } else { + /* +* Going from 1 sec to 60 sec res. If we +* are already at minute's boundary, so +* let it run, otherwise schedule for the +* next minute. +*/ + tm = localtime(&TargetTime); + if (tm->tm_sec > 0) { + cron_sync(secres2); + continue; + } + } + } + } /* do this iteration */ - cron_tick(&database); + cron_tick(&database, secres1); - /* sleep 1 minute + /* sleep 1 or 60 seconds */ - TargetTime += 60; + TargetTime += (secres1 != 0) ? 1 : 60; + runnum += 1; } } @@ -187,29 +216,29 @@ run_reboot_jobs(db) static void -cron_tick(db) - cron_db *db; +cron_tick(cron_db *db, int secres) { static struct tmlasttm; static time_t diff = 0, /* time difference in seconds from the last offset change */ difflimit = 0; /* end point for the time zone correction */ struct tm otztm; /* time in the old time zone */ - int otzminute, otzhour, otzdom, otzmonth, otzdow; + int otzsecond, otzminute, otzhour, otzdom, otzmonth, otzdow; register struct tm *tm = localtime(&TargetTime); - register intminute, hour, dom, month, dow; + register intsecond, minute, hour, dom, month, dow; register user *u; register entry *e; /* make 0-based val
Re: svn commit: r242101 - in head/usr.sbin/cron: cron crontab lib
On 10/27/2012 12:29 PM, Pawel Jakub Dawidek wrote: On behalf of Mother Earth thank you:) Thank You, Mother Earth, for noticing my humble attempts to make worl^HFreeBSD a better place. :) -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r240981 - head/sys/dev/pci
Author: sobomax Date: Thu Sep 27 04:28:55 2012 New Revision: 240981 URL: http://svn.freebsd.org/changeset/base/240981 Log: Add 32-bit ABI compat shims. Those are necessary for i386 binary-only tools like sysutils/hpacucli (HP P4xx RAID controller management suite) working on amd64 systems. PR: 139271 Submitted by: Kazumi MORINAGA, Eugene Grosbein MFC after:1 week Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c == --- head/sys/dev/pci/pci_user.c Thu Sep 27 04:06:20 2012(r240980) +++ head/sys/dev/pci/pci_user.c Thu Sep 27 04:28:55 2012(r240981) @@ -225,6 +225,49 @@ struct pci_io_old { u_int32_t pi_data;/* data to write or result of read */ }; +#ifdef COMPAT_FREEBSD32 +struct pci_conf_old32 { + struct pcisel_old pc_sel; /* bus+slot+function */ + u_int8_tpc_hdr; /* PCI header type */ + u_int16_t pc_subvendor; /* card vendor ID */ + u_int16_t pc_subdevice; /* card device ID, assigned by + card vendor */ + u_int16_t pc_vendor; /* chip vendor ID */ + u_int16_t pc_device; /* chip device ID, assigned by + chip vendor */ + u_int8_tpc_class; /* chip PCI class */ + u_int8_tpc_subclass;/* chip PCI subclass */ + u_int8_tpc_progif; /* chip PCI programming interface */ + u_int8_tpc_revid; /* chip revision ID */ + charpd_name[PCI_MAXNAMELEN + 1]; /* device name */ + u_int32_t pd_unit;/* device unit number (u_long) */ +}; + +struct pci_match_conf_old32 { + struct pcisel_old pc_sel; /* bus+slot+function */ + charpd_name[PCI_MAXNAMELEN + 1]; /* device name */ + u_int32_t pd_unit;/* Unit number (u_long) */ + u_int16_t pc_vendor; /* PCI Vendor ID */ + u_int16_t pc_device; /* PCI Device ID */ + u_int8_tpc_class; /* PCI class */ + pci_getconf_flags_old flags; /* Matching expression */ +}; + +struct pci_conf_io32 { + u_int32_t pat_buf_len;/* pattern buffer length */ + u_int32_t num_patterns; /* number of patterns */ + u_int32_t patterns; /* pattern buffer (struct pci_match_conf_old32 *) */ + u_int32_t match_buf_len; /* match buffer length */ + u_int32_t num_matches;/* number of matches returned */ + u_int32_t matches;/* match buffer (struct pci_conf_old32 *) */ + u_int32_t offset; /* offset into device list */ + u_int32_t generation; /* device list generation */ + pci_getconf_status status; /* request status */ +}; + +#definePCIOCGETCONF_OLD32 _IOWR('p', 1, struct pci_conf_io32) +#endif + #definePCIOCGETCONF_OLD_IOWR('p', 1, struct pci_conf_io) #definePCIOCREAD_OLD _IOWR('p', 2, struct pci_io_old) #definePCIOCWRITE_OLD _IOWR('p', 3, struct pci_io_old) @@ -295,6 +338,69 @@ pci_conf_match_old(struct pci_match_conf return(1); } +static int +pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches, +struct pci_conf *match_buf) +{ + int i; + + if ((matches == NULL) || (match_buf == NULL) || (num_matches <= 0)) + return(1); + + for (i = 0; i < num_matches; i++) { + if (match_buf->pc_sel.pc_domain != 0) + continue; + + /* +* I'm not sure why someone would do this...but... +*/ + if (matches[i].flags == PCI_GETCONF_NO_MATCH_OLD) + continue; + + /* +* Look at each of the match flags. If it's set, do the +* comparison. If the comparison fails, we don't have a +* match, go on to the next item if there is one. +*/ + if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_OLD) != 0) +&& (match_buf->pc_sel.pc_bus != matches[i].pc_sel.pc_bus)) + continue; + + if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_OLD) != 0) +&& (match_buf->pc_sel.pc_dev != matches[i].pc_sel.pc_dev)) + continue; + + if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_OLD) != 0) +&& (match_buf->pc_sel.pc_func != matches[i].pc_sel.pc_func)) + continue; + + if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_OLD) != 0) +&& (match_buf->pc_v
svn commit: r189023 - in head/sys: amd64/amd64 i386/i386
Author: sobomax Date: Wed Feb 25 01:49:01 2009 New Revision: 189023 URL: http://svn.freebsd.org/changeset/base/189023 Log: Make machdep.hyperthreading_enabled tunable working with the SCHED_ULE. Unlike with SCHED_BSD, however, it can only be set to 0 at boot time, it's not possible to change it at runtime. Reviewed by: jhb MFC after:1 month Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Wed Feb 25 01:12:56 2009 (r189022) +++ head/sys/amd64/amd64/mp_machdep.c Wed Feb 25 01:49:01 2009 (r189023) @@ -151,6 +151,7 @@ struct cpu_info { int cpu_present:1; int cpu_bsp:1; int cpu_disabled:1; + int cpu_hyperthread:1; } static cpu_info[MAX_APIC_ID + 1]; int cpu_apic_ids[MAXCPU]; int apic_cpuids[MAX_APIC_ID + 1]; @@ -353,11 +354,6 @@ cpu_mp_start(void) cpu_apic_ids[0] = boot_cpu_id; apic_cpuids[boot_cpu_id] = 0; - assign_cpu_ids(); - - /* Start each Application Processor */ - start_all_aps(); - /* Setup the initial logical CPUs info. */ logical_cpus = logical_cpus_mask = 0; if (cpu_feature & CPUID_HTT) @@ -404,6 +400,11 @@ cpu_mp_start(void) hyperthreading_cpus = logical_cpus; } + assign_cpu_ids(); + + /* Start each Application Processor */ + start_all_aps(); + set_interrupt_apic_ids(); } @@ -415,18 +416,26 @@ void cpu_mp_announce(void) { int i, x; + const char *hyperthread; /* List CPUs */ printf(" cpu0 (BSP): APIC ID: %2d\n", boot_cpu_id); for (i = 1, x = 0; x <= MAX_APIC_ID; x++) { if (!cpu_info[x].cpu_present || cpu_info[x].cpu_bsp) continue; + if (cpu_info[x].cpu_hyperthread) { + hyperthread = "/HT"; + } else { + hyperthread = ""; + } if (cpu_info[x].cpu_disabled) - printf(" cpu (AP): APIC ID: %2d (disabled)\n", x); + printf(" cpu (AP%s): APIC ID: %2d (disabled)\n", + hyperthread, x); else { KASSERT(i < mp_ncpus, ("mp_ncpus and actual cpus are out of whack")); - printf(" cpu%d (AP): APIC ID: %2d\n", i++, x); + printf(" cpu%d (AP%s): APIC ID: %2d\n", i++, + hyperthread, x); } } } @@ -642,11 +651,28 @@ assign_cpu_ids(void) { u_int i; + TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", + &hyperthreading_allowed); + /* Check for explicitly disabled CPUs. */ for (i = 0; i <= MAX_APIC_ID; i++) { if (!cpu_info[i].cpu_present || cpu_info[i].cpu_bsp) continue; + if (hyperthreading_cpus > 1 && i % hyperthreading_cpus != 0) { + cpu_info[i].cpu_hyperthread = 1; +#if defined(SCHED_ULE) + /* +* Don't use HT CPU if it has been disabled by a +* tunable. +*/ + if (hyperthreading_allowed == 0) { + cpu_info[i].cpu_disabled = 1; + continue; + } +#endif + } + /* Don't use this CPU if it has been disabled by a tunable. */ if (resource_disabled("lapic", i)) { cpu_info[i].cpu_disabled = 1; @@ -1198,6 +1224,16 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN if (error || !req->newptr) return (error); +#ifdef SCHED_ULE + /* +* SCHED_ULE doesn't allow enabling/disabling HT cores at +* tun time. +*/ + if (allowed != hyperthreading_allowed) + return (ENOTSUP); + return (error); +#endif + if (allowed) hlt_cpus_mask &= ~hyperthreading_cpus_mask; else @@ -1242,8 +1278,6 @@ cpu_hlt_setup(void *dummy __unused) * of hlt_logical_cpus. */ if (hyperthreading_cpus_mask) { - TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", - &hyperthreading_allowed); SYSCTL_ADD_PROC(&logical_cpu_clist, SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW, Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Wed Feb 25 01:12:56 2009 (r189
svn commit: r189057 - in head/sys: amd64/amd64 i386/i386
Author: sobomax Date: Wed Feb 25 22:24:56 2009 New Revision: 189057 URL: http://svn.freebsd.org/changeset/base/189057 Log: Fix typo in comments in r189023. Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Wed Feb 25 20:56:27 2009 (r189056) +++ head/sys/amd64/amd64/mp_machdep.c Wed Feb 25 22:24:56 2009 (r189057) @@ -1227,7 +1227,7 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN #ifdef SCHED_ULE /* * SCHED_ULE doesn't allow enabling/disabling HT cores at -* tun time. +* run time. */ if (allowed != hyperthreading_allowed) return (ENOTSUP); Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Wed Feb 25 20:56:27 2009 (r189056) +++ head/sys/i386/i386/mp_machdep.c Wed Feb 25 22:24:56 2009 (r189057) @@ -1398,7 +1398,7 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN #ifdef SCHED_ULE /* * SCHED_ULE doesn't allow enabling/disabling HT cores at -* tun time. +* run time. */ if (allowed != hyperthreading_allowed) return (ENOTSUP); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r189509 - in head/sys: amd64/amd64 i386/i386
Author: sobomax Date: Sun Mar 8 05:01:39 2009 New Revision: 189509 URL: http://svn.freebsd.org/changeset/base/189509 Log: Small comment nit: "run time" -> "run-time". Submitted by: rwatson Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Sun Mar 8 04:32:38 2009 (r189508) +++ head/sys/amd64/amd64/mp_machdep.c Sun Mar 8 05:01:39 2009 (r189509) @@ -1227,7 +1227,7 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN #ifdef SCHED_ULE /* * SCHED_ULE doesn't allow enabling/disabling HT cores at -* run time. +* run-time. */ if (allowed != hyperthreading_allowed) return (ENOTSUP); Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Sun Mar 8 04:32:38 2009 (r189508) +++ head/sys/i386/i386/mp_machdep.c Sun Mar 8 05:01:39 2009 (r189509) @@ -1398,7 +1398,7 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN #ifdef SCHED_ULE /* * SCHED_ULE doesn't allow enabling/disabling HT cores at -* run time. +* run-time. */ if (allowed != hyperthreading_allowed) return (ENOTSUP); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199670 - head/sys/dev/bge
Joerg Sonnenberger wrote: On Sun, Nov 22, 2009 at 08:50:27PM +, Pyun YongHyeon wrote: Log: Fix two long standing bugs on bge(4). Most pre BCM5755 controllers have a DMA bug when buffer address crosses a multiple of the 4GB boundary(e.g. 4GB, 8GB, 12GB etc). Does this only affect transfers that *cross* a 4GB boundary or does it also affect transfers that *end* at a 4GB boundary? E.g. if the mbuf cluster starts at 0xff00 with size 0x100 -- will the DMA engine stall happen or not? What about bce(4) driver? Could it be affected too? We've seen some periodic lookups with the bce machine under the load (7.2-release, 5708C). Installing the add-on intel pro-based card into the same machine resolved the issue for us. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199855 - in head/sys/boot: forth i386/libi386 i386/loader pc98/loader
Author: sobomax Date: Fri Nov 27 03:55:42 2009 New Revision: 199855 URL: http://svn.freebsd.org/changeset/base/199855 Log: Add new loader console type: "spinconsole". This console selects the video console which doesn't take any input from keyboard and hides all output replacing it with ``spinning'' character (useful for embedded products and custom installations). Sponsored by: Sippy Software, Inc. Added: head/sys/boot/i386/libi386/spinconsole.c - copied, changed from r199821, head/sys/boot/i386/libi386/nullconsole.c Modified: head/sys/boot/forth/loader.conf.5 head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/vidconsole.c head/sys/boot/i386/loader/conf.c head/sys/boot/pc98/loader/conf.c Modified: head/sys/boot/forth/loader.conf.5 == --- head/sys/boot/forth/loader.conf.5 Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/forth/loader.conf.5 Fri Nov 27 03:55:42 2009 (r199855) @@ -180,10 +180,15 @@ serial port speed setting. .Dq comconsole selects serial console, .Dq vidconsole -selects the video console, and +selects the video console, .Dq nullconsole selects a mute console -(useful for systems with neither a video console nor a serial port). +(useful for systems with neither a video console nor a serial port), and +.Dq spinconsole +selects the video console which prevents any input and hides all output +replacing it with +.Dq spinning +character (useful for embedded products and such). .It Va kernel .Pq Dq Pa /boot/kernel/kernel .It Va loader_conf_files Modified: head/sys/boot/i386/libi386/Makefile == --- head/sys/boot/i386/libi386/Makefile Fri Nov 27 02:47:49 2009 (r199854) +++ head/sys/boot/i386/libi386/Makefile Fri Nov 27 03:55:42 2009 (r199855) @@ -8,7 +8,7 @@ SRCS= biosacpi.c bioscd.c biosdisk.c bio comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ - smbios.c time.c vidconsole.c amd64_tramp.S + smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) Copied and modified: head/sys/boot/i386/libi386/spinconsole.c (from r199821, head/sys/boot/i386/libi386/nullconsole.c) == --- head/sys/boot/i386/libi386/nullconsole.cThu Nov 26 08:49:46 2009 (r199821, copy source) +++ head/sys/boot/i386/libi386/spinconsole.cFri Nov 27 03:55:42 2009 (r199855) @@ -1,8 +1,8 @@ /*- - * nullconsole.c + * spinconsole.c * - * Author: Doug Ambrisko - * Copyright (c) 2000 Whistle Communications, Inc. + * Author: Maksym Sobolyev + * Copyright (c) 2009 Sippy Software, Inc. * All rights reserved. * * Subject to the following obligations and disclaimer of warranty, use and @@ -41,48 +41,66 @@ __FBSDID("$FreeBSD$"); #include #include -static voidnullc_probe(struct console *cp); -static int nullc_init(int arg); -static voidnullc_putchar(int c); -static int nullc_getchar(void); -static int nullc_ischar(void); - -struct console nullconsole = { - "nullconsole", - "null port", +extern void get_pos(int *x, int *y); +extern void curs_move(int *_x, int *_y, int x, int y); +extern void vidc_biosputchar(int c); + +static voidspinc_probe(struct console *cp); +static int spinc_init(int arg); +static voidspinc_putchar(int c); +static int spinc_getchar(void); +static int spinc_ischar(void); + +struct console spinconsole = { + "spinconsole", + "spin port", 0, - nullc_probe, - nullc_init, - nullc_putchar, - nullc_getchar, - nullc_ischar + spinc_probe, + spinc_init, + spinc_putchar, + spinc_getchar, + spinc_ischar }; static void -nullc_probe(struct console *cp) +spinc_probe(struct console *cp) { cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); } static int -nullc_init(int arg) +spinc_init(int arg) { return(0); } static void -nullc_putchar(int c) +spinc_putchar(int c) { + static int curx, cury; + static unsigned tw_chars = 0x5C2D2F7C;/* "\-/|" */ +static time_t lasttime; + time_t now; + +now = time(NULL); +if (now < (lasttime + 1)) +return; +lasttime = now; + get_pos(&curx, &cury); + if (curx > 0) + curs_move(&curx, &cury, curx - 1, cury); + vidc_biosputchar((char)tw_chars); + tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24); } static int -nullc_getchar(void) +spinc_getchar(void) { return(-1); } static int -nullc_ischar(void) +spinc_ischar(void) { return(0); } Modified: head/sys/boot/i386/libi386/vidcon
svn commit: r199856 - head/sys/boot/i386/libi386
Author: sobomax Date: Fri Nov 27 03:58:21 2009 New Revision: 199856 URL: http://svn.freebsd.org/changeset/base/199856 Log: Whitespace on: use tabs for identation consistently. Modified: head/sys/boot/i386/libi386/spinconsole.c Modified: head/sys/boot/i386/libi386/spinconsole.c == --- head/sys/boot/i386/libi386/spinconsole.cFri Nov 27 03:55:42 2009 (r199855) +++ head/sys/boot/i386/libi386/spinconsole.cFri Nov 27 03:58:21 2009 (r199856) @@ -82,10 +82,10 @@ spinc_putchar(int c) static time_t lasttime; time_t now; -now = time(NULL); -if (now < (lasttime + 1)) -return; -lasttime = now; + now = time(NULL); + if (now < (lasttime + 1)) + return; + lasttime = now; get_pos(&curx, &cury); if (curx > 0) curs_move(&curx, &cury, curx - 1, cury); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199857 - head/sys/boot/i386/libi386
Author: sobomax Date: Fri Nov 27 04:00:52 2009 New Revision: 199857 URL: http://svn.freebsd.org/changeset/base/199857 Log: Whitespace-only: another instance of identation with spaces. Modified: head/sys/boot/i386/libi386/spinconsole.c Modified: head/sys/boot/i386/libi386/spinconsole.c == --- head/sys/boot/i386/libi386/spinconsole.cFri Nov 27 03:58:21 2009 (r199856) +++ head/sys/boot/i386/libi386/spinconsole.cFri Nov 27 04:00:52 2009 (r199857) @@ -79,7 +79,7 @@ spinc_putchar(int c) { static int curx, cury; static unsigned tw_chars = 0x5C2D2F7C;/* "\-/|" */ -static time_t lasttime; + static time_t lasttime; time_t now; now = time(NULL); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199864 - head/sys/boot/pc98/loader
Author: sobomax Date: Fri Nov 27 13:19:06 2009 New Revision: 199864 URL: http://svn.freebsd.org/changeset/base/199864 Log: Remove spinconsole from pc98, some parts seem to be missed and it's too late (early?) to figure out what exactly. Reported by: TAKAHASHI Yoshihiro Modified: head/sys/boot/pc98/loader/conf.c Modified: head/sys/boot/pc98/loader/conf.c == --- head/sys/boot/pc98/loader/conf.cFri Nov 27 13:08:25 2009 (r199863) +++ head/sys/boot/pc98/loader/conf.cFri Nov 27 13:19:06 2009 (r199864) @@ -100,13 +100,11 @@ struct file_format *file_formats[] = { extern struct console vidconsole; extern struct console comconsole; extern struct console nullconsole; -extern struct console spinconsole; struct console *consoles[] = { &vidconsole, &comconsole, &nullconsole, -&spinconsole, NULL }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r199855 - in head/sys/boot: forth i386/libi386 i386/loader pc98/loader
TAKAHASHI Yoshihiro wrote: This breaks the loader for pc98. Sorry, reverted. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/7/sys: conf dev/bce
Is the option related to Jumbo Frames in any way? If not, IMHO the name should be changed to avoid any confusion. -Maxim Stanislav Sedov wrote: Author: stas Date: Sun Nov 15 11:43:28 2009 New Revision: 199289 URL: http://svn.freebsd.org/changeset/base/199289 Log: - MFC r198320: Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not into if_bce.c anyway. It is disabled by default. > PR:If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. _M 7/sys M7/sys/conf/NOTES M7/sys/conf/options M7/sys/dev/bce/if_bce.c M7/sys/dev/bce/if_bcereg.h _M 7/sys/contrib/pf Modified: stable/7/sys/conf/NOTES stable/7/sys/conf/options stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/NOTES == --- stable/7/sys/conf/NOTES Sun Nov 15 11:30:59 2009(r199288) +++ stable/7/sys/conf/NOTES Sun Nov 15 11:43:28 2009(r199289) @@ -1929,6 +1929,12 @@ device lmc # only works for Tigon II chips, and has no effect for Tigon I chips. optionsTI_JUMBO_HDRSPLIT +# +# Use header splitting feature on bce(4) adapters. +# This may help to reduce the amount of jumbo-sized memory buffers used. +# +optionsBCE_JUMBO_HDRSPLIT + # These two options allow manipulating the mbuf cluster size and mbuf size, # respectively. Be very careful with NIC driver modules when changing # these from their default values, because that can potentially cause a Modified: stable/7/sys/conf/options == --- stable/7/sys/conf/options Sun Nov 15 11:30:59 2009(r199288) +++ stable/7/sys/conf/options Sun Nov 15 11:43:28 2009(r199289) @@ -493,6 +493,7 @@ DRM_DEBUG opt_drm.h ZERO_COPY_SOCKETS opt_zero.h TI_PRIVATE_JUMBOS opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h +BCE_JUMBO_HDRSPLIT opt_bce.h # XXX Conflict: # of devices vs network protocol (Native ATM). # This makes "atm.h" unusable. Modified: stable/7/sys/dev/bce/if_bce.c == --- stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:30:59 2009 (r199288) +++ stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:43:28 2009 (r199289) @@ -293,12 +293,12 @@ static void bce_dump_enet (str static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); #endif static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *); static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); #endif static void bce_dump_l2fhdr(struct bce_softc *, int, struct l2_fhdr *); @@ -306,7 +306,7 @@ static void bce_dump_ctx(struct bce_s static void bce_dump_ftqs (struct bce_softc *); static void bce_dump_tx_chain (struct bce_softc *, u16, int); static void bce_dump_rx_chain (struct bce_softc *, u16, int); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_chain (struct bce_softc *, u16, int); #endif static void bce_dump_status_block (struct bce_softc *); @@ -391,7 +391,7 @@ static int bce_init_rx_chain (struct b static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); @@ -597,7 +597,7 @@ bce_print_adapter_info(struct bce_softc /* Firmware version and device features. */ printf("B/C (0x%08X); Flags( ", sc->bce_bc_v
Re: svn: stable/7/sys: conf dev/bce
Tom Judge wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Maxim Sobolev wrote: Is the option related to Jumbo Frames in any way? If not, IMHO the name should be changed to avoid any confusion. The bug is easier to reproduce when jumbo frames are turned on however we have seen it with normal frames also. Can we change the name then? We've seen the similar issue without the jumbo frames, which made me wonder. Also, perhaps we should make it a default and/or tunable. Having user to recompile kernel just to save 20 bytes of text segment is not very practical these days. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/7/sys: conf dev/bce
Maxim Sobolev wrote: Tom Judge wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Maxim Sobolev wrote: Is the option related to Jumbo Frames in any way? If not, IMHO the name should be changed to avoid any confusion. The bug is easier to reproduce when jumbo frames are turned on however we have seen it with normal frames also. Can we change the name then? We've seen the similar issue without the jumbo frames, which made me wonder. Also, perhaps we should make it a default and/or tunable. Having user to recompile kernel just to save 20 bytes of text segment is not very practical these days. Here is the patch: http://sobomax.sippysoft.com/~sobomax/bce.diff Please let me know if you have any objection to it, otherwise I will check it in. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/7/sys: conf dev/bce
Stanislav Sedov wrote: On Mon, 30 Nov 2009 13:25:03 -0800 Maxim Sobolev mentioned: Can we change the name then? We've seen the similar issue without the jumbo frames, which made me wonder. It's strange, because 'normal' frames are less than a page size in length, so the issue I was experiencing should not be reproducable with jumbo frames disabled. Can you describe a bit more what kind of problem you're experiencing? The traffic through interface abruptly halts randomly when under a load, without any signs of a problem. What is interesting is that the communication through unix domain sockets appears to be down too, since some scripts that connect to database not able to complete as well, so whatever this problem is it affect the whole network subsystem. We tried to replace hardware and it did not help. Only after we replaced bce(4) with IntelPro card (em) the problem has went away. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/7/sys: conf dev/bce
Tom Judge wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Maxim Sobolev wrote: Stanislav Sedov wrote: On Mon, 30 Nov 2009 13:25:03 -0800 Maxim Sobolev mentioned: Can we change the name then? We've seen the similar issue without the jumbo frames, which made me wonder. It's strange, because 'normal' frames are less than a page size in length, so the issue I was experiencing should not be reproducable with jumbo frames disabled. Can you describe a bit more what kind of problem you're experiencing? The traffic through interface abruptly halts randomly when under a load, without any signs of a problem. What is interesting is that the communication through unix domain sockets appears to be down too, since some scripts that connect to database not able to complete as well, so whatever this problem is it affect the whole network subsystem. We tried to replace hardware and it did not help. Only after we replaced bce(4) with IntelPro card (em) the problem has went away. When you see this lock up do you also see denied requests for mbufs? All the times I have seen the issue, the system was denying mbuf requests. Not sure about that, since we only have had network connection to that box, no console. However, I think that the problem with the other network subsystems that we see at the same time suggests that it might be an issue with the mbufs indeed. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/7/sys: conf dev/bce
Attila Nagy wrote: Maxim Sobolev wrote: Stanislav Sedov wrote: On Mon, 30 Nov 2009 13:25:03 -0800 Maxim Sobolev mentioned: Can we change the name then? We've seen the similar issue without the jumbo frames, which made me wonder. It's strange, because 'normal' frames are less than a page size in length, so the issue I was experiencing should not be reproducable with jumbo frames disabled. Can you describe a bit more what kind of problem you're experiencing? The traffic through interface abruptly halts randomly when under a load, without any signs of a problem. What is interesting is that the communication through unix domain sockets appears to be down too, since some scripts that connect to database not able to complete as well, so whatever this problem is it affect the whole network subsystem. We tried to replace hardware and it did not help. Only after we replaced bce(4) with IntelPro card (em) the problem has went away. Sorry, I've just noticed this thread and did not read the earlier posts. I can see similar, although only (at least for now) on version 8 (running something around RC2), also with bce interfaces and "heavy" -in terms of pps, this is a DNS server- network load. Everything which involves network halts for some minutes, but the machine is completely usable from the console. top shows some processes (I don't have an output, but as far as I can remember they were only that which did network IO) in the "keglim" state. Then something happens and the machine starts to work again. Can this be the same, or is it completely different? It really looks like the same issue. Those boxes are heavy-duty VoIP switches, so that they are handling high PPS as well in our case. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: stable/8/sbin/geom/class/mirror
Alexander Motin wrote: Author: mav Date: Thu Dec 10 23:51:24 2009 New Revision: 200373 URL: http://svn.freebsd.org/changeset/base/200373 Log: MFC r200282, r200290: Change gmirror default balance algorithm from "split" to improved "load". "split" is very ineffective for devices with rotating media as HDDs. To be effective, it needs that transfer time reduction due to block splitting was bigger then access time increase due to non-sequential access. For modern HDDs I was able to reproduce it only with read sizes of 2MB and above, which is almost not applicable in real life. "load" algorithm same time is more universal and effective now. The other problem with real hard drives is that they usually read much more data than requested. Some suggest that they read as much as one track each time the data is not in cache even if one sector has been requested, therefore splitting request of any reasonable size is meaningless, as it would simply cause both drives to load essentially the same data, wasting half of available I/O bandwidth and in addition you cause both heads to do seek, which makes it even worse. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r201782 - head/contrib/tcp_wrappers
Author: sobomax Date: Fri Jan 8 10:54:15 2010 New Revision: 201782 URL: http://svn.freebsd.org/changeset/base/201782 Log: Allow comment (#) to be placed anywhere in the line, not only at the beginning, so it's consistent with other configuration files. MFC after:3 weeks Modified: head/contrib/tcp_wrappers/hosts_access.c Modified: head/contrib/tcp_wrappers/hosts_access.c == --- head/contrib/tcp_wrappers/hosts_access.cFri Jan 8 10:32:27 2010 (r201781) +++ head/contrib/tcp_wrappers/hosts_access.cFri Jan 8 10:54:15 2010 (r201782) @@ -148,6 +148,7 @@ struct request_info *request; char *sh_cmd;/* becomes optional shell command */ int match = NO; struct tcpd_context saved_context; +char *cp; saved_context = tcpd_context; /* stupid compilers */ @@ -164,7 +165,16 @@ struct request_info *request; tcpd_warn("missing newline or line too long"); continue; } - if (sv_list[0] == '#' || sv_list[strspn(sv_list, " \t\r\n")] == 0) + /* Ignore anything after unescaped # character */ + for (cp = strchr(sv_list, '#'); cp != NULL;) { + if (cp > sv_list && cp[-1] == '\\') { + cp = strchr(cp + 1, '#'); + continue; + } + *cp = '\0'; + break; + } + if (sv_list[strspn(sv_list, " \t\r\n")] == 0) continue; if ((cl_list = split_at(sv_list, ':')) == 0) { tcpd_warn("missing \":\" separator"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/usr.sbin/burncd
Should not it be better to implement this on the kernel side when the device is closed abruptly? David E. O'Brien wrote: Author: obrien Date: Fri Dec 19 20:20:14 2008 New Revision: 186337 URL: http://svn.freebsd.org/changeset/base/186337 Log: burncd(8) doesn't handle signals and interrupting burncd during operation. For example, ^C (SIGINT) may leave the drive spinning and locked. This may also happen if you try to write a too-large image to a disc and burncd(8) exits with an I/O error. Add signal handling by doing a CDRIOCFLUSH ioctl to attempt to leave burner in a sane state when burning is interrupted with SIGHUP, SIGINT, SIGTERM, or in case an I/O error occurs during write. Note, that blanking will still continue after interrupt but it seems to finish correctly even after burncd(8) has quit. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/usr.sbin/burncd
Kostik Belousov wrote: On Fri, Dec 19, 2008 at 12:52:12PM -0800, Maxim Sobolev wrote: Should not it be better to implement this on the kernel side when the device is closed abruptly? The state that is kept is not accumulated on any particular filedescriptor, it is associated with the physical state of the device. Therefore, I think that kernel shall not be charged with cleanup, and userspace calls should deal with resetting device back to the pristine state. It may not be associated with any particular descriptor, still you can count number of opens for write compared to count of closes in the kernel. And it should be trivial to track when this number goes down to 0 and clean up any leftover mess. Check dev/md/md.c for example, function g_md_access(). -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/usr.sbin/mergemaster
Doug Barton wrote: Author: dougb Date: Thu Jan 1 10:55:26 2009 New Revision: 186677 URL: http://svn.freebsd.org/changeset/base/186677 Log: Revert 184781, 184804, and 184832 (automatic installation of files that differ only by VCS Id) for the following reasons: 1. It was added without my consent, review, or even a heads up Huh? I sent you request for review on 24 October 2008 and did received any reply, so that I went ahead and checked it in due to maintainer timeout. -Maxim Original Message From: - Fri Oct 24 17:15:25 2008 X-Mozilla-Status: 0001 X-Mozilla-Status2: 0080 X-Mozilla-Keys: Message-ID: <49026515.7080...@sippysoft.com> Date: Fri, 24 Oct 2008 17:15:17 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Doug Barton Subject: mergemaster(8) change for approval Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Hi Doug, How are you? Can you please review and hopefully approve the following patch, which makes mergemaster to skip any files that only differ in revision number. This is extremely helpful in tracking stable releases, since there are lot of cases when nothing changes but revision number. The patch is here: http://sobomax.sippysoft.com/~sobomax/mergemaster.diff Thanks in advance! Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts T/F: +1-646-651-1110 Web: http://www.sippysoft.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/usr.sbin/mergemaster
Doug Barton wrote: Given that this is a situation that comes up very infrequently (usually only for a major version upgrade) and can usually be handled simply enough on a one-off basis, I will once again point out that I think this is a Bad Idea. I would be willing to consider a better implementation as an option that is off by default. You are very wrong on this. This situation happens very *frequently* even for updates between minor releases (such as 6.3 to 6.4 and so on). As somebody doing lot of source upgrades frequently I can tell you this for sure. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/usr.sbin/mergemaster
Doug Barton wrote: Maxim Sobolev wrote: Doug Barton wrote: Author: dougb Date: Thu Jan 1 10:55:26 2009 New Revision: 186677 URL: http://svn.freebsd.org/changeset/base/186677 Log: Revert 184781, 184804, and 184832 (automatic installation of files that differ only by VCS Id) for the following reasons: 1. It was added without my consent, review, or even a heads up Huh? I sent you request for review on 24 October 2008 If that's the case then I apologize, I've been extremely overloaded lately and it's possible that this fell through the cracks. My other objections remain however, including the one about the -U option being a better solution that requires no new code. 1. -U option requires system to have the copy of the database from the previous upgrade. It gives no help on the system that was installed from CD. 2. If the functionality has some issues leading to false positives I can investigate and improve/fix. 3. I don't see anything so technically bad about that feature (put aside implementation details). I would like to hear some of your principal objections. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/usr.sbin/mergemaster
Doug Barton wrote: 1. Past experience indicates that your average _developer_ is not very good at estimating what the average _user_ will want as the default. This statement is pretty much self-contradictory. You are saying that average developer is very bad at estimating which behavior should be the default, yet you ("average developer") is vetoing features that users (myself and others) report to be very useful. I don't have much time to spend on this issue, but I really think you should release mergemaster from strong maintainership lock and let community lead it future development, especially considering that you have confessed to not having much time to devote to it these days. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/i386/conf
Luigi Rizzo wrote: +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value' , same as for hints files. What do you think about extending comment with the following: "hints files" -> "hints or loader.conf(5) files". -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/i386/conf
Luigi Rizzo wrote: On Tue, Jan 06, 2009 at 02:02:17PM -0800, Maxim Sobolev wrote: Luigi Rizzo wrote: +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value' , same as for hints files. What do you think about extending comment with the following: "hints files" -> "hints or loader.conf(5) files". i don't know -- in fact, I have a curiosity here: loader.conf is processed by some code in loader.4th which in turn is interpreted by loader.conf, and this chain does some magic on certain variable names (and can also do $variable expansion). Instead, I believe that 'hints' (and presumably 'env' values) are passed directly to the kernel, so there are no special manipulation of variable names or values. Is that correct ? That's true, however if loader doesn't have any handling logic for a certain valuable it simply sets kenv (aka kernel tunable). Take a look at the loader.conf(5) for example. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/i386/conf
Luigi Rizzo wrote: On Tue, Jan 06, 2009 at 04:08:59PM -0800, Maxim Sobolev wrote: Luigi Rizzo wrote: On Tue, Jan 06, 2009 at 02:02:17PM -0800, Maxim Sobolev wrote: Luigi Rizzo wrote: +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value' , same as for hints files. What do you think about extending comment with the following: "hints files" -> "hints or loader.conf(5) files". i don't know -- in fact, I have a curiosity here: loader.conf is processed by some code in loader.4th which in turn is interpreted by loader.conf, and this chain does some magic on certain variable names (and can also do $variable expansion). Instead, I believe that 'hints' (and presumably 'env' values) are passed directly to the kernel, so there are no special manipulation of variable names or values. Is that correct ? That's true, however if loader doesn't have any handling logic for a certain valuable it simply sets kenv (aka kernel tunable). Take a look at the loader.conf(5) for example. ok, but all we need to say is the following: The file can contain lines of the form name = "value"# this is a coment where whitespace around name and '=' is ignored, and so is everything after a '#' character. Almost any printable character except '=' is acceptable as part of a name. Quotes are optional and necessary only if the value contains whitespace. so why don't we just say that in the kenv(1) manpage (and refer to that) instead of referring to loader.conf which contains a lot of stuff that does not apply in this case ? My main point is that usually people set those tunables not in "hints files" but in loader.conf, so that if you refer to hints you should also need to mention loader.conf. In fact I guess that many people may not even know about what "hints files" are. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn: head/sys/i386/conf
Maxim Sobolev wrote: Luigi Rizzo wrote: On Tue, Jan 06, 2009 at 04:08:59PM -0800, Maxim Sobolev wrote: Luigi Rizzo wrote: On Tue, Jan 06, 2009 at 02:02:17PM -0800, Maxim Sobolev wrote: Luigi Rizzo wrote: +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value' , same as for hints files. What do you think about extending comment with the following: "hints files" -> "hints or loader.conf(5) files". i don't know -- in fact, I have a curiosity here: loader.conf is processed by some code in loader.4th which in turn is interpreted by loader.conf, and this chain does some magic on certain variable names (and can also do $variable expansion). Instead, I believe that 'hints' (and presumably 'env' values) are passed directly to the kernel, so there are no special manipulation of variable names or values. Is that correct ? That's true, however if loader doesn't have any handling logic for a certain valuable it simply sets kenv (aka kernel tunable). Take a look at the loader.conf(5) for example. ok, but all we need to say is the following: The file can contain lines of the form name = "value"# this is a coment where whitespace around name and '=' is ignored, and so is everything after a '#' character. Almost any printable character except '=' is acceptable as part of a name. Quotes are optional and necessary only if the value contains whitespace. so why don't we just say that in the kenv(1) manpage (and refer to that) instead of referring to loader.conf which contains a lot of stuff that does not apply in this case ? My main point is that usually people set those tunables not in "hints files" but in loader.conf, so that if you refer to hints you should also need to mention loader.conf. In fact I guess that many people may not even know about what "hints files" are. Forgot to mention that IMHO another reason why loader.conf(5) is a good reference is that it describes purpose of many of the commonly used tunables. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r187251 - head/sys/mips/malta
Christoph Mallon wrote: Alexey Dokuchaev schrieb: On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: In message: <20090115020752.52566769.s...@freebsd.org> Stanislav Sedov writes: : > +shift = 8 * (reg & 3); : > : : Would it make sense to replace this with : > +shift = (reg & 3) << 3; : : to not rely on possible compiler optimizations? I don't think that it matters all that much these days... But the name "shift" kinda suggests << instead of *, no? The value *is* a shift amount (see its uses a few lines down). Its name does not imply the way it is calculated, but what it is used for. BTW: Even the most cheap compilers emit shift instructions for multiplication by a power of two. The new code also is clearly faster then the old - quite some code gets generated for switches. I believe Warner's point is that the code is not in the hot path, so that it should not really matter either way. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r187426 - head/sys/amd64/conf
Author: sobomax Date: Mon Jan 19 07:10:11 2009 New Revision: 187426 URL: http://svn.freebsd.org/changeset/base/187426 Log: Add asr(4) and stge(4) from i386 GENERIC. Both drivers compile on amd64 and there is no particular reason for them to be i386-only. MFC after:2 weeks Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Mon Jan 19 06:55:29 2009(r187425) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 07:10:11 2009(r187426) @@ -138,6 +138,7 @@ device ses # SCSI Environmental Servic # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID +device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss# Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x @@ -230,6 +231,7 @@ device sf # Adaptec AIC-6915 (``Starfi device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) +device stge# Sundance/Tamarack TC9021 gigabit Ethernet device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vge # VIA VT612x gigabit Ethernet ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r187427 - head/sys/amd64/conf
Author: sobomax Date: Mon Jan 19 07:18:32 2009 New Revision: 187427 URL: http://svn.freebsd.org/changeset/base/187427 Log: Whitespace-only: reduce diff to the i386 GENERIC. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Mon Jan 19 07:10:11 2009(r187426) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 07:18:32 2009(r187427) @@ -28,7 +28,7 @@ ident GENERIC # through getenv() (or kenv(1) in userland). The format of the file # is 'variable=value', see kenv(1) # -# env "GENERIC.env" +# env "GENERIC.env" makeoptionsDEBUG=-g# Build kernel with gdb(1) debug symbols @@ -69,8 +69,8 @@ options SYSVSEM # SYSV-style semaphor options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev optionsSTOP_NMI# Stop CPUS using NMI instead of IPI +optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) optionsAUDIT # Security event auditing -optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks @@ -251,8 +251,8 @@ device xe # Xircom pccard Ethernet # Wireless NIC cards device wlan# 802.11 support -optionsIEEE80211_DEBUG # enable debug msgs -optionsIEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +optionsIEEE80211_DEBUG # enable debug msgs +optionsIEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's device wlan_wep# 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r187426 - head/sys/amd64/conf
Scott Long wrote: Maxim Sobolev wrote: Author: sobomax Date: Mon Jan 19 07:10:11 2009 New Revision: 187426 URL: http://svn.freebsd.org/changeset/base/187426 Log: Add asr(4) and stge(4) from i386 GENERIC. Both drivers compile on amd64 and there is no particular reason for them to be i386-only. Yes, there is a particular reason why asr is i386 only. This has been discussed extensively over the years, but to sum it up, no it is not 64-bit clean. Please remove. At this point in the lifecycle of amd64, you can be 100% assured that the list of compatible devices has been checked and rechecked a few dozen times. You are not going to find hidden gems that people have forgotten about. If you think you've found something, ask first, and prepare to be wrong. And above all else, don't put drivers into here that you haven't tested. It's pretty silly to admit in your commit message, for all to see, that you are blatantly committing without testing. Point taken, thanks. Is there any technical reason why stge(4) not in there? -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r187429 - head/sys/amd64/conf
Author: sobomax Date: Mon Jan 19 08:25:41 2009 New Revision: 187429 URL: http://svn.freebsd.org/changeset/base/187429 Log: Comment amr(4) out - according to scottl it's not 64-bit clean. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Mon Jan 19 07:44:18 2009(r187428) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 08:25:41 2009(r187429) @@ -136,7 +136,8 @@ device pass# Passthrough device (dire device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID +#XXX it is not 64-bit clean, -scottl +#deviceamr # AMI MegaRAID device arcmsr # Areca SATA II RAID device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss# Compaq Smart RAID 5* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r187430 - head/sys/amd64/conf
Author: sobomax Date: Mon Jan 19 08:51:20 2009 New Revision: 187430 URL: http://svn.freebsd.org/changeset/base/187430 Log: asr(4) is not amd64-clean, not amr(4). Pointy hat to:myself Submitted by: scottl Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Mon Jan 19 08:25:41 2009(r187429) +++ head/sys/amd64/conf/GENERIC Mon Jan 19 08:51:20 2009(r187430) @@ -136,10 +136,10 @@ devicepass# Passthrough device (dire device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem -#XXX it is not 64-bit clean, -scottl -#deviceamr # AMI MegaRAID +device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID -device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +#XXX it is not 64-bit clean, -scottl +#deviceasr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss# Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r187426 - head/sys/amd64/conf
Scott Long wrote: prepare to be wrong. And above all else, don't put drivers into here that you haven't tested. It's pretty silly to admit in your commit message, for all to see, that you are blatantly committing without testing. Actually this is interesting point, what the best strategy for us as the project should be? Should we new put drivers that have been tested on i386 only and don't have any particular reason to be i386-specific (i.e. ISA/EISA drivers, PCMCIA drivers etc) into amd64 GENERIC automatically and wait for somebody to report a problem, or stay on the safe side and enable drivers on amd64 only after somebody actually has tested them and confirms that they are working? Should this policy depend on driver class (for example a storage driver has much higher potential for screwing user's data compared to a network driver or a sound driver) and on release (HEAD / STABLE)? IMHO FreeBSD could benefit by putting at least non-storage untested non i386-specific drivers into amd64 kernel and/or at least in HEAD to give them testing and a wider exposure. This is not just idle interest for me - recently our company has started shipping amd64 version of our FreeBSD-based product, so that we are a little bit concerned about hardware support with amd64 7.1 kernel being a little bit narrower compared to i386 7.1 kernel. I apologize if this topic has been discussed somewhere already. -Maxim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"