svn commit: r254241 - head/tools/tools/usbtest
Author: hselasky Date: Mon Aug 12 09:15:33 2013 New Revision: 254241 URL: http://svnweb.freebsd.org/changeset/base/254241 Log: Fix some signed comparison compile warnings. Modified: head/tools/tools/usbtest/usb_control_ep_test.c head/tools/tools/usbtest/usb_modem_test.c head/tools/tools/usbtest/usb_msc_test.c Modified: head/tools/tools/usbtest/usb_control_ep_test.c == --- head/tools/tools/usbtest/usb_control_ep_test.c Mon Aug 12 09:03:34 2013(r254240) +++ head/tools/tools/usbtest/usb_control_ep_test.c Mon Aug 12 09:15:33 2013(r254241) @@ -286,7 +286,7 @@ usb_port_reset_test(uint16_t vid, uint16 } timersub(&sub_tv, &ref_tv, &res_tv); - if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= duration)) + if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= (int)duration)) break; if (libusb20_dev_reset(pdev)) { @@ -445,7 +445,7 @@ usb_suspend_resume_test(uint16_t vid, ui } timersub(&sub_tv, &ref_tv, &res_tv); - if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= duration)) + if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= (int)duration)) break; error = libusb20_dev_set_power_mode(pdev, (iter & 1) ? Modified: head/tools/tools/usbtest/usb_modem_test.c == --- head/tools/tools/usbtest/usb_modem_test.c Mon Aug 12 09:03:34 2013 (r254240) +++ head/tools/tools/usbtest/usb_modem_test.c Mon Aug 12 09:15:33 2013 (r254241) @@ -215,7 +215,7 @@ usb_modem_control_ep_test(struct modem * } timersub(&sub_tv, &ref_tv, &res_tv); - if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= duration)) + if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= (int)duration)) break; LIBUSB20_INIT(LIBUSB20_CONTROL_SETUP, &setup); @@ -333,7 +333,7 @@ usb_modem_data_stress_test(struct modem } timersub(&sub_tv, &ref_tv, &res_tv); - if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= duration)) + if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= (int)duration)) break; libusb20_dev_process(p->usb_dev); Modified: head/tools/tools/usbtest/usb_msc_test.c == --- head/tools/tools/usbtest/usb_msc_test.c Mon Aug 12 09:03:34 2013 (r254240) +++ head/tools/tools/usbtest/usb_msc_test.c Mon Aug 12 09:15:33 2013 (r254241) @@ -798,7 +798,7 @@ retry_read_init: } timersub(&sub_tv, &ref_tv, &res_tv); - if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= p->duration)) + if ((res_tv.tv_sec < 0) || (res_tv.tv_sec >= (int)p->duration)) break; do_io_test(p, lun, lba_max, buffer, reference); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254243 - head/sys/dev/usb
Author: hselasky Date: Mon Aug 12 09:17:48 2013 New Revision: 254243 URL: http://svnweb.freebsd.org/changeset/base/254243 Log: - Try to fix build of 32-bit compatibility USB support for FreeBSD and Linux targets without breaking the existing IOCTL API. - Remove some not-needed header file inclusions. - Wrap a long line. MFC after:1 week Reported by: Damjan Jovanovic Modified: head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_ioctl.h head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_compat_linux.c == --- head/sys/dev/usb/usb_compat_linux.c Mon Aug 12 09:17:46 2013 (r254242) +++ head/sys/dev/usb/usb_compat_linux.c Mon Aug 12 09:17:48 2013 (r254243) @@ -48,7 +48,6 @@ #include #include -#include #include #include Modified: head/sys/dev/usb/usb_hub.c == --- head/sys/dev/usb/usb_hub.c Mon Aug 12 09:17:46 2013(r254242) +++ head/sys/dev/usb/usb_hub.c Mon Aug 12 09:17:48 2013(r254243) @@ -53,7 +53,6 @@ #include #include -#include #include #include Modified: head/sys/dev/usb/usb_ioctl.h == --- head/sys/dev/usb/usb_ioctl.hMon Aug 12 09:17:46 2013 (r254242) +++ head/sys/dev/usb/usb_ioctl.hMon Aug 12 09:17:48 2013 (r254243) @@ -31,6 +31,7 @@ #ifndef USB_GLOBAL_INCLUDE_FILE #include +#include /* Building "kdump" depends on these includes */ @@ -43,6 +44,16 @@ #defineUSB_GENERIC_NAME "ugen" #defineUSB_TEMPLATE_SYSCTL "hw.usb.template" /* integer type */ +/* + * Align IOCTL structures to hide differences when running 32-bit + * programs under 64-bit kernels: + */ +#ifdef COMPAT_32BIT +#defineUSB_IOCTL_STRUCT_ALIGN(n) __aligned(n) +#else +#defineUSB_IOCTL_STRUCT_ALIGN(n) +#endif + /* Definition of valid template sysctl values */ enum { @@ -64,7 +75,7 @@ struct usb_read_dir { #endif uint32_t urd_startentry; uint32_t urd_maxlen; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_ctl_request { #ifdef COMPAT_32BIT @@ -76,12 +87,12 @@ struct usb_ctl_request { uint16_t ucr_actlen;/* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ struct usb_device_request ucr_request; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_alt_interface { uint8_t uai_interface_index; uint8_t uai_alt_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_gen_descriptor { #ifdef COMPAT_32BIT @@ -100,7 +111,7 @@ struct usb_gen_descriptor { uint8_t ugd_endpt_index; uint8_t ugd_report_type; uint8_t reserved[8]; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_device_info { uint16_t udi_productNo; @@ -129,7 +140,7 @@ struct usb_device_info { charudi_vendor[128]; charudi_serial[64]; charudi_release[8]; -}; +} USB_IOCTL_STRUCT_ALIGN(2); #defineUSB_DEVICE_PORT_PATH_MAX 32 @@ -138,24 +149,24 @@ struct usb_device_port_path { uint8_t udp_index; /* which device index */ uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_device_stats { uint32_t uds_requests_ok[4];/* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ -}; +} USB_IOCTL_STRUCT_ALIGN(4); struct usb_fs_start { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_stop { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_complete { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); /* This structure is used for all endpoint types */ struct usb_fs_endpoint { @@ -188,7 +199,7 @@ struct usb_fs_endpoint { /* timeout value for no timeout */ #defineUSB_FS_TIMEOUT_NONE 0 int status; /* see USB_ERR_XXX */ -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_fs_init { /* userland pointer to endpoints structure */ @@ -199,11 +210,11 @@ struct usb_fs_init { #endif /* maximum number of endpoints */ uint8_t ep_index_max; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_fs_uninit { uint8_t dummy; /* zero */ -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_open { #defineUSB_FS_MAX_BUFSIZE (1 << 18) @@ -215,20 +226,20 @@ struct usb_fs_open { uint8_t dev_index; /* currently unused */ uint8_t ep_index; uint8_t ep_no; /* bEndpointNumber */ -}; +} USB_IOCTL_STRUCT_ALIGN(4); struct usb_fs_open_stream { struct usb_fs_open fs_open; - uint16_
svn commit: r254245 - head/usr.bin/vi/catalog
Author: peter Date: Mon Aug 12 10:11:10 2013 New Revision: 254245 URL: http://svnweb.freebsd.org/changeset/base/254245 Log: It seems the pre-commit checker doesn't detect illegal character sets. Fix. Modified: Directory Properties: head/usr.bin/vi/catalog/dutch.UTF-8.base (props changed) head/usr.bin/vi/catalog/french.UTF-8.base (props changed) head/usr.bin/vi/catalog/german.UTF-8.base (props changed) head/usr.bin/vi/catalog/polish.UTF-8.base (props changed) head/usr.bin/vi/catalog/ru_RU.UTF-8.base (props changed) head/usr.bin/vi/catalog/spanish.UTF-8.base (props changed) head/usr.bin/vi/catalog/swedish.UTF-8.base (props changed) head/usr.bin/vi/catalog/uk_UA.UTF-8.base (props changed) head/usr.bin/vi/catalog/zh_CN.UTF-8.base (props changed) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254248 - head/sys/netinet
Author: tuexen Date: Mon Aug 12 13:52:15 2013 New Revision: 254248 URL: http://svnweb.freebsd.org/changeset/base/254248 Log: Make the features a 64-bit value instead of 32-bit. This will allow an easier integration of the support for NDATA. While there, do also some minor cleanups. Obtained from:rrs@ MFC after: 2 weeks Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.h Modified: head/sys/netinet/sctp.h == --- head/sys/netinet/sctp.h Mon Aug 12 11:41:39 2013(r254247) +++ head/sys/netinet/sctp.h Mon Aug 12 13:52:15 2013(r254248) @@ -425,7 +425,7 @@ struct sctp_error_unrecognized_chunk { /* RFC4895 */ #define SCTP_AUTHENTICATION 0x0f /* EY nr_sack chunk id*/ -#define SCTP_NR_SELECTIVE_ACK 0x10 +#define SCTP_NR_SELECTIVE_ACK 0x10 /0x40 series ***/ /0x80 series ***/ /* RFC5061 */ @@ -509,38 +509,38 @@ struct sctp_error_unrecognized_chunk { /* * PCB Features (in sctp_features bitmask) */ -#define SCTP_PCB_FLAGS_DO_NOT_PMTUD 0x0001 -#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x0002/* deprecated */ -#define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x0004 -#define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x0008 -#define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x0010 -#define SCTP_PCB_FLAGS_DO_ASCONF 0x0020 -#define SCTP_PCB_FLAGS_AUTO_ASCONF 0x0040 -#define SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE 0x0080 +#define SCTP_PCB_FLAGS_DO_NOT_PMTUD 0x0001 +#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x0002/* deprecated */ +#define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x0004 +#define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x0008 +#define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x0010 +#define SCTP_PCB_FLAGS_DO_ASCONF 0x0020 +#define SCTP_PCB_FLAGS_AUTO_ASCONF 0x0040 +#define SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE 0x0080 /* socket options */ -#define SCTP_PCB_FLAGS_NODELAY 0x0100 -#define SCTP_PCB_FLAGS_AUTOCLOSE 0x0200 -#define SCTP_PCB_FLAGS_RECVDATAIOEVNT0x0400/* deprecated */ -#define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x0800 -#define SCTP_PCB_FLAGS_RECVPADDREVNT 0x1000 -#define SCTP_PCB_FLAGS_RECVPEERERR 0x2000 -#define SCTP_PCB_FLAGS_RECVSENDFAILEVNT 0x4000/* deprecated */ -#define SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT 0x8000 -#define SCTP_PCB_FLAGS_ADAPTATIONEVNT0x0001 -#define SCTP_PCB_FLAGS_PDAPIEVNT 0x0002 -#define SCTP_PCB_FLAGS_AUTHEVNT 0x0004 -#define SCTP_PCB_FLAGS_STREAM_RESETEVNT 0x0008 -#define SCTP_PCB_FLAGS_NO_FRAGMENT 0x0010 -#define SCTP_PCB_FLAGS_EXPLICIT_EOR 0x0040 -#define SCTP_PCB_FLAGS_NEEDS_MAPPED_V4 0x0080 -#define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS 0x0100 -#define SCTP_PCB_FLAGS_PORTREUSE 0x0200 -#define SCTP_PCB_FLAGS_DRYEVNT 0x0400 -#define SCTP_PCB_FLAGS_RECVRCVINFO 0x0800 -#define SCTP_PCB_FLAGS_RECVNXTINFO 0x1000 -#define SCTP_PCB_FLAGS_ASSOC_RESETEVNT 0x2000 -#define SCTP_PCB_FLAGS_STREAM_CHANGEEVNT 0x4000 -#define SCTP_PCB_FLAGS_RECVNSENDFAILEVNT 0x8000 +#define SCTP_PCB_FLAGS_NODELAY 0x0100 +#define SCTP_PCB_FLAGS_AUTOCLOSE 0x0200 +#define SCTP_PCB_FLAGS_RECVDATAIOEVNT0x0400/* deprecated */ +#define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x0800 +#define SCTP_PCB_FLAGS_RECVPADDREVNT 0x1000 +#define SCTP_PCB_FLAGS_RECVPEERERR 0x2000 +#define SCTP_PCB_FLAGS_RECVSENDFAILEVNT 0x4000/* deprecated */ +#define SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT 0x8000 +#define SCTP_PCB_FLAGS_ADAPTATIONEVNT0x0001 +#define SCTP_PCB_FLAGS_PDAPIEVNT 0x0002 +#define SCTP_PCB_FLAGS_AUTHEVNT 0x0004 +#define SCTP_PCB_FLAGS_STREAM_RESETEVNT 0x0008 +#define SCTP_PCB_FLAGS_NO_FRAGMENT 0x0010 +#define SCTP_PCB_FLAGS_EXPLICIT_EOR 0x0040 +#define SCTP_PCB_FLAGS_NEEDS_MAPPED_V4 0x0080 +#define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS 0x0100 +#define SCTP_PCB_FLAGS_PORTREUSE 0x0200 +#define SCTP_PCB_FLAGS_DRYEVNT 0x0400 +#define SCTP_PCB_FLAGS_RECVRCVINFO 0x0800 +#define SCTP_PCB_FLAGS_RECVNXTINFO 0x1000 +#define SCTP_PCB_FLAGS_ASSOC_RESETEVNT 0x2000 +#define SCTP_PCB_FLAGS_STREAM_CHANGEEVNT 0x4000 +#define SCTP_PCB_FLAGS_RECVNSENDFAILEVNT 0x8000 /*- * mobility_features parameters (by micchie).Note Modified: head/sys/netinet/sctp_indata.c
Re: svn commit: r253460 - head/sys/dev/mps
On 11 Aug 2013, at 18:01, Adrian Chadd wrote: > Damnit, I really should create a generic "here's a 64 bit mask for > debug" set of macros we can use elsewhere. Like re-inventing bitstring.h and bitset.h? -- Rui Paulo ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253550 - head/sys/dev/mps
On Sat, Aug 10, 2013 at 22:14:54 +0400, Slawa Olhovchenkov wrote: > On Mon, Jul 22, 2013 at 06:41:54PM +, Kenneth D. Merry wrote: > > > Author: ken > > Date: Mon Jul 22 18:41:53 2013 > > New Revision: 253550 > > URL: http://svnweb.freebsd.org/changeset/base/253550 > > > > Log: > > Merge in phase 14+ -> 16 mps driver fixes from LSI: > > Submitted by: LSI > > MFC after:1 week > > Not done? I was waiting for the stable/9 freeze to end. Now that it's done, I hope to merge that change to stable/9 this week. Ken -- Kenneth Merry k...@freebsd.org ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253460 - head/sys/dev/mps
On 12 August 2013 08:53, Rui Paulo wrote: > On 11 Aug 2013, at 18:01, Adrian Chadd wrote: > >> Damnit, I really should create a generic "here's a 64 bit mask for >> debug" set of macros we can use elsewhere. > > Like re-inventing bitstring.h and bitset.h? Right, except for use inside a debugging macro. :P (Patches to ath/net80211 to make debugging use those are gratefully accepted, btw. :) -adrian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253460 - head/sys/dev/mps
On Aug 12, 2013, at 11:12 AM, Adrian Chadd wrote: > On 12 August 2013 08:53, Rui Paulo wrote: >> On 11 Aug 2013, at 18:01, Adrian Chadd wrote: >> >>> Damnit, I really should create a generic "here's a 64 bit mask for >>> debug" set of macros we can use elsewhere. >> >> Like re-inventing bitstring.h and bitset.h? > > Right, except for use inside a debugging macro. :P > > (Patches to ath/net80211 to make debugging use those are gratefully > accepted, btw. :) > Anyways… the MPS driver already uses debugging macros, but the case that Alexander pointed out is more complicated than a simple printf. I'll take care of it. Scott ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254251 - head/contrib/sendmail/include/sm/os
Author: gshapiro Date: Mon Aug 12 17:22:39 2013 New Revision: 254251 URL: http://svnweb.freebsd.org/changeset/base/254251 Log: Temporarily revert sendmail 8.14.7 change to getipnodebyname() flags to prevent problems between the resolver and Microsoft DNS servers with lookups. The upstream open source project will work on a more permanent fix for the next release. Issue noted by Pavel Timofeev. MFC after:3 days Modified: head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Modified: head/contrib/sendmail/include/sm/os/sm_os_freebsd.h == --- head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Mon Aug 12 15:35:10 2013(r254250) +++ head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Mon Aug 12 17:22:39 2013(r254251) @@ -39,3 +39,7 @@ #ifndef SM_CONF_MSG # define SM_CONF_MSG 1 #endif /* SM_CONF_MSG */ + +#ifndef SM_IPNODEBYNAME_FLAGS +# define SM_IPNODEBYNAME_FLAGS AI_DEFAULT|AI_ALL +#endif /* SM_IPNODEBYNAME_FLAGS */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r253550 - head/sys/dev/mps
On Mon, Aug 12, 2013 at 09:56:48AM -0600, Kenneth D. Merry wrote: > On Sat, Aug 10, 2013 at 22:14:54 +0400, Slawa Olhovchenkov wrote: > > On Mon, Jul 22, 2013 at 06:41:54PM +, Kenneth D. Merry wrote: > > > > > Author: ken > > > Date: Mon Jul 22 18:41:53 2013 > > > New Revision: 253550 > > > URL: http://svnweb.freebsd.org/changeset/base/253550 > > > > > > Log: > > > Merge in phase 14+ -> 16 mps driver fixes from LSI: > > > Submitted by: LSI > > > MFC after: 1 week > > > > Not done? > > I was waiting for the stable/9 freeze to end. Hm? Date: Mon Aug 5 23:34:35 2013 New Revision: 253975 URL: http://svnweb.freebsd.org/changeset/base/253975 Log: stable/9 no longer requires re@ approval for commits, now that the releng/9.2 branch is created. Committers are urged to exercise caution with commits to stable/9 until the 9.2-RELEASE is finalized. Or, can you published patch for 9-STABLE? > Now that it's done, I hope to merge that change to stable/9 this week. Also, I see strange behaviour of LSI 9211-8i -- after some activity got timeout and HBA put in looped reset. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254252 - head/sys/geom/mirror
Author: ed Date: Mon Aug 12 18:17:45 2013 New Revision: 254252 URL: http://svnweb.freebsd.org/changeset/base/254252 Log: Fix the formatting of the error message. The G_MIRROR_DEBUG() macro already appends a newline. Also, most of the log messages emitted by gmirror start with an uppercase letter. Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c == --- head/sys/geom/mirror/g_mirror.c Mon Aug 12 17:22:39 2013 (r254251) +++ head/sys/geom/mirror/g_mirror.c Mon Aug 12 18:17:45 2013 (r254252) @@ -2052,8 +2052,8 @@ g_mirror_launch_provider(struct g_mirror } /* A provider underneath us doesn't support unmapped */ if ((dp->flags & G_PF_ACCEPT_UNMAPPED) == 0) { - G_MIRROR_DEBUG(0, "cancelling unmapped " - "because of %s\n", dp->name); + G_MIRROR_DEBUG(0, "Cancelling unmapped " + "because of %s.", dp->name); pp->flags &= ~G_PF_ACCEPT_UNMAPPED; } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254253 - head/sys/dev/mps
Author: scottl Date: Mon Aug 12 19:16:55 2013 New Revision: 254253 URL: http://svnweb.freebsd.org/changeset/base/254253 Log: r253460 accidentally some moderately expensive debugging code, even when debugging isn't enabled. Work around this. Submitted by: mav Obtained from:Netflix MFC after:3 days Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c == --- head/sys/dev/mps/mps_sas.c Mon Aug 12 18:17:45 2013(r254252) +++ head/sys/dev/mps/mps_sas.c Mon Aug 12 19:16:55 2013(r254253) @@ -307,6 +307,10 @@ mpssas_log_command(struct mps_command *c if (cm == NULL) return; + /* No need to be in here if debugging isn't enabled */ + if (cm->cm_sc->mps_debug & level) == 0) + return; + sbuf_new(&sb, str, sizeof(str), 0); va_start(ap, fmt); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254257 - head/sys/dev/mps
Author: mav Date: Mon Aug 12 20:17:37 2013 New Revision: 254257 URL: http://svnweb.freebsd.org/changeset/base/254257 Log: Add brace missing in r254253. Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c == --- head/sys/dev/mps/mps_sas.c Mon Aug 12 19:50:08 2013(r254256) +++ head/sys/dev/mps/mps_sas.c Mon Aug 12 20:17:37 2013(r254257) @@ -308,7 +308,7 @@ mpssas_log_command(struct mps_command *c return; /* No need to be in here if debugging isn't enabled */ - if (cm->cm_sc->mps_debug & level) == 0) + if ((cm->cm_sc->mps_debug & level) == 0) return; sbuf_new(&sb, str, sizeof(str), 0); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254259 - head/usr.bin/su
Author: trasz Date: Mon Aug 12 21:01:01 2013 New Revision: 254259 URL: http://svnweb.freebsd.org/changeset/base/254259 Log: Make check for unknown login class actually work. Previously, using the "-c" option with login class not defined in login.conf(5) would silently fail, resulting in using the default login class. Modified: head/usr.bin/su/su.c Modified: head/usr.bin/su/su.c == --- head/usr.bin/su/su.cMon Aug 12 20:27:24 2013(r254258) +++ head/usr.bin/su/su.cMon Aug 12 21:01:01 2013(r254259) @@ -373,6 +373,8 @@ main(int argc, char *argv[]) } lc = login_getclass(class); if (lc == NULL) + err(1, "login_getclass"); + if (lc->lc_class == NULL || strcmp(class, lc->lc_class) != 0) errx(1, "unknown class: %s", class); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254260 - in head/sys: conf fs/ext2fs modules/ext2fs
Author: pfg Date: Mon Aug 12 21:34:48 2013 New Revision: 254260 URL: http://svnweb.freebsd.org/changeset/base/254260 Log: Add read-only support for extents in ext2fs. Basic support for extents was implemented by Zheng Liu as part of his Google Summer of Code in 2010. This support is read-only at this time. In addition to extents we also support the huge_file extension for read-only purposes. This works nicely with the additional support for birthtime/nanosec timestamps and dir_index that have been added lately. The implementation may not work for all ext4 filesystems as it doesn't support some features that are being enabled by default on recent linux like flex_bg. Nevertheless, the feature should be very useful for migration or simple access in filesystems that have been converted from ext2/3 or don't use incompatible features. Special thanks to Zheng Liu for his dedication and continued work to support ext2 in FreeBSD. Submitted by: Zheng Liu (lz@) Reviewed by: Mike Ma, Christoph Mallon (previous version) Sponsored by: Google Inc. MFC after:3 weeks Added: head/sys/fs/ext2fs/ext2_extents.c (contents, props changed) head/sys/fs/ext2fs/ext2_extents.h (contents, props changed) Modified: head/sys/conf/files head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/inode.h head/sys/modules/ext2fs/Makefile Modified: head/sys/conf/files == --- head/sys/conf/files Mon Aug 12 21:01:01 2013(r254259) +++ head/sys/conf/files Mon Aug 12 21:34:48 2013(r254260) @@ -2714,6 +2714,7 @@ geom/zero/g_zero.coptional geom_zero fs/ext2fs/ext2_alloc.c optional ext2fs fs/ext2fs/ext2_balloc.coptional ext2fs fs/ext2fs/ext2_bmap.c optional ext2fs +fs/ext2fs/ext2_extents.c optional ext2fs fs/ext2fs/ext2_inode.c optional ext2fs fs/ext2fs/ext2_inode_cnv.c optional ext2fs fs/ext2fs/ext2_hash.c optional ext2fs Modified: head/sys/fs/ext2fs/ext2_bmap.c == --- head/sys/fs/ext2fs/ext2_bmap.c Mon Aug 12 21:01:01 2013 (r254259) +++ head/sys/fs/ext2fs/ext2_bmap.c Mon Aug 12 21:34:48 2013 (r254260) @@ -46,10 +46,14 @@ #include #include +#include #include +#include #include #include +static int ext4_bmapext(struct vnode *, int32_t, int64_t *, int *, int *); + /* * Bmap converts the logical block number of a file to its physical block * number on the disk. The conversion is done by using the logical block @@ -58,7 +62,7 @@ int ext2_bmap(struct vop_bmap_args *ap) { - int32_t blkno; + int64_t blkno; int error; /* @@ -70,13 +74,57 @@ ext2_bmap(struct vop_bmap_args *ap) if (ap->a_bnp == NULL) return (0); - error = ext2_bmaparray(ap->a_vp, ap->a_bn, &blkno, - ap->a_runp, ap->a_runb); + if (VTOI(ap->a_vp)->i_flags & EXT4_EXTENTS) + error = ext4_bmapext(ap->a_vp, ap->a_bn, &blkno, + ap->a_runp, ap->a_runb); + else + error = ext2_bmaparray(ap->a_vp, ap->a_bn, &blkno, + ap->a_runp, ap->a_runb); *ap->a_bnp = blkno; return (error); } /* + * This function converts the logical block number of a file to + * its physical block number on the disk within ext4 extents. + */ +static int +ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bnp, int *runp, int *runb) +{ + struct inode *ip; + struct m_ext2fs *fs; + struct ext4_extent *ep; + struct ext4_extent_path path; + daddr_t lbn; + + ip = VTOI(vp); + fs = ip->i_e2fs; + lbn = bn; + + /* +* TODO: need to implement read ahead to improve the performance. +*/ + if (runp != NULL) + *runp = 0; + + if (runb != NULL) + *runb = 0; + + ext4_ext_find_extent(fs, ip, lbn, &path); + ep = path.ep_ext; + if (ep == NULL) + return (EIO); + + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + + if (*bnp == 0) + *bnp = -1; + + return (0); +} + +/* * Indirect blocks are now on the vnode for the file. They are given negative * logical block numbers. Indirect blocks are addressed by the negative * address of the first data block to which they point. Double indirect blocks @@ -91,7 +139,7 @@ ext2_bmap(struct vop_bmap_args *ap) */ int -ext2_bmaparray(struct vnode *vp, int32_t bn, int32_t *bnp, int *runp, int *runb) +ext2_bmaparray(struct vn
svn commit: r254261 - head/sys/net80211
Author: adrian Date: Mon Aug 12 22:27:53 2013 New Revision: 254261 URL: http://svnweb.freebsd.org/changeset/base/254261 Log: Blank m_nextpkt before passing it up. Modified: head/sys/net80211/ieee80211_power.c Modified: head/sys/net80211/ieee80211_power.c == --- head/sys/net80211/ieee80211_power.c Mon Aug 12 21:34:48 2013 (r254260) +++ head/sys/net80211/ieee80211_power.c Mon Aug 12 22:27:53 2013 (r254261) @@ -475,6 +475,7 @@ pwrsave_flushq(struct ieee80211_node *ni while (ifp_q != NULL) { m = ifp_q; ifp_q = m->m_nextpkt; + m->m_nextpkt = NULL; KASSERT((!(m->m_flags & M_ENCAP)), ("%s: vapq with M_ENCAP frame!\n", __func__)); (void) ieee80211_vap_xmitpkt(vap, m); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254262 - in head/sys/dev: e1000 ixgbe
Author: jfv Date: Mon Aug 12 22:54:38 2013 New Revision: 254262 URL: http://svnweb.freebsd.org/changeset/base/254262 Log: Improve the MSIX setup code in the drivers, thanks to Marius for the changes. Make sure that pci_alloc_msix() does give us the vectors we need and fall back to MSI when it doesn't, also release any that were allocated when insufficient. MFC after: 3 days Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Mon Aug 12 22:27:53 2013(r254261) +++ head/sys/dev/e1000/if_em.c Mon Aug 12 22:54:38 2013(r254262) @@ -2277,7 +2277,7 @@ em_local_timer(void *arg) /* Mask to use in the irq trigger */ if (adapter->msix_mem) - trigger = rxr->ims; /* RX for 82574 */ + trigger = rxr->ims; else trigger = E1000_ICS_RXDMT0; @@ -2775,23 +2775,30 @@ em_setup_msix(struct adapter *adapter) if (val >= 3) val = 3; else { - bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem); - adapter->msix_mem = NULL; device_printf(adapter->dev, - "MSIX: incorrect vectors, using MSI\n"); + "MSIX: insufficient vectors, using MSI\n"); goto msi; } - if (pci_alloc_msix(dev, &val) == 0) { + if ((pci_alloc_msix(dev, &val) == 0) && (val == 3)) { device_printf(adapter->dev, "Using MSIX interrupts " "with %d vectors\n", val); return (val); } - /* Fall through to MSI */ + + /* + ** If MSIX alloc failed or provided us with + ** less than needed, free and fall through to MSI + */ + pci_release_msi(dev); } msi: + if (adapter->msix_mem != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem); + adapter->msix_mem = NULL; + } val = 1; if (pci_alloc_msi(dev, &val) == 0) { device_printf(adapter->dev,"Using an MSI interrupt\n"); Modified: head/sys/dev/e1000/if_igb.c == --- head/sys/dev/e1000/if_igb.c Mon Aug 12 22:27:53 2013(r254261) +++ head/sys/dev/e1000/if_igb.c Mon Aug 12 22:54:38 2013(r254262) @@ -2899,13 +2899,18 @@ igb_setup_msix(struct adapter *adapter) msgs, want); goto msi; } - if (pci_alloc_msix(dev, &msgs) == 0) { + if ((pci_alloc_msix(dev, &msgs) == 0) && (msgs == want)) { device_printf(adapter->dev, "Using MSIX interrupts with %d vectors\n", msgs); adapter->num_queues = queues; return (msgs); } - /* Fallback to MSI configuration */ + /* + ** If MSIX alloc failed or provided us with + ** less than needed, free and fall through to MSI + */ + pci_release_msi(dev); + msi: if (adapter->msix_mem != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, @@ -2914,10 +2919,10 @@ msi: } msgs = 1; if (pci_alloc_msi(dev, &msgs) == 0) { - device_printf(adapter->dev," Using MSI interrupt\n"); + device_printf(adapter->dev," Using an MSI interrupt\n"); return (msgs); } - /* Default to a legacy interrupt */ + device_printf(adapter->dev," Using a Legacy interrupt\n"); return (0); } Modified: head/sys/dev/ixgbe/ixgbe.c == --- head/sys/dev/ixgbe/ixgbe.c Mon Aug 12 22:27:53 2013(r254261) +++ head/sys/dev/ixgbe/ixgbe.c Mon Aug 12 22:54:38 2013(r254262) @@ -2456,12 +2456,18 @@ ixgbe_setup_msix(struct adapter *adapter msgs, want); goto msi; } - if (pci_alloc_msix(dev, &msgs) == 0) { + if ((pci_alloc_msix(dev, &msgs) == 0) && (msgs == want)) { device_printf(adapter->dev, "Using MSIX interrupts with %d vectors\n", msgs); adapter->num_queues = queues; return (msgs); } + /* + ** If MSIX alloc failed or provided us with + ** less than needed, free and fall through to MSI + */ + pci_release_msi(dev); + msi:
svn commit: r254263 - in head/sys: dev/aacraid dev/advansys dev/aic7xxx dev/amr dev/an dev/arcmsr dev/asr dev/ata dev/bktr dev/buslogic dev/dpt dev/e1000 dev/fatm dev/firewire dev/fxp dev/hatm dev/...
Author: scottl Date: Mon Aug 12 23:30:01 2013 New Revision: 254263 URL: http://svnweb.freebsd.org/changeset/base/254263 Log: Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after:1 day Modified: head/sys/dev/aacraid/aacraid_pci.c head/sys/dev/advansys/adw_pci.c head/sys/dev/aic7xxx/ahc_pci.c head/sys/dev/aic7xxx/ahd_pci.c head/sys/dev/amr/amr_pci.c head/sys/dev/an/if_an_pci.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/asr/asr.c head/sys/dev/ata/ata-pci.c head/sys/dev/bktr/bktr_os.c head/sys/dev/buslogic/bt_pci.c head/sys/dev/dpt/dpt_pci.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/fatm/if_fatm.c head/sys/dev/firewire/fwohci_pci.c head/sys/dev/fxp/if_fxp.c head/sys/dev/hatm/if_hatm.c head/sys/dev/ips/ips_pci.c head/sys/dev/isp/isp_pci.c head/sys/dev/iwn/if_iwn.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgbe/ixv.c head/sys/dev/mfi/mfi_pci.c head/sys/dev/mly/mly.c head/sys/dev/mn/if_mn.c head/sys/dev/mps/mps_pci.c head/sys/dev/mpt/mpt_pci.c head/sys/dev/mwl/if_mwl_pci.c head/sys/dev/mxge/if_mxge.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pst/pst-pci.c head/sys/dev/rp/rp_pci.c head/sys/dev/safe/safe.c head/sys/dev/sound/pci/als4000.c head/sys/dev/sound/pci/aureal.c head/sys/dev/sound/pci/cmi.c head/sys/dev/sound/pci/cs4281.c head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/ds1.c head/sys/dev/sound/pci/emu10k1.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/es137x.c head/sys/dev/sound/pci/fm801.c head/sys/dev/sound/pci/hdspe.c head/sys/dev/sound/pci/maestro.c head/sys/dev/sound/pci/maestro3.c head/sys/dev/sound/pci/neomagic.c head/sys/dev/sound/pci/solo.c head/sys/dev/sound/pci/t4dwave.c head/sys/dev/sound/pci/via82c686.c head/sys/dev/sound/pci/vibes.c head/sys/dev/stge/if_stge.c head/sys/dev/sym/sym_hipd.c head/sys/dev/tdfx/tdfx_pci.c head/sys/dev/twa/tw_osl_freebsd.c head/sys/dev/tws/tws.c head/sys/dev/ubsec/ubsec.c head/sys/dev/wi/if_wi_pci.c head/sys/pci/ncr.c Modified: head/sys/dev/aacraid/aacraid_pci.c == --- head/sys/dev/aacraid/aacraid_pci.c Mon Aug 12 22:54:38 2013 (r254262) +++ head/sys/dev/aacraid/aacraid_pci.c Mon Aug 12 23:30:01 2013 (r254263) @@ -169,18 +169,12 @@ aacraid_pci_attach(device_t dev) /* * Verify that the adapter is correctly set up in PCI space. */ - command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); + pci_enable_busmaster(dev); command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); if (!(command & PCIM_CMD_BUSMASTEREN)) { device_printf(sc->aac_dev, "can't enable bus-master feature\n"); goto out; } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(sc->aac_dev, "memory window not available\n"); - goto out; - } /* * Detect the hardware interface version, set up the bus interface Modified: head/sys/dev/advansys/adw_pci.c == --- head/sys/dev/advansys/adw_pci.c Mon Aug 12 22:54:38 2013 (r254262) +++ head/sys/dev/advansys/adw_pci.c Mon Aug 12 23:30:01 2013 (r254263) @@ -199,14 +199,13 @@ adw_pci_attach(device_t dev) { struct adw_softc *adw; struct adw_pci_identity *entry; - u_int32_t command; + u_int16_t command; struct resource *regs; int regs_type; int regs_id; int error; int zero; - command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); entry = adw_find_pci_device(dev); if (entry == NULL) return (ENXIO); @@ -214,14 +213,11 @@ adw_pci_attach(device_t dev) regs_type = 0; regs_id = 0; #ifdef ADW_ALLOW_MEMIO - if ((command & PCIM_CMD_MEMEN) != 0) { - regs_t
svn commit: r254264 - head/sys/dev/e1000
Author: jfv Date: Tue Aug 13 00:25:39 2013 New Revision: 254264 URL: http://svnweb.freebsd.org/changeset/base/254264 Log: Alter the mq_start routine to do a TRYLOCK and call to the locked routine rather than just queueing. The former code was an attempt at getting UDP performance up, but there have been customer reports of problems with it, so the ixgbe approach seems the best solution for now. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c == --- head/sys/dev/e1000/if_igb.c Mon Aug 12 23:30:01 2013(r254263) +++ head/sys/dev/e1000/if_igb.c Tue Aug 13 00:25:39 2013(r254264) @@ -972,7 +972,13 @@ igb_mq_start(struct ifnet *ifp, struct m que = &adapter->queues[i]; err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &txr->txq_task); + if (err) + return (err); + if (IGB_TX_TRYLOCK(txr)) { + err = igb_mq_start_locked(ifp, txr); + IGB_TX_UNLOCK(txr); + } else + taskqueue_enqueue(que->tq, &txr->txq_task); return (err); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254265 - head/usr.sbin/bsdinstall/scripts
Author: gjb Date: Tue Aug 13 02:31:46 2013 New Revision: 254265 URL: http://svnweb.freebsd.org/changeset/base/254265 Log: Make sure bootonly.iso for -BETAs and -RCs use the releases/ directory on the FTP mirrors to fetch distributions, since these are always pushed to releases/ during the release cycle. MFC after:3 days X-MFC-To: stable/9, releng/9.2 Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect == --- head/usr.sbin/bsdinstall/scripts/mirrorselect Tue Aug 13 00:25:39 2013(r254264) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Tue Aug 13 02:31:46 2013(r254265) @@ -162,7 +162,7 @@ exec 3>&- _UNAME_R=`uname -r` case ${_UNAME_R} in - *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) + *-CURRENT|*-STABLE|*-PRERELEASE) RELDIR="snapshots" ;; *) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254266 - in head: share/man/man9 sys/kern sys/sys
Author: markj Date: Tue Aug 13 03:07:49 2013 New Revision: 254266 URL: http://svnweb.freebsd.org/changeset/base/254266 Log: Add event handlers for module load and unload events. The load handlers are called after the module has been loaded, and the unload handlers are called before the module is unloaded. Moreover, the module unload handlers may return an error to prevent the unload from proceeding. Reviewed by: avg MFC after:2 weeks Modified: head/share/man/man9/EVENTHANDLER.9 head/sys/kern/kern_linker.c head/sys/sys/eventhandler.h Modified: head/share/man/man9/EVENTHANDLER.9 == --- head/share/man/man9/EVENTHANDLER.9 Tue Aug 13 02:31:46 2013 (r254265) +++ head/share/man/man9/EVENTHANDLER.9 Tue Aug 13 03:07:49 2013 (r254266) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd May 11, 2012 +.Dd August 1, 2013 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -199,6 +199,12 @@ Callbacks invoked when a new network int Callbacks invoked when a network interface is taken down. .It Vt bpf_track Callbacks invoked when a BPF listener attaches to/detaches from network interface. +.It Vt mod_load +Callbacks invoked after a module has been loaded. +.It Vt mod_unload +Callbacks invoked before a module is about to be unloaded. +These callbacks may be used to return an error and prevent the unload from +proceeding. .It Vt power_profile_change Callbacks invoked when the power profile of the system changes. .It Vt process_exec Modified: head/sys/kern/kern_linker.c == --- head/sys/kern/kern_linker.c Tue Aug 13 02:31:46 2013(r254265) +++ head/sys/kern/kern_linker.c Tue Aug 13 03:07:49 2013(r254266) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1046,6 +1047,9 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; if (fileid != NULL) *fileid = lf->id; + + EVENTHANDLER_INVOKE(mod_load, lf); + #ifdef HWPMC_HOOKS KLD_DOWNGRADE(); pkm.pm_file = lf->filename; @@ -1101,8 +1105,10 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - /* Check if there are DTrace probes enabled on this file. */ - if (lf->nenabled > 0) { + EVENTHANDLER_INVOKE(mod_unload, lf, &error); + if (error != 0) + error = EBUSY; + else if (lf->nenabled > 0) { printf("kldunload: attempt to unload file that has" " DTrace probes enabled\n"); error = EBUSY; Modified: head/sys/sys/eventhandler.h == --- head/sys/sys/eventhandler.h Tue Aug 13 02:31:46 2013(r254265) +++ head/sys/sys/eventhandler.h Tue Aug 13 03:07:49 2013(r254266) @@ -266,4 +266,11 @@ EVENTHANDLER_DECLARE(nmbclusters_change, EVENTHANDLER_DECLARE(nmbufs_change, uma_zone_chfn); EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); +/* Module load and unload events */ +struct linker_file; +typedef void (*mod_load_fn)(void *, struct linker_file *); +typedef void (*mod_unload_fn)(void *, struct linker_file *, int *); +EVENTHANDLER_DECLARE(mod_load, mod_load_fn); +EVENTHANDLER_DECLARE(mod_unload, mod_unload_fn); + #endif /* SYS_EVENTHANDLER_H */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254267 - in head/sys: kern sys
Author: markj Date: Tue Aug 13 03:09:00 2013 New Revision: 254267 URL: http://svnweb.freebsd.org/changeset/base/254267 Log: Remove some unused fields from struct linker_file. They were added in r172862 for use by the DTrace SDT framework but don't seem to have ever been used. MFC after:2 weeks Modified: head/sys/kern/kern_linker.c head/sys/sys/linker.h Modified: head/sys/kern/kern_linker.c == --- head/sys/kern/kern_linker.c Tue Aug 13 03:07:49 2013(r254266) +++ head/sys/kern/kern_linker.c Tue Aug 13 03:09:00 2013(r254267) @@ -583,8 +583,6 @@ linker_make_file(const char *pathname, l lf->ndeps = 0; lf->deps = NULL; lf->loadcnt = ++loadcnt; - lf->sdt_probes = NULL; - lf->sdt_nprobes = 0; STAILQ_INIT(&lf->common); TAILQ_INIT(&lf->modules); TAILQ_INSERT_TAIL(&linker_files, lf, link); Modified: head/sys/sys/linker.h == --- head/sys/sys/linker.h Tue Aug 13 03:07:49 2013(r254266) +++ head/sys/sys/linker.h Tue Aug 13 03:09:00 2013(r254267) @@ -92,10 +92,6 @@ struct linker_file { */ intnenabled; /* number of enabled probes. */ intfbt_nentries; /* number of fbt entries created. */ -void *sdt_probes; -intsdt_nentries; -size_t sdt_nprobes; -size_t sdt_size; }; /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254268 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace cddl/dev/fbt cddl/dev/sdt kern sys
Author: markj Date: Tue Aug 13 03:10:39 2013 New Revision: 254268 URL: http://svnweb.freebsd.org/changeset/base/254268 Log: FreeBSD's DTrace implementation has a few problems with respect to handling probes declared in a kernel module when that module is unloaded. In particular, * Unloading a module with active SDT probes will cause a panic. [1] * A module's (FBT/SDT) probes aren't destroyed when the module is unloaded; trying to use them after the fact will generally cause a panic. This change fixes both problems by porting the DTrace module load/unload handlers from illumos and registering them with the corresponding EVENTHANDLER(9) handlers. This allows the DTrace framework to destroy all probes defined in a module when that module is unloaded, and to prevent a module unload from proceeding if some of its probes are active. The latter problem has already been fixed for FBT probes by checking lf->nenabled in kern_kldunload(), but moving the check into the DTrace framework generalizes it to all kernel providers and also fixes a race in the current implementation (since a probe may be activated between the check and the call to linker_file_unload()). Additionally, the SDT implementation has been reworked to define SDT providers/probes/argtypes in linker sets rather than using SYSINIT/SYSUNINIT to create and destroy SDT probes when a module is loaded or unloaded. This simplifies things quite a bit since it means that pretty much all of the SDT code can live in sdt.ko, and since it becomes easier to integrate SDT with the DTrace framework. Furthermore, this allows FreeBSD to be quite flexible in that SDT providers spanning multiple modules can be created on the fly when a module is loaded; at the moment it looks like illumos' SDT implementation requires all SDT probes to be statically defined in a single kernel table. PR: 166927, 166926, 166928 Reported by: davide [1] Reviewed by: avg, trociny (earlier version) MFC after:1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/dtrace_unload.c head/sys/cddl/dev/fbt/fbt.c head/sys/cddl/dev/sdt/sdt.c head/sys/kern/kern_linker.c head/sys/kern/kern_sdt.c head/sys/sys/sdt.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c == --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cTue Aug 13 03:09:00 2013(r254267) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cTue Aug 13 03:10:39 2013(r254268) @@ -116,6 +116,7 @@ #if !defined(sun) #include #include +#include #include #include #include @@ -240,6 +241,8 @@ int dtrace_in_probe;/* non-zero if exe #if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif +static eventhandler_tagdtrace_modload_tag; +static eventhandler_tagdtrace_modunload_tag; #endif /* @@ -8098,19 +8101,6 @@ dtrace_probe_description(const dtrace_pr (void) strncpy(pdp->dtpd_name, prp->dtpr_name, DTRACE_NAMELEN - 1); } -#if !defined(sun) -static int -dtrace_probe_provide_cb(linker_file_t lf, void *arg) -{ - dtrace_provider_t *prv = (dtrace_provider_t *) arg; - - prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, lf); - - return(0); -} -#endif - - /* * Called to indicate that a probe -- or probes -- should be provided by a * specfied provider. If the specified description is NULL, the provider will @@ -8166,8 +8156,6 @@ dtrace_probe_provide(dtrace_probedesc_t } while ((ctl = ctl->mod_next) != &modules); mutex_exit(&mod_lock); -#else - (void) linker_file_foreach(dtrace_probe_provide_cb, prv); #endif } while (all && (prv = prv->dtpv_next) != NULL); } @@ -15152,7 +15140,6 @@ dtrace_helpers_duplicate(proc_t *from, p dtrace_helper_provider_register(to, newhelp, NULL); } -#if defined(sun) /* * DTrace Hook Functions */ @@ -15166,7 +15153,9 @@ dtrace_module_loaded(modctl_t *ctl) mutex_enter(&mod_lock); #endif +#if defined(sun) ASSERT(ctl->mod_busy); +#endif /* * We're going to call each providers per-module provide operation @@ -15214,12 +15203,29 @@ dtrace_module_loaded(modctl_t *ctl) } static void +#if defined(sun) dtrace_module_unloaded(modctl_t *ctl) +#else +dtrace_module_unloaded(modctl_t *ctl, int *error) +#endif { dtrace_probe_t template, *probe, *first, *next; dtrace_provider_t *prov; +#if !defined(sun) + char modname[DTRACE_MODNAMELEN]; + size_t len; +#endif +#if defined(sun) template
svn commit: r254269 - head/sys/geom/raid
Author: mav Date: Tue Aug 13 06:21:36 2013 New Revision: 254269 URL: http://svnweb.freebsd.org/changeset/base/254269 Log: Fix reasonable but safe Clang warnings. Modified: head/sys/geom/raid/tr_raid5.c Modified: head/sys/geom/raid/tr_raid5.c == --- head/sys/geom/raid/tr_raid5.c Tue Aug 13 03:10:39 2013 (r254268) +++ head/sys/geom/raid/tr_raid5.c Tue Aug 13 06:21:36 2013 (r254269) @@ -106,7 +106,8 @@ g_raid_tr_taste_raid5(struct g_raid_tr_o trs = (struct g_raid_tr_raid5_object *)tr; qual = tr->tro_volume->v_raid_level_qualifier; if (tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID4 && - qual >= 0 && qual <= 1) { + (qual == G_RAID_VOLUME_RLQ_R4P0 || +qual == G_RAID_VOLUME_RLQ_R4P0)) { /* RAID4 */ } else if ((tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5 || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5E || @@ -114,7 +115,10 @@ g_raid_tr_taste_raid5(struct g_raid_tr_o tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5R || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID6 || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAIDMDF) && - qual >= 0 && qual <= 3) { + (qual == G_RAID_VOLUME_RLQ_R5RA || +qual == G_RAID_VOLUME_RLQ_R5RS || +qual == G_RAID_VOLUME_RLQ_R5LA || +qual == G_RAID_VOLUME_RLQ_R5LS)) { /* RAID5/5E/5EE/5R/6/MDF */ } else return (G_RAID_TR_TASTE_FAIL); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254271 - head/sys/geom/raid
Author: mav Date: Tue Aug 13 06:25:34 2013 New Revision: 254271 URL: http://svnweb.freebsd.org/changeset/base/254271 Log: Oops, wrong constant at r254269. Modified: head/sys/geom/raid/tr_raid5.c Modified: head/sys/geom/raid/tr_raid5.c == --- head/sys/geom/raid/tr_raid5.c Tue Aug 13 06:25:17 2013 (r254270) +++ head/sys/geom/raid/tr_raid5.c Tue Aug 13 06:25:34 2013 (r254271) @@ -107,7 +107,7 @@ g_raid_tr_taste_raid5(struct g_raid_tr_o qual = tr->tro_volume->v_raid_level_qualifier; if (tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID4 && (qual == G_RAID_VOLUME_RLQ_R4P0 || -qual == G_RAID_VOLUME_RLQ_R4P0)) { +qual == G_RAID_VOLUME_RLQ_R4PN)) { /* RAID4 */ } else if ((tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5 || tr->tro_volume->v_raid_level == G_RAID_VOLUME_RL_RAID5E || ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"