Date: Wed, 17 Sep 2008 11:36:07 GMT From: Rafal Jaworowski <raj@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 149933 for review Message-ID: <200809171136.m8HBa7Zh010879@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149933 Change 149933 by raj@raj_mimi on 2008/09/17 11:36:01 IFC @149929 Affected files ... .. //depot/projects/arm/src/ObsoleteFiles.inc#40 integrate .. //depot/projects/arm/src/UPDATING#31 integrate .. //depot/projects/arm/src/contrib/libpcap/pcap-bpf.c#5 integrate .. //depot/projects/arm/src/contrib/libpcap/pcap-int.h#4 integrate .. //depot/projects/arm/src/contrib/libpcap/pcap.c#4 integrate .. //depot/projects/arm/src/contrib/telnet/arpa/telnet.h#2 integrate .. //depot/projects/arm/src/etc/defaults/rc.conf#26 integrate .. //depot/projects/arm/src/etc/rc.d/jail#6 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#4 integrate .. //depot/projects/arm/src/include/arpa/telnet.h#2 integrate .. //depot/projects/arm/src/include/uuid.h#2 integrate .. //depot/projects/arm/src/lib/libarchive/archive_platform.h#9 integrate .. //depot/projects/arm/src/lib/libarchive/archive_read_support_compression_program.c#4 integrate .. //depot/projects/arm/src/lib/libarchive/archive_write_disk.c#17 integrate .. //depot/projects/arm/src/lib/libarchive/config_freebsd.h#8 integrate .. //depot/projects/arm/src/lib/libarchive/filter_fork.c#4 integrate .. //depot/projects/arm/src/lib/libc/rpc/clnt_dg.c#4 integrate .. //depot/projects/arm/src/lib/libc/uuid/Symbol.map#3 integrate .. //depot/projects/arm/src/lib/libpmc/Makefile#3 integrate .. //depot/projects/arm/src/lib/libpmc/libpmc.c#5 integrate .. //depot/projects/arm/src/lib/libpmc/pmc.3#6 integrate .. //depot/projects/arm/src/lib/libpmc/pmc.k7.3#1 branch .. //depot/projects/arm/src/lib/libpmc/pmc.k8.3#1 branch .. //depot/projects/arm/src/lib/libpmc/pmc.p4.3#1 branch .. //depot/projects/arm/src/lib/libpmc/pmc.p5.3#1 branch .. //depot/projects/arm/src/lib/libpmc/pmc.p6.3#1 branch .. //depot/projects/arm/src/lib/libpmc/pmc.tsc.3#1 branch .. //depot/projects/arm/src/lib/libthr/thread/thr_event.c#3 integrate .. //depot/projects/arm/src/lib/libthread_db/libpthread_db.c#4 integrate .. //depot/projects/arm/src/lib/libthread_db/libthr_db.c#4 integrate .. //depot/projects/arm/src/lib/libthread_db/thread_db.c#5 integrate .. //depot/projects/arm/src/lib/libthread_db/thread_db.h#3 integrate .. //depot/projects/arm/src/lib/libthread_db/thread_db_int.h#3 integrate .. //depot/projects/arm/src/libexec/rtld-elf/rtld_lock.c#4 integrate .. //depot/projects/arm/src/rescue/rescue/Makefile#13 integrate .. //depot/projects/arm/src/sbin/fsck_ffs/fsck_ffs.8#3 integrate .. //depot/projects/arm/src/sbin/mount_nfs/mount_nfs.8#6 integrate .. //depot/projects/arm/src/sbin/mount_nfs/mount_nfs.c#8 integrate .. //depot/projects/arm/src/share/man/man4/ddb.4#12 integrate .. //depot/projects/arm/src/share/man/man4/snd_hda.4#12 integrate .. //depot/projects/arm/src/share/man/man5/rc.conf.5#22 integrate .. //depot/projects/arm/src/share/man/man9/DB_COMMAND.9#1 branch .. //depot/projects/arm/src/share/man/man9/Makefile#23 integrate .. //depot/projects/arm/src/share/man/man9/bus_dma.9#9 integrate .. //depot/projects/arm/src/share/zoneinfo/africa#7 integrate .. //depot/projects/arm/src/share/zoneinfo/asia#8 integrate .. //depot/projects/arm/src/share/zoneinfo/europe#7 integrate .. //depot/projects/arm/src/share/zoneinfo/southamerica#9 integrate .. //depot/projects/arm/src/sys/amd64/amd64/vm_machdep.c#9 integrate .. //depot/projects/arm/src/sys/amd64/include/pmc_mdep.h#4 integrate .. //depot/projects/arm/src/sys/amd64/pci/pci_cfgreg.c#6 integrate .. //depot/projects/arm/src/sys/arm/include/pcpu.h#7 integrate .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425.c#27 integrate .. //depot/projects/arm/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c#4 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_misc.c#23 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_proto.h#29 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_syscall.h#29 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_syscalls.c#29 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_sysent.c#29 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/syscalls.master#30 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_misc.c#35 integrate .. //depot/projects/arm/src/sys/compat/ndis/ntoskrnl_var.h#6 integrate .. //depot/projects/arm/src/sys/compat/svr4/svr4_stream.c#9 integrate .. //depot/projects/arm/src/sys/compat/svr4/svr4_sysvec.c#7 integrate .. //depot/projects/arm/src/sys/conf/NOTES#66 integrate .. //depot/projects/arm/src/sys/ddb/db_command.c#13 integrate .. //depot/projects/arm/src/sys/ddb/ddb.h#8 integrate .. //depot/projects/arm/src/sys/dev/aac/aac_pci.c#12 integrate .. //depot/projects/arm/src/sys/dev/aic7xxx/aic79xx_osm.c#10 integrate .. //depot/projects/arm/src/sys/dev/cxgb/common/cxgb_t3_hw.c#10 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_adapter.h#13 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_config.h#7 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_include.h#4 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_main.c#20 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_offload.h#9 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_osdep.h#9 integrate .. //depot/projects/arm/src/sys/dev/cxgb/cxgb_sge.c#17 integrate .. //depot/projects/arm/src/sys/dev/cxgb/sys/cxgb_support.c#3 integrate .. //depot/projects/arm/src/sys/dev/cxgb/sys/mbufq.h#3 integrate .. //depot/projects/arm/src/sys/dev/cxgb/ulp/toecore/cxgb_toedev.h#2 integrate .. //depot/projects/arm/src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#6 integrate .. //depot/projects/arm/src/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c#6 integrate .. //depot/projects/arm/src/sys/dev/cxgb/ulp/tom/cxgb_ddp.c#5 integrate .. //depot/projects/arm/src/sys/dev/cxgb/ulp/tom/cxgb_tom.c#4 integrate .. //depot/projects/arm/src/sys/dev/hwpmc/hwpmc_x86.c#5 integrate .. //depot/projects/arm/src/sys/dev/mlx/mlx.c#4 integrate .. //depot/projects/arm/src/sys/dev/pci/vga_pci.c#3 integrate .. //depot/projects/arm/src/sys/dev/ppbus/if_plip.c#9 integrate .. //depot/projects/arm/src/sys/dev/ppbus/lpt.c#7 integrate .. //depot/projects/arm/src/sys/dev/ppbus/ppbconf.c#6 integrate .. //depot/projects/arm/src/sys/dev/ppbus/ppbconf.h#3 integrate .. //depot/projects/arm/src/sys/dev/ppbus/ppi.c#5 integrate .. //depot/projects/arm/src/sys/dev/ppbus/pps.c#8 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppc.c#11 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppc_acpi.c#3 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppc_isa.c#4 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppc_pci.c#2 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppc_puc.c#3 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppcreg.h#4 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppcvar.h#5 integrate .. //depot/projects/arm/src/sys/dev/sound/pci/hda/hda_reg.h#3 integrate .. //depot/projects/arm/src/sys/dev/sound/pci/hda/hdac.c#24 integrate .. //depot/projects/arm/src/sys/dev/sound/pci/hda/hdac_private.h#9 integrate .. //depot/projects/arm/src/sys/dev/tx/if_tx.c#9 integrate .. //depot/projects/arm/src/sys/dev/usb/ubsa.c#14 integrate .. //depot/projects/arm/src/sys/dev/usb/ufoma.c#9 integrate .. //depot/projects/arm/src/sys/dev/usb/usbdevs#50 integrate .. //depot/projects/arm/src/sys/fs/nullfs/null_vnops.c#12 integrate .. //depot/projects/arm/src/sys/gnu/fs/ext2fs/ext2_inode.c#4 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/support/kdb.c#4 integrate .. //depot/projects/arm/src/sys/i386/conf/GENERIC#32 integrate .. //depot/projects/arm/src/sys/i386/i386/sys_machdep.c#12 integrate .. //depot/projects/arm/src/sys/i386/i386/vm_machdep.c#15 integrate .. //depot/projects/arm/src/sys/i386/include/pmc_mdep.h#4 integrate .. //depot/projects/arm/src/sys/i386/include/proc.h#5 integrate .. //depot/projects/arm/src/sys/i386/pci/pci_cfgreg.c#8 integrate .. //depot/projects/arm/src/sys/kern/kern_intr.c#23 integrate .. //depot/projects/arm/src/sys/kern/kern_proc.c#20 integrate .. //depot/projects/arm/src/sys/kern/subr_pcpu.c#4 integrate .. //depot/projects/arm/src/sys/kern/subr_rman.c#16 integrate .. //depot/projects/arm/src/sys/kern/subr_sleepqueue.c#25 integrate .. //depot/projects/arm/src/sys/kern/subr_turnstile.c#16 integrate .. //depot/projects/arm/src/sys/kern/subr_witness.c#32 integrate .. //depot/projects/arm/src/sys/kern/tty.c#24 integrate .. //depot/projects/arm/src/sys/kern/vfs_bio.c#30 integrate .. //depot/projects/arm/src/sys/kern/vfs_vnops.c#23 integrate .. //depot/projects/arm/src/sys/modules/Makefile#60 integrate .. //depot/projects/arm/src/sys/modules/svr4/Makefile#6 integrate .. //depot/projects/arm/src/sys/modules/wlan/Makefile#7 integrate .. //depot/projects/arm/src/sys/net/if_atmsubr.c#8 integrate .. //depot/projects/arm/src/sys/net/if_fwsubr.c#9 integrate .. //depot/projects/arm/src/sys/net/if_iso88025subr.c#8 integrate .. //depot/projects/arm/src/sys/net/route.c#13 integrate .. //depot/projects/arm/src/sys/net/route.h#8 integrate .. //depot/projects/arm/src/sys/netgraph/ng_base.c#23 integrate .. //depot/projects/arm/src/sys/netinet/if_ether.c#23 integrate .. //depot/projects/arm/src/sys/netinet/in_rmx.c#8 integrate .. //depot/projects/arm/src/sys/netinet/in_var.h#8 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw.h#16 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw2.c#47 integrate .. //depot/projects/arm/src/sys/netinet/tcp_output.c#29 integrate .. //depot/projects/arm/src/sys/netinet/tcp_subr.c#39 integrate .. //depot/projects/arm/src/sys/netinet/tcp_syncache.c#32 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_vfsops.c#24 integrate .. //depot/projects/arm/src/sys/nfsserver/nfs.h#8 integrate .. //depot/projects/arm/src/sys/nfsserver/nfs_serv.c#22 integrate .. //depot/projects/arm/src/sys/nfsserver/nfs_srvsock.c#15 integrate .. //depot/projects/arm/src/sys/nfsserver/nfs_srvsubs.c#17 integrate .. //depot/projects/arm/src/sys/nfsserver/nfs_syscalls.c#16 integrate .. //depot/projects/arm/src/sys/powerpc/aim/clock.c#5 integrate .. //depot/projects/arm/src/sys/powerpc/aim/mmu_oea.c#5 integrate .. //depot/projects/arm/src/sys/powerpc/aim/mp_cpudep.c#2 integrate .. //depot/projects/arm/src/sys/powerpc/aim/swtch.S#4 integrate .. //depot/projects/arm/src/sys/powerpc/aim/trap_subr.S#4 integrate .. //depot/projects/arm/src/sys/powerpc/include/cpufunc.h#4 integrate .. //depot/projects/arm/src/sys/powerpc/include/smp.h#3 integrate .. //depot/projects/arm/src/sys/powerpc/include/spr.h#5 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/autoconf.c#5 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/cpu.c#6 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/mp_machdep.c#5 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/openpic.c#8 integrate .. //depot/projects/arm/src/sys/sys/interrupt.h#10 integrate .. //depot/projects/arm/src/sys/sys/mount.h#25 integrate .. //depot/projects/arm/src/sys/sys/param.h#49 integrate .. //depot/projects/arm/src/sys/sys/proc.h#40 integrate .. //depot/projects/arm/src/sys/sys/procfs.h#3 integrate .. //depot/projects/arm/src/sys/sys/vnode.h#30 integrate .. //depot/projects/arm/src/sys/ufs/ffs/ffs_extern.h#9 integrate .. //depot/projects/arm/src/sys/ufs/ffs/ffs_inode.c#9 integrate .. //depot/projects/arm/src/sys/ufs/ffs/ffs_snapshot.c#24 integrate .. //depot/projects/arm/src/sys/ufs/ffs/ffs_softdep.c#28 integrate .. //depot/projects/arm/src/sys/ufs/ffs/ffs_vfsops.c#34 integrate .. //depot/projects/arm/src/sys/ufs/ufs/dirhash.h#3 integrate .. //depot/projects/arm/src/sys/ufs/ufs/inode.h#6 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_dirhash.c#4 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_inode.c#10 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_lookup.c#11 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_vnops.c#24 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufsmount.h#6 integrate .. //depot/projects/arm/src/tools/build/mk/OptionalObsoleteFiles.inc#15 integrate .. //depot/projects/arm/src/usr.bin/tar/config_freebsd.h#5 integrate .. //depot/projects/arm/src/usr.bin/tar/test/Makefile#3 integrate .. //depot/projects/arm/src/usr.bin/tar/test/test_symlink_dir.c#1 branch .. //depot/projects/arm/src/usr.bin/tar/write.c#15 integrate .. //depot/projects/arm/src/usr.bin/top/machine.c#8 integrate .. //depot/projects/arm/src/usr.sbin/fwcontrol/fwcontrol.8#7 integrate .. //depot/projects/arm/src/usr.sbin/mlxcontrol/command.c#2 integrate .. //depot/projects/arm/src/usr.sbin/mlxcontrol/interface.c#2 integrate .. //depot/projects/arm/src/usr.sbin/ntp/config.h#4 integrate .. //depot/projects/arm/src/usr.sbin/portsnap/portsnap/portsnap.8#4 integrate .. //depot/projects/arm/src/usr.sbin/quot/quot.c#4 integrate .. //depot/projects/arm/src/usr.sbin/ypbind/yp_ping.c#2 integrate Differences ... ==== //depot/projects/arm/src/ObsoleteFiles.inc#40 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/ObsoleteFiles.inc,v 1.158 2008/09/10 18:36:58 jhb Exp $ +# $FreeBSD: src/ObsoleteFiles.inc,v 1.160 2008/09/14 17:49:46 antoine Exp $ # # This file lists old files (OLD_FILES), libraries (OLD_LIBS) and # directories (OLD_DIRS) which should get removed at an update. Recently @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20080913: pax removed from rescue +OLD_FILES+=rescue/pax # 20080823: removal of unneeded pt_chown, to implement grantpt(3) OLD_FILES+=usr/libexec/pt_chown # 20080822: ntp 4.2.4p5 import @@ -3794,7 +3796,6 @@ OLD_FILES+=usr/games/worms OLD_FILES+=usr/games/wump OLD_FILES+=sbin/mount_reiserfs -OLD_FILES+=usr/bin/hesinfo OLD_FILES+=usr/include/c++/3.4/ext/demangle.h OLD_FILES+=usr/include/cam/cam_extend.h OLD_FILES+=usr/include/dev/wi/wi_hostap.h @@ -4204,10 +4205,8 @@ OLD_FILES+=usr/share/doc/ntp/tickadj.htm OLD_FILES+=usr/share/doc/papers/nqnfs.ascii.gz OLD_FILES+=usr/share/doc/papers/px.ascii.gz -OLD_FILES+=usr/share/man/man1/hesinfo.1.gz OLD_FILES+=usr/share/man/man3/mbrune.3.gz OLD_FILES+=usr/share/man/man3/rune.3.gz -OLD_FILES+=usr/share/man/man3/hesiod.3.gz OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz @@ -4222,7 +4221,6 @@ OLD_FILES+=usr/share/man/man3/setinvalidrune.3.gz OLD_FILES+=usr/share/man/man3/mbrune.3.gz OLD_FILES+=usr/share/man/man3/rune.3.gz -OLD_FILES+=usr/share/man/man3/hesiod.3.gz OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz @@ -4238,7 +4236,6 @@ OLD_FILES+=usr/share/man/man3/fungetrune.3.gz OLD_FILES+=usr/share/man/man3/fputrune.3.gz OLD_FILES+=usr/share/man/man3/fgetrune.3.gz -OLD_FILES+=usr/share/man/man5/hesiod.conf.5.gz OLD_FILES+=usr/share/man/man5/usbd.conf.5.gz .if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64" OLD_FILES+=usr/share/man/man8/boot_i386.8.gz ==== //depot/projects/arm/src/UPDATING#31 (text+ko) ==== @@ -30,10 +30,10 @@ drivers have not yet been ported to the new TTY layer: PCI/ISA: - cy, digi, rc, rp, si, sio + cy, digi, rc, rp, sio USB: - ubser, ucycom, ufoma + ubser, ucycom Line disciplines: ng_h4, ng_tty, ppp, sl, snp @@ -1126,4 +1126,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.541 2008/09/03 08:30:17 roberto Exp $ +$FreeBSD: src/UPDATING,v 1.542 2008/09/14 19:25:57 ed Exp $ ==== //depot/projects/arm/src/contrib/libpcap/pcap-bpf.c#5 (text+ko) ==== @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $FreeBSD: src/contrib/libpcap/pcap-bpf.c,v 1.4 2007/10/16 02:07:55 mlaier Exp $ + * $FreeBSD: src/contrib/libpcap/pcap-bpf.c,v 1.5 2008/09/16 20:32:29 csjp Exp $ */ #ifndef lint static const char rcsid[] _U_ = @@ -30,6 +30,7 @@ #endif #include <sys/param.h> /* optionally get BSD define */ +#include <sys/mman.h> #include <sys/time.h> #include <sys/timeb.h> #include <sys/socket.h> @@ -86,6 +87,10 @@ #endif /* _AIX */ +#ifdef BIOCSETBUFMODE +#include <machine/atomic.h> +#endif + #include <ctype.h> #include <errno.h> #include <netdb.h> @@ -139,6 +144,159 @@ return (0); } +#ifdef BIOCGETBUFMODE +/* + * Zero-copy BPF buffer routines to check for and acknowledge BPF data in + * shared memory buffers. + * + * pcap_next_zbuf_shm(): Check for a newly available shared memory buffer, + * and set up p->buffer and cc to reflect one if available. Notice that if + * there was no prior buffer, we select zbuf1 as this will be the first + * buffer filled for a fresh BPF session. + */ +static int +pcap_next_zbuf_shm(pcap_t *p, int *cc) +{ + struct bpf_zbuf_header *bzh; + + if (p->zbuffer == p->zbuf2 || p->zbuffer == NULL) { + bzh = (struct bpf_zbuf_header *)p->zbuf1; + if (bzh->bzh_user_gen != + atomic_load_acq_int(&bzh->bzh_kernel_gen)) { + p->bzh = bzh; + p->zbuffer = (u_char *)p->zbuf1; + p->buffer = p->zbuffer + sizeof(*bzh); + *cc = bzh->bzh_kernel_len; + return (1); + } + } else if (p->zbuffer == p->zbuf1) { + bzh = (struct bpf_zbuf_header *)p->zbuf2; + if (bzh->bzh_user_gen != + atomic_load_acq_int(&bzh->bzh_kernel_gen)) { + p->bzh = bzh; + p->zbuffer = (u_char *)p->zbuf2; + p->buffer = p->zbuffer + sizeof(*bzh); + *cc = bzh->bzh_kernel_len; + return (1); + } + } + *cc = 0; + return (0); +} + +/* + * pcap_next_zbuf() -- Similar to pcap_next_zbuf_shm(), except wait using + * select() for data or a timeout, and possibly force rotation of the buffer + * in the event we time out or are in immediate mode. Invoke the shared + * memory check before doing system calls in order to avoid doing avoidable + * work. + */ +static int +pcap_next_zbuf(pcap_t *p, int *cc) +{ + struct bpf_zbuf bz; + struct timeval tv; + struct timespec cur; + fd_set r_set; + int data, r; + int tmout, expire; + +#define TSTOMILLI(ts) (((ts)->tv_sec * 1000) + ((ts)->tv_nsec / 1000000)) + /* + * Start out by seeing whether anything is waiting by checking the + * next shared memory buffer for data. + */ + data = pcap_next_zbuf_shm(p, cc); + if (data) + return (data); + /* + * If a previous sleep was interrupted due to signal delivery, make + * sure that the timeout gets adjusted accordingly. This requires + * that we analyze when the timeout should be been expired, and + * subtract the current time from that. If after this operation, + * our timeout is less then or equal to zero, handle it like a + * regular timeout. + */ + tmout = p->to_ms; + if (tmout) + (void) clock_gettime(CLOCK_MONOTONIC, &cur); + if (p->interrupted && p->to_ms) { + expire = TSTOMILLI(&p->firstsel) + p->to_ms; + tmout = expire - TSTOMILLI(&cur); +#undef TSTOMILLI + if (tmout <= 0) { + p->interrupted = 0; + data = pcap_next_zbuf_shm(p, cc); + if (data) + return (data); + if (ioctl(p->fd, BIOCROTZBUF, &bz) < 0) { + (void) snprintf(p->errbuf, PCAP_ERRBUF_SIZE, + "BIOCROTZBUF: %s", strerror(errno)); + return (-1); + } + return (pcap_next_zbuf_shm(p, cc)); + } + } + /* + * No data in the buffer, so must use select() to wait for data or + * the next timeout. + */ + FD_ZERO(&r_set); + FD_SET(p->fd, &r_set); + if (tmout != 0) { + tv.tv_sec = tmout / 1000; + tv.tv_usec = (tmout * 1000) % 1000000; + } + r = select(p->fd + 1, &r_set, NULL, NULL, p->to_ms != 0 ? &tv : + NULL); + if (r < 0 && errno == EINTR) { + if (!p->interrupted && p->to_ms) { + p->interrupted = 1; + p->firstsel = cur; + } + return (0); + } else if (r < 0) { + (void) snprintf(p->errbuf, PCAP_ERRBUF_SIZE, + "select: %s", strerror(errno)); + return (-1); + } + p->interrupted = 0; + /* + * Check again for data, which may exist now that we've either been + * woken up as a result of data or timed out. Try the "there's data" + * case first since it doesn't require a system call. + */ + data = pcap_next_zbuf_shm(p, cc); + if (data) + return (data); + + /* + * Try forcing a buffer rotation to dislodge timed out or immediate + * data. + */ + if (ioctl(p->fd, BIOCROTZBUF, &bz) < 0) { + (void) snprintf(p->errbuf, PCAP_ERRBUF_SIZE, + "BIOCROTZBUF: %s", strerror(errno)); + return (-1); + } + return (pcap_next_zbuf_shm(p, cc)); +} + +/* + * Notify kernel that we are done with the buffer. We don't reset zbuffer so + * that we know which buffer to use next time around. + */ +static int +pcap_ack_zbuf(pcap_t *p) +{ + + atomic_store_rel_int(&p->bzh->bzh_user_gen, p->bzh->bzh_kernel_gen); + p->bzh = NULL; + p->buffer = NULL; + return (0); +} +#endif + static int pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user) { @@ -147,6 +305,9 @@ register u_char *bp, *ep; u_char *datap; struct bpf_insn *fcode; +#ifdef BIOCSETBUFMODE + int i; +#endif #ifdef PCAP_FDDIPAD register int pad; #endif @@ -167,7 +328,27 @@ } cc = p->cc; if (p->cc == 0) { - cc = read(p->fd, (char *)p->buffer, p->bufsize); + /* + * When reading without zero-copy from a file descriptor, we + * use a single buffer and return a length of data in the + * buffer. With zero-copy, we update the p->buffer pointer + * to point at whatever underlying buffer contains the next + * data and update cc to reflect the data found in the + * buffer. + */ +#ifdef BIOCSETBUFMODE + if (p->zerocopy) { + if (p->buffer != NULL) + pcap_ack_zbuf(p); + i = pcap_next_zbuf(p, &cc); + if (i == 0) + goto again; + if (i < 0) + return (-1); + } else +#endif + cc = read(p->fd, (char *)p->buffer, p->bufsize); + if (cc < 0) { /* Don't choke when we get ptraced */ switch (errno) { @@ -609,6 +790,10 @@ struct bpf_insn total_insn; struct bpf_program total_prog; struct utsname osinfo; +#ifdef BIOCSETBUFMODE + struct bpf_zbuf bz; + u_int bufmode, zbufmax; +#endif #ifdef HAVE_DAG_API if (strstr(device, "dag")) { @@ -646,41 +831,105 @@ goto bad; } +#ifdef BIOCSETBUFMODE /* - * Try finding a good size for the buffer; 32768 may be too - * big, so keep cutting it in half until we find a size - * that works, or run out of sizes to try. If the default - * is larger, don't make it smaller. - * - * XXX - there should be a user-accessible hook to set the - * initial buffer size. + * If the BPF extension to set buffer mode is present, try setting + * the mode to zero-copy. If that fails, use regular buffering. If + * it succeeds but other setup fails, return an error to the user. */ - if ((ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0) || v < 32768) - v = 32768; - for ( ; v != 0; v >>= 1) { - /* Ignore the return value - this is because the call fails - * on BPF systems that don't have kernel malloc. And if - * the call fails, it's no big deal, we just continue to - * use the standard buffer size. + bufmode = BPF_BUFMODE_ZBUF; + if (ioctl(fd, BIOCSETBUFMODE, (caddr_t)&bufmode) == 0) { + p->zerocopy = 1; + + /* + * How to pick a buffer size: first, query the maximum buffer + * size supported by zero-copy. This also lets us quickly + * determine whether the kernel generally supports zero-copy. + * Then, query the default buffer size, which reflects kernel + * policy for a desired default. Round to the nearest page + * size. */ - (void) ioctl(fd, BIOCSBLEN, (caddr_t)&v); - + if (ioctl(fd, BIOCGETZMAX, (caddr_t)&zbufmax) < 0) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, "BIOCGETZMAX: %s", + pcap_strerror(errno)); + goto bad; + } + if ((ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0) || v < 32768) + v = 32768; +#ifndef roundup +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ +#endif + p->zbufsize = roundup(v, getpagesize()); + if (p->zbufsize > zbufmax) + p->zbufsize = zbufmax; + p->zbuf1 = mmap(NULL, p->zbufsize, PROT_READ | PROT_WRITE, + MAP_ANON, -1, 0); + p->zbuf2 = mmap(NULL, p->zbufsize, PROT_READ | PROT_WRITE, + MAP_ANON, -1, 0); + if (p->zbuf1 == MAP_FAILED || p->zbuf2 == MAP_FAILED) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, "mmap: %s", + pcap_strerror(errno)); + goto bad; + } + bzero(&bz, sizeof(bz)); + bz.bz_bufa = p->zbuf1; + bz.bz_bufb = p->zbuf2; + bz.bz_buflen = p->zbufsize; + if (ioctl(fd, BIOCSETZBUF, (caddr_t)&bz) < 0) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, "BIOCSETZBUF: %s", + pcap_strerror(errno)); + goto bad; + } (void)strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); - if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) >= 0) - break; /* that size worked; we're done */ - - if (errno != ENOBUFS) { + if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) < 0) { snprintf(ebuf, PCAP_ERRBUF_SIZE, "BIOCSETIF: %s: %s", device, pcap_strerror(errno)); goto bad; } - } + v = p->zbufsize - sizeof(struct bpf_zbuf_header); + } else { +#endif + + /* + * Try finding a good size for the buffer; 32768 may be too + * big, so keep cutting it in half until we find a size + * that works, or run out of sizes to try. If the default + * is larger, don't make it smaller. + * + * XXX - there should be a user-accessible hook to set the + * initial buffer size. + */ + if ((ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0) || v < 32768) + v = 32768; + for ( ; v != 0; v >>= 1) { + /* Ignore the return value - this is because the call + * fails on BPF systems that don't have kernel + * malloc. And if the call fails, it's no big deal, + * we just continue to use the standard buffer size. + */ + (void) ioctl(fd, BIOCSBLEN, (caddr_t)&v); + + (void)strncpy(ifr.ifr_name, device, + sizeof(ifr.ifr_name)); + if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) >= 0) + break; /* that size worked; we're done */ + + if (errno != ENOBUFS) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, + "BIOCSETIF: %s: %s", + device, pcap_strerror(errno)); + goto bad; + } + } - if (v == 0) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, - "BIOCSBLEN: %s: No buffer size worked", device); - goto bad; + if (v == 0) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, + "BIOCSBLEN: %s: No buffer size worked", device); + goto bad; + } +#ifdef BIOCSETBUFMODE } +#endif /* Get the data link layer type. */ if (ioctl(fd, BIOCGDLT, (caddr_t)&v) < 0) { @@ -855,7 +1104,8 @@ } #endif /* set timeout */ - if (to_ms != 0) { + p->to_ms = to_ms; + if (to_ms != 0 && !p->zerocopy) { /* * XXX - is this seconds/nanoseconds in AIX? * (Treating it as such doesn't fix the timeout @@ -870,6 +1120,9 @@ goto bad; } } +#ifdef BIOCSETBUFMODE + p->timeout = to_ms; +#endif #ifdef _AIX #ifdef BIOCIMMEDIATE @@ -942,16 +1195,22 @@ goto bad; } p->bufsize = v; - p->buffer = (u_char *)malloc(p->bufsize); - if (p->buffer == NULL) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", - pcap_strerror(errno)); - goto bad; +#ifdef BIOCSETBUFMODE + if (!p->zerocopy) { +#endif + p->buffer = (u_char *)malloc(p->bufsize); + if (p->buffer == NULL) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", + pcap_strerror(errno)); + goto bad; + } +#ifdef _AIX + /* For some strange reason this seems to prevent the EFAULT + * problems we have experienced from AIX BPF. */ + memset(p->buffer, 0x0, p->bufsize); +#endif +#ifdef BIOCSETBUFMODE } -#ifdef _AIX - /* For some strange reason this seems to prevent the EFAULT - * problems we have experienced from AIX BPF. */ - memset(p->buffer, 0x0, p->bufsize); #endif /* @@ -1036,7 +1295,22 @@ return (p); bad: + (void)close(fd); +#ifdef BIOCSETBUFMODE + /* + * In zero-copy mode, p->buffer is just a pointer into one of the two + * memory-mapped buffers, so no need to free it. + */ + if (p->zerocopy) { + if (p->zbuf1 != MAP_FAILED && p->zbuf1 != NULL) + munmap(p->zbuf1, p->zbufsize); + if (p->zbuf2 != MAP_FAILED && p->zbuf2 != NULL) + munmap(p->zbuf2, p->zbufsize); + } else +#endif + if (p->buffer != NULL) + free(p->buffer); if (p->dlt_list != NULL) free(p->dlt_list); free(p); ==== //depot/projects/arm/src/contrib/libpcap/pcap-int.h#4 (text+ko) ==== @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/contrib/libpcap/pcap-int.h,v 1.13 2007/10/16 02:07:55 mlaier Exp $ + * $FreeBSD: src/contrib/libpcap/pcap-int.h,v 1.14 2008/09/16 20:32:29 csjp Exp $ * @(#) $Header: /tcpdump/master/libpcap/pcap-int.h,v 1.68.2.11 2007/06/22 06:43:58 guy Exp $ (LBL) */ @@ -167,12 +167,36 @@ struct pcap_md md; /* - * Read buffer. + * Read buffer -- for file descriptor read buffer model. */ int bufsize; u_char *buffer; u_char *bp; int cc; + int to_ms; + + /* + * Zero-copy read buffer -- for zero-copy BPF. 'buffer' above will + * alternative between these two actual mmap'd buffers as required. + * As there is a header on the front size of the mmap'd buffer, only + * some of the buffer is exposed to libpcap as a whole via bufsize; + * zbufsize is the true size. zbuffer tracks the current zbuf + * assocated with buffer so that it can be used to decide which the + * next buffer to read will be. + */ + u_char *zbuf1, *zbuf2, *zbuffer; + u_int zbufsize; + u_int timeout; + u_int zerocopy; + u_int interrupted; + struct timespec firstsel; + + /* + * If there's currently a buffer being actively processed, then it is + * referenced here; 'buffer' is also pointed at it, but offset by the + * size of the header. + */ + struct bpf_zbuf_header *bzh; /* * Place holder for pcap_next(). ==== //depot/projects/arm/src/contrib/libpcap/pcap.c#4 (text+ko) ==== @@ -44,6 +44,7 @@ #include <pcap-stdinc.h> #else /* WIN32 */ #include <sys/types.h> +#include <sys/mman.h> #endif /* WIN32 */ #include <stdio.h> @@ -738,6 +739,24 @@ void pcap_close_common(pcap_t *p) { +#ifdef BIOCSETBUFMODE + /* + * Check to see if this pcap instance was using the zerocopy buffer + * mode. If it was, delete the mappings. Note that p->buffer + * gets initialized to one of the mmaped regions in this case, so + * do not try and free it directly. + * + * If the regular buffer mode was selected, then it is safe to free + * this memory. + */ + if (p->zerocopy) { + if (p->zbuf1 != MAP_FAILED && p->zbuf1 != NULL) + munmap(p->zbuf1, p->zbufsize); + if (p->zbuf2 != MAP_FAILED && p->zbuf2 != NULL) + munmap(p->zbuf2, p->zbufsize); + p->buffer = NULL; + } else +#endif if (p->buffer != NULL) free(p->buffer); #if !defined(WIN32) && !defined(MSDOS) ==== //depot/projects/arm/src/contrib/telnet/arpa/telnet.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)telnet.h 8.2 (Berkeley) 12/15/93 - * $FreeBSD: src/contrib/telnet/arpa/telnet.h,v 1.9 2003/01/18 06:10:21 billf Exp $ + * $FreeBSD: src/contrib/telnet/arpa/telnet.h,v 1.10 2008/09/13 17:46:50 antoine Exp $ */ #ifndef _ARPA_TELNET_H_ @@ -140,8 +140,8 @@ "TACACS UID", "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", - "ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT", - "KERMIT", + "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET", + "RSP", "COM-PORT", "SLE", "STARTTLS", "KERMIT", 0 }; #define TELOPT_FIRST TELOPT_BINARY ==== //depot/projects/arm/src/etc/defaults/rc.conf#26 (text+ko) ==== @@ -15,7 +15,7 @@ # For a more detailed explanation of all the rc.conf variables, please # refer to the rc.conf(5) manual page. # -# $FreeBSD: src/etc/defaults/rc.conf,v 1.344 2008/08/29 20:30:30 jhb Exp $ +# $FreeBSD: src/etc/defaults/rc.conf,v 1.345 2008/09/16 20:18:25 thompsa Exp $ ############################################################## ### Important initial Boot-time options #################### @@ -621,6 +621,7 @@ #jail_example_hostname="default.domain.com" # Jail's hostname #jail_example_ip="192.168.0.10" # Jail's IP number #jail_example_interface="" # Interface to create the IP alias on +#jail_example_fib="0" # routing table for setfib(1) #jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting #jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for # starting the jail. More than one can be ==== //depot/projects/arm/src/etc/rc.d/jail#6 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/jail,v 1.38 2008/01/13 14:27:53 simon Exp $ +# $FreeBSD: src/etc/rc.d/jail,v 1.39 2008/09/16 20:18:25 thompsa Exp $ # # PROVIDE: jail @@ -83,6 +83,7 @@ [ -z "${_flags}" ] && _flags="-l -U root" eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" # Debugging aid # @@ -93,6 +94,7 @@ debug "$_j hostname: $_hostname" debug "$_j ip: $_ip" debug "$_j interface: $_interface" + debug "$_j fib: $_fib" debug "$_j root: $_rootdir" debug "$_j devdir: $_devdir" debug "$_j fdescdir: $_fdescdir" @@ -297,6 +299,11 @@ if [ -n "${_interface}" ]; then ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255 fi + if [ -n "${_fib}" ]; then + _setfib="setfib -F '${_fib}'" + else + _setfib="" + fi if checkyesno _mount; then info "Mounting fstab for jail ${_jail} (${_fstab})" if [ ! -f "${_fstab}" ]; then @@ -350,7 +357,7 @@ fi fi _tmp_jail=${_tmp_dir}/jail.$$ - eval jail ${_flags} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ ${_ip} ${_exec_start} > ${_tmp_jail} 2>&1 if [ "$?" -eq 0 ] ; then ==== //depot/projects/arm/src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c,v 1.17 2008/04/29 17:47:25 jhb Exp $ */ +/* $FreeBSD: src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c,v 1.18 2008/09/14 16:52:42 marcel Exp $ */ /* FreeBSD libthread_db assisted debugging support. Copyright 1999, 2000, 2001 Free Software Foundation, Inc. @@ -710,7 +710,7 @@ error ("Cannot get thread event message: %s", thread_db_err_str (err)); } - err = td_thr_get_info_p (msg.th_p, &ti); + err = td_thr_get_info_p ((void *)(uintptr_t)msg.th_p, &ti); if (err != TD_OK) error ("Cannot get thread info: %s", thread_db_err_str (err)); ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); @@ -720,7 +720,7 @@ /* We may already know about this thread, for instance when the user has issued the `info threads' command before the SIGTRAP for hitting the thread creation breakpoint was reported. */ - attach_thread (ptid, msg.th_p, &ti, 1); + attach_thread (ptid, (void *)(uintptr_t)msg.th_p, &ti, 1); break; case TD_DEATH: if (!in_thread_list (ptid)) @@ -1178,13 +1178,14 @@ if (ti.ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %p (LWP %d)", - th.th_thread, ti.ti_lid); + snprintf (buf, sizeof (buf), "Thread %llx (LWP %d)", + (unsigned long long)th.th_thread, ti.ti_lid); } else { - snprintf (buf, sizeof (buf), "Thread %p (%s)", - th.th_thread, thread_db_state_str (ti.ti_state)); + snprintf (buf, sizeof (buf), "Thread %llx (%s)", + (unsigned long long)th.th_thread, + thread_db_state_str (ti.ti_state)); } return buf; ==== //depot/projects/arm/src/include/arpa/telnet.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)telnet.h 8.2 (Berkeley) 12/15/93 - * $FreeBSD: src/include/arpa/telnet.h,v 1.9 2003/01/18 06:13:57 billf Exp $ + * $FreeBSD: src/include/arpa/telnet.h,v 1.10 2008/09/13 17:46:50 antoine Exp $ */ #ifndef _ARPA_TELNET_H_ @@ -140,8 +140,8 @@ "TACACS UID", "OUTPUT MARKING", "TTYLOC", "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", - "ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT", - "KERMIT", + "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET", + "RSP", "COM-PORT", "SLE", "STARTTLS", "KERMIT", 0 }; #define TELOPT_FIRST TELOPT_BINARY ==== //depot/projects/arm/src/include/uuid.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/include/uuid.h,v 1.3 2005/01/03 02:56:15 marcel Exp $ + * $FreeBSD: src/include/uuid.h,v 1.4 2008/09/15 23:47:19 emax Exp $ */ #ifndef _UUID_H_ @@ -54,6 +54,10 @@ uint16_t uuid_hash(const uuid_t *, uint32_t *); int32_t uuid_is_nil(const uuid_t *, uint32_t *); void uuid_to_string(const uuid_t *, char **, uint32_t *); +void uuid_enc_le(void *, const uuid_t *); +void uuid_dec_le(const void *, uuid_t *); +void uuid_enc_be(void *, const uuid_t *); +void uuid_dec_be(const void *, uuid_t *); __END_DECLS #endif /* _UUID_H_ */ ==== //depot/projects/arm/src/lib/libarchive/archive_platform.h#9 (text+ko) ==== @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.30 2008/05/26 17:00:22 kientzle Exp $ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809171136.m8HBa7Zh010879>