svn commit: r244483 - in stable/9/sys: netinet netinet6
Author: ae Date: Thu Dec 20 11:10:23 2012 New Revision: 244483 URL: http://svnweb.freebsd.org/changeset/base/244483 Log: MFC r244360: Use M_PROTO7 flag for M_IP6_NEXTHOP, because M_PROTO2 was used for M_AUTHIPHDR. MFC r244365: Since we use different flags to detect tcp forwarding, and we share the same code for IPv4 and IPv6 in tcp_input, we should check both M_IP_NEXTHOP and M_IP6_NEXTHOP flags. MFC r244386 (by glebius): Clear correct flag in INET6 case. MFC r244387 (by glebius): Fix !INET6 build after r244365. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet6/ip6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c == --- stable/9/sys/netinet/tcp_input.cThu Dec 20 05:02:12 2012 (r244482) +++ stable/9/sys/netinet/tcp_input.cThu Dec 20 11:10:23 2012 (r244483) @@ -792,7 +792,17 @@ findpcb: /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - if (m->m_flags & M_IP_NEXTHOP) +if ( +#ifdef INET6 + (isipv6 && (m->m_flags & M_IP6_NEXTHOP)) +#ifdef INET + || (!isipv6 && (m->m_flags & M_IP_NEXTHOP)) +#endif +#endif +#if defined(INET) && !defined(INET6) + (m->m_flags & M_IP_NEXTHOP) +#endif + ) fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); #ifdef INET6 @@ -821,7 +831,7 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); - m->m_flags &= ~M_IP_NEXTHOP; + m->m_flags &= ~M_IP6_NEXTHOP; fwd_tag = NULL; } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, Modified: stable/9/sys/netinet6/ip6_var.h == --- stable/9/sys/netinet6/ip6_var.h Thu Dec 20 05:02:12 2012 (r244482) +++ stable/9/sys/netinet6/ip6_var.h Thu Dec 20 11:10:23 2012 (r244483) @@ -285,7 +285,7 @@ struct ip6aux { #defineIPV6_FORWARDING 0x02/* most of IPv6 header exists */ #defineIPV6_MINMTU 0x04/* use minimum MTU (IPV6_USE_MIN_MTU) */ -#defineM_IP6_NEXTHOP M_PROTO2/* explicit ip nexthop */ +#defineM_IP6_NEXTHOP M_PROTO7/* explicit ip nexthop */ #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 ___ 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: r244484 - head/etc/periodic/daily
Author: bapt Date: Thu Dec 20 11:39:20 2012 New Revision: 244484 URL: http://svnweb.freebsd.org/changeset/base/244484 Log: make installation of the 220.backup-pkgdb periodic script depend on PKGTOOLS knob Modified: head/etc/periodic/daily/Makefile Modified: head/etc/periodic/daily/Makefile == --- head/etc/periodic/daily/MakefileThu Dec 20 11:10:23 2012 (r244483) +++ head/etc/periodic/daily/MakefileThu Dec 20 11:39:20 2012 (r244484) @@ -6,7 +6,6 @@ FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ 200.backup-passwd \ - 220.backup-pkgdb \ 330.news \ 400.status-disks \ 405.status-ata-raid \ @@ -41,7 +40,8 @@ FILES+= 480.status-ntpd .endif .if ${MK_PKGTOOLS} != "no" -FILES+=490.status-pkg-changes +FILES+=220.backup-pkgdb \ + 490.status-pkg-changes .endif .if ${MK_RCMDS} != "no" ___ 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: r244489 - head/sys/dev/usb/serial
Author: hselasky Date: Thu Dec 20 16:21:02 2012 New Revision: 244489 URL: http://svnweb.freebsd.org/changeset/base/244489 Log: Make sure we block recursion on TTY's inwakeup callback Suggested by: davide MFC after:1 week Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h Modified: head/sys/dev/usb/serial/usb_serial.c == --- head/sys/dev/usb/serial/usb_serial.cThu Dec 20 13:27:43 2012 (r244488) +++ head/sys/dev/usb/serial/usb_serial.cThu Dec 20 16:21:02 2012 (r244489) @@ -797,10 +797,14 @@ ucom_inwakeup(struct tty *tp) DPRINTF("tp=%p\n", tp); if (ttydisc_can_bypass(tp) != 0 || - (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { + (sc->sc_flag & UCOM_FLAG_HL_READY) == 0 || + (sc->sc_flag & UCOM_FLAG_INWAKEUP) != 0) { return; } + /* prevent recursion */ + sc->sc_flag |= UCOM_FLAG_INWAKEUP; + pos = sc->sc_jitterbuf_out; while (sc->sc_jitterbuf_in != pos) { @@ -821,6 +825,8 @@ ucom_inwakeup(struct tty *tp) if ((sc->sc_jitterbuf_in == pos) && (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) ucom_rts(sc, 0); + + sc->sc_flag &= ~UCOM_FLAG_INWAKEUP; } static int Modified: head/sys/dev/usb/serial/usb_serial.h == --- head/sys/dev/usb/serial/usb_serial.hThu Dec 20 13:27:43 2012 (r244488) +++ head/sys/dev/usb/serial/usb_serial.hThu Dec 20 16:21:02 2012 (r244489) @@ -183,6 +183,7 @@ struct ucom_softc { #defineUCOM_FLAG_CONSOLE 0x80/* set if device is a console */ #defineUCOM_FLAG_WAIT_REFS 0x0100/* set if we must wait for refs */ #defineUCOM_FLAG_FREE_UNIT 0x0200/* set if we must free the unit */ +#defineUCOM_FLAG_INWAKEUP0x0400/* set if we are in the tsw_inwakeup callback */ uint8_t sc_lsr; uint8_t sc_msr; uint8_t sc_mcr; ___ 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: r244491 - head/sys/dev/usb/storage
Author: hselasky Date: Thu Dec 20 17:14:10 2012 New Revision: 244491 URL: http://svnweb.freebsd.org/changeset/base/244491 Log: Add support for throttling UMASS. Mostly useful for debugging purposes. MFC after:1 week Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c == --- head/sys/dev/usb/storage/umass.cThu Dec 20 17:13:01 2012 (r244490) +++ head/sys/dev/usb/storage/umass.cThu Dec 20 17:14:10 2012 (r244491) @@ -163,12 +163,16 @@ __FBSDID("$FreeBSD$"); #defineUDMASS_CBI 0x0040 /* CBI transfers */ #defineUDMASS_WIRE (UDMASS_BBB|UDMASS_CBI) #defineUDMASS_ALL 0x /* all of the above */ -static int umass_debug = 0; +static int umass_debug; +static int umass_throttle; static SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &umass_debug, 0, "umass debug level"); TUNABLE_INT("hw.usb.umass.debug", &umass_debug); +SYSCTL_INT(_hw_usb_umass, OID_AUTO, throttle, CTLFLAG_RW | CTLFLAG_TUN, +&umass_throttle, 0, "Forced delay between commands in milliseconds"); +TUNABLE_INT("hw.usb.umass.throttle", &umass_throttle); #else #defineDIF(...) do { } while (0) #defineDPRINTF(...) do { } while (0) @@ -881,7 +885,7 @@ umass_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct umass_probe_proto temp = umass_probe_proto(dev, uaa); struct usb_interface_descriptor *id; - int32_t err; + int err; /* * NOTE: the softc struct is cleared in device_set_driver. @@ -994,6 +998,24 @@ umass_attach(device_t dev) "transfers, %s\n", usbd_errstr(err)); goto detach; } +#ifdef USB_DEBUG + if (umass_throttle > 0) { + uint8_t x; + int iv; + + iv = umass_throttle; + + if (iv < 1) + iv = 1; + else if (iv > 8000) + iv = 8000; + + for (x = 0; x != UMASS_T_MAX; x++) { + if (sc->sc_xfer[x] != NULL) + usbd_xfer_set_interval(sc->sc_xfer[x], iv); + } + } +#endif sc->sc_transform = (sc->sc_proto & UMASS_PROTO_SCSI) ? &umass_scsi_transform : (sc->sc_proto & UMASS_PROTO_UFI) ? &umass_ufi_transform : ___ 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: r244493 - head/usr.bin/grep
Author: eadler Date: Thu Dec 20 17:38:14 2012 New Revision: 244493 URL: http://svnweb.freebsd.org/changeset/base/244493 Log: Make bsdgrep behave as gnugrep and as documented: -m should only stop reading the specific file, not any file. Tested by:frogs (irc) Reviewed by: gabor Approved by: cperciva (implicit) MFC after:1 week Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/usr.bin/grep/grep.c == --- head/usr.bin/grep/grep.cThu Dec 20 17:23:40 2012(r244492) +++ head/usr.bin/grep/grep.cThu Dec 20 17:38:14 2012(r244493) @@ -108,6 +108,7 @@ bool iflag; /* -i: ignore case */ boollflag; /* -l: only show names of files with matches */ boolmflag; /* -m x: stop reading the files after x matches */ long long mcount; /* count for -m */ +long long mlimit; /* requested value for -m */ boolnflag; /* -n: show line numbers in front of matching lines */ booloflag; /* -o: print only matching part */ boolqflag; /* -q: quiet mode (don't output anything) */ @@ -524,7 +525,7 @@ main(int argc, char *argv[]) case 'm': mflag = true; errno = 0; - mcount = strtoll(optarg, &ep, 10); + mlimit = mcount = strtoll(optarg, &ep, 10); if (((errno == ERANGE) && (mcount == LLONG_MAX)) || ((errno == EINVAL) && (mcount == 0))) err(2, NULL); Modified: head/usr.bin/grep/grep.h == --- head/usr.bin/grep/grep.hThu Dec 20 17:23:40 2012(r244492) +++ head/usr.bin/grep/grep.hThu Dec 20 17:38:14 2012(r244493) @@ -115,6 +115,7 @@ extern bool Eflag, Fflag, Gflag, Hflag, extern bool dexclude, dinclude, fexclude, finclude, lbflag, nullflag; extern unsigned long long Aflag, Bflag; extern long long mcount; +extern long long mlimit; extern char*label; extern const char *color; extern int binbehave, devbehave, dirbehave, filebehave, grepbehave, linkbehave; Modified: head/usr.bin/grep/util.c == --- head/usr.bin/grep/util.cThu Dec 20 17:23:40 2012(r244492) +++ head/usr.bin/grep/util.cThu Dec 20 17:38:14 2012(r244493) @@ -176,8 +176,7 @@ procfile(const char *fn) mode_t s; int c, t; - if (mflag && (mcount <= 0)) - return (0); + mcount = mlimit; if (strcmp(fn, "-") == 0) { fn = label != NULL ? label : getstr(1); ___ 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: r244497 - stable/8/usr.bin/fetch
Author: eadler Date: Thu Dec 20 18:13:04 2012 New Revision: 244497 URL: http://svnweb.freebsd.org/changeset/base/244497 Log: MFC r244037: Add check for failure of mkstemp and setenv. Approved by: cperciva (implicit) Modified: stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/usr.bin/fetch/fetch.c == --- stable/8/usr.bin/fetch/fetch.c Thu Dec 20 18:12:40 2012 (r244496) +++ stable/8/usr.bin/fetch/fetch.c Thu Dec 20 18:13:04 2012 (r244497) @@ -604,7 +604,10 @@ fetch(char *URL, const char *path) asprintf(&tmppath, "%.*s.fetch.XX.%s", (int)(slash - path), path, slash); if (tmppath != NULL) { - mkstemps(tmppath, strlen(slash) + 1); + if (mkstemps(tmppath, strlen(slash) + 1) == -1) { + warn("%s: mkstemps()", path); + goto failure; + } of = fopen(tmppath, "w"); chown(tmppath, sb.st_uid, sb.st_gid); chmod(tmppath, sb.st_mode & ALLPERMS); @@ -974,7 +977,8 @@ main(int argc, char *argv[]) if (v_tty) fetchAuthMethod = query_auth; if (N_filename != NULL) - setenv("NETRC", N_filename, 1); + if (setenv("NETRC", N_filename, 1) == -1) + err(1, "setenv: cannot set NETRC=%s", N_filename); while (argc) { if ((p = strrchr(*argv, '/')) == 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: r244498 - stable/7/usr.bin/fetch
Author: eadler Date: Thu Dec 20 18:13:04 2012 New Revision: 244498 URL: http://svnweb.freebsd.org/changeset/base/244498 Log: MFC r244037: Add check for failure of mkstemp and setenv. Approved by: cperciva (implicit) Modified: stable/7/usr.bin/fetch/fetch.c Directory Properties: stable/7/usr.bin/fetch/ (props changed) Modified: stable/7/usr.bin/fetch/fetch.c == --- stable/7/usr.bin/fetch/fetch.c Thu Dec 20 18:13:04 2012 (r244497) +++ stable/7/usr.bin/fetch/fetch.c Thu Dec 20 18:13:04 2012 (r244498) @@ -604,7 +604,10 @@ fetch(char *URL, const char *path) asprintf(&tmppath, "%.*s.fetch.XX.%s", (int)(slash - path), path, slash); if (tmppath != NULL) { - mkstemps(tmppath, strlen(slash) + 1); + if (mkstemps(tmppath, strlen(slash) + 1) == -1) { + warn("%s: mkstemps()", path); + goto failure; + } of = fopen(tmppath, "w"); chown(tmppath, sb.st_uid, sb.st_gid); chmod(tmppath, sb.st_mode & ALLPERMS); @@ -969,7 +972,8 @@ main(int argc, char *argv[]) if (v_tty) fetchAuthMethod = query_auth; if (N_filename != NULL) - setenv("NETRC", N_filename, 1); + if (setenv("NETRC", N_filename, 1) == -1) + err(1, "setenv: cannot set NETRC=%s", N_filename); while (argc) { if ((p = strrchr(*argv, '/')) == 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: r244499 - stable/9/usr.bin/fetch
Author: eadler Date: Thu Dec 20 18:13:04 2012 New Revision: 244499 URL: http://svnweb.freebsd.org/changeset/base/244499 Log: MFC r244037: Add check for failure of mkstemp and setenv. Approved by: cperciva (implicit) Modified: stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.c == --- stable/9/usr.bin/fetch/fetch.c Thu Dec 20 18:13:04 2012 (r244498) +++ stable/9/usr.bin/fetch/fetch.c Thu Dec 20 18:13:04 2012 (r244499) @@ -604,7 +604,10 @@ fetch(char *URL, const char *path) asprintf(&tmppath, "%.*s.fetch.XX.%s", (int)(slash - path), path, slash); if (tmppath != NULL) { - mkstemps(tmppath, strlen(slash) + 1); + if (mkstemps(tmppath, strlen(slash) + 1) == -1) { + warn("%s: mkstemps()", path); + goto failure; + } of = fopen(tmppath, "w"); chown(tmppath, sb.st_uid, sb.st_gid); chmod(tmppath, sb.st_mode & ALLPERMS); @@ -974,7 +977,8 @@ main(int argc, char *argv[]) if (v_tty) fetchAuthMethod = query_auth; if (N_filename != NULL) - setenv("NETRC", N_filename, 1); + if (setenv("NETRC", N_filename, 1) == -1) + err(1, "setenv: cannot set NETRC=%s", N_filename); while (argc) { if ((p = strrchr(*argv, '/')) == 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: r244500 - head/sys/dev/usb
Author: hselasky Date: Thu Dec 20 18:13:37 2012 New Revision: 244500 URL: http://svnweb.freebsd.org/changeset/base/244500 Log: Allocate separate USB buffers for DMA'ed data, so that DMA data does not reside next to non DMA data. This might cause more memory to be allocated, but solves problems on platforms using manual cache synchronization. Add a convenience function to get the buffer only from a USB transfer's page cache structure. MFC after:1 week Suggested by: imp Modified: head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usb_transfer.c == --- head/sys/dev/usb/usb_transfer.c Thu Dec 20 18:13:04 2012 (r244499) +++ head/sys/dev/usb/usb_transfer.c Thu Dec 20 18:13:37 2012 (r244500) @@ -181,6 +181,10 @@ usbd_get_dma_delay(struct usb_device *ud * according to "size", "align" and "count" arguments. "ppc" is * pointed to a linear array of USB page caches afterwards. * + * If the "align" argument is equal to "1" a non-contiguous allocation + * can happen. Else if the "align" argument is greater than "1", the + * allocation will always be contiguous in memory. + * * Returns: *0: Success * Else: Failure @@ -195,13 +199,14 @@ usbd_transfer_setup_sub_malloc(struct us struct usb_page *pg; void *buf; usb_size_t n_dma_pc; + usb_size_t n_dma_pg; usb_size_t n_obj; usb_size_t x; usb_size_t y; usb_size_t r; usb_size_t z; - USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x\n", + USB_ASSERT(align > 0, ("Invalid alignment, 0x%08x\n", align)); USB_ASSERT(size > 0, ("Invalid size = 0\n")); @@ -217,8 +222,14 @@ usbd_transfer_setup_sub_malloc(struct us * Try multi-allocation chunks to reduce the number of DMA * allocations, hence DMA allocations are slow. */ - if (size >= USB_PAGE_SIZE) { + if (align == 1) { + /* special case - non-cached multi page DMA memory */ + n_dma_pc = count; + n_dma_pg = (2 + (size / USB_PAGE_SIZE)); + n_obj = 1; + } else if (size >= USB_PAGE_SIZE) { n_dma_pc = count; + n_dma_pg = 1; n_obj = 1; } else { /* compute number of objects per page */ @@ -228,13 +239,22 @@ usbd_transfer_setup_sub_malloc(struct us * to nearest one: */ n_dma_pc = ((count + n_obj - 1) / n_obj); + n_dma_pg = 1; } + /* +* DMA memory is allocated once, but mapped twice. That's why +* there is one list for auto-free and another list for +* non-auto-free which only holds the mapping and not the +* allocation. +*/ if (parm->buf == NULL) { - /* for the future */ - parm->dma_page_ptr += n_dma_pc; + /* reserve memory (auto-free) */ + parm->dma_page_ptr += n_dma_pc * n_dma_pg; parm->dma_page_cache_ptr += n_dma_pc; - parm->dma_page_ptr += count; + + /* reserve memory (no-auto-free) */ + parm->dma_page_ptr += count * n_dma_pg; parm->xfer_page_cache_ptr += count; return (0); } @@ -272,9 +292,9 @@ usbd_transfer_setup_sub_malloc(struct us buf = parm->dma_page_cache_ptr->buffer; /* Make room for one DMA page cache and one page */ parm->dma_page_cache_ptr++; - pg++; + pg += n_dma_pg; - for (y = 0; (y != n_obj); y++, r--, pc++, pg++) { + for (y = 0; (y != n_obj); y++, r--, pc++, pg += n_dma_pg) { /* Load sub-chunk into DMA */ if (usb_pc_dmamap_create(pc, size)) { @@ -688,12 +708,30 @@ usbd_transfer_setup_sub(struct usb_setup */ if (!xfer->flags.ext_buffer) { +#if USB_HAVE_BUSDMA + struct usb_page_search page_info; + struct usb_page_cache *pc; + if (usbd_transfer_setup_sub_malloc(parm, + &pc, parm->bufsize, 1, 1)) { + parm->err = USB_ERR_NOMEM; + } else if (parm->buf != NULL) { + + usbd_get_page(pc, 0, &page_info); + + xfer->local_buffer = page_info.buffer; + + usbd_xfer_set_frame_offset(xfer, 0, 0); + + if ((type == UE_CONTROL) && (n_frbuffers > 1)) { + usbd_xfer_set_frame_offset(xfer, REQ_SIZE, 1); + } + } +#else /* align data */ parm->size[0] += ((-parm->size[0]) & (USB_HOST_ALIGN - 1)); - if (parm->buf) { - + if (parm->buf != NULL) {
svn commit: r244503 - in head/sys/dev/usb: . storage wlan
Author: hselasky Date: Thu Dec 20 18:38:02 2012 New Revision: 244503 URL: http://svnweb.freebsd.org/changeset/base/244503 Log: Make sure all USB drivers allocate buffer memory through the USB API and/or busdma. The following assumptions have been made: umass - buffers passed from CAM/SCSI layer are OK network - mbufs are OK. Some other nits while at it. MFC after:1 week Suggested by: imp Modified: head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_uathvar.h head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_upgtvar.h head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwvar.h Modified: head/sys/dev/usb/storage/ustorage_fs.c == --- head/sys/dev/usb/storage/ustorage_fs.c Thu Dec 20 18:30:34 2012 (r244502) +++ head/sys/dev/usb/storage/ustorage_fs.c Thu Dec 20 18:38:02 2012 (r244503) @@ -74,7 +74,7 @@ SYSCTL_INT(_hw_usb_ustorage_fs, OID_AUTO /* Define some limits */ #ifndef USTORAGE_FS_BULK_SIZE -#defineUSTORAGE_FS_BULK_SIZE (1UL << 17) /* bytes */ +#defineUSTORAGE_FS_BULK_SIZE (1U << 17) /* bytes */ #endif #ifndefUSTORAGE_FS_MAX_LUN @@ -85,8 +85,6 @@ SYSCTL_INT(_hw_usb_ustorage_fs, OID_AUTO #defineUSTORAGE_QDATA_MAX 40 /* bytes */ #endif -#define sc_cmd_data sc_cbw.CBWCDB - /* * The SCSI ID string must be exactly 28 characters long * exluding the terminating zero. @@ -176,8 +174,9 @@ struct ustorage_fs_lun { struct ustorage_fs_softc { - ustorage_fs_bbb_cbw_t sc_cbw; /* Command Wrapper Block */ - ustorage_fs_bbb_csw_t sc_csw; /* Command Status Block */ + ustorage_fs_bbb_cbw_t *sc_cbw; /* Command Wrapper Block */ + ustorage_fs_bbb_csw_t *sc_csw; /* Command Status Block */ + void *sc_dma_ptr; /* Main data buffer */ struct mtx sc_mtx; @@ -275,7 +274,6 @@ static struct usb_config ustorage_fs_bbb .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = sizeof(ustorage_fs_bbb_cbw_t), - .flags = {.ext_buffer = 1,}, .callback = &ustorage_fs_t_bbb_command_callback, .usb_mode = USB_MODE_DEVICE, }, @@ -295,7 +293,7 @@ static struct usb_config ustorage_fs_bbb .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = USTORAGE_FS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer = 1}, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1}, .callback = &ustorage_fs_t_bbb_data_read_callback, .usb_mode = USB_MODE_DEVICE, }, @@ -315,7 +313,7 @@ static struct usb_config ustorage_fs_bbb .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = sizeof(ustorage_fs_bbb_csw_t), - .flags = {.short_xfer_ok = 1,.ext_buffer = 1,}, + .flags = {.short_xfer_ok = 1}, .callback = &ustorage_fs_t_bbb_status_callback, .usb_mode = USB_MODE_DEVICE, }, @@ -409,6 +407,14 @@ ustorage_fs_attach(device_t dev) "transfers, %s\n", usbd_errstr(err)); goto detach; } + + sc->sc_cbw = usbd_xfer_get_frame_buffer(sc->sc_xfer[ + USTORAGE_FS_T_BBB_COMMAND], 0); + sc->sc_csw = usbd_xfer_get_frame_buffer(sc->sc_xfer[ + USTORAGE_FS_T_BBB_STATUS], 0); + sc->sc_dma_ptr = usbd_xfer_get_frame_buffer(sc->sc_xfer[ + USTORAGE_FS_T_BBB_DATA_READ], 0); + /* start Mass Storage State Machine */ mtx_lock(&sc->sc_mtx); @@ -518,44 +524,44 @@ ustorage_fs_t_bbb_command_callback(struc switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - tag = UGETDW(sc->sc_cbw.dCBWSignature); + tag = UGETDW(sc->sc_cbw->dCBWSignature); if (tag != CBWSIGNATURE) { /* do nothing */ DPRINTF("invalid signature 0x%08x\n", tag); break; } - tag = UGETDW(sc->sc_cbw.dCBWTag); + tag = UGETDW(sc->sc_cbw->dCBWTag); /* echo back tag */ - USETDW(sc->sc_csw.dCSWTag, tag); + USETDW(sc->sc_csw->dCSWTag, tag); /* reset status */ - sc->sc_csw.bCSWStatus = 0; + sc->sc_csw->bCSWStatus = 0; /* reset data offset, data length and data remainder */ sc->sc_transfer.offset = 0; sc->sc_transfer.data_rem = - UGETDW(sc->sc_cbw.dCBWDataTransferLength); + UGETDW(sc->sc_cbw->dCBWDataTransferLength); /* reset data flags */
svn commit: r244508 - head/sys/cam/scsi
Author: mav Date: Thu Dec 20 19:51:32 2012 New Revision: 244508 URL: http://svnweb.freebsd.org/changeset/base/244508 Log: Make SES driver to not fall out on some errors in Additional Status page. This allows CAM devices still get their physical paths even if status of later elements it corrupted. Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c == --- head/sys/cam/scsi/scsi_enc_ses.cThu Dec 20 19:47:46 2012 (r244507) +++ head/sys/cam/scsi/scsi_enc_ses.cThu Dec 20 19:51:32 2012 (r244508) @@ -1801,8 +1801,7 @@ ses_process_elm_addlstatus(enc_softc_t * ENC_VLOG(enc, "Element %d Beyond End " "of Additional Element Status Descriptors\n", iter.global_element_index); - err = EIO; - goto out; + break; } /* Advance to the protocol data, skipping eip bytes if needed */ @@ -1831,7 +1830,7 @@ ses_process_elm_addlstatus(enc_softc_t * ENC_VLOG(enc, "Element %d: Unknown Additional Element " "Protocol 0x%x\n", iter.global_element_index, ses_elm_addlstatus_proto(elmpriv->addl.hdr)); - goto out; + break; } offset += proto_info_len; ___ 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: r244510 - head/sys/kern
Author: des Date: Thu Dec 20 20:18:27 2012 New Revision: 244510 URL: http://svnweb.freebsd.org/changeset/base/244510 Log: Rewrite fdgrowtable() so common mortals can actually understand what it does and how, and add comments describing the data structures and explaining how they are managed. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cThu Dec 20 19:59:13 2012 (r244509) +++ head/sys/kern/kern_descrip.cThu Dec 20 20:18:27 2012 (r244510) @@ -133,12 +133,26 @@ static intfill_socket_info(struct socke static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif); /* - * A process is initially started out with NDFILE descriptors stored within - * this structure, selected to be enough for typical applications based on - * the historical limit of 20 open files (and the usage of descriptors by - * shells). If these descriptors are exhausted, a larger descriptor table - * may be allocated, up to a process' resource limit; the internal arrays - * are then unused. + * Each process has: + * + * - An array of open file descriptors (fd_ofiles) + * - An array of file flags (fd_ofileflags) + * - A bitmap recording which descriptors are in use (fd_map) + * + * A process starts out with NDFILE descriptors. The value of NDFILE has + * been selected based the historical limit of 20 open files, and an + * assumption that the majority of processes, especially short-lived + * processes like shells, will never need more. + * + * If this initial allocation is exhausted, a larger descriptor table and + * map are allocated dynamically, and the pointers in the process's struct + * filedesc are updated to point to those. This is repeated every time + * the process runs out of file descriptors (provided it hasn't hit its + * resource limit). + * + * Since threads may hold references to individual descriptor table + * entries, the tables are never freed. Instead, they are placed on a + * linked list and freed only when the struct filedesc is released. */ #define NDFILE 20 #define NDSLOTSIZE sizeof(NDSLOTTYPE) @@ -148,34 +162,23 @@ static intfill_vnode_info(struct vnode #defineNDSLOTS(x) (((x) + NDENTRIES - 1) / NDENTRIES) /* - * Storage required per open file descriptor. - */ -#define OFILESIZE (sizeof(struct file *) + sizeof(char)) - -/* - * Storage to hold unused ofiles that need to be reclaimed. + * SLIST entry used to keep track of ofiles which must be reclaimed when + * the process exits. */ struct freetable { - struct file **ft_table; + struct file **ft_table; SLIST_ENTRY(freetable) ft_next; }; /* - * Basic allocation of descriptors: - * one of the above, plus arrays for NDFILE descriptors. + * Initial allocation: a filedesc structure + the head of SLIST used to + * keep track of old ofiles + enough space for NDFILE descriptors. */ struct filedesc0 { - struct filedesc fd_fd; - /* -* ofiles which need to be reclaimed on free. -*/ - SLIST_HEAD(,freetable) fd_free; - /* -* These arrays are used when the number of open files is -* <= NDFILE, and are then pointed to by the pointers above. -*/ - struct file *fd_dfiles[NDFILE]; - charfd_dfileflags[NDFILE]; + struct filedesc fd_fd; + SLIST_HEAD(, freetable) fd_free; + struct file *fd_dfiles[NDFILE]; + char fd_dfileflags[NDFILE]; NDSLOTTYPE fd_dmap[NDSLOTS(NDFILE)]; }; @@ -1414,58 +1417,74 @@ static void fdgrowtable(struct filedesc *fdp, int nfd) { struct filedesc0 *fdp0; - struct freetable *fo; + struct freetable *ft; struct file **ntable; struct file **otable; - char *nfileflags; + char *nfileflags, *ofileflags; int nnfiles, onfiles; - NDSLOTTYPE *nmap; + NDSLOTTYPE *nmap, *omap; FILEDESC_XLOCK_ASSERT(fdp); KASSERT(fdp->fd_nfiles > 0, ("zero-length file table")); - /* compute the size of the new table */ + /* save old values */ onfiles = fdp->fd_nfiles; + otable = fdp->fd_ofiles; + ofileflags = fdp->fd_ofileflags; + omap = fdp->fd_map; + + /* compute the size of the new table */ nnfiles = NDSLOTS(nfd) * NDENTRIES; /* round up */ if (nnfiles <= onfiles) /* the table is already large enough */ return; - /* allocate a new table and (if required) new bitmaps */ - ntable = malloc((nnfiles * OFILESIZE) + sizeof(struct freetable), + /* +* Allocate a new table and map. We need enough space for a) the +* file entries themselves, b) the file flags, and c) the struct +* freetable we will use when we decommission the table and place +* it on the freelist.
svn commit: r244512 - head/tools/build/mk
Author: bapt Date: Thu Dec 20 22:07:47 2012 New Revision: 244512 URL: http://svnweb.freebsd.org/changeset/base/244512 Log: Add etc/periodic/daily/220.backup-pkgdb to OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Dec 20 20:41:01 2012(r244511) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Dec 20 22:07:47 2012(r244512) @@ -3688,6 +3688,7 @@ OLD_FILES+=usr/sbin/pkg .endif .if ${MK_PKGTOOLS} == no +OLD_FILES+=etc/periodic/daily/220.backup-pkgdb OLD_FILES+=etc/periodic/daily/490.status-pkg-changes OLD_FILES+=etc/periodic/security/460.chkportsum OLD_FILES+=etc/periodic/weekly/400.status-pkg ___ 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: r244514 - in head/sys/dev: ixgbe netmap
Author: luigi Date: Thu Dec 20 22:26:03 2012 New Revision: 244514 URL: http://svnweb.freebsd.org/changeset/base/244514 Log: rename the 'tag' and 'map' fields used the rx ring to their previous names, 'ptag' and 'pmap' -- p stands for packet. This change reduces the difference between the code in stable/9 and head, and also helps using the same ixgbe_netmap.h on both branches. Approved by: Jack Vogel 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 Thu Dec 20 22:22:57 2012(r244513) +++ head/sys/dev/ixgbe/ixgbe.c Thu Dec 20 22:26:03 2012(r244514) @@ -3721,8 +3721,8 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, */ if ((rxbuf->flags & IXGBE_RX_COPY) == 0) { /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->tag, - rxbuf->map, mp, seg, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, seg, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { printf("Refresh mbufs: payload dmamap load" " failure - %d\n", error); @@ -3731,7 +3731,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, goto update; } rxbuf->buf = mp; - bus_dmamap_sync(rxr->tag, rxbuf->map, + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_PREREAD); rxbuf->addr = rxr->rx_base[i].read.pkt_addr = htole64(seg[0].ds_addr); @@ -3790,15 +3790,15 @@ ixgbe_allocate_receive_buffers(struct rx 0, /* flags */ NULL,/* lockfunc */ NULL,/* lockfuncarg */ - &rxr->tag))) { + &rxr->ptag))) { device_printf(dev, "Unable to create RX DMA tag\n"); goto fail; } for (i = 0; i < rxr->num_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->tag, - BUS_DMA_NOWAIT, &rxbuf->map); + error = bus_dmamap_create(rxr->ptag, + BUS_DMA_NOWAIT, &rxbuf->pmap); if (error) { device_printf(dev, "Unable to create RX dma map\n"); goto fail; @@ -3897,9 +3897,9 @@ ixgbe_free_receive_ring(struct rx_ring * for (i = 0; i < rxr->num_desc; i++) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->buf != NULL) { - bus_dmamap_sync(rxr->tag, rxbuf->map, + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->tag, rxbuf->map); + bus_dmamap_unload(rxr->ptag, rxbuf->pmap); rxbuf->buf->m_flags |= M_PKTHDR; m_freem(rxbuf->buf); rxbuf->buf = NULL; @@ -3966,7 +3966,7 @@ ixgbe_setup_receive_ring(struct rx_ring void *addr; addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->tag, rxbuf->map, addr); + netmap_load_map(rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ rxr->rx_base[j].read.pkt_addr = htole64(paddr); continue; @@ -3981,13 +3981,13 @@ ixgbe_setup_receive_ring(struct rx_ring mp = rxbuf->buf; mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->tag, - rxbuf->map, mp, seg, + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, seg, &nsegs, BUS_DMA_NOWAIT); if (error != 0) goto fail; - bus_dmamap_sync(rxr->tag, - rxbuf->map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(rxr->ptag, + rxbuf->pmap, BUS_DMASYNC_PREREAD); /* Update descriptor */ rxr->rx_base[j].read.pkt_addr = htole64(seg[0].ds_addr); } @@ -4237,16 +4237,16 @@ ixgbe_free_receive_buffers(struct rx_rin for (int i = 0; i < adapter->num_rx_desc; i++) { rxbuf = &rxr->rx_buffers[i];
svn commit: r244515 - head/usr.bin/sort
Author: gabor Date: Thu Dec 20 22:30:40 2012 New Revision: 244515 URL: http://svnweb.freebsd.org/changeset/base/244515 Log: - Change the memory heuristics to an actually working one Submitted by: Oleg Moskalenko Prodded by: kib Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c == --- head/usr.bin/sort/sort.cThu Dec 20 22:26:03 2012(r244514) +++ head/usr.bin/sort/sort.cThu Dec 20 22:30:40 2012(r244515) @@ -265,33 +265,27 @@ read_fns_from_file0(const char *fn) static void set_hw_params(void) { -#if defined(SORT_THREADS) - size_t ncpusz; -#endif - unsigned int pages, psize; - size_t psz, pszsz; + long pages, psize; pages = psize = 0; + #if defined(SORT_THREADS) ncpu = 1; - ncpusz = sizeof(size_t); #endif - psz = sizeof(pages); - pszsz = sizeof(psize); - if (sysctlbyname("vm.stats.vm.v_free_count", &pages, &psz, - NULL, 0) < 0) { - perror("vm.stats.vm.v_free_count"); - return; - } - if (sysctlbyname("vm.stats.vm.v_page_size", &psize, &pszsz, - NULL, 0) < 0) { - perror("vm.stats.vm.v_page_size"); - return; + pages = sysconf(_SC_PHYS_PAGES); + if (pages < 1) { + perror("sysconf pages"); + psize = 1; + } + psize = sysconf(_SC_PAGESIZE); + if (psize < 1) { + perror("sysconf psize"); + psize = 4096; } #if defined(SORT_THREADS) - if (sysctlbyname("hw.ncpu", &ncpu, &ncpusz, - NULL, 0) < 0) + ncpu = (unsigned int)sysconf(_SC_NPROCESSORS_ONLN); + if (ncpu < 1) ncpu = 1; else if(ncpu > 32) ncpu = 32; @@ -300,7 +294,7 @@ set_hw_params(void) #endif free_memory = (unsigned long long) pages * (unsigned long long) psize; - available_free_memory = (free_memory * 9) / 10; + available_free_memory = free_memory / 2; if (available_free_memory < 1024) available_free_memory = 1024; @@ -1232,7 +1226,9 @@ main(int argc, char **argv) } if (debug_sort) { + printf("Memory to be used for sorting: %llu\n",available_free_memory); #if defined(SORT_THREADS) + printf("Number of CPUs: %d\n",(int)ncpu); nthreads = 1; #endif printf("Using collate rules of %s locale\n", ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r244522 - head/etc
Author: markj Date: Thu Dec 20 23:18:36 2012 New Revision: 244522 URL: http://svnweb.freebsd.org/changeset/base/244522 Log: Don't reload syslogd after rotating sendmail.st, as this file isn't managed by syslogd. PR: conf/169973 Approved by: rstone (co-mentor) MFC after:1 week Modified: head/etc/newsyslog.conf Modified: head/etc/newsyslog.conf == --- head/etc/newsyslog.conf Thu Dec 20 23:06:47 2012(r244521) +++ head/etc/newsyslog.conf Thu Dec 20 23:18:36 2012(r244522) @@ -33,7 +33,7 @@ /var/log/pflog 600 3 100 * JB /var/run/pflogd.pid /var/log/ppp.log root:network640 3 100 * JC /var/log/security 600 10100 * JC -/var/log/sendmail.st 640 10*168 B +/var/log/sendmail.st 640 10*168 BN /var/log/utx.log 644 3 *@01T05 B /var/log/weekly.log640 5 *$W6D0 JN /var/log/xferlog 600 7 100 * JC ___ 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: r244523 - head/usr.sbin/syslogd
Author: markj Date: Thu Dec 20 23:21:20 2012 New Revision: 244523 URL: http://svnweb.freebsd.org/changeset/base/244523 Log: - Make sure that errno isn't modified before calling logerror() in error conditions. - Don't check for AF_INET6 when compiled without INET6 support. PR: bin/173930 Submitted by: Garrett Cooper Approved by: rstone (co-mentor) MFC after:1 week Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Thu Dec 20 23:18:36 2012 (r244522) +++ head/usr.sbin/syslogd/syslogd.c Thu Dec 20 23:21:20 2012 (r244523) @@ -1873,6 +1873,7 @@ cfline(const char *line, struct filed *f pri = decode(buf, prioritynames); if (pri < 0) { + errno = 0; (void)snprintf(ebuf, sizeof ebuf, "unknown priority name \"%s\"", buf); logerror(ebuf); @@ -1901,6 +1902,7 @@ cfline(const char *line, struct filed *f } else { i = decode(buf, facilitynames); if (i < 0) { + errno = 0; (void)snprintf(ebuf, sizeof ebuf, "unknown facility name \"%s\"", buf); @@ -2687,6 +2689,7 @@ socksetup(int af, char *bindhostname) logerror("socket"); continue; } +#ifdef INET6 if (r->ai_family == AF_INET6) { if (setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof (on)) < 0) { @@ -2695,6 +2698,7 @@ socksetup(int af, char *bindhostname) continue; } } +#endif if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof (on)) < 0) { logerror("setsockopt"); @@ -2711,8 +2715,8 @@ socksetup(int af, char *bindhostname) */ if (!NoBind) { if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) { - close(*s); logerror("bind"); + close(*s); continue; } ___ 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: r244524 - in stable/9/sys: netinet netinet6
Author: delphij Date: Fri Dec 21 00:41:52 2012 New Revision: 244524 URL: http://svnweb.freebsd.org/changeset/base/244524 Log: MFC r241916: Remove __P. Submitted by: kevlo Modified: stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_var.h stable/9/sys/netinet6/icmp6.c stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/in6.h stable/9/sys/netinet6/in6_gif.h stable/9/sys/netinet6/in6_ifattach.h stable/9/sys/netinet6/in6_pcb.h stable/9/sys/netinet6/in6_src.c stable/9/sys/netinet6/in6_var.h stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h stable/9/sys/netinet6/ip6protosw.h stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6.h stable/9/sys/netinet6/nd6_rtr.c stable/9/sys/netinet6/pim6_var.h stable/9/sys/netinet6/scope6_var.h stable/9/sys/netinet6/sctp6_var.h stable/9/sys/netinet6/tcp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h == --- stable/9/sys/netinet/sctp_uio.h Thu Dec 20 23:21:20 2012 (r244523) +++ stable/9/sys/netinet/sctp_uio.h Fri Dec 21 00:41:52 2012 (r244524) @@ -1267,44 +1267,44 @@ sctp_sorecvmsg(struct socket *so, #if !(defined(_KERNEL)) && !(defined(__Userspace__)) __BEGIN_DECLS -int sctp_peeloff __P((int, sctp_assoc_t)); -int sctp_bindx __P((int, struct sockaddr *, int, int)); -int sctp_connectx __P((int, const struct sockaddr *, int, sctp_assoc_t *)); -int sctp_getaddrlen __P((sa_family_t)); -int sctp_getpaddrs __P((int, sctp_assoc_t, struct sockaddr **)); -void sctp_freepaddrs __P((struct sockaddr *)); -int sctp_getladdrs __P((int, sctp_assoc_t, struct sockaddr **)); -void sctp_freeladdrs __P((struct sockaddr *)); -int sctp_opt_info __P((int, sctp_assoc_t, int, void *, socklen_t *)); +int sctp_peeloff(int, sctp_assoc_t); +int sctp_bindx(int, struct sockaddr *, int, int); +int sctp_connectx(int, const struct sockaddr *, int, sctp_assoc_t *); +int sctp_getaddrlen(sa_family_t); +int sctp_getpaddrs(int, sctp_assoc_t, struct sockaddr **); +void sctp_freepaddrs(struct sockaddr *); +int sctp_getladdrs(int, sctp_assoc_t, struct sockaddr **); +void sctp_freeladdrs(struct sockaddr *); +int sctp_opt_info(int, sctp_assoc_t, int, void *, socklen_t *); /* deprecated */ ssize_t sctp_sendmsg -__P((int, const void *, size_t, const struct sockaddr *, -socklen_t, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t)); +(int, const void *, size_t, const struct sockaddr *, +socklen_t, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); /* deprecated */ - ssize_t sctp_send __P((int, const void *, size_t, - const struct sctp_sndrcvinfo *, int)); + ssize_t sctp_send(int, const void *, size_t, + const struct sctp_sndrcvinfo *, int); /* deprecated */ - ssize_t sctp_sendx __P((int, const void *, size_t, struct sockaddr *, - int, struct sctp_sndrcvinfo *, int)); + ssize_t sctp_sendx(int, const void *, size_t, struct sockaddr *, + int, struct sctp_sndrcvinfo *, int); /* deprecated */ - ssize_t sctp_sendmsgx __P((int sd, const void *, size_t, struct sockaddr *, - int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t)); + ssize_t sctp_sendmsgx(int sd, const void *, size_t, struct sockaddr *, + int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); - sctp_assoc_t sctp_getassocid __P((int, struct sockaddr *)); + sctp_assoc_t sctp_getassocid(int, struct sockaddr *); /* deprecated */ - ssize_t sctp_recvmsg __P((int, void *, size_t, struct sockaddr *, socklen_t *, - struct sctp_sndrcvinfo *, int *)); + ssize_t sctp_recvmsg(int, void *, size_t, struct sockaddr *, socklen_t *, + struct sctp_sndrcvinfo *, int *); - ssize_t sctp_sendv __P((int, const struct iovec *, int, struct sockaddr *, - int, void *, socklen_t, unsigned int, int)); + ssize_t sctp_sendv(int, const struct iovec *, int, struct sockaddr *, + int, void *, socklen_t, unsigned int, int); - ssize_t sctp_recvv __P((int, const struct iovec *, int, struct sockaddr *, - socklen_t *, void *, socklen_t *, unsigned int *, int *)); + ssize_t sctp_recvv(int, const struct iovec *, int, struct sockaddr *, + socklen_t *, void *, socklen_t *, unsigned int *, int *); __END_DECLS Modified: stable/9/sys/netinet/sctp_var.h == --- stable/9/sys/netinet/sctp_var.h Thu Dec 20 23:21:20 2012 (r244523) +++ stable/9/sys/netinet/sctp_var.h Fri Dec 21 00:41:52 2012 (r244524) @@ -322,29 +322,29 @@ struct sctphdr; void sctp_close(struct socket *so); int sctp_disconnect(struct socket *so); -void sctp_ctlinput __P((int, struct sockaddr *, void *)); -int sctp_ctloutput
svn commit: r244525 - head/usr.sbin/acpi/acpidump
Author: neel Date: Fri Dec 21 01:19:48 2012 New Revision: 244525 URL: http://svnweb.freebsd.org/changeset/base/244525 Log: Teach acpidump to dump the DMA Remapping Reporting table (aka DMAR). The DMAR table is documented in chapter 8 of the Intel VT-d specification. Reviewed by: jhb Obtained from:NetApp Modified: head/usr.sbin/acpi/acpidump/acpi.c head/usr.sbin/acpi/acpidump/acpidump.8 Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.c Fri Dec 21 00:41:52 2012 (r244524) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Dec 21 01:19:48 2012 (r244525) @@ -123,6 +123,31 @@ static const char *TCPA_pcclient_strings "Table of Devices", }; +#definePRINTFLAG_END() printflag_end() + +static char pf_sep = '{'; + +static void +printflag_end(void) +{ + + if (pf_sep != '{') { + printf("}"); + pf_sep = '{'; + } + printf("\n"); +} + +static void +printflag(uint64_t var, uint64_t mask, const char *name) +{ + + if (var & mask) { + printf("%c%s", pf_sep, name); + pf_sep = ','; + } +} + static void acpi_print_string(char *s, size_t length) { @@ -729,6 +754,238 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); } +static const char * +devscope_type2str(int type) +{ + static char typebuf[16]; + + switch (type) { + case 1: + return ("PCI Endpoint Device"); + case 2: + return ("PCI Sub-Hierarchy"); + case 3: + return ("IOAPIC"); + case 4: + return ("HPET"); + default: + snprintf(typebuf, sizeof(typebuf), "%d", type); + return (typebuf); + } +} + +static int +acpi_handle_dmar_devscope(void *addr, int remaining) +{ + char sep; + int pathlen; + ACPI_DMAR_PCI_PATH *path, *pathend; + ACPI_DMAR_DEVICE_SCOPE *devscope = addr; + + if (remaining < (int)sizeof(ACPI_DMAR_DEVICE_SCOPE)) + return (-1); + + if (remaining < devscope->Length) + return (-1); + + printf("\n"); + printf("\t\tType=%s\n", devscope_type2str(devscope->EntryType)); + printf("\t\tLength=%d\n", devscope->Length); + printf("\t\tEnumerationId=%d\n", devscope->EnumerationId); + printf("\t\tStartBusNumber=%d\n", devscope->Bus); + + path = (ACPI_DMAR_PCI_PATH *)(devscope + 1); + pathlen = devscope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE); + pathend = path + pathlen / sizeof(ACPI_DMAR_PCI_PATH); + if (path < pathend) { + sep = '{'; + printf("\t\tPath="); + do { + printf("%c%d:%d", sep, path->Device, path->Function); + sep=','; + path++; + } while (path < pathend); + printf("}\n"); + } + + return (devscope->Length); +} + +static void +acpi_handle_dmar_drhd(ACPI_DMAR_HARDWARE_UNIT *drhd) +{ + char *cp; + int remaining, consumed; + + printf("\n"); + printf("\tType=DRHD\n"); + printf("\tLength=%d\n", drhd->Header.Length); + +#definePRINTFLAG(var, flag)printflag((var), ACPI_DMAR_## flag, #flag) + + printf("\tFlags="); + PRINTFLAG(drhd->Flags, INCLUDE_ALL); + PRINTFLAG_END(); + +#undef PRINTFLAG + + printf("\tSegment=%d\n", drhd->Segment); + printf("\tAddress=0x%0jx\n", drhd->Address); + + remaining = drhd->Header.Length - sizeof(ACPI_DMAR_HARDWARE_UNIT); + if (remaining > 0) + printf("\tDevice Scope:"); + while (remaining > 0) { + cp = (char *)drhd + drhd->Header.Length - remaining; + consumed = acpi_handle_dmar_devscope(cp, remaining); + if (consumed <= 0) + break; + else + remaining -= consumed; + } +} + +static void +acpi_handle_dmar_rmrr(ACPI_DMAR_RESERVED_MEMORY *rmrr) +{ + char *cp; + int remaining, consumed; + + printf("\n"); + printf("\tType=RMRR\n"); + printf("\tLength=%d\n", rmrr->Header.Length); + printf("\tSegment=%d\n", rmrr->Segment); + printf("\tBaseAddress=0x%0jx\n", rmrr->BaseAddress); + printf("\tLimitAddress=0x%0jx\n", rmrr->EndAddress); + + remaining = rmrr->Header.Length - sizeof(ACPI_DMAR_RESERVED_MEMORY); + if (remaining > 0) + printf("\tDevice Scope:"); + while (remaining > 0) { + cp = (char *)rmrr + rmrr->Header.Length - remaining; + consumed = acpi_handle_dmar_devscope(cp, remaining); + if (consumed <= 0) + break; + else + remaining -= consumed; + } +} + +static void +acpi_handle_dmar_ats
svn commit: r244526 - head/usr.sbin/mptable
Author: neel Date: Fri Dec 21 01:31:56 2012 New Revision: 244526 URL: http://svnweb.freebsd.org/changeset/base/244526 Log: The MPtable specification allows for an 8-bit "BUS ID" and "I/O APIC ID". Since the 'busses[]' and 'apics[]' arrays are indexed by these 8-bit IDs make sure that they have enough space to accomodate up to 256 entries. Submitted by: Ravi Shamanna Obtained from:NetApp Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c == --- head/usr.sbin/mptable/mptable.c Fri Dec 21 01:19:48 2012 (r244525) +++ head/usr.sbin/mptable/mptable.c Fri Dec 21 01:31:56 2012 (r244526) @@ -270,8 +270,8 @@ static void pnstr( char* s, int c ); /* global data */ static int pfd;/* physical /dev/mem fd */ -static int busses[16]; -static int apics[16]; +static int busses[256]; +static int apics[256]; static int ncpu; static int nbus; @@ -711,7 +711,7 @@ MPConfigTableHeader( u_int32_t pap ) printf( "MP Config Base Table Entries:\n\n" ); /* initialze tables */ -for ( x = 0; x < 16; ++x ) { +for ( x = 0; x < 256; ++x ) { busses[ x ] = apics[ x ] = 0xff; } ___ 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: r244526 - head/usr.sbin/mptable
On Thu, Dec 20, 2012 at 5:31 PM, Neel Natu wrote: > Author: neel > Date: Fri Dec 21 01:31:56 2012 > New Revision: 244526 > URL: http://svnweb.freebsd.org/changeset/base/244526 > > Log: > The MPtable specification allows for an 8-bit "BUS ID" and "I/O APIC ID". > > Since the 'busses[]' and 'apics[]' arrays are indexed by these 8-bit IDs > make sure that they have enough space to accomodate up to 256 entries. > > Submitted by: Ravi Shamanna > Obtained from:NetApp > > Modified: > head/usr.sbin/mptable/mptable.c > > Modified: head/usr.sbin/mptable/mptable.c > == > --- head/usr.sbin/mptable/mptable.c Fri Dec 21 01:19:48 2012 > (r244525) > +++ head/usr.sbin/mptable/mptable.c Fri Dec 21 01:31:56 2012 > (r244526) > @@ -270,8 +270,8 @@ static void pnstr( char* s, int c ); > /* global data */ > static int pfd;/* physical /dev/mem fd */ > > -static int busses[16]; > -static int apics[16]; > +static int busses[256]; > +static int apics[256]; > > static int ncpu; > static int nbus; > @@ -711,7 +711,7 @@ MPConfigTableHeader( u_int32_t pap ) > printf( "MP Config Base Table Entries:\n\n" ); > > /* initialze tables */ > -for ( x = 0; x < 16; ++x ) { > +for ( x = 0; x < 256; ++x ) { `nitems(busses)` (requires sys/param.h)? > busses[ x ] = apics[ x ] = 0xff; > > } Thanks, -Garrett ___ 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: r244527 - head/share/mk
Author: emaste Date: Fri Dec 21 02:18:11 2012 New Revision: 244527 URL: http://svnweb.freebsd.org/changeset/base/244527 Log: Sort default option lists Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk == --- head/share/mk/bsd.own.mkFri Dec 21 01:31:56 2012(r244526) +++ head/share/mk/bsd.own.mkFri Dec 21 02:18:11 2012(r244527) @@ -322,9 +322,6 @@ __DEFAULT_YES_OPTIONS = \ BOOT \ BSD_CPIO \ BSNMP \ -SOURCELESS \ -SOURCELESS_HOST \ -SOURCELESS_UCODE \ BZIP2 \ CALENDAR \ CAPSICUM \ @@ -401,10 +398,13 @@ __DEFAULT_YES_OPTIONS = \ SENDMAIL \ SETUID_LOGIN \ SHAREDOCS \ +SOURCELESS \ +SOURCELESS_HOST \ +SOURCELESS_UCODE \ SSP \ -SYSINSTALL \ SYMVER \ SYSCONS \ +SYSINSTALL \ TCSH \ TELNET \ TEXTPROC \ @@ -417,14 +417,14 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ -BMAKE \ -BSD_GREP \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ +BMAKE \ BSDCONFIG \ +BSD_GREP \ CLANG_EXTRAS \ CTF \ HESIOD \ ___ 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: r244529 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Fri Dec 21 04:28:05 2012 New Revision: 244529 URL: http://svnweb.freebsd.org/changeset/base/244529 Log: Note why fast frames is disabled for 802.11n NICs now. It actually works, but net80211 handles A-MPDU and Fast frames incorrectly; it tries enabling both in some instances, with tragic results. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Dec 21 02:42:35 2012(r244528) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Dec 21 04:28:05 2012(r244529) @@ -898,7 +898,13 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halCompressSupport = AH_FALSE; pCap->halBurstSupport = AH_TRUE; - pCap->halFastFramesSupport = AH_FALSE; /* XXX? */ + /* +* This is disabled for now; the net80211 layer needs to be +* taught when it is and isn't appropriate to enable FF processing +* with 802.11n NICs (it tries to enable both A-MPDU and +* fast frames, with very tragic crash-y results.) +*/ + pCap->halFastFramesSupport = AH_FALSE; pCap->halChapTuningSupport = AH_TRUE; pCap->halTurboPrimeSupport = AH_TRUE; ___ 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: r244530 - head/usr.sbin/mptable
Author: neel Date: Fri Dec 21 04:44:40 2012 New Revision: 244530 URL: http://svnweb.freebsd.org/changeset/base/244530 Log: Divine the array size by using 'nitems(array)' instead of using magic numbers. Suggested by: Garrett Cooper Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c == --- head/usr.sbin/mptable/mptable.c Fri Dec 21 04:28:05 2012 (r244529) +++ head/usr.sbin/mptable/mptable.c Fri Dec 21 04:44:40 2012 (r244530) @@ -42,7 +42,7 @@ static const char rcsid[] = #define EXTENDED_PROCESSING_READY #define OEM_PROCESSING_READY_NOT -#include +#include #include #include #include @@ -710,10 +710,12 @@ MPConfigTableHeader( u_int32_t pap ) printf( "MP Config Base Table Entries:\n\n" ); -/* initialze tables */ -for ( x = 0; x < 256; ++x ) { - busses[ x ] = apics[ x ] = 0xff; -} +/* initialize tables */ +for (x = 0; x < (int)nitems(busses); x++) + busses[x] = 0xff; + +for (x = 0; x < (int)nitems(apics); x++) + apics[x] = 0xff; ncpu = 0; nbus = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r244526 - head/usr.sbin/mptable
Hi Garrett, On Thu, Dec 20, 2012 at 6:07 PM, Garrett Cooper wrote: > On Thu, Dec 20, 2012 at 5:31 PM, Neel Natu wrote: >> Author: neel >> Date: Fri Dec 21 01:31:56 2012 >> New Revision: 244526 >> URL: http://svnweb.freebsd.org/changeset/base/244526 >> >> Log: >> The MPtable specification allows for an 8-bit "BUS ID" and "I/O APIC ID". >> >> Since the 'busses[]' and 'apics[]' arrays are indexed by these 8-bit IDs >> make sure that they have enough space to accomodate up to 256 entries. >> >> Submitted by: Ravi Shamanna >> Obtained from:NetApp >> >> Modified: >> head/usr.sbin/mptable/mptable.c >> >> Modified: head/usr.sbin/mptable/mptable.c >> == >> --- head/usr.sbin/mptable/mptable.c Fri Dec 21 01:19:48 2012 >> (r244525) >> +++ head/usr.sbin/mptable/mptable.c Fri Dec 21 01:31:56 2012 >> (r244526) >> @@ -270,8 +270,8 @@ static void pnstr( char* s, int c ); >> /* global data */ >> static int pfd;/* physical /dev/mem fd */ >> >> -static int busses[16]; >> -static int apics[16]; >> +static int busses[256]; >> +static int apics[256]; >> >> static int ncpu; >> static int nbus; >> @@ -711,7 +711,7 @@ MPConfigTableHeader( u_int32_t pap ) >> printf( "MP Config Base Table Entries:\n\n" ); >> >> /* initialze tables */ >> -for ( x = 0; x < 16; ++x ) { >> +for ( x = 0; x < 256; ++x ) { > > `nitems(busses)` (requires sys/param.h)? Sure. Fixed in: http://svnweb.freebsd.org/base?view=revision&revision=244530 best Neel > >> busses[ x ] = apics[ x ] = 0xff; >> >> } > > Thanks, > -Garrett ___ 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: r244531 - in head/sys/boot: ficl ficl64
Author: rpaulo Date: Fri Dec 21 05:22:14 2012 New Revision: 244531 URL: http://svnweb.freebsd.org/changeset/base/244531 Log: Build a 64 bit version of the FICL library. This is need for a 64 bit EFI bootloader (amd64 only for now). This is not yet connected to the build. Added: head/sys/boot/ficl64/ head/sys/boot/ficl64/Makefile (contents, props changed) Modified: head/sys/boot/ficl/Makefile Modified: head/sys/boot/ficl/Makefile == --- head/sys/boot/ficl/Makefile Fri Dec 21 04:44:40 2012(r244530) +++ head/sys/boot/ficl/Makefile Fri Dec 21 05:22:14 2012(r244531) @@ -1,6 +1,13 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} + +FICLDIR?= ${.CURDIR} + +.if !defined(FICL64) +.PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} +.else +.PATH: ${FICLDIR}/${MACHINE_CPUARCH} +.endif BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c @@ -8,8 +15,10 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES=softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if !defined(FICL64) CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 +.endif CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif .if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" @@ -33,13 +42,13 @@ INTERNALLIB= .endif # Standard softwords -.PATH: ${.CURDIR}/softwords +.PATH: ${FICLDIR}/softwords SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \ ifbrack.fr # Optional OO extension softwords #SOFTWORDS+= oo.fr classes.fr -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" && !defined(FICL64) CFLAGS+= -m32 -I. .endif @@ -47,11 +56,11 @@ CFLAGS+=-m32 -I. CFLAGS+= -m32 -mcpu=powerpc -I. .endif -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \ - -I${.CURDIR}/../common +CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \ + -I${FICLDIR}/../common softcore.c: ${SOFTWORDS} softcore.awk - (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \ + (cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \ | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} .if ${MACHINE_CPUARCH} == "amd64" Added: head/sys/boot/ficl64/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/ficl64/Makefile Fri Dec 21 05:22:14 2012 (r244531) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +FICL64= +FICLDIR= ${.CURDIR}/../ficl + +.PATH: ${FICLDIR} + +.include "${FICLDIR}/Makefile" ___ 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"