Re: svn commit: r243670 - head/share/man/man5
On 30 Nov 2012, at 00:15, Eitan Adler wrote: Every time I talk to the clang folk about flags they point me to gcc documentation. No we don't. We point you at the gcc documentation and at the clang manual. Clang aims to support all of the gcc flags, and provides some extra ones as documented here: http://clang.llvm.org/docs/UsersManual.html If you are interested in writing a full manual for clang including the gcc options, then that would almost certainly be appreciated. Most of this can be automatically generated. The best thing to do would be to write a tablegen back end that could emit mandoc from the existing options descriptions. David ___ 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: r243665 - head/sbin/dump
Den 29/11/2012 kl. 13.01 skrev Konstantin Belousov kostik...@gmail.com: On Thu, Nov 29, 2012 at 05:16:50AM +, Eitan Adler wrote: Author: eadler Date: Thu Nov 29 05:16:50 2012 New Revision: 243665 URL: http://svnweb.freebsd.org/changeset/base/243665 Log: Mark non-returning function as such PR: bin/172978 Approved by:cperciva MFC after: 3 days Modified: head/sbin/dump/dump.h Modified: head/sbin/dump/dump.h == --- head/sbin/dump/dump.hThu Nov 29 03:48:39 2012(r243664) +++ head/sbin/dump/dump.hThu Nov 29 05:16:50 2012(r243665) @@ -121,7 +121,7 @@ void trewind(void); void writerec(char *dp, int isspcl); void Exit(int status) __dead2; -voiddumpabort(int signo); +voiddumpabort(int signo) __dead2; void dump_getfstab(void); char *rawname(char *cp); What is the goal of this change ? It is arguably backward. There is absolutely no use to mark signal handler as __dead2, and all other uses do not benefit from the redundand declaration. I submitted this patch because it fixes static analysis warnings. Compilation units that contain the header but not the implementation need this to reason about the code. As I see it, the __dead2 is part of the function definition, just like 'void' and 'int signo'. Actually, before the patch, return type 'void' was a lie, because the function never returns. Also, being quite removed from the function definition, there is a chance that some future modification would make the attribute a lie. That is not any different than some future modification changing the return type to 'int', which the compiler would also warn about. Thanks, Erik ___ 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: r243670 - head/share/man/man5
On 30 November 2012 04:12, David Chisnall thera...@freebsd.org wrote: On 30 Nov 2012, at 00:15, Eitan Adler wrote: Every time I talk to the clang folk about flags they point me to gcc documentation. No we don't. We point you at the gcc documentation and at the clang manual. Clang aims to support all of the gcc flags, and provides some extra ones as documented here: Actually, every time I've asked the response I got has been exactly man gcc If you are interested in writing a full manual for clang including the gcc options, then that would almost certainly be appreciated. Most of this can be automatically generated. The best thing to do would be to write a tablegen back end that could emit mandoc from the existing options descriptions. and then they mention this. I've thought about working on it, but ENOTIME usually ;) -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams ___ 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: r243706 - in releng/9.1/release/doc: de_DE.ISO8859-1 fr_FR.ISO8859-1 ja_JP.eucJP ru_RU.KOI8-R zh_CN.GB2312
Author: hrs Date: Fri Nov 30 16:18:26 2012 New Revision: 243706 URL: http://svnweb.freebsd.org/changeset/base/243706 Log: Remove stale documents. Approved by: re (implicitly) Deleted: releng/9.1/release/doc/de_DE.ISO8859-1/ releng/9.1/release/doc/fr_FR.ISO8859-1/ releng/9.1/release/doc/ja_JP.eucJP/ releng/9.1/release/doc/ru_RU.KOI8-R/ releng/9.1/release/doc/zh_CN.GB2312/ ___ 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: r243707 - head/sys/netpfil/ipfw
Author: melifaro Date: Fri Nov 30 16:33:22 2012 New Revision: 243707 URL: http://svnweb.freebsd.org/changeset/base/243707 Log: Make ipfw dynamic states operations SMP-ready. * Global IPFW_DYN_LOCK() is changed to per-bucket mutex. * State expiration is done in ipfw_tick every second. * No expiration is done on forwarding path. * hash table resize is done automatically and does not flush all states. * Dynamic UMA zone is now allocated per each VNET * State limiting is now done via UMA(9) api. Discussed with: ipfw MFC after:3 weeks Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw2.c == --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 16:18:26 2012 (r243706) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 16:33:22 2012 (r243707) @@ -2046,7 +2046,7 @@ do { \ f-rulenum, f-id); cmd = ACTION_PTR(f); l = f-cmd_len - f-act_ofs; - ipfw_dyn_unlock(); + ipfw_dyn_unlock(q); cmdlen = 0; match = 1; break; @@ -2525,7 +2525,6 @@ ipfw_init(void) { int error = 0; - ipfw_dyn_attach(); /* * Only print out this stuff the first time around, * when called from the sysinit code. @@ -2579,7 +2578,6 @@ ipfw_destroy(void) { ipfw_log_bpf(0); /* uninit */ - ipfw_dyn_detach(); printf(IP firewall unloaded\n); } @@ -2637,7 +2635,7 @@ vnet_ipfw_init(const void *unused) chain-id = rule-id = 1; IPFW_LOCK_INIT(chain); - ipfw_dyn_init(); + ipfw_dyn_init(chain); /* First set up some values that are compile time options */ V_ipfw_vnet_ready = 1; /* Open for business */ Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c == --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 16:18:26 2012 (r243706) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 16:33:22 2012 (r243707) @@ -95,7 +95,7 @@ __FBSDID($FreeBSD$); * The lifetime of dynamic rules is regulated by dyn_*_lifetime, * measured in seconds and depending on the flags. * - * The total number of dynamic rules is stored in dyn_count. + * The total number of dynamic rules is equal to UMA zone items count. * The max number of dynamic rules is dyn_max. When we reach * the maximum number of rules we do not create anymore. This is * done to avoid consuming too much memory, but also too much @@ -111,37 +111,33 @@ __FBSDID($FreeBSD$); * passes through the firewall. XXX check the latter!!! */ +struct ipfw_dyn_bucket { + struct mtx mtx;/* Bucket protecting lock */ + ipfw_dyn_rule *head; /* Pointer to first rule */ +}; + /* * Static variables followed by global ones */ -static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets); +static VNET_DEFINE(struct ipfw_dyn_bucket *, ipfw_dyn_v); +static VNET_DEFINE(u_int32_t, dyn_buckets_max); static VNET_DEFINE(u_int32_t, curr_dyn_buckets); static VNET_DEFINE(struct callout, ipfw_timeout); #defineV_ipfw_dyn_vVNET(ipfw_dyn_v) -#defineV_dyn_buckets VNET(dyn_buckets) +#defineV_dyn_buckets_max VNET(dyn_buckets_max) #defineV_curr_dyn_buckets VNET(curr_dyn_buckets) #define V_ipfw_timeout VNET(ipfw_timeout) -static uma_zone_t ipfw_dyn_rule_zone; -#ifndef __FreeBSD__ -DEFINE_SPINLOCK(ipfw_dyn_mtx); -#else -static struct mtx ipfw_dyn_mtx;/* mutex guarding dynamic rules */ -#endif - -#defineIPFW_DYN_LOCK_INIT() \ - mtx_init(ipfw_dyn_mtx, IPFW dynamic rules, NULL, MTX_DEF) -#defineIPFW_DYN_LOCK_DESTROY() mtx_destroy(ipfw_dyn_mtx) -#defineIPFW_DYN_LOCK() mtx_lock(ipfw_dyn_mtx) -#defineIPFW_DYN_UNLOCK() mtx_unlock(ipfw_dyn_mtx) -#defineIPFW_DYN_LOCK_ASSERT() mtx_assert(ipfw_dyn_mtx, MA_OWNED) +static VNET_DEFINE(uma_zone_t, ipfw_dyn_rule_zone); +#defineV_ipfw_dyn_rule_zoneVNET(ipfw_dyn_rule_zone) -void -ipfw_dyn_unlock(void) -{ - IPFW_DYN_UNLOCK(); -} +#defineIPFW_BUCK_LOCK_INIT(b) \ + mtx_init((b)-mtx, IPFW dynamic bucket, NULL, MTX_DEF) +#defineIPFW_BUCK_LOCK_DESTROY(b) \ + mtx_destroy((b)-mtx) +#define
svn commit: r243708 - stable/9
Author: kensmith Date: Fri Nov 30 19:27:31 2012 New Revision: 243708 URL: http://svnweb.freebsd.org/changeset/base/243708 Log: Guess when we'll be ready to announce 9.1-RELEASE. Modified: stable/9/UPDATING Modified: stable/9/UPDATING == --- stable/9/UPDATING Fri Nov 30 16:33:22 2012(r243707) +++ stable/9/UPDATING Fri Nov 30 19:27:31 2012(r243708) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121205: + 9.1-RELEASE. + 20121129: A new version of ZFS (pool version 5000) has been merged to 9-STABLE. Starting with this version the old system of ZFS pool versioning ___ 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: r243709 - releng/9.1
Author: kensmith Date: Fri Nov 30 19:35:01 2012 New Revision: 243709 URL: http://svnweb.freebsd.org/changeset/base/243709 Log: Merge r243708: Guess when we'll be ready to announce 9.1-RELEASE. Approved by: re (implicit) Modified: releng/9.1/UPDATING (contents, props changed) Directory Properties: releng/9.1/ (props changed) Modified: releng/9.1/UPDATING == --- releng/9.1/UPDATING Fri Nov 30 19:27:31 2012(r243708) +++ releng/9.1/UPDATING Fri Nov 30 19:35:01 2012(r243709) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121205: + 9.1-RELEASE. + 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these ___ 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: r243710 - releng/9.1/sys/conf
Author: kensmith Date: Fri Nov 30 19:36:20 2012 New Revision: 243710 URL: http://svnweb.freebsd.org/changeset/base/243710 Log: We think we're ready for the 9.1-RELEASE builds. Approved by: re (implicit) Modified: releng/9.1/sys/conf/newvers.sh Modified: releng/9.1/sys/conf/newvers.sh == --- releng/9.1/sys/conf/newvers.sh Fri Nov 30 19:35:01 2012 (r243709) +++ releng/9.1/sys/conf/newvers.sh Fri Nov 30 19:36:20 2012 (r243710) @@ -32,7 +32,7 @@ TYPE=FreeBSD REVISION=9.1 -BRANCH=RC3 +BRANCH=RELEASE if [ X${BRANCH_OVERRIDE} != X ]; then BRANCH=${BRANCH_OVERRIDE} fi ___ 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: r243711 - head/sys/netpfil/ipfw
Author: melifaro Date: Fri Nov 30 19:36:55 2012 New Revision: 243711 URL: http://svnweb.freebsd.org/changeset/base/243711 Log: Use common macros for working with rule/dynamic counters. This is done as preparation to introduce per-cpu ipfw counters. MFC after:3 weeks Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw2.c == --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 19:36:20 2012 (r243710) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 30 19:36:55 2012 (r243711) @@ -2034,8 +2034,7 @@ do { \ * the parent rule by setting * f, cmd, l and clearing cmdlen. */ - q-pcnt++; - q-bcnt += pktlen; + IPFW_INC_DYN_COUNTER(q, pktlen); /* XXX we would like to have f_pos * readily accessible in the dynamic * rule, instead of having to @@ -2096,16 +2095,12 @@ do { \ break; case O_COUNT: - f-pcnt++; /* update stats */ - f-bcnt += pktlen; - f-timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); l = 0; /* exit inner loop */ break; case O_SKIPTO: - f-pcnt++; /* update stats */ - f-bcnt += pktlen; - f-timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); /* If possible use cached f_pos (in f-next_rule), * whose version is written in f-next_rule * (horrible hacks to avoid changing the ABI). @@ -2202,9 +2197,7 @@ do { \ break; } - f-pcnt++; /* update stats */ - f-bcnt += pktlen; - f-timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); stack = (uint16_t *)(mtag + 1); /* @@ -2357,9 +2350,7 @@ do { \ case O_SETFIB: { uint32_t fib; - f-pcnt++; /* update stats */ - f-bcnt += pktlen; - f-timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(f, pktlen); fib = (cmd-arg1 == IP_FW_TABLEARG) ? tablearg: cmd-arg1; if (fib = rt_numfibs) @@ -2409,8 +2400,7 @@ do { \ case O_REASS: { int ip_off; - f-pcnt++; - f-bcnt += pktlen; + IPFW_INC_RULE_COUNTER(f, pktlen); l = 0; /* in any case exit inner loop */ ip_off = ntohs(ip-ip_off); @@ -2473,9 +2463,7 @@ do { \ if (done) { struct ip_fw *rule = chain-map[f_pos]; /* Update statistics */ - rule-pcnt++; - rule-bcnt += pktlen; - rule-timestamp = time_uptime; + IPFW_INC_RULE_COUNTER(rule, pktlen); } else { retval = IP_FW_DENY; printf(ipfw: ouch!, skip past end of rules, denying packet\n); Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c == --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 19:36:20 2012 (r243710) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 30 19:36:55 2012 (r243711) @@ -594,7 +594,7 @@ add_dyn_rule(struct ipfw_flow_id *id, in r-expire = time_uptime + V_dyn_syn_lifetime; r-rule = rule; r-dyn_type = dyn_type; -
svn commit: r243712 - in head/sys: amd64/pci i386/pci
Author: jkim Date: Fri Nov 30 20:15:01 2012 New Revision: 243712 URL: http://svnweb.freebsd.org/changeset/base/243712 Log: Use volatile keywords properly. Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c == --- head/sys/amd64/pci/pci_cfgreg.c Fri Nov 30 19:36:55 2012 (r243711) +++ head/sys/amd64/pci/pci_cfgreg.c Fri Nov 30 20:15:01 2012 (r243712) @@ -313,7 +313,7 @@ static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) { - volatile vm_offset_t va; + vm_offset_t va; int data = -1; if (bus pcie_minbus || bus pcie_maxbus || slot PCI_SLOTMAX || @@ -324,16 +324,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile(movl %1, %0 : =a (data) - : m (*(uint32_t *)va)); + __asm(movl %1, %0 : =a (data) + : m (*(volatile uint32_t *)va)); break; case 2: - __asm __volatile(movzwl %1, %0 : =a (data) - : m (*(uint16_t *)va)); + __asm(movzwl %1, %0 : =a (data) + : m (*(volatile uint16_t *)va)); break; case 1: - __asm __volatile(movzbl %1, %0 : =a (data) - : m (*(uint8_t *)va)); + __asm(movzbl %1, %0 : =a (data) + : m (*(volatile uint8_t *)va)); break; } @@ -344,7 +344,7 @@ static void pciereg_cfgwrite(int bus, unsigned slot, unsigned func, unsigned reg, int data, unsigned bytes) { - volatile vm_offset_t va; + vm_offset_t va; if (bus pcie_minbus || bus pcie_maxbus || slot PCI_SLOTMAX || func PCI_FUNCMAX || reg PCIE_REGMAX) @@ -354,15 +354,15 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile(movl %1, %0 : =m (*(uint32_t *)va) + __asm(movl %1, %0 : =m (*(volatile uint32_t *)va) : a (data)); break; case 2: - __asm __volatile(movw %1, %0 : =m (*(uint16_t *)va) + __asm(movw %1, %0 : =m (*(volatile uint16_t *)va) : a ((uint16_t)data)); break; case 1: - __asm __volatile(movb %1, %0 : =m (*(uint8_t *)va) + __asm(movb %1, %0 : =m (*(volatile uint8_t *)va) : a ((uint8_t)data)); break; } Modified: head/sys/i386/pci/pci_cfgreg.c == --- head/sys/i386/pci/pci_cfgreg.c Fri Nov 30 19:36:55 2012 (r243711) +++ head/sys/i386/pci/pci_cfgreg.c Fri Nov 30 20:15:01 2012 (r243712) @@ -665,7 +665,7 @@ pciereg_cfgread(int bus, unsigned slot, unsigned bytes) { struct pcie_cfg_elem *elem; - volatile vm_offset_t va; + vm_offset_t va; vm_paddr_t pa, papage; int data = -1; @@ -681,16 +681,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile(movl %1, %0 : =a (data) - : m (*(uint32_t *)va)); + __asm(movl %1, %0 : =a (data) + : m (*(volatile uint32_t *)va)); break; case 2: - __asm __volatile(movzwl %1, %0 : =a (data) - : m (*(uint16_t *)va)); + __asm(movzwl %1, %0 : =a (data) + : m (*(volatile uint16_t *)va)); break; case 1: - __asm __volatile(movzbl %1, %0 : =a (data) - : m (*(uint8_t *)va)); + __asm(movzbl %1, %0 : =a (data) + : m (*(volatile uint8_t *)va)); break; } @@ -703,7 +703,7 @@ pciereg_cfgwrite(int bus, unsigned slot, unsigned bytes) { struct pcie_cfg_elem *elem; - volatile vm_offset_t va; + vm_offset_t va; vm_paddr_t pa, papage; if (bus pcie_minbus || bus pcie_maxbus || slot PCI_SLOTMAX || @@ -718,15 +718,15 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - __asm __volatile(movl %1, %0 : =m (*(uint32_t *)va) + __asm(movl %1, %0 : =m (*(volatile uint32_t *)va) : a (data)); break; case 2: - __asm __volatile(movw %1, %0 : =m (*(uint16_t *)va) + __asm(movw %1, %0 : =m (*(volatile uint16_t *)va) : a ((uint16_t)data)); break; case 1: - __asm __volatile(movb %1, %0 : =m (*(uint8_t *)va) + __asm(movb %1, %0 : =m (*(volatile uint8_t *)va) : a
svn commit: r243713 - head
Author: sjg Date: Fri Nov 30 20:50:34 2012 New Revision: 243713 URL: http://svnweb.freebsd.org/changeset/base/243713 Log: The build-tools step during build32 also needs the -legacy magic. Approved by: marcel (mentor) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Fri Nov 30 20:15:01 2012(r243712) +++ head/Makefile.inc1 Fri Nov 30 20:50:34 2012(r243713) @@ -511,6 +511,8 @@ build32: .endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic cd ${.CURDIR}/${_dir}; \ + WORLDTMP=${WORLDTMP} \ + MAKEFLAGS=-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS} \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ -DEARLY_BUILD build-tools ___ 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: r242102 - in head: contrib/bmake usr.bin/bmake
[A bit delayed] On 2012-Nov-15 02:41:22 -0600, Matthew D. Fuller fulle...@over-yonder.net wrote: On Thu, Nov 15, 2012 at 06:07:27PM +1100 I heard the voice of Bruce Evans, and lo! it spake thus: Maybe malloc() would be faster with MALLOC_PRODUCTION. I use /etc/malloc.conf - aj locally. freefall doesn't have /etc/malloc.conf. MALLOC_OPTIONS no longer works, and MALLOC_CONF is too large for me to understand, so I don't know how to turn off non-production features dynamically. FWIW, I suspected MALLOC_PRODUCTION in some massive slowdowns I see from time to time on my -CURRENT box. Most vividly around running portupgrade-related bits (portupgrade, pkgdb, etc). I got annoyed by it enough a few weeks ago to write up a quickie to bang malloc() around and see what happened. Attached, just for grins. Not defining MALLOC_PRODUCTION causes quite significant startup costs for any process that uses malloc() at all. In this case, jemalloc verifies that memory obtained from the kernel is zero-filled, causing (thousands of unnecessary) page faults. For a short-running process that doesn't allocate all the space in the jemalloc arenas, this dominates the runtime - in the case of /bin/echo, I measured 87 page faults with MALLOC_PRODUCTION and 2133 without. -- Peter Jeremy pgpCEY8jxCTmb.pgp Description: PGP signature
svn commit: r243714 - in head/sys/dev: ixgbe netmap
Author: jfv Date: Fri Nov 30 22:19:18 2012 New Revision: 243714 URL: http://svnweb.freebsd.org/changeset/base/243714 Log: First of a series of 11 patches leading to new ixgbe version 2.5.0 This removes the header split and supporting code from the driver. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 20:50:34 2012(r243713) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:19:18 2012(r243714) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.4.11; +char ixgbe_driver_version[] = 2.5.0 - 1; /* * PCI Device ID Table @@ -266,15 +266,6 @@ static int ixgbe_enable_msix = 1; TUNABLE_INT(hw.ixgbe.enable_msix, ixgbe_enable_msix); /* - * Header split: this causes the hardware to DMA - * the header into a separate mbuf from the payload, - * it can be a performance win in some workloads, but - * in others it actually hurts, its off by default. - */ -static int ixgbe_header_split = FALSE; -TUNABLE_INT(hw.ixgbe.hdr_split, ixgbe_header_split); - -/* * Number of Queues, can be set to 0, * it then autoconfigures based on the * number of cpus with a max of 8. This @@ -1117,7 +1108,7 @@ ixgbe_init_locked(struct adapter *adapte /* ** Determine the correct mbuf pool - ** for doing jumbo/headersplit + ** for doing jumbo frames */ if (adapter-max_frame_size = 2048) adapter-rx_mbuf_sz = MCLBYTES; @@ -3728,10 +3719,9 @@ static void ixgbe_refresh_mbufs(struct rx_ring *rxr, int limit) { struct adapter *adapter = rxr-adapter; - bus_dma_segment_t hseg[1]; - bus_dma_segment_t pseg[1]; + bus_dma_segment_t seg[1]; struct ixgbe_rx_buf *rxbuf; - struct mbuf *mh, *mp; + struct mbuf *mp; int i, j, nsegs, error; boolrefreshed = FALSE; @@ -3742,43 +3732,13 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, while (j != limit) { rxbuf = rxr-rx_buffers[i]; - if (rxr-hdr_split == FALSE) - goto no_split; - - if (rxbuf-m_head == NULL) { - mh = m_gethdr(M_DONTWAIT, MT_DATA); - if (mh == NULL) - goto update; - } else - mh = rxbuf-m_head; - - mh-m_pkthdr.len = mh-m_len = MHLEN; - mh-m_len = MHLEN; - mh-m_flags |= M_PKTHDR; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr-htag, - rxbuf-hmap, mh, hseg, nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf(Refresh mbufs: hdr dmamap load -failure - %d\n, error); - m_free(mh); - rxbuf-m_head = NULL; - goto update; - } - rxbuf-m_head = mh; - bus_dmamap_sync(rxr-htag, rxbuf-hmap, - BUS_DMASYNC_PREREAD); - rxr-rx_base[i].read.hdr_addr = - htole64(hseg[0].ds_addr); - -no_split: - if (rxbuf-m_pack == NULL) { + if (rxbuf-buf == NULL) { mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, adapter-rx_mbuf_sz); if (mp == NULL) goto update; } else - mp = rxbuf-m_pack; + mp = rxbuf-buf; mp-m_pkthdr.len = mp-m_len = adapter-rx_mbuf_sz; @@ -3787,22 +3747,22 @@ no_split: */ if ((rxbuf-flags IXGBE_RX_COPY) == 0) { /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr-ptag, - rxbuf-pmap, mp, pseg, nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(rxr-tag, + rxbuf-map, mp, seg, nsegs, BUS_DMA_NOWAIT); if (error != 0) { printf(Refresh mbufs: payload dmamap load failure - %d\n, error); m_free(mp); - rxbuf-m_pack = NULL; + rxbuf-buf = NULL; goto update; } -
svn commit: r243715 - head/crypto/openssl/crypto/rand
Author: pjd Date: Fri Nov 30 22:23:23 2012 New Revision: 243715 URL: http://svnweb.freebsd.org/changeset/base/243715 Log: Allow OpenSSL to use arc4random(3) on FreeBSD. arc4random(3) was modified some time ago to use sysctl instead of /dev/random to get random data, so is now much better choice, especially for sandboxed processes that have no direct access to /dev/random. Approved by: benl MFC after:2 weeks Modified: head/crypto/openssl/crypto/rand/rand_unix.c Modified: head/crypto/openssl/crypto/rand/rand_unix.c == --- head/crypto/openssl/crypto/rand/rand_unix.c Fri Nov 30 22:19:18 2012 (r243714) +++ head/crypto/openssl/crypto/rand/rand_unix.c Fri Nov 30 22:23:23 2012 (r243715) @@ -216,7 +216,7 @@ int RAND_poll(void) } return 1; } -#elif defined __OpenBSD__ +#elif defined(__FreeBSD__) || defined(__OpenBSD__) int RAND_poll(void) { u_int32_t rnd = 0, i; @@ -233,7 +233,7 @@ int RAND_poll(void) return 1; } -#else /* !defined(__OpenBSD__) */ +#else /* !defined(__FreeBSD__) !defined(__OpenBSD__) */ int RAND_poll(void) { unsigned long l; @@ -419,7 +419,7 @@ int RAND_poll(void) #endif } -#endif /* defined(__OpenBSD__) */ +#endif /* defined(__FreeBSD__) || defined(__OpenBSD__) */ #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */ ___ 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: r243716 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 22:33:21 2012 New Revision: 243716 URL: http://svnweb.freebsd.org/changeset/base/243716 Log: Patch #2 - remove OACTIVE and DEPLETED notions from the multiqueue code, this functionality has proven to be more trouble than it was worth. Thanks to Gleb for a second critical look over my code and help in the patches! Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:23:23 2012(r243715) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:33:21 2012(r243716) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 1; +char ixgbe_driver_version[] = 2.5.0 - 2; /* * PCI Device ID Table @@ -736,17 +736,14 @@ ixgbe_start_locked(struct tx_ring *txr, IXGBE_TX_LOCK_ASSERT(txr); - if ((ifp-if_drv_flags (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) + if ((ifp-if_drv_flags IFF_DRV_RUNNING) == 0) return; if (!adapter-link_active) return; while (!IFQ_DRV_IS_EMPTY(ifp-if_snd)) { - if (txr-tx_avail = IXGBE_QUEUE_MIN_FREE) { - txr-queue_status |= IXGBE_QUEUE_DEPLETED; + if (txr-tx_avail = IXGBE_QUEUE_MIN_FREE) break; -} IFQ_DRV_DEQUEUE(ifp-if_snd, m_head); if (m_head == NULL) @@ -755,8 +752,6 @@ ixgbe_start_locked(struct tx_ring *txr, if (ixgbe_xmit(txr, m_head)) { if (m_head != NULL) IFQ_DRV_PREPEND(ifp-if_snd, m_head); - if (txr-tx_avail = IXGBE_QUEUE_MIN_FREE) - txr-queue_status |= IXGBE_QUEUE_DEPLETED; break; } /* Send a copy of the frame to the BPF listener */ @@ -811,8 +806,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct txr = adapter-tx_rings[i]; que = adapter-queues[i]; - if (((txr-queue_status IXGBE_QUEUE_DEPLETED) == 0) - IXGBE_TX_TRYLOCK(txr)) { + if (IXGBE_TX_TRYLOCK(txr)) { err = ixgbe_mq_start_locked(ifp, txr, m); IXGBE_TX_UNLOCK(txr); } else { @@ -831,7 +825,6 @@ ixgbe_mq_start_locked(struct ifnet *ifp, int enqueued, err = 0; if (((ifp-if_drv_flags IFF_DRV_RUNNING) == 0) || - (txr-queue_status == IXGBE_QUEUE_DEPLETED) || adapter-link_active == 0) { if (m != NULL) err = drbr_enqueue(ifp, txr-br, m); @@ -862,16 +855,12 @@ ixgbe_mq_start_locked(struct ifnet *ifp, break; if (txr-tx_avail IXGBE_TX_OP_THRESHOLD) ixgbe_txeof(txr); - if (txr-tx_avail IXGBE_TX_OP_THRESHOLD) { - txr-queue_status |= IXGBE_QUEUE_DEPLETED; - break; - } next = drbr_dequeue(ifp, txr-br); } if (enqueued 0) { /* Set watchdog on */ - txr-queue_status |= IXGBE_QUEUE_WORKING; + txr-queue_status = IXGBE_QUEUE_WORKING; txr-watchdog_time = ticks; } @@ -1316,7 +1305,6 @@ ixgbe_init_locked(struct adapter *adapte /* Now inform the stack we're ready */ ifp-if_drv_flags |= IFF_DRV_RUNNING; - ifp-if_drv_flags = ~IFF_DRV_OACTIVE; return; } @@ -2018,13 +2006,11 @@ ixgbe_local_timer(void *arg) { struct adapter *adapter = arg; device_tdev = adapter-dev; - struct ifnet*ifp = adapter-ifp; struct ix_queue *que = adapter-queues; struct tx_ring *txr = adapter-tx_rings; - int hung, busy, paused; + int hung = 0, paused = 0; mtx_assert(adapter-core_mtx, MA_OWNED); - hung = busy = paused = 0; /* Check for pluggable optics */ if (adapter-sfp_probe) @@ -2046,23 +2032,15 @@ ixgbe_local_timer(void *arg) ** - watchdog only if all queues show hung */ for (int i = 0; i adapter-num_queues; i++, que++, txr++) { - if ((txr-queue_status IXGBE_QUEUE_HUNG) + if ((txr-queue_status == IXGBE_QUEUE_HUNG) (paused == 0)) ++hung; - if (txr-queue_status IXGBE_QUEUE_DEPLETED) - ++busy; - if ((txr-queue_status IXGBE_QUEUE_IDLE) == 0) + else if
svn commit: r243717 - in stable/8: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolar...
/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/8/sys/modules/zfs/Makefile Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/Makefile.inc1 == --- stable/8/Makefile.inc1 Fri Nov 30 22:33:21 2012(r243716) +++ stable/8/Makefile.inc1 Fri Nov 30 22:38:42 2012(r243717) @@ -1120,7 +1120,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ - ${_cddl_lib_libumem} \ + ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1135,6 +1135,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != no _cddl_lib_libumem= cddl/lib/libumem +_cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib= cddl/lib .endif Modified: stable/8/UPDATING == --- stable/8/UPDATING Fri Nov 30 22:33:21 2012(r243716) +++ stable/8/UPDATING Fri Nov 30 22:38:42 2012(r243717) @@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20121130: + A new version of ZFS (pool version 5000) has been merged to 8-STABLE. + Starting with this version the old system of ZFS pool versioning + is superseded by feature flags. This concept enables forward + compatibility against certain future changes in functionality of ZFS + pools. The first two read-only compatible feature flags for ZFS + pools are com.delphix:async_destroy and com.delphix:empty_bpobj. + For more information read the new zpool-features(7) manual page. + Please refer to the ZFS notes section of this file for information + on upgrading boot ZFS pools. + 20121018: WITH_CTF can now be specified in src.conf (not recommended, there are some problems with static executables), make.conf (would also Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 == --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Nov 30 22:33:21 2012(r243716) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Nov 30 22:38:42 2012(r243717) @@ -93,14 +93,14 @@ If specified multiple times, verify the .It Fl C Display information about the configuration. If specified with no other options, instead display information about the cache file -.Ns ( Pa /etc/zfs/zpool.cache Ns ). +.Po Pa /etc/zfs/zpool.cache Pc . To specify the cache file to display, see .Fl U .Pp If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with -.FL e +.Fl e also display the configuration that would be used were the pool to be imported. .It Fl d @@ -135,7 +135,7 @@ option is also specified, also display t .It Fl L Disable leak tracing and the loading of space maps. By default, -.Nm +.Nm verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. @@ -253,7 +253,7 @@ MOS Configuration: .Li # Ic zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects -... + ... .Ed .It Xo Sy Example 3 Display basic information about object 0 in .Sy 'rpool/export/home' @@ -272,7 +272,7 @@ Dataset rpool/export/home [ZPL], ID 137, .Li # Ic zdb -S rpool Simulated DDT histogram: -bucket allocated referenced +bucket allocated
Re: svn commit: r243554 - in head/usr.sbin/pkg_install: add create delete info lib updating version
On Thu, 29 Nov 2012 08:38:47 +0100 Baptiste Daroussin b...@freebsd.org mentioned: pkg is no more experimental at all, it is not perfect there are large rooms for improvements, but it is perfectly ready to be used, if you have any concern about some missing feature just report it; Concerning a landmine, when you have big flashy lights all over the place: http://lists.freebsd.org/pipermail/freebsd-ports-announce/2012-October/32.html http://lists.freebsd.org/pipermail/freebsd-current/2012-October/037001.html a fanfare playing in front of it saying beware landsmine: http://svnweb.freebsd.org/ports?view=revisionrevision=305637 and maps available all over the places to explains where the mine are how to workaround them, or be mine proof: http://svnweb.freebsd.org/ports/head/CHANGES (entry 20121010) http://svnweb.freebsd.org/ports/head/UPDATING (entry 20121010) I'd say in that case it is no more considered as a landmine but just a new safe way. It is a new way forced on users. I didn't ask to use pkgng on my system, neither I got any warning when it silently stopped creating entries in /var/db/pkg. Do you expect all users to read UPDATING and/or svn commit logs each time they update? Switching to pkgng was not a community descision, it was a decision made by a small group of people (alledgedly, considering input from the community). Personally, I don't see why it should be that way, and why the default had to be forceably changed. It is an open question (at least for me) whether pkgng is any better than the old tools, and there is at least on drawback in using pkgng, namely sqlite database, which will make you lose all packages in the case of a small fs corruption. That problem was raised before numerous times starting when developing a new pkg tool was proposed. But it is a design decision, and I respect it. What I don't like is that the switch to the new pkg system lacks any legitemacy, as it was largely a portmgr descision. If instead you ran it alongside for some time and it ended up being used by majority of users compared to the legacy pkg, and then pulled the switch, then it'd a different story. The bottom line is that I ended up with a corrupted pkg database for no particular reason. And it didn't have to be that way. -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ 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: r243718 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 22:41:32 2012 New Revision: 243718 URL: http://svnweb.freebsd.org/changeset/base/243718 Log: Patch #3 - Add a new ioctl to access SFP+ module diagnostic data via the I2C routines in shared code. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:38:42 2012(r243717) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:41:32 2012(r243718) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 2; +char ixgbe_driver_version[] = 2.5.0 - 3; /* * PCI Device ID Table @@ -919,6 +919,7 @@ static int ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { struct adapter *adapter = ifp-if_softc; + struct ixgbe_hw *hw = adapter-hw; struct ifreq*ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; @@ -1024,7 +1025,22 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c VLAN_CAPABILITIES(ifp); break; } - + case SIOCGI2C: + { + struct ixgbe_i2c_reqi2c; + IOCTL_DEBUGOUT(ioctl: SIOCGI2C (Get I2C Data)); + error = copyin(ifr-ifr_data, i2c, sizeof(i2c)); + if (error) + break; + if ((i2c.dev_addr != 0xA0) || (i2c.dev_addr != 0xA2)){ + error = EINVAL; + break; + } + hw-phy.ops.read_i2c_byte(hw, i2c.offset, + i2c.dev_addr, i2c.data); + error = copyout(i2c, ifr-ifr_data, sizeof(i2c)); + break; + } default: IOCTL_DEBUGOUT1(ioctl: UNKNOWN (0x%X)\n, (int)command); error = ether_ioctl(ifp, command, data); Modified: head/sys/dev/ixgbe/ixgbe.h == --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:38:42 2012(r243717) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 22:41:32 2012(r243718) @@ -199,6 +199,9 @@ #define IXGBE_BR_SIZE 4096 #define IXGBE_QUEUE_MIN_FREE 32 +/* IOCTL define to gather SFP+ Diagnostic data */ +#define SIOCGI2C SIOCGIFGENERIC + /* Offload bits in mbuf flag */ #if __FreeBSD_version = 80 #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) @@ -241,6 +244,13 @@ typedef struct _ixgbe_vendor_info_t { unsigned intindex; } ixgbe_vendor_info_t; +/* This is used to get SFP+ module data */ +struct ixgbe_i2c_req { +u8 dev_addr; +u8 offset; +u8 len; +u8 data[8]; +}; struct ixgbe_tx_buf { u32 eop_index; ___ 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: r243719 - head/sys/kern
Author: pjd Date: Fri Nov 30 22:49:28 2012 New Revision: 243719 URL: http://svnweb.freebsd.org/changeset/base/243719 Log: IFp4 @208450: Remove redundant call to AUDIT_ARG_UPATH1(). Path will be remembered by the following NDINIT(AUDITVNODE1) call. Sponsored by: FreeBSD Foundation (auditdistd) MFC after:2 weeks Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c == --- head/sys/kern/vfs_mount.c Fri Nov 30 22:41:32 2012(r243718) +++ head/sys/kern/vfs_mount.c Fri Nov 30 22:49:28 2012(r243719) @@ -1170,7 +1170,6 @@ sys_unmount(td, uap) } mtx_unlock(mountlist_mtx); } else { - AUDIT_ARG_UPATH1(td, pathbuf); /* * Try to find global path for path argument. */ ___ 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: r243720 - head/sys/security/audit
Author: pjd Date: Fri Nov 30 22:52:35 2012 New Revision: 243720 URL: http://svnweb.freebsd.org/changeset/base/243720 Log: IFp4 @208381: For VOP_GETATTR() we just need vnode to be shared-locked. Sponsored by: FreeBSD Foundation (auditdistd) MFC after:2 weeks Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c == --- head/sys/security/audit/audit_worker.c Fri Nov 30 22:49:28 2012 (r243719) +++ head/sys/security/audit/audit_worker.c Fri Nov 30 22:52:35 2012 (r243720) @@ -133,7 +133,7 @@ audit_record_write(struct vnode *vp, str error = VFS_STATFS(vp-v_mount, mnt_stat); if (error) goto fail; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, vattr, cred); VOP_UNLOCK(vp, 0); if (error) ___ 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: r243721 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 22:54:14 2012 New Revision: 243721 URL: http://svnweb.freebsd.org/changeset/base/243721 Log: Patch #4 - this does two things, it removes a number of statistics, these are FCOE stats (fiber channel over ethernet), something that FreeBSD does not yet have, they were mistaken for flow control by the implementor I believe. Secondly, the real flow control stats are oddly named with a 'link' tag on the front, it was requested by my validation engineer to make these stats have the same name as the igb driver for clarity and that seemed reasonable to me. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:52:35 2012(r243720) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 22:54:14 2012(r243721) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 3; +char ixgbe_driver_version[] = 2.5.0 - 4; /* * PCI Device ID Table @@ -5388,16 +5388,18 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, rec_len_errs, CTLFLAG_RD, stats-rlec, Receive Length Errors); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, link_xon_txd, + + /* Flow Control stats */ + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, xon_txd, CTLFLAG_RD, stats-lxontxc, Link XON Transmitted); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, link_xon_rcvd, + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, xon_recvd, CTLFLAG_RD, stats-lxonrxc, Link XON Received); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, link_xoff_txd, + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, xoff_txd, CTLFLAG_RD, stats-lxofftxc, Link XOFF Transmitted); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, link_xoff_rcvd, + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, xoff_recvd, CTLFLAG_RD, stats-lxoffrxc, Link XOFF Received); @@ -5497,29 +5499,6 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, tx_frames_1024_1522, CTLFLAG_RD, stats-ptc1522, 1024-1522 byte frames transmitted); - - /* FC Stats */ - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_crc, - CTLFLAG_RD, stats-fccrc, - FC CRC Errors); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_last, - CTLFLAG_RD, stats-fclast, - FC Last Error); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_drpd, - CTLFLAG_RD, stats-fcoerpdc, - FCoE Packets Dropped); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_pkts_rcvd, - CTLFLAG_RD, stats-fcoeprc, - FCoE Packets Received); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_pkts_txd, - CTLFLAG_RD, stats-fcoeptc, - FCoE Packets Transmitted); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_dword_rcvd, - CTLFLAG_RD, stats-fcoedwrc, - FCoE DWords Received); - SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, fc_dword_txd, - CTLFLAG_RD, stats-fcoedwtc, - FCoE DWords Transmitted); } /* ___ 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: r243722 - head/sys/security/audit
Author: pjd Date: Fri Nov 30 22:59:20 2012 New Revision: 243722 URL: http://svnweb.freebsd.org/changeset/base/243722 Log: IFp4 @208382: Currently on each record write we call VFS_STATFS() to get available space on the file system as well as VOP_GETATTR() to get trail file size. We can assume that trail file is only updated by the audit worker, so instead of asking for file size on every write, get file size on trail switch only (it should be zero, but it's not expensive) and use global variable audit_size protected by the audit worker lock to keep track of trail file's size. This eliminates VOP_GETATTR() call for every write. VFS_STATFS() is satisfied from in-memory data (mount-mnt_stat), so shouldn't be expensive. Sponsored by: FreeBSD Foundation (auditdistd) MFC after:2 weeks Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c == --- head/sys/security/audit/audit_worker.c Fri Nov 30 22:54:14 2012 (r243721) +++ head/sys/security/audit/audit_worker.c Fri Nov 30 22:59:20 2012 (r243722) @@ -88,6 +88,7 @@ static struct proc*audit_thread; static int audit_file_rotate_wait; static struct ucred*audit_cred; static struct vnode*audit_vp; +static off_taudit_size; static struct sxaudit_worker_lock; #defineAUDIT_WORKER_LOCK_INIT()sx_init(audit_worker_lock, \ @@ -115,7 +116,6 @@ audit_record_write(struct vnode *vp, str struct statfs *mnt_stat; int error; static int cur_fail; - struct vattr vattr; long temp; AUDIT_WORKER_LOCK_ASSERT(); @@ -133,12 +133,6 @@ audit_record_write(struct vnode *vp, str error = VFS_STATFS(vp-v_mount, mnt_stat); if (error) goto fail; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - goto fail; - audit_fstat.af_currsz = vattr.va_size; /* * We handle four different space-related limits: @@ -196,7 +190,7 @@ audit_record_write(struct vnode *vp, str * records may be generated before the daemon rotates the file. */ if ((audit_fstat.af_filesz != 0) (audit_file_rotate_wait == 0) - (vattr.va_size = audit_fstat.af_filesz)) { + (audit_size = audit_fstat.af_filesz)) { AUDIT_WORKER_LOCK_ASSERT(); audit_file_rotate_wait = 1; @@ -238,6 +232,8 @@ audit_record_write(struct vnode *vp, str goto fail_enospc; else if (error) goto fail; + AUDIT_WORKER_LOCK_ASSERT(); + audit_size += len; /* * Catch completion of a queue drain here; if we're draining and the @@ -448,10 +444,20 @@ audit_rotate_vnode(struct ucred *cred, s { struct ucred *old_audit_cred; struct vnode *old_audit_vp; + struct vattr vattr; KASSERT((cred != NULL vp != NULL) || (cred == NULL vp == NULL), (audit_rotate_vnode: cred %p vp %p, cred, vp)); + if (vp != NULL) { + vn_lock(vp, LK_SHARED | LK_RETRY); + if (VOP_GETATTR(vp, vattr, cred) != 0) + vattr.va_size = 0; + VOP_UNLOCK(vp, 0); + } else { + vattr.va_size = 0; + } + /* * Rotate the vnode/cred, and clear the rotate flag so that we will * send a rotate trigger if the new file fills. @@ -461,6 +467,7 @@ audit_rotate_vnode(struct ucred *cred, s old_audit_vp = audit_vp; audit_cred = cred; audit_vp = vp; + audit_size = vattr.va_size; audit_file_rotate_wait = 0; audit_enabled = (audit_vp != NULL); AUDIT_WORKER_UNLOCK(); ___ 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: r243723 - head/sys/security/audit
Author: pjd Date: Fri Nov 30 23:03:51 2012 New Revision: 243723 URL: http://svnweb.freebsd.org/changeset/base/243723 Log: IFp4 @208383: Currently when we discover that trail file is greater than configured limit we send AUDIT_TRIGGER_ROTATE_KERNEL trigger to the auditd daemon once. If for some reason auditd didn't rotate trail file it will never be rotated. Change it by sending the trigger when trail file size grows by the configured limit. For example if the limit is 1MB, we will send trigger on 1MB, 2MB, 3MB, etc. This is also needed for the auditd change that will be committed soon where auditd may ignore the trigger - it might be ignored if kernel requests the trail file to be rotated too quickly (often than once a second) which would result in overwriting previous trail file. Sponsored by: FreeBSD Foundation (auditdistd) MFC after:2 weeks Modified: head/sys/security/audit/audit_worker.c Modified: head/sys/security/audit/audit_worker.c == --- head/sys/security/audit/audit_worker.c Fri Nov 30 22:59:20 2012 (r243722) +++ head/sys/security/audit/audit_worker.c Fri Nov 30 23:03:51 2012 (r243723) @@ -189,11 +189,11 @@ audit_record_write(struct vnode *vp, str * to the daemon. This is only approximate, which is fine as more * records may be generated before the daemon rotates the file. */ - if ((audit_fstat.af_filesz != 0) (audit_file_rotate_wait == 0) - (audit_size = audit_fstat.af_filesz)) { + if (audit_fstat.af_filesz != 0 + audit_size = audit_fstat.af_filesz * (audit_file_rotate_wait + 1)) { AUDIT_WORKER_LOCK_ASSERT(); - audit_file_rotate_wait = 1; + audit_file_rotate_wait++; (void)audit_send_trigger(AUDIT_TRIGGER_ROTATE_KERNEL); } ___ 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: r243724 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 23:06:27 2012 New Revision: 243724 URL: http://svnweb.freebsd.org/changeset/base/243724 Log: Patch #5 Cleanup unused IEEE1588 code fragments, the day may come when this feature gets implemented, but its not here yet and I see no reason to leave this laying around. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:03:51 2012(r243723) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:06:27 2012(r243724) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 4; +char ixgbe_driver_version[] = 2.5.0 - 5; /* * PCI Device ID Table @@ -1830,12 +1830,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m } else if (ixgbe_tx_ctx_setup(txr, m_head)) olinfo_status |= IXGBE_TXD_POPTS_TXSM 8; -#ifdef IXGBE_IEEE1588 -/* This is changing soon to an mtag detection */ -if (we detect this mbuf has a TSTAMP mtag) -cmd_type_len |= IXGBE_ADVTXD_MAC_TSTAMP; -#endif - #ifdef IXGBE_FDIR /* Do the flow director magic */ if ((txr-atr_sample) (!adapter-fdir_reinit)) { Modified: head/sys/dev/ixgbe/ixgbe.h == --- head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:03:51 2012(r243723) +++ head/sys/dev/ixgbe/ixgbe.h Fri Nov 30 23:06:27 2012(r243724) @@ -89,10 +89,6 @@ #include sys/smp.h #include machine/smp.h -#ifdef IXGBE_IEEE1588 -#include sys/ieee1588.h -#endif - #include ixgbe_api.h /* Tunables */ ___ 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: r243725 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 23:13:56 2012 New Revision: 243725 URL: http://svnweb.freebsd.org/changeset/base/243725 Log: Patch #6 Whitespace cleanup, and removal of some very old defines (at Gleb's request). Also, change the defines around the old transmit code to IXGBE_LEGACY_TX, I do this to make it possible to define this regardless of the OS level (it is not defined by default). There are also a couple changed comments for clarity. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:06:27 2012(r243724) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:13:56 2012(r243725) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 5; +char ixgbe_driver_version[] = 2.5.0 - 6; /* * PCI Device ID Table @@ -104,16 +104,16 @@ static int ixgbe_probe(device_t); static int ixgbe_attach(device_t); static int ixgbe_detach(device_t); static int ixgbe_shutdown(device_t); -#if __FreeBSD_version = 80 +#ifdef IXGBE_LEGACY_TX +static void ixgbe_start(struct ifnet *); +static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); +#else /* ! IXGBE_LEGACY_TX */ static int ixgbe_mq_start(struct ifnet *, struct mbuf *); static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static voidixgbe_qflush(struct ifnet *); static voidixgbe_deferred_mq_start(void *, int); -#else -static void ixgbe_start(struct ifnet *); -static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); -#endif +#endif /* IXGBE_LEGACY_TX */ static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); static voidixgbe_init(void *); static voidixgbe_init_locked(struct adapter *); @@ -541,7 +541,6 @@ ixgbe_attach(device_t dev) case IXGBE_ERR_SFP_NOT_SUPPORTED: device_printf(dev,Unsupported SFP+ Module\n); error = EIO; - device_printf(dev,Hardware Initialization Failure\n); goto err_late; case IXGBE_ERR_SFP_NOT_PRESENT: device_printf(dev,No SFP+ Module found\n); @@ -653,7 +652,7 @@ ixgbe_detach(device_t dev) for (int i = 0; i adapter-num_queues; i++, que++, txr++) { if (que-tq) { -#if __FreeBSD_version = 80 +#ifdef IXGBE_LEGACY_TX taskqueue_drain(que-tq, txr-txq_task); #endif taskqueue_drain(que-tq, que-que_task); @@ -717,7 +716,7 @@ ixgbe_shutdown(device_t dev) } -#if __FreeBSD_version 80 +#ifdef IXGBE_LEGACY_TX /* * Transmit entry point * @@ -784,7 +783,8 @@ ixgbe_start(struct ifnet *ifp) return; } -#else +#else /* ! IXGBE_LEGACY_TX */ + /* ** Multiqueue Transmit driver ** @@ -904,7 +904,7 @@ ixgbe_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* __FreeBSD_version = 80 */ +#endif /* IXGBE_LEGACY_TX */ /* * Ioctl entry point @@ -1413,7 +1413,7 @@ ixgbe_handle_que(void *context, int pend more = ixgbe_rxeof(que, adapter-rx_process_limit); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); -#if __FreeBSD_version = 80 +#ifndef IXGBE_LEGACY_TX if (!drbr_empty(ifp, txr-br)) ixgbe_mq_start_locked(ifp, txr, NULL); #else @@ -1513,7 +1513,7 @@ ixgbe_msix_que(void *arg) ** has anything queued the task gets ** scheduled to handle it. */ -#if __FreeBSD_version 80 +#ifdef IXGBE_LEGACY_TX if (!IFQ_DRV_IS_EMPTY(adapter-ifp-if_snd)) #else if (!drbr_empty(adapter-ifp, txr-br)) @@ -1809,15 +1809,14 @@ ixgbe_xmit(struct tx_ring *txr, struct m /* Make certain there are enough descriptors */ if (nsegs txr-tx_avail - 2) { txr-no_desc_avail++; - error = ENOBUFS; - goto xmit_fail; + bus_dmamap_unload(txr-txtag, map); + return (ENOBUFS); } m_head = *m_headp; /* ** Set up the appropriate offload context - ** this becomes the first descriptor of - ** a packet. + ** this will consume the first descriptor */ if (m_head-m_pkthdr.csum_flags CSUM_TSO) { if (ixgbe_tso_setup(txr, m_head, paylen, olinfo_status)) { @@ -1874,7 +1873,12 @@ ixgbe_xmit(struct tx_ring *txr, struct m txr-next_avail_desc = i;
svn commit: r243726 - in head/sys: kern security/audit
Author: pjd Date: Fri Nov 30 23:18:49 2012 New Revision: 243726 URL: http://svnweb.freebsd.org/changeset/base/243726 Log: IFp4 @208451: Fix path handling for *at() syscalls. Before the change directory descriptor was totally ignored, so the relative path argument was appended to current working directory path and not to the path provided by descriptor, thus wrong paths were stored in audit logs. Now that we use directory descriptor in vfs_lookup, move AUDIT_ARG_UPATH1() and AUDIT_ARG_UPATH2() calls to the place where we hold file descriptors table lock, so we are sure paths will be resolved according to the same directory in audit record and in actual operation. Sponsored by: FreeBSD Foundation (auditdistd) Reviewed by: rwatson MFC after:2 weeks Modified: head/sys/kern/vfs_lookup.c head/sys/security/audit/audit.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Fri Nov 30 23:13:56 2012(r243725) +++ head/sys/kern/vfs_lookup.c Fri Nov 30 23:18:49 2012(r243726) @@ -160,17 +160,6 @@ namei(struct nameidata *ndp) error = copyinstr(ndp-ni_dirp, cnp-cn_pnbuf, MAXPATHLEN, (size_t *)ndp-ni_pathlen); - if (error == 0) { - /* -* If we are auditing the kernel pathname, save the user -* pathname. -*/ - if (cnp-cn_flags AUDITVNODE1) - AUDIT_ARG_UPATH1(td, cnp-cn_pnbuf); - if (cnp-cn_flags AUDITVNODE2) - AUDIT_ARG_UPATH2(td, cnp-cn_pnbuf); - } - /* * Don't allow empty pathnames. */ @@ -218,6 +207,14 @@ namei(struct nameidata *ndp) ndp-ni_rootdir = fdp-fd_rdir; ndp-ni_topdir = fdp-fd_jdir; + /* +* If we are auditing the kernel pathname, save the user pathname. +*/ + if (cnp-cn_flags AUDITVNODE1) + AUDIT_ARG_UPATH1(td, ndp-ni_dirfd, , cnp-cn_pnbuf); + if (cnp-cn_flags AUDITVNODE2) + AUDIT_ARG_UPATH2(td, ndp-ni_dirfd, , cnp-cn_pnbuf); + dp = NULL; if (cnp-cn_pnbuf[0] != '/') { if (ndp-ni_startdir != NULL) { Modified: head/sys/security/audit/audit.c == --- head/sys/security/audit/audit.c Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit.c Fri Nov 30 23:18:49 2012 (r243726) @@ -691,7 +691,7 @@ audit_proc_coredump(struct thread *td, c if (path != NULL) { pathp = ar-k_ar.ar_arg_upath1; *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK); - audit_canon_path(td, path, *pathp); + audit_canon_path(td, AT_FDCWD, path, *pathp); ARG_SET_VALID(ar, ARG_UPATH1); } ar-k_ar.ar_arg_signum = td-td_proc-p_sig; Modified: head/sys/security/audit/audit.h == --- head/sys/security/audit/audit.h Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit.h Fri Nov 30 23:18:49 2012 (r243726) @@ -99,8 +99,8 @@ void audit_arg_sockaddr(struct thread * voidaudit_arg_auid(uid_t auid); voidaudit_arg_auditinfo(struct auditinfo *au_info); voidaudit_arg_auditinfo_addr(struct auditinfo_addr *au_info); -voidaudit_arg_upath1(struct thread *td, char *upath); -voidaudit_arg_upath2(struct thread *td, char *upath); +voidaudit_arg_upath1(struct thread *td, int dirfd, char *upath); +voidaudit_arg_upath2(struct thread *td, int dirfd, char *upath); voidaudit_arg_vnode1(struct vnode *vp); voidaudit_arg_vnode2(struct vnode *vp); voidaudit_arg_text(char *text); @@ -276,14 +276,14 @@ void audit_thread_free(struct thread *t audit_arg_uid((uid)); \ } while (0) -#defineAUDIT_ARG_UPATH1(td, upath) do { \ +#defineAUDIT_ARG_UPATH1(td, dirfd, upath) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_upath1((td), (upath));\ + audit_arg_upath1((td), (dirfd), (upath)); \ } while (0) -#defineAUDIT_ARG_UPATH2(td, upath) do { \ +#defineAUDIT_ARG_UPATH2(td, dirfd, upath) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_upath2((td), (upath));\ + audit_arg_upath2((td),
svn commit: r243727 - head/sys/security/audit
Author: pjd Date: Fri Nov 30 23:21:55 2012 New Revision: 243727 URL: http://svnweb.freebsd.org/changeset/base/243727 Log: IFp4 @208452: Audit handling for missing events: - AUE_READLINKAT - AUE_FACCESSAT - AUE_MKDIRAT - AUE_MKFIFOAT - AUE_MKNODAT - AUE_SYMLINKAT Sponsored by: FreeBSD Foundation (auditdistd) MFC after:2 weeks Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c == --- head/sys/security/audit/audit_bsm.c Fri Nov 30 23:18:49 2012 (r243726) +++ head/sys/security/audit/audit_bsm.c Fri Nov 30 23:21:55 2012 (r243727) @@ -724,13 +724,6 @@ kaudit_to_bsm(struct kaudit_record *kar, */ break; - case AUE_MKFIFO: - if (ARG_IS_VALID(kar, ARG_MODE)) { - tok = au_to_arg32(2, mode, ar-ar_arg_mode); - kau_write(rec, tok); - } - /* FALLTHROUGH */ - case AUE_CHDIR: case AUE_CHROOT: case AUE_FSTATAT: @@ -743,6 +736,7 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_LPATHCONF: case AUE_PATHCONF: case AUE_READLINK: + case AUE_READLINKAT: case AUE_REVOKE: case AUE_RMDIR: case AUE_SEARCHFS: @@ -762,6 +756,8 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_ACCESS: case AUE_EACCESS: + case AUE_FACCESSAT: + ATFD1_TOKENS(1); UPATH1_VNODE1_TOKENS; if (ARG_IS_VALID(kar, ARG_VALUE)) { tok = au_to_arg32(2, mode, ar-ar_arg_value); @@ -1059,6 +1055,10 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_MKDIR: + case AUE_MKDIRAT: + case AUE_MKFIFO: + case AUE_MKFIFOAT: + ATFD1_TOKENS(1); if (ARG_IS_VALID(kar, ARG_MODE)) { tok = au_to_arg32(2, mode, ar-ar_arg_mode); kau_write(rec, tok); @@ -1067,6 +1067,8 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_MKNOD: + case AUE_MKNODAT: + ATFD1_TOKENS(1); if (ARG_IS_VALID(kar, ARG_MODE)) { tok = au_to_arg32(2, mode, ar-ar_arg_mode); kau_write(rec, tok); @@ -1546,10 +1548,12 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_SYMLINK: + case AUE_SYMLINKAT: if (ARG_IS_VALID(kar, ARG_TEXT)) { tok = au_to_text(ar-ar_arg_text); kau_write(rec, tok); } + ATFD1_TOKENS(1); UPATH1_VNODE1_TOKENS; break; ___ 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: r243728 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 23:28:01 2012 New Revision: 243728 URL: http://svnweb.freebsd.org/changeset/base/243728 Log: Patch #7 This is primarily about processing limit control. - add a limit for both RX and TX, change the default to 256 - change the sysctl usage to be common, and now to be called during init for each ring. - the TX limit is not yet used, but the changes in the last patch in this series uses the value. - the motivation behind these changes is to improve data locality in the final code. - rxeof interface changes since it now gets limit from the ring struct Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:21:55 2012(r243727) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:28:01 2012(r243728) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 6; +char ixgbe_driver_version[] = 2.5.0 - 7; /* * PCI Device ID Table @@ -150,7 +150,7 @@ static void ixgbe_enable_intr(struct static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); static boolixgbe_txeof(struct tx_ring *); -static boolixgbe_rxeof(struct ix_queue *, int); +static boolixgbe_rxeof(struct ix_queue *); static voidixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); @@ -163,7 +163,7 @@ static int ixgbe_set_thermal_test(SYSCTL static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); -static voidixgbe_add_rx_process_limit(struct adapter *, const char *, +static voidixgbe_add_process_limit(struct adapter *, const char *, const char *, int *, int); static boolixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); static boolixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); @@ -246,9 +246,13 @@ static int ixgbe_max_interrupt_rate = (4 TUNABLE_INT(hw.ixgbe.max_interrupt_rate, ixgbe_max_interrupt_rate); /* How many packets rxeof tries to clean at a time */ -static int ixgbe_rx_process_limit = 128; +static int ixgbe_rx_process_limit = 256; TUNABLE_INT(hw.ixgbe.rx_process_limit, ixgbe_rx_process_limit); +/* How many packets txeof tries to clean at a time */ +static int ixgbe_tx_process_limit = 256; +TUNABLE_INT(hw.ixgbe.tx_process_limit, ixgbe_tx_process_limit); + /* ** Smart speed setting, default to on ** this only works as a compile option @@ -563,11 +567,6 @@ ixgbe_attach(device_t dev) if (ixgbe_setup_interface(dev, adapter) != 0) goto err_late; - /* Sysctl for limiting the amount of work done in the taskqueue */ - ixgbe_add_rx_process_limit(adapter, rx_processing_limit, - max number of rx packets to process, adapter-rx_process_limit, - ixgbe_rx_process_limit); - /* Initialize statistics */ ixgbe_update_stats_counters(adapter); @@ -1410,7 +1409,7 @@ ixgbe_handle_que(void *context, int pend boolmore; if (ifp-if_drv_flags IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que, adapter-rx_process_limit); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX @@ -1458,7 +1457,7 @@ ixgbe_legacy_irq(void *arg) return; } - more_rx = ixgbe_rxeof(que, adapter-rx_process_limit); + more_rx = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); do { @@ -1504,7 +1503,7 @@ ixgbe_msix_que(void *arg) ixgbe_disable_queue(adapter, que-msix); ++que-irqs; - more_rx = ixgbe_rxeof(que, adapter-rx_process_limit); + more_rx = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); more_tx = ixgbe_txeof(txr); @@ -3083,6 +3082,11 @@ ixgbe_initialize_transmit_units(struct a u64 tdba = txr-txdma.dma_paddr; u32 txctrl; + /* Sysctl for limiting work done in tx clean */ + ixgbe_add_process_limit(adapter, tx_processing_limit, + max number of packets to process, txr-process_limit, + ixgbe_tx_process_limit); + IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba 0xULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba 32)); @@ -4122,6 +4126,11 @@ ixgbe_initialize_receive_units(struct ad
svn commit: r243729 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 23:45:55 2012 New Revision: 243729 URL: http://svnweb.freebsd.org/changeset/base/243729 Log: Patch #8 Performance changes - this one improves locality, moving some counters and data to the ring struct from the adapter struct, also compressing some data in the move. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:28:01 2012(r243728) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:45:55 2012(r243729) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 7; +char ixgbe_driver_version[] = 2.5.0 - 8; /* * PCI Device ID Table @@ -164,7 +164,7 @@ static int ixgbe_dma_malloc(struct adapt struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); static voidixgbe_add_process_limit(struct adapter *, const char *, - const char *, int *, int); + const char *, u16 *, u16); static boolixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); static boolixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static voidixgbe_set_ivar(struct adapter *, u8, u8, s8); @@ -1787,19 +1787,19 @@ ixgbe_xmit(struct tx_ring *txr, struct m *m_headp, segs, nsegs, BUS_DMA_NOWAIT); if (error == ENOMEM) { - adapter-no_tx_dma_setup++; + txr-no_tx_dma_setup++; return (error); } else if (error != 0) { - adapter-no_tx_dma_setup++; + txr-no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } } else if (error == ENOMEM) { - adapter-no_tx_dma_setup++; + txr-no_tx_dma_setup++; return (error); } else if (error != 0) { - adapter-no_tx_dma_setup++; + txr-no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); @@ -1822,7 +1822,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; olinfo_status |= IXGBE_TXD_POPTS_TXSM 8; olinfo_status |= paylen IXGBE_ADVTXD_PAYLEN_SHIFT; - ++adapter-tso_tx; + ++txr-tso_tx; } else return (ENXIO); } else if (ixgbe_tx_ctx_setup(txr, m_head)) @@ -1859,7 +1859,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m txd-read.olinfo_status = htole32(olinfo_status); last = i; /* descriptor that will get completion IRQ */ - if (++i == adapter-num_tx_desc) + if (++i == txr-num_desc) i = 0; txbuf-m_head = NULL; @@ -2816,6 +2816,7 @@ ixgbe_allocate_queues(struct adapter *ad txr = adapter-tx_rings[i]; txr-adapter = adapter; txr-me = i; + txr-num_desc = adapter-num_tx_desc; /* Initialize the TX side lock */ snprintf(txr-mtx_name, sizeof(txr-mtx_name), %s:tx(%d), @@ -2862,6 +2863,7 @@ ixgbe_allocate_queues(struct adapter *ad /* Set up some basics */ rxr-adapter = adapter; rxr-me = i; + rxr-num_desc = adapter-num_rx_desc; /* Initialize the RX side lock */ snprintf(rxr-mtx_name, sizeof(rxr-mtx_name), %s:rx(%d), @@ -3007,7 +3009,7 @@ ixgbe_setup_transmit_ring(struct tx_ring /* Free any existing tx buffers. */ txbuf = txr-tx_buffers; - for (i = 0; i adapter-num_tx_desc; i++, txbuf++) { + for (i = 0; i txr-num_desc; i++, txbuf++) { if (txbuf-m_head != NULL) { bus_dmamap_sync(txr-txtag, txbuf-map, BUS_DMASYNC_POSTWRITE); @@ -3226,7 +3228,6 @@ ixgbe_free_transmit_buffers(struct tx_ri static bool ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp) { - struct adapter *adapter = txr-adapter; struct ixgbe_adv_tx_context_desc *TXD; struct ixgbe_tx_buf*tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; @@ -3329,7 +3330,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, tx_buffer-eop_index = -1; /* We've consumed the first desc, adjust counters */ -
svn commit: r243730 - in vendor/openbsm/dist: . bin bin/audit bin/auditd bin/auditdistd bin/auditfilterd bin/auditreduce bin/praudit bsm compat config etc libauditd libbsm m4 man modules modules/au...
Author: rwatson Date: Fri Nov 30 23:50:07 2012 New Revision: 243730 URL: http://svnweb.freebsd.org/changeset/base/243730 Log: Import OpenBSM 1.2-alpha2: OpenBSM 1.2 alpha 2 - auditdistd, a distributed audit trail management daemon, has now been merged. This allows trail files to be securely and reliably synced from audited hosts to an audit server, and employs TLS encryption. Where available, it uses Capsicum to sandbox the service. This work was contributed by Pawel Jakub Dawidek under sponsorship from the FreeBSD Foundation. OpenBSM 1.2 alpha 1 - Add Capsicum-related error numbers for FreeBSD: ENOTCAPABLE, ECAPMODE. - Add Capsicum, process descriptor audit events for FreeBSD. - Allow 0% minspace. - Fixes from the clang static analyser. - Fix expiration of trail files when the host parameter is used. - Various typo fixes. - Support for Solaris privilege and privilege set tokens. - Documentation for getachost(), improvements for getacfilesz(). - Fix a directory descriptor leak that happened when audit trail partitions filled. - Support for more Linux distributions with a partial contemporary endian.h. - Improved escaping of XML-encapsulated BSM. - A variety of minor documentation, style, and functional. Obtained from:TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Added: vendor/openbsm/dist/bin/auditdistd/ vendor/openbsm/dist/bin/auditdistd/Makefile.am (contents, props changed) vendor/openbsm/dist/bin/auditdistd/Makefile.in (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.8 (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 (contents, props changed) vendor/openbsm/dist/bin/auditdistd/auditdistd.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/faccessat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/fstatat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/openat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/parse.y vendor/openbsm/dist/bin/auditdistd/pjdlog.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/pjdlog.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_common.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_impl.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_socketpair.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_tcp.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_tls.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/proto_uds.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/receiver.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/renameat.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sandbox.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sandbox.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sender.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/strndup.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/subr.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/subr.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/synch.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/token.l vendor/openbsm/dist/bin/auditdistd/trail.c (contents, props changed) vendor/openbsm/dist/bin/auditdistd/trail.h (contents, props changed) vendor/openbsm/dist/bin/auditdistd/unlinkat.h (contents, props changed) vendor/openbsm/dist/compat/closefrom.h (contents, props changed) vendor/openbsm/dist/compat/compat.h (contents, props changed) vendor/openbsm/dist/compat/endian_enc.h (contents, props changed) vendor/openbsm/dist/compat/flopen.h (contents, props changed) vendor/openbsm/dist/compat/pidfile.h (contents, props changed) vendor/openbsm/dist/compat/vis.h (contents, props changed) vendor/openbsm/dist/config/ylwrap vendor/openbsm/dist/m4/ vendor/openbsm/dist/m4/libtool.m4 vendor/openbsm/dist/m4/ltoptions.m4 vendor/openbsm/dist/m4/ltsugar.m4 vendor/openbsm/dist/m4/ltversion.m4 vendor/openbsm/dist/m4/lt~obsolete.m4 Modified: vendor/openbsm/dist/CREDITS vendor/openbsm/dist/INSTALL vendor/openbsm/dist/LICENSE vendor/openbsm/dist/Makefile.am vendor/openbsm/dist/Makefile.in vendor/openbsm/dist/NEWS vendor/openbsm/dist/README vendor/openbsm/dist/TODO vendor/openbsm/dist/VERSION vendor/openbsm/dist/aclocal.m4 vendor/openbsm/dist/autogen.sh
svn commit: r243731 - head/lib/libc/stdio
Author: jilles Date: Fri Nov 30 23:51:33 2012 New Revision: 243731 URL: http://svnweb.freebsd.org/changeset/base/243731 Log: libc: Allow setting close-on-exec in fopen/freopen/fdopen. This commit adds a new mode option 'e' that must follow any 'b', '+' and/or 'x' options. C11 is clear about the 'x' needing to follow 'b' and/or '+' and that is what we implement; therefore, require a strict position for 'e' as well. For freopen() with a non-NULL path argument and fopen(), the close-on-exec flag is set iff the 'e' mode option is specified. For freopen() with a NULL path argument and fdopen(), the close-on-exec flag is turned on if the 'e' mode option is specified and remains unchanged otherwise. Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC) and fdopen(), this needlessly complicates the calling code. Apart from the ordering requirement, the new option matches glibc. PR: kern/169320 Modified: head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/flags.c head/lib/libc/stdio/fopen.3 head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/fdopen.c == --- head/lib/libc/stdio/fdopen.cFri Nov 30 23:50:07 2012 (r243730) +++ head/lib/libc/stdio/fdopen.cFri Nov 30 23:51:33 2012 (r243731) @@ -80,6 +80,12 @@ fdopen(fd, mode) if ((fp = __sfp()) == NULL) return (NULL); + + if ((oflags O_CLOEXEC) _fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { + fp-_flags = 0; + return (NULL); + } + fp-_flags = flags; /* * If opened for appending, but underlying descriptor does not have Modified: head/lib/libc/stdio/flags.c == --- head/lib/libc/stdio/flags.c Fri Nov 30 23:50:07 2012(r243730) +++ head/lib/libc/stdio/flags.c Fri Nov 30 23:51:33 2012(r243731) @@ -97,6 +97,7 @@ __sflags(mode, optr) /* 'x' means exclusive (fail if the file exists) */ if (*mode == 'x') { + mode++; if (m == O_RDONLY) { errno = EINVAL; return (0); @@ -104,6 +105,10 @@ __sflags(mode, optr) o |= O_EXCL; } + /* set close-on-exec */ + if (*mode == 'e') + o |= O_CLOEXEC; + *optr = m | o; return (ret); } Modified: head/lib/libc/stdio/fopen.3 == --- head/lib/libc/stdio/fopen.3 Fri Nov 30 23:50:07 2012(r243730) +++ head/lib/libc/stdio/fopen.3 Fri Nov 30 23:51:33 2012(r243731) @@ -32,7 +32,7 @@ .\ @(#)fopen.38.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd October 17, 2011 +.Dd November 30, 2012 .Dt FOPEN 3 .Os .Sh NAME @@ -97,6 +97,14 @@ or causes the .Fn fopen call to fail if the file already exists. +An optional +.Dq Li e +following the above +causes the +.Fn fopen +call to set the +.Dv FD_CLOEXEC +flag on the underlying file descriptor. .Pp The .Fa mode @@ -144,6 +152,11 @@ of the stream must be compatible with th The .Dq Li x mode option is ignored. +If the +.Dq Li e +mode option is present, the +.Dv FD_CLOEXEC +flag is set, otherwise it remains unchanged. When the stream is closed via .Xr fclose 3 , .Fa fildes @@ -277,3 +290,7 @@ The function conforms to .St -p1003.1-88 . +The +.Dq Li e +mode option does not conform to any standard +but is also supported by glibc. Modified: head/lib/libc/stdio/freopen.c == --- head/lib/libc/stdio/freopen.c Fri Nov 30 23:50:07 2012 (r243730) +++ head/lib/libc/stdio/freopen.c Fri Nov 30 23:51:33 2012 (r243731) @@ -118,6 +118,8 @@ freopen(file, mode, fp) (void) ftruncate(fp-_file, (off_t)0); if (!(oflags O_APPEND)) (void) _sseek(fp, (fpos_t)0, SEEK_SET); + if (oflags O_CLOEXEC) + (void) _fcntl(fp-_file, F_SETFD, FD_CLOEXEC); f = fp-_file; isopen = 0; wantfd = -1; @@ -194,7 +196,8 @@ finish: * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ if (wantfd = 0) { - if (_dup2(f, wantfd) = 0) { + if ((oflags O_CLOEXEC ? _fcntl(f, F_DUP2FD_CLOEXEC, wantfd) : + _dup2(f, wantfd)) = 0) { (void)_close(f); f = wantfd; } else ___ 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: r243733 - head/sys/dev/ixgbe
Author: jfv Date: Fri Nov 30 23:54:57 2012 New Revision: 243733 URL: http://svnweb.freebsd.org/changeset/base/243733 Log: Patch #9 Performance - improve the tx dma failure path, similar to a change done in igb long ago. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:52:45 2012(r243732) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 30 23:54:57 2012(r243733) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 8; +char ixgbe_driver_version[] = 2.5.0 - 9; /* * PCI Device ID Table @@ -1740,6 +1740,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m u32 paylen = 0; int i, j, error, nsegs; int first, last = 0; + boolremap = TRUE; struct mbuf *m_head; bus_dma_segment_t segs[adapter-num_segs]; bus_dmamap_tmap; @@ -1767,42 +1768,38 @@ ixgbe_xmit(struct tx_ring *txr, struct m /* * Map the packet for DMA. */ +retry: error = bus_dmamap_load_mbuf_sg(txr-txtag, map, *m_headp, segs, nsegs, BUS_DMA_NOWAIT); - if (error == EFBIG) { + if (__predict_false(error)) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); - if (m == NULL) { - adapter-mbuf_defrag_failed++; - m_freem(*m_headp); - *m_headp = NULL; - return (ENOBUFS); - } - *m_headp = m; - - /* Try it again */ - error = bus_dmamap_load_mbuf_sg(txr-txtag, map, - *m_headp, segs, nsegs, BUS_DMA_NOWAIT); - - if (error == ENOMEM) { + switch (error) { + case EFBIG: + /* Try it again? - one try */ + if (remap == TRUE) { + remap = FALSE; + m = m_defrag(*m_headp, M_NOWAIT); + if (m == NULL) { + adapter-mbuf_defrag_failed++; + m_freem(*m_headp); + *m_headp = NULL; + return (ENOBUFS); + } + *m_headp = m; + goto retry; + } else + return (error); + case ENOMEM: txr-no_tx_dma_setup++; return (error); - } else if (error != 0) { + default: txr-no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } - } else if (error == ENOMEM) { - txr-no_tx_dma_setup++; - return (error); - } else if (error != 0) { - txr-no_tx_dma_setup++; - m_freem(*m_headp); - *m_headp = NULL; - return (error); } /* Make certain there are enough descriptors */ ___ 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: r243732 - vendor/openbsm/1.2-ALPHA-2
Author: rwatson Date: Fri Nov 30 23:52:45 2012 New Revision: 243732 URL: http://svnweb.freebsd.org/changeset/base/243732 Log: Tag OpenBSM 1.2-alpha2. Obtained from:TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Added: vendor/openbsm/1.2-ALPHA-2/ - copied from r243731, vendor/openbsm/dist/ ___ 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: r243734 - in vendor/openbsm/dist: bin/auditd bin/auditdistd bin/praudit libbsm sys/bsm
Author: rwatson Date: Sat Dec 1 00:02:31 2012 New Revision: 243734 URL: http://svnweb.freebsd.org/changeset/base/243734 Log: Merge a number of post-1.2-alpha2 changes to OpenBSM into the OpenBSM vendor area; these sort out various post-release issues, largely to do with integrating OpenBSM with the base FreeBSD build. All of these changes will appear in a future 1.2-alpha3: Change 219846 on 2012/11/26 by rwatson@rwatson_cinnamon Update several instances of Apple Computer to Apple; a change made in the FreeBSD tree some years ago but not propagated to OpenBSM. Change 219845 on 2012/11/26 by rwatson@rwatson_cinnamon Remove Apple acknowledgement clause from file with Christian Peron copyright (with permission from Christian). Change 219836 on 2012/11/23 by rwatson@rwatson_cinnamon Replace further instances of with for local includes in auditdistd. Change 219834 on 2012/11/23 by rwatson@rwatson_cinnamon For current-directory headers, use #include rather than #include . Change 219832 on 2012/11/23 by rwatson@rwatson_cinnamon Be more consistent with the remainder of OpenBSM and include config/config.h rather than config.h. Don't include config.h from synch.h, which is included only from .c files that already include config.h. Change 219831 on 2012/11/23 by pjd@pjd_anger Add Xref to auditdistd(8). Suggested by: rwatson Obtained from:TrustedBSD Project Sponsored by: The FreeBSD Foundation (auditdistd) Modified: vendor/openbsm/dist/bin/auditd/auditd.8 vendor/openbsm/dist/bin/auditdistd/auditdistd.c vendor/openbsm/dist/bin/auditdistd/parse.y vendor/openbsm/dist/bin/auditdistd/proto_tcp.c vendor/openbsm/dist/bin/auditdistd/proto_tls.c vendor/openbsm/dist/bin/auditdistd/proto_uds.c vendor/openbsm/dist/bin/auditdistd/receiver.c vendor/openbsm/dist/bin/auditdistd/sandbox.c vendor/openbsm/dist/bin/auditdistd/sender.c vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h vendor/openbsm/dist/bin/auditdistd/subr.c vendor/openbsm/dist/bin/auditdistd/synch.h vendor/openbsm/dist/bin/auditdistd/token.l vendor/openbsm/dist/bin/auditdistd/trail.c vendor/openbsm/dist/bin/praudit/praudit.c vendor/openbsm/dist/libbsm/audit_submit.3 vendor/openbsm/dist/libbsm/bsm_audit.c vendor/openbsm/dist/libbsm/bsm_class.c vendor/openbsm/dist/libbsm/bsm_io.c vendor/openbsm/dist/sys/bsm/audit_internal.h Modified: vendor/openbsm/dist/bin/auditd/auditd.8 == --- vendor/openbsm/dist/bin/auditd/auditd.8 Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditd/auditd.8 Sat Dec 1 00:02:31 2012 (r243734) @@ -25,7 +25,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. .\ -.\ $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#18 $ +.\ $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ .\ .Dd December 11, 2008 .Dt AUDITD 8 @@ -122,6 +122,7 @@ and are no longer available as arguments .Xr audit_event 5 , .Xr audit_warn 5 , .Xr audit 8 , +.Xr auditdistd 8 , .Xr launchd 8 .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.c == --- vendor/openbsm/dist/bin/auditdistd/auditdistd.c Fri Nov 30 23:54:57 2012(r243733) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.c Sat Dec 1 00:02:31 2012(r243734) @@ -26,10 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ -#include config.h +#include config/config.h #include sys/param.h #if defined(HAVE_SYS_ENDIAN_H) defined(HAVE_BSWAP) @@ -75,9 +75,8 @@ #include sigtimedwait.h #endif -#include pjdlog.h - #include auditdistd.h +#include pjdlog.h #include proto.h #include subr.h #include synch.h Modified: vendor/openbsm/dist/bin/auditdistd/parse.y == --- vendor/openbsm/dist/bin/auditdistd/parse.y Fri Nov 30 23:54:57 2012 (r243733) +++ vendor/openbsm/dist/bin/auditdistd/parse.y Sat Dec 1 00:02:31 2012 (r243734) @@ -27,10 +27,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#3 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ -#include config.h +#include config/config.h
svn commit: r243735 - head/sys/dev/ixgbe
Author: jfv Date: Sat Dec 1 00:03:58 2012 New Revision: 243735 URL: http://svnweb.freebsd.org/changeset/base/243735 Log: Patch #10 Performance - this changes the protocol offload interface and code in the TX path,making it tighter and hopefully more efficient. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:02:31 2012(r243734) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:03:58 2012(r243735) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 9; +char ixgbe_driver_version[] = 2.5.0 - 10; /* * PCI Device ID Table @@ -165,8 +165,10 @@ static int ixgbe_dma_malloc(struct adapt static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); static voidixgbe_add_process_limit(struct adapter *, const char *, const char *, u16 *, u16); -static boolixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); -static boolixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); +static int ixgbe_tx_ctx_setup(struct tx_ring *, + struct mbuf *, u32 *, u32 *); +static int ixgbe_tso_setup(struct tx_ring *, + struct mbuf *, u32 *, u32 *); static voidixgbe_set_ivar(struct adapter *, u8, u8, s8); static voidixgbe_configure_ivars(struct adapter *); static u8 *ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -1737,7 +1739,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m { struct adapter *adapter = txr-adapter; u32 olinfo_status = 0, cmd_type_len; - u32 paylen = 0; int i, j, error, nsegs; int first, last = 0; boolremap = TRUE; @@ -1814,16 +1815,12 @@ retry: ** Set up the appropriate offload context ** this will consume the first descriptor */ - if (m_head-m_pkthdr.csum_flags CSUM_TSO) { - if (ixgbe_tso_setup(txr, m_head, paylen, olinfo_status)) { - cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_TXSM 8; - olinfo_status |= paylen IXGBE_ADVTXD_PAYLEN_SHIFT; - ++txr-tso_tx; - } else - return (ENXIO); - } else if (ixgbe_tx_ctx_setup(txr, m_head)) - olinfo_status |= IXGBE_TXD_POPTS_TXSM 8; + error = ixgbe_tx_ctx_setup(txr, m_head, cmd_type_len, olinfo_status); + if (__predict_false(error)) { + if (error == ENOBUFS) + *m_headp = NULL; + return (error); + } #ifdef IXGBE_FDIR /* Do the flow director magic */ @@ -1835,10 +1832,6 @@ retry: } } #endif -/* Record payload length */ - if (paylen == 0) - olinfo_status |= m_head-m_pkthdr.len - IXGBE_ADVTXD_PAYLEN_SHIFT; i = txr-next_avail_desc; for (j = 0; j nsegs; j++) { @@ -3218,31 +3211,37 @@ ixgbe_free_transmit_buffers(struct tx_ri /* * - * Advanced Context Descriptor setup for VLAN or CSUM + * Advanced Context Descriptor setup for VLAN, CSUM or TSO * **/ -static bool -ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp) +static int +ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, +u32 *cmd_type_len, u32 *olinfo_status) { struct ixgbe_adv_tx_context_desc *TXD; - struct ixgbe_tx_buf*tx_buffer; - u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; struct ether_vlan_header *eh; struct ip *ip; struct ip6_hdr *ip6; - int ehdrlen, ip_hlen = 0; + u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; + int ehdrlen, ip_hlen = 0; u16 etype; u8 ipproto = 0; - booloffload = TRUE; - int ctxd = txr-next_avail_desc; - u16 vtag = 0; - + int offload = TRUE; + int ctxd = txr-next_avail_desc; + u16 vtag = 0; + + /* First check if TSO is to be used */ + if (mp-m_pkthdr.csum_flags CSUM_TSO) + return (ixgbe_tso_setup(txr, mp, cmd_type_len, olinfo_status)); if ((mp-m_pkthdr.csum_flags CSUM_OFFLOAD) == 0) offload = FALSE; - tx_buffer = txr-tx_buffers[ctxd]; + /* Indicate the whole packet as payload when not doing TSO */ + *olinfo_status |= mp-m_pkthdr.len IXGBE_ADVTXD_PAYLEN_SHIFT;
svn commit: r243736 - head/sys/dev/ixgbe
Author: jfv Date: Sat Dec 1 00:11:24 2012 New Revision: 243736 URL: http://svnweb.freebsd.org/changeset/base/243736 Log: Patch #11 - The final patch: this one greatly improves the TX hot path by getting rid of index calculations and simply managing pointers. Much of the creative code is due to my coworker here at Intel, Alex Duyck, thanks Alex! Also, this whole series of patches was given the critical eye of Gleb Smirnoff and is all the better for it, thanks Gleb! Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:03:58 2012(r243735) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 00:11:24 2012(r243736) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /* * Driver version */ -char ixgbe_driver_version[] = 2.5.0 - 10; +char ixgbe_driver_version[] = 2.5.0; /* * PCI Device ID Table @@ -1740,7 +1740,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m struct adapter *adapter = txr-adapter; u32 olinfo_status = 0, cmd_type_len; int i, j, error, nsegs; - int first, last = 0; + int first; boolremap = TRUE; struct mbuf *m_head; bus_dma_segment_t segs[adapter-num_segs]; @@ -1847,13 +1847,9 @@ retry: txd-read.cmd_type_len = htole32(txr-txd_cmd | cmd_type_len |seglen); txd-read.olinfo_status = htole32(olinfo_status); - last = i; /* descriptor that will get completion IRQ */ if (++i == txr-num_desc) i = 0; - - txbuf-m_head = NULL; - txbuf-eop_index = -1; } txd-read.cmd_type_len |= @@ -1872,9 +1868,9 @@ retry: txbuf-map = map; bus_dmamap_sync(txr-txtag, map, BUS_DMASYNC_PREWRITE); -/* Set the index of the descriptor that will be marked done */ +/* Set the EOP descriptor that will be marked done */ txbuf = txr-tx_buffers[first]; - txbuf-eop_index = last; + txbuf-eop = txd; bus_dmamap_sync(txr-txdma.dma_tag, txr-txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -3023,8 +3019,8 @@ ixgbe_setup_transmit_ring(struct tx_ring netmap_load_map(txr-txtag, txbuf-map, NMB(slot + si)); } #endif /* DEV_NETMAP */ - /* Clear the EOP index */ - txbuf-eop_index = -1; + /* Clear the EOP descriptor pointer */ + txbuf-eop = NULL; } #ifdef IXGBE_FDIR @@ -3083,7 +3079,7 @@ ixgbe_initialize_transmit_units(struct a (tdba 0xULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba 32)); IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i), - adapter-num_tx_desc * sizeof(struct ixgbe_legacy_tx_desc)); + adapter-num_tx_desc * sizeof(union ixgbe_adv_tx_desc)); /* Setup the HW Tx Head and Tail descriptor pointers */ IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0); @@ -3320,8 +3316,8 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, *olinfo_status |= IXGBE_TXD_POPTS_TXSM 8; /* Now copy bits into descriptor */ - TXD-vlan_macip_lens |= htole32(vlan_macip_lens); - TXD-type_tucmd_mlhl |= htole32(type_tucmd_mlhl); + TXD-vlan_macip_lens = htole32(vlan_macip_lens); + TXD-type_tucmd_mlhl = htole32(type_tucmd_mlhl); TXD-seqnum_seed = htole32(0); TXD-mss_l4len_idx = htole32(0); @@ -3423,12 +3419,12 @@ ixgbe_tso_setup(struct tx_ring *txr, str vlan_macip_lens |= ehdrlen IXGBE_ADVTXD_MACLEN_SHIFT; vlan_macip_lens |= ip_hlen; - TXD-vlan_macip_lens |= htole32(vlan_macip_lens); + TXD-vlan_macip_lens = htole32(vlan_macip_lens); /* ADV DTYPE TUCMD */ type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; - TXD-type_tucmd_mlhl |= htole32(type_tucmd_mlhl); + TXD-type_tucmd_mlhl = htole32(type_tucmd_mlhl); /* MSS L4LEN IDX */ mss_l4len_idx |= (mp-m_pkthdr.tso_segsz IXGBE_ADVTXD_MSS_SHIFT); @@ -3535,11 +3531,12 @@ ixgbe_atr(struct tx_ring *txr, struct mb static bool ixgbe_txeof(struct tx_ring *txr) { - struct adapter *adapter = txr-adapter; - struct ifnet*ifp = adapter-ifp; - u32 first, last, done, processed; - struct ixgbe_tx_buf *tx_buffer; - struct ixgbe_legacy_tx_desc *tx_desc, *eop_desc; + struct adapter
svn commit: r243737 - in head/sys: amd64/pci i386/pci
Author: jkim Date: Sat Dec 1 00:56:19 2012 New Revision: 243737 URL: http://svnweb.freebsd.org/changeset/base/243737 Log: Remove duplicate code. Reduce diff between amd64 and i386. Modified: head/sys/amd64/pci/pci_cfgreg.c head/sys/i386/pci/pci_cfgreg.c Modified: head/sys/amd64/pci/pci_cfgreg.c == --- head/sys/amd64/pci/pci_cfgreg.c Sat Dec 1 00:11:24 2012 (r243736) +++ head/sys/amd64/pci/pci_cfgreg.c Sat Dec 1 00:56:19 2012 (r243737) @@ -295,6 +295,13 @@ pcie_cfgregopen(uint64_t base, uint8_t m return (1); } +#define PCIE_VADDR(base, reg, bus, slot, func) \ + ((base) + \ + bus) 0xff) 20) | \ + (((slot) 0x1f) 15) | \ + (((func) 0x7) 12) | \ + ((reg) 0xfff))) + /* * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h * have a requirement that all accesses to the memory mapped PCI configuration @@ -302,12 +309,6 @@ pcie_cfgregopen(uint64_t base, uint8_t m * Since other vendors do not currently have any contradicting requirements * the AMD access pattern is applied universally. */ -#define PCIE_VADDR(base, reg, bus, slot, func) \ - ((base) + \ - bus) 0xff) 20) | \ - (((slot) 0x1f) 15) | \ - (((func) 0x7) 12) | \ - ((reg) 0xfff))) static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, Modified: head/sys/i386/pci/pci_cfgreg.c == --- head/sys/i386/pci/pci_cfgreg.c Sat Dec 1 00:11:24 2012 (r243736) +++ head/sys/i386/pci/pci_cfgreg.c Sat Dec 1 00:56:19 2012 (r243737) @@ -610,25 +610,29 @@ pcie_cfgregopen(uint64_t base, uint8_t m } #endif /* !XEN */ -#define PCIE_PADDR(bar, reg, bus, slot, func) \ - ((bar) | \ - (((bus) 0xff) 20) | \ +#define PCIE_PADDR(base, reg, bus, slot, func) \ + ((base) + \ + bus) 0xff) 20) | \ (((slot) 0x1f) 15) | \ (((func) 0x7) 12) | \ - ((reg) 0xfff)) + ((reg) 0xfff))) -/* - * Find an element in the cache that matches the physical page desired, or - * create a new mapping from the least recently used element. - * A very simple LRU algorithm is used here, does it need to be more - * efficient? - */ -static __inline struct pcie_cfg_elem * -pciereg_findelem(vm_paddr_t papage) +static __inline vm_offset_t +pciereg_findaddr(int bus, unsigned slot, unsigned func, unsigned reg) { struct pcie_cfg_list *pcielist; struct pcie_cfg_elem *elem; + vm_paddr_t pa, papage; + pa = PCIE_PADDR(pcie_base, reg, bus, slot, func); + papage = pa ~PAGE_MASK; + + /* +* Find an element in the cache that matches the physical page desired, +* or create a new mapping from the least recently used element. +* A very simple LRU algorithm is used here, does it need to be more +* efficient? +*/ pcielist = pcie_list[PCPU_GET(cpuid)]; TAILQ_FOREACH(elem, pcielist, elem) { if (elem-papage == papage) @@ -649,7 +653,7 @@ pciereg_findelem(vm_paddr_t papage) TAILQ_REMOVE(pcielist, elem, elem); TAILQ_INSERT_HEAD(pcielist, elem, elem); } - return (elem); + return (elem-vapage | (pa PAGE_MASK)); } /* @@ -664,9 +668,7 @@ static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) { - struct pcie_cfg_elem *elem; vm_offset_t va; - vm_paddr_t pa, papage; int data = -1; if (bus pcie_minbus || bus pcie_maxbus || slot PCI_SLOTMAX || @@ -674,10 +676,7 @@ pciereg_cfgread(int bus, unsigned slot, return (-1); critical_enter(); - pa = PCIE_PADDR(pcie_base, reg, bus, slot, func); - papage = pa ~PAGE_MASK; - elem = pciereg_findelem(papage); - va = elem-vapage | (pa PAGE_MASK); + va = pciereg_findaddr(bus, slot, func, reg); switch (bytes) { case 4: @@ -702,19 +701,14 @@ static void pciereg_cfgwrite(int bus, unsigned slot, unsigned func, unsigned reg, int data, unsigned bytes) { - struct pcie_cfg_elem *elem; vm_offset_t va; - vm_paddr_t pa, papage; if (bus pcie_minbus || bus pcie_maxbus || slot PCI_SLOTMAX || func PCI_FUNCMAX || reg PCIE_REGMAX) return; critical_enter(); - pa = PCIE_PADDR(pcie_base, reg, bus, slot, func); - papage = pa ~PAGE_MASK; - elem = pciereg_findelem(papage); - va = elem-vapage | (pa PAGE_MASK); +
svn commit: r243738 - in stable/9/sys: fs/nfsserver nfs
Author: rmacklem Date: Sat Dec 1 01:07:51 2012 New Revision: 243738 URL: http://svnweb.freebsd.org/changeset/base/243738 Log: MFC: r241561 Add two new options to the nfssvc(2) syscall that allow processes running as root to suspend/resume execution of the kernel nfsd threads. An earlier version of this patch was tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/9/sys/fs/nfsserver/nfs_nfsdport.c stable/9/sys/nfs/nfs_nfssvc.c stable/9/sys/nfs/nfssvc.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c == --- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.cSat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.cSat Dec 1 01:07:51 2012 (r243738) @@ -45,6 +45,8 @@ __FBSDID($FreeBSD$); #include security/mac/mac_framework.h NFSDLOCKMUTEX; +NFSV4ROOTLOCKMUTEX; +struct nfsv4lock nfsd_suspend_lock; /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. @@ -221,9 +223,24 @@ nfssvc_program(struct svc_req *rqst, SVC #ifdef MAC mac_cred_associate_nfsd(nd.nd_cred); #endif + /* +* Get a refcnt (shared lock) on nfsd_suspend_lock. +* NFSSVC_SUSPENDNFSD will take an exclusive lock on +* nfsd_suspend_lock to suspend these threads. +* This must be done here, before the check of +* nfsv4root exports by nfsvno_v4rootexport(). +*/ + NFSLOCKV4ROOTMUTEX(); + nfsv4_getref(nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); + NFSUNLOCKV4ROOTMUTEX(); + if ((nd.nd_flag ND_NFSV4) != 0) { nd.nd_repstat = nfsvno_v4rootexport(nd); if (nd.nd_repstat != 0) { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); @@ -233,6 +250,9 @@ nfssvc_program(struct svc_req *rqst, SVC cacherep = nfs_proc(nd, rqst-rq_xid, xprt-xp_socket, xprt-xp_sockref, rp); + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(nfsd_suspend_lock); + NFSUNLOCKV4ROOTMUTEX(); } else { NFSMGET(nd.nd_mreq); nd.nd_mreq-m_len = 0; Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c == --- stable/9/sys/fs/nfsserver/nfs_nfsdport.cSat Dec 1 00:56:19 2012 (r243737) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.cSat Dec 1 01:07:51 2012 (r243738) @@ -57,6 +57,7 @@ extern struct mount nfsv4root_mnt; extern struct nfsrv_stablefirst nfsrv_stablefirst; extern void (*nfsd_call_servertimer)(void); extern SVCPOOL *nfsrvd_pool; +extern struct nfsv4lock nfsd_suspend_lock; struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; NFSDLOCKMUTEX; struct mtx nfs_cache_mutex; @@ -3104,8 +3105,9 @@ nfssvc_srvcall(struct thread *p, struct struct nfsd_dumplocks *dumplocks; struct nameidata nd; vnode_t vp; - int error = EINVAL; + int error = EINVAL, igotlock; struct proc *procp; + static int suspend_nfsd = 0; if (uap-flag NFSSVC_PUBLICFH) { NFSBZERO((caddr_t)nfs_pubfh.nfsrvfh_data, @@ -3184,6 +3186,26 @@ nfssvc_srvcall(struct thread *p, struct nfsd_master_start = procp-p_stats-p_start; nfsd_master_proc = procp; PROC_UNLOCK(procp); + } else if ((uap-flag NFSSVC_SUSPENDNFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd == 0) { + /* Lock out all nfsd threads */ + do { + igotlock = nfsv4_lock(nfsd_suspend_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (igotlock == 0 suspend_nfsd == 0); + suspend_nfsd = 1; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; + } else if ((uap-flag NFSSVC_RESUMENFSD) != 0) { + NFSLOCKV4ROOTMUTEX(); + if (suspend_nfsd != 0) { + nfsv4_unlock(nfsd_suspend_lock, 0); + suspend_nfsd = 0; + } + NFSUNLOCKV4ROOTMUTEX(); + error = 0; } NFSEXITCODE(error); Modified: stable/9/sys/nfs/nfs_nfssvc.c
svn commit: r243739 - stable/9/usr.sbin/mountd
Author: rmacklem Date: Sat Dec 1 01:11:59 2012 New Revision: 243739 URL: http://svnweb.freebsd.org/changeset/base/243739 Log: MFC: r241568 Add a new '-S' option to mountd, which tells it to suspend execution of the nfsd threads while it is reloading the exports. This avoids clients from getting intermittent access errors when the exports are being reloaded non-atomically. It is not an ideal solution, since requests will back up while the nfsd threads are suspended. Also, when this option is used, if mountd crashes while reloading exports, mountd will have to be restarted to get the nfsd threads to resume execution. This has been tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). The nfse patch offers a more comprehensive solution for this issue. Modified: stable/9/usr.sbin/mountd/mountd.c Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.c == --- stable/9/usr.sbin/mountd/mountd.c Sat Dec 1 01:07:51 2012 (r243738) +++ stable/9/usr.sbin/mountd/mountd.c Sat Dec 1 01:11:59 2012 (r243739) @@ -246,6 +246,7 @@ static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; static int sock_fdpos; +static int suspend_nfsd = 0; int opt_flags; static int have_v6 = 1; @@ -311,7 +312,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, 2deh:lnop:r)) != -1) + while ((c = getopt(argc, argv, 2deh:lnop:rS)) != -1) switch (c) { case '2': force_v2 = 1; @@ -363,6 +364,9 @@ main(int argc, char **argv) out_of_mem(); } break; + case 'S': + suspend_nfsd = 1; + break; default: usage(); }; @@ -921,7 +925,7 @@ usage(void) { fprintf(stderr, usage: mountd [-2] [-d] [-e] [-l] [-n] [-p port] [-r] - [-h bindip] [export_file ...]\n); + [-S] [-h bindip] [export_file ...]\n); exit(1); } @@ -1660,6 +1664,8 @@ get_exportlist(void) int done; struct nfsex_args eargs; + if (suspend_nfsd != 0) + (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); v4root_dirpath[0] = '\0'; bzero(export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; @@ -1790,6 +1796,9 @@ get_exportlist(void) */ if (run_v4server 0 has_publicfh == 0) (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); + + /* Resume the nfsd. If they weren't suspended, this is harmless. */ + (void)nfssvc(NFSSVC_RESUMENFSD, 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: r243740 - stable/9/usr.sbin/mountd
Author: rmacklem Date: Sat Dec 1 01:16:40 2012 New Revision: 243740 URL: http://svnweb.freebsd.org/changeset/base/243740 Log: MFC: r241569 Document the -S option added by r241568. Modified: stable/9/usr.sbin/mountd/mountd.8 Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.8 == --- stable/9/usr.sbin/mountd/mountd.8 Sat Dec 1 01:11:59 2012 (r243739) +++ stable/9/usr.sbin/mountd/mountd.8 Sat Dec 1 01:16:40 2012 (r243740) @@ -28,7 +28,7 @@ .\ @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\ $FreeBSD$ .\ -.Dd April 23, 2011 +.Dd October 14, 2012 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnor +.Op Fl 2delnorS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -131,6 +131,19 @@ flag. Specify an alternate location for the exports file. More than one exports file can be specified. +.It Fl S +Tell mountd to suspend/resume execution of the nfsd threads whenever +the exports list is being reloaded. +This avoids intermittent access +errors for clients that do NFS RPCs while the exports are being +reloaded, but introduces a delay in RPC response while the reload +is in progress. +If +.Nm +crashes while an exports load is in progress, +.Nm +must be restarted to get the nfsd threads running again, if this +option is used. .El .Pp When ___ 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: r243741 - head/sys/dev/ixgbe
Author: jfv Date: Sat Dec 1 01:24:40 2012 New Revision: 243741 URL: http://svnweb.freebsd.org/changeset/base/243741 Log: Patch #12 OK, I said there was only 11 patches, but unfortunately the revamped sysctl code did not work, and needed a change. This makes the limit get set at the time that all sysctl stats are created and is actually more elegant imho anyway. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 01:16:40 2012(r243740) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 01:24:40 2012(r243741) @@ -163,8 +163,6 @@ static int ixgbe_set_thermal_test(SYSCTL static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); -static voidixgbe_add_process_limit(struct adapter *, const char *, - const char *, u16 *, u16); static int ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static int ixgbe_tso_setup(struct tx_ring *, @@ -3070,11 +3068,6 @@ ixgbe_initialize_transmit_units(struct a u64 tdba = txr-txdma.dma_paddr; u32 txctrl; - /* Sysctl for limiting work done in tx clean */ - ixgbe_add_process_limit(adapter, tx_processing_limit, - max number of packets to process, txr-process_limit, - ixgbe_tx_process_limit); - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba 0xULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba 32)); @@ -4119,11 +4112,6 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i adapter-num_queues; i++, rxr++) { u64 rdba = rxr-rxdma.dma_paddr; - /* Sysctl for limiting work done in rx clean */ - ixgbe_add_process_limit(adapter, rx_processing_limit, - max number of packets to process, rxr-process_limit, - ixgbe_rx_process_limit); - /* Setup the Base and Length of the Rx Descriptor Ring */ IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), (rdba 0xULL)); @@ -5185,6 +5173,23 @@ ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ return 0; } +/** ixgbe_sysctl_tx_process_limit - Handler function + * Set the limit value for TX processing + */ +static int +ixgbe_sysctl_tx_process_limit(SYSCTL_HANDLER_ARGS) +{ + int error; + + struct tx_ring *txr = ((struct tx_ring *)oidp-oid_arg1); + if (!txr) return 0; + + error = sysctl_handle_int(oidp, ixgbe_tx_process_limit, 0, req); + if (error || !req-newptr) + return error; + return 0; +} + /** ixgbe_sysctl_rdh_handler - Handler function * Retrieves the RDH value from the hardware */ @@ -5221,6 +5226,23 @@ ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ return 0; } +/** ixgbe_sysctl_rx_process_limit - Handler function + * Set the limit value for RX processing + */ +static int +ixgbe_sysctl_rx_process_limit(SYSCTL_HANDLER_ARGS) +{ + int error; + + struct rx_ring *rxr = ((struct rx_ring *)oidp-oid_arg1); + if (!rxr) return 0; + + error = sysctl_handle_int(oidp, ixgbe_rx_process_limit, 0, req); + if (error || !req-newptr) + return error; + return 0; +} + static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS) { @@ -5308,6 +5330,10 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdt_handler, IU, Transmit Descriptor Tail); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, tx_process_limit, + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), + ixgbe_sysctl_tx_process_limit, IU, + Transmit Process Limit); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, tso_tx, CTLFLAG_RD, txr-tso_tx, TSO); @@ -5343,6 +5369,10 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdt_handler, IU, Receive Descriptor Tail); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, rx_process_limit, + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), + ixgbe_sysctl_rx_process_limit, IU, + Receive Process Limit); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, rx_packets, CTLFLAG_RD,
svn commit: r243742 - stable/9/sys/fs/ext2fs
Author: pfg Date: Sat Dec 1 02:02:19 2012 New Revision: 243742 URL: http://svnweb.freebsd.org/changeset/base/243742 Log: MFC r243562: Update some definitions or make them match NetBSD's headers. Bring several definitions required for newer ext4 features. Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it is not being used yet and the new name is more compatible with NetBSD and Linux. This change is purely cosmetic. Obtained from:NetBSD Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h == --- stable/9/sys/fs/ext2fs/ext2_dinode.hSat Dec 1 01:24:40 2012 (r243741) +++ stable/9/sys/fs/ext2fs/ext2_dinode.hSat Dec 1 02:02:19 2012 (r243742) @@ -60,8 +60,15 @@ #define EXT2_APPEND0x0020 /* writes to file may only append */ #define EXT2_NODUMP0x0040 /* do not dump file */ #define EXT2_NOATIME 0x0080 /* do not update atime */ - -#define EXT2_HTREE 0x1000 /* HTree-indexed directory */ +#define EXT2_INDEX 0x1000 /* hash-indexed directory */ +#define EXT2_IMAGIC0x2000 /* AFS directory */ +#define EXT2_JOURNAL_DATA 0x4000 /* file data should be journaled */ +#define EXT2_NOTAIL0x8000 /* file tail should not be merged */ +#define EXT2_DIRSYNC 0x0001 /* dirsync behaviour */ +#define EXT2_TOPDIR0x0002 /* Top of directory hierarchies*/ +#define EXT2_HUGE_FILE 0x0004 /* Set to each huge file */ +#define EXT2_EXTENTS 0x0008 /* Inode uses extents */ +#define EXT2_EOFBLOCKS 0x0040 /* Blocks allocated beyond EOF */ /* * Definitions for nanosecond timestamps. @@ -95,9 +102,8 @@ struct ext2fs_dinode { uint32_te2di_facl; /* 104: file ACL (not implemented) */ uint32_te2di_dacl; /* 108: dir ACL (not implemented) */ uint32_te2di_faddr; /* 112: fragment address */ - uint8_t e2di_nfrag; /* 116: fragment number */ - uint8_t e2di_fsize; /* 117: fragment size */ - uint16_te2di_linux_reserved2; /* 118 */ + uint16_te2di_nblock_high; /* 116: Blocks count bits 47:32 */ + uint16_te2di_facl_high; /* 118: file ACL bits 47:32 */ uint16_te2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_te2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_te2di_linux_reserved3; /* 124 */ Modified: stable/9/sys/fs/ext2fs/ext2fs.h == --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Dec 1 01:24:40 2012 (r243741) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sat Dec 1 02:02:19 2012 (r243742) @@ -210,15 +210,23 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL0x0004 #define EXT2F_COMPAT_RESIZE0x0010 -#define EXT2F_COMPAT_HTREE 0x0020 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT4F_ROCOMPAT_HUGE_FILE 0x0008 +#define EXT4F_ROCOMPAT_GDT_CSUM0x0010 +#define EXT4F_ROCOMPAT_DIR_NLINK 0x0020 #define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040 #define EXT2F_INCOMPAT_COMP0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT4F_INCOMPAT_META_BG 0x0010 +#define EXT4F_INCOMPAT_EXTENTS 0x0040 +#define EXT4F_INCOMPAT_64BIT 0x0080 +#define EXT4F_INCOMPAT_MMP 0x0100 +#define EXT4F_INCOMPAT_FLEX_BG 0x0200 /* * Features supported in this implementation ___ 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: r243726 - in head/sys: kern security/audit
On Fri, Nov 30, 2012 at 11:18:49PM +, Pawel Jakub Dawidek wrote: Modified: head/sys/security/audit/audit_bsm_klib.c == --- head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:13:56 2012 (r243725) +++ head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:18:49 2012 (r243726) @@ -462,13 +462,13 @@ auditon_command_event(int cmd) * leave the filename starting with '/' in the audit log in this case. */ void -audit_canon_path(struct thread *td, char *path, char *cpath) +audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath) { struct vnode *cvnp, *rvnp; char *rbuf, *fbuf, *copy; struct filedesc *fdp; struct sbuf sbf; - int error, cwir; + int error, needslash, vfslocked; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, %s: at %s:%d, __func__, __FILE__, __LINE__); @@ -491,10 +491,27 @@ audit_canon_path(struct thread *td, char * path. */ if (*path != '/') { - cvnp = fdp-fd_cdir; - vhold(cvnp); + if (dirfd == AT_FDCWD) { + cvnp = fdp-fd_cdir; + vhold(cvnp); + } else { + /* XXX: fgetvp() that vhold()s vnode instead of vref()ing it would be better */ This line is too long. + error = fgetvp(td, dirfd, 0, cvnp); + if (error) { + cpath[0] = '\0'; + if (rvnp != NULL) + vdrop(rvnp); + return; + } + vhold(cvnp); + vfslocked = VFS_LOCK_GIANT(cvnp-v_mount); + vrele(cvnp); + VFS_UNLOCK_GIANT(vfslocked); And this cannot compile. pgpdSccrU8Jh2.pgp Description: PGP signature
svn commit: r243743 - in head/sys/dev/ath/ath_hal: . ar5416
Author: adrian Date: Sat Dec 1 03:48:11 2012 New Revision: 243743 URL: http://svnweb.freebsd.org/changeset/base/243743 Log: Add a new HAL capability - check and enforce whether the NIC supports enforcing the TXOP and TBTT limits: * Frames which will overlap with TBTT will not TX; * Frames which will exceed TXOP will be filtered. This is not enabled by default; it's intended to be enabled by the TDMA code on 802.11n capable chipsets. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h == --- head/sys/dev/ath/ath_hal/ah.h Sat Dec 1 02:02:19 2012 (r243742) +++ head/sys/dev/ath/ath_hal/ah.h Sat Dec 1 03:48:11 2012 (r243743) @@ -192,6 +192,7 @@ typedef enum { HAL_CAP_LONG_RXDESC_TSF = 243, /* hardware supports 32bit TSF in RX descriptor */ HAL_CAP_BB_READ_WAR = 244, /* baseband read WAR */ HAL_CAP_SERIALISE_WAR = 245, /* serialise register access on PCI */ + HAL_CAP_ENFORCE_TXOP= 246, /* Enforce TXOP if supported */ } HAL_CAPABILITY_TYPE; /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Dec 1 02:02:19 2012(r243742) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Dec 1 03:48:11 2012(r243743) @@ -451,6 +451,10 @@ ar5416GetCapability(struct ath_hal *ah, HAL_OK : HAL_ENOTSUPP; case HAL_CAP_DIVERSITY: /* disable classic fast diversity */ return HAL_ENXIO; + case HAL_CAP_ENFORCE_TXOP: + (*result) = + !! (AH5212(ah)-ah_miscMode AR_PCU_TXOP_TBTT_LIMIT_ENA); + return (HAL_OK); default: break; } @@ -480,6 +484,19 @@ ar5416SetCapability(struct ath_hal *ah, else pCap-halTxStreams = 1; return AH_TRUE; + case HAL_CAP_ENFORCE_TXOP: + if (setting) { + AH5212(ah)-ah_miscMode + |= AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_SET_BIT(ah, AR_MISC_MODE, + AR_PCU_TXOP_TBTT_LIMIT_ENA); + } else { + AH5212(ah)-ah_miscMode + = ~AR_PCU_TXOP_TBTT_LIMIT_ENA; + OS_REG_CLR_BIT(ah, AR_MISC_MODE, + AR_PCU_TXOP_TBTT_LIMIT_ENA); + } + return AH_TRUE; default: break; } ___ 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