svn commit: r242126 - in head/sys/dev/usb: . controller input serial storage wlan

2012-10-26 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Oct 26 06:04:47 2012
New Revision: 242126
URL: http://svn.freebsd.org/changeset/base/242126

Log:
  Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.
  Rearrange the tunables and belonging sysctl declarations, so
  that they are next to eachother.
  
  Submitted by: n_hibma @
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/dwc_otg.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usb_debug.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_urtw.c

Modified: head/sys/dev/usb/controller/dwc_otg.c
==
--- head/sys/dev/usb/controller/dwc_otg.c   Fri Oct 26 05:48:53 2012
(r242125)
+++ head/sys/dev/usb/controller/dwc_otg.c   Fri Oct 26 06:04:47 2012
(r242126)
@@ -105,9 +105,8 @@ static int dwc_otg_use_hsic;
 
 static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, USB DWC OTG);
 
-SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RD,
+SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, use_hsic, CTLFLAG_RD | CTLFLAG_TUN,
 dwc_otg_use_hsic, 0, DWC OTG uses HSIC interface);
-
 TUNABLE_INT(hw.usb.dwc_otg.use_hsic, dwc_otg_use_hsic);
 
 #ifdef USB_DEBUG

Modified: head/sys/dev/usb/controller/ehci.c
==
--- head/sys/dev/usb/controller/ehci.c  Fri Oct 26 05:48:53 2012
(r242125)
+++ head/sys/dev/usb/controller/ehci.c  Fri Oct 26 06:04:47 2012
(r242126)
@@ -95,20 +95,20 @@ static int ehciiaadbug = 0;
 static int ehcilostintrbug = 0;
 
 static SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, USB ehci);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
 ehcidebug, 0, Debug level);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW,
-ehcinohighspeed, 0, Disable High Speed USB);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW,
-ehciiaadbug, 0, Enable doorbell bug workaround);
-SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW,
-ehcilostintrbug, 0, Enable lost interrupt bug workaround);
-
 TUNABLE_INT(hw.usb.ehci.debug, ehcidebug);
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW | CTLFLAG_TUN,
+ehcinohighspeed, 0, Disable High Speed USB);
 TUNABLE_INT(hw.usb.ehci.no_hs, ehcinohighspeed);
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW | CTLFLAG_TUN,
+ehciiaadbug, 0, Enable doorbell bug workaround);
 TUNABLE_INT(hw.usb.ehci.iaadbug, ehciiaadbug);
+SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW | CTLFLAG_TUN,
+ehcilostintrbug, 0, Enable lost interrupt bug workaround);
 TUNABLE_INT(hw.usb.ehci.lostintrbug, ehcilostintrbug);
 
+
 static void ehci_dump_regs(ehci_softc_t *sc);
 static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh);
 

Modified: head/sys/dev/usb/controller/ohci.c
==
--- head/sys/dev/usb/controller/ohci.c  Fri Oct 26 05:48:53 2012
(r242125)
+++ head/sys/dev/usb/controller/ohci.c  Fri Oct 26 06:04:47 2012
(r242126)
@@ -81,9 +81,8 @@ __FBSDID($FreeBSD$);
 static int ohcidebug = 0;
 
 static SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, USB ohci);
-SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
 ohcidebug, 0, ohci debug level);
-
 TUNABLE_INT(hw.usb.ohci.debug, ohcidebug);
 
 static void ohci_dumpregs(ohci_softc_t *);

Modified: head/sys/dev/usb/controller/uhci.c
==
--- head/sys/dev/usb/controller/uhci.c  Fri Oct 26 05:48:53 2012
(r242125)
+++ head/sys/dev/usb/controller/uhci.c  Fri Oct 26 06:04:47 2012
(r242126)
@@ -86,12 +86,11 @@ static int uhcidebug = 0;
 static int uhcinoloop = 0;
 
 static SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, USB uhci);
-SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW,
+SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
 uhcidebug, 0, uhci debug level);
-SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW,
-uhcinoloop, 0, uhci noloop);
-
 TUNABLE_INT(hw.usb.uhci.debug, uhcidebug);
+SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN,
+uhcinoloop, 0, uhci noloop);
 TUNABLE_INT(hw.usb.uhci.loop, uhcinoloop);
 
 static void uhci_dumpregs(uhci_softc_t *sc);

Modified: 

Re: svn commit: r242124 - head/sys/arm/conf

2012-10-26 Thread Giovanni Trematerra
On Fri, Oct 26, 2012 at 7:41 AM, Tim Kientzle kient...@freebsd.org wrote:
 Author: kientzle
 Date: Fri Oct 26 05:41:58 2012
 New Revision: 242124
 URL: http://svn.freebsd.org/changeset/base/242124

 Log:
   Comment out the BOOTP/NFSROOT support.  Transition this
   config file to support a production kernel mounted on an
   SD card.

 Modified:
   head/sys/arm/conf/PANDABOARD

 Modified: head/sys/arm/conf/PANDABOARD
 ==
 --- head/sys/arm/conf/PANDABOARDFri Oct 26 03:20:04 2012
 (r242123)
 +++ head/sys/arm/conf/PANDABOARDFri Oct 26 05:41:58 2012
 (r242124)
 @@ -44,17 +44,18 @@ options FFS #Berkeley Fast 
 Filesystem
  optionsSOFTUPDATES #Enable FFS soft updates support
  optionsUFS_ACL #Support for access control lists
  optionsUFS_DIRHASH #Improve performance on big 
 directories
 -optionsNFSCLIENT   #Network Filesystem Client
  device snp
 +optionsBREAK_TO_DEBUGGER
 +
  #options   NFSCL
 +optionsNFSCLIENT   #Network Filesystem Client
  #options   NFSSERVER   #Network Filesystem Server
  optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT
 -optionsBREAK_TO_DEBUGGER
 -optionsBOOTP_NFSROOT
 -optionsBOOTP_COMPAT
 -optionsBOOTP
 +#options   BOOTP_NFSROOT
 +#options   BOOTP_COMPAT
 +#options   BOOTP
  optionsBOOTP_NFSV3
 -optionsBOOTP_WIRED_TO=ue0
 +#options   BOOTP_WIRED_TO=ue0
  optionsMSDOSFS #MSDOS Filesystem
  #options   CD9660  #ISO 9660 Filesystem
  #options   PROCFS  #Process filesystem (requires 
 PSEUDOFS)

Why did you leave BOOTP_NFSV3 uncommented?

--
Gianni
___
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: r242079 - in head: sbin/ipfw share/man/man4 sys/conf sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw

2012-10-26 Thread Gleb Smirnoff
On Thu, Oct 25, 2012 at 10:29:51PM +0200, Andre Oppermann wrote:
A On 25.10.2012 18:25, Andrey V. Elsukov wrote:
A  On 25.10.2012 19:54, Andre Oppermann wrote:
A  I still don't agree with naming the sysctl net.pfil.forward.  This
A  type of forwarding is a property of IPv4 and IPv6 and thus should
A  be put there.  Pfil hooking can be on layer 2, 2-bridging, 3 and
A  who knows where else in the future.  Forwarding works only for IPv46.
A 
A  You haven't even replied to my comment on net@.  Please change the
A  sysctl location and name to its appropriate place.
A 
A  Hi Andre,
A 
A  There were two replies related to this subject, you did not replied to
A  them and i thought that you became agree.
A 
A I replied to your reply to mine.  Other than that I didn't find
A anything else from you.
A 
A  So, if not, what you think about the name net.pfil.ipforward?
A 
A net.inet.ip.pfil_forward
A net.inet6.ip6.pfil_forward
A 
A or something like that.
A 
A If you can show with your performance profiling that the sysctl
A isn't even necessary, you could leave it completely away and have
A pfil_forward enabled permanently.  That would be even better for
A everybody.

I'd prefer to have the sysctl. Benchmarking will definitely show
no regression, because in default case packets are tagless. But if
packets would carry 1 or 2 tags each, which don't actually belong
to PACKET_TAG_IPFORWARD, then processing would be pessimized.

-- 
Totus tuus, Glebius.
___
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: r242127 - in head/sys/dev/usb: . quirk

2012-10-26 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Oct 26 11:41:57 2012
New Revision: 242127
URL: http://svn.freebsd.org/changeset/base/242127

Log:
  Add support for Fast Track Ultra 8R from M-audio.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Fri Oct 26 06:04:47 2012
(r242126)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Fri Oct 26 11:41:57 2012
(r242127)
@@ -472,6 +472,10 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(TEXTECH, U2M_2, 0x, 0x, UQ_SINGLE_CMD_MIDI),
USB_QUIRK(WCH2, U2M, 0x, 0x, UQ_SINGLE_CMD_MIDI),
 
+   /* Non-standard USB AUDIO devices */
+   USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x, 0x, UQ_AU_VENDOR_CLASS),
+   USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x, 0x, UQ_AU_VENDOR_CLASS),
+
/*
 * Quirks for manufacturers which USB devices does not respond
 * after issuing non-supported commands:

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Oct 26 06:04:47 2012(r242126)
+++ head/sys/dev/usb/usbdevsFri Oct 26 11:41:57 2012(r242127)
@@ -366,7 +366,7 @@ vendor EICON0x0734  Eicon Networks
 vendor SYNTECH 0x0745  Syntech Information
 vendor DIGITALSTREAM   0x074e  Digital Stream
 vendor AUREAL  0x0755  Aureal Semiconductor
-vendor MIDIMAN 0x0763  Midiman
+vendor MAUDIO  0x0763  M-Audio
 vendor CYBERPOWER  0x0764  Cyber Power Systems, Inc.
 vendor SURECOM 0x0769  Surecom Technology
 vendor HIDGLOBAL   0x076b  HID Global
@@ -2887,7 +2887,9 @@ product MICROTEK V6UL 0x80ac  ScanMaker 
 product MICROTUNE BT_DONGLE0x1000  Bluetooth USB dongle
 
 /* Midiman products */
-product MIDIMAN MIDISPORT2X2   0x1001  Midisport 2x2
+product MAUDIO MIDISPORT2X20x1001  Midisport 2x2
+product MAUDIO FASTTRACKULTRA  0x2080  Fast Track Ultra
+product MAUDIO FASTTRACKULTRA8R0x2081  Fast Track Ultra 8R
 
 /* MindsAtWork products */
 product MINDSATWORK WALLET 0x0001  Digital Wallet
___
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: r242079 - in head: sbin/ipfw share/man/man4 sys/conf sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw

2012-10-26 Thread Andre Oppermann

On 26.10.2012 13:26, Gleb Smirnoff wrote:

On Thu, Oct 25, 2012 at 10:29:51PM +0200, Andre Oppermann wrote:
A On 25.10.2012 18:25, Andrey V. Elsukov wrote:
A  On 25.10.2012 19:54, Andre Oppermann wrote:
A  I still don't agree with naming the sysctl net.pfil.forward.  This
A  type of forwarding is a property of IPv4 and IPv6 and thus should
A  be put there.  Pfil hooking can be on layer 2, 2-bridging, 3 and
A  who knows where else in the future.  Forwarding works only for IPv46.
A 
A  You haven't even replied to my comment on net@.  Please change the
A  sysctl location and name to its appropriate place.
A 
A  Hi Andre,
A 
A  There were two replies related to this subject, you did not replied to
A  them and i thought that you became agree.
A
A I replied to your reply to mine.  Other than that I didn't find
A anything else from you.
A
A  So, if not, what you think about the name net.pfil.ipforward?
A
A net.inet.ip.pfil_forward
A net.inet6.ip6.pfil_forward
A
A or something like that.
A
A If you can show with your performance profiling that the sysctl
A isn't even necessary, you could leave it completely away and have
A pfil_forward enabled permanently.  That would be even better for
A everybody.

I'd prefer to have the sysctl. Benchmarking will definitely show
no regression, because in default case packets are tagless. But if
packets would carry 1 or 2 tags each, which don't actually belong
to PACKET_TAG_IPFORWARD, then processing would be pessimized.


With M_FASTFWD_OURS I used an overlay of the protocol specific M_PROTO[1-5]
mbuf flags.  The same can be done with M_IPFORWARD.  The ipfw code then
will not only add the m_tag but also set M_IPFORWARD flag.  That way no
sysctl is required and the feature is always available.  The overlay
definition is in ip_var.h.

--
Andre

___
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: r242079 - in head: sbin/ipfw share/man/man4 sys/conf sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw

2012-10-26 Thread Andrey V. Elsukov
On 26.10.2012 15:43, Andre Oppermann wrote:
 A If you can show with your performance profiling that the sysctl
 A isn't even necessary, you could leave it completely away and have
 A pfil_forward enabled permanently.  That would be even better for
 A everybody.

 I'd prefer to have the sysctl. Benchmarking will definitely show
 no regression, because in default case packets are tagless. But if
 packets would carry 1 or 2 tags each, which don't actually belong
 to PACKET_TAG_IPFORWARD, then processing would be pessimized.
 
 With M_FASTFWD_OURS I used an overlay of the protocol specific M_PROTO[1-5]
 mbuf flags.  The same can be done with M_IPFORWARD.  The ipfw code then
 will not only add the m_tag but also set M_IPFORWARD flag.  That way no
 sysctl is required and the feature is always available.  The overlay
 definition is in ip_var.h.

It seems we have only one bit in the m_flags that can be used, so, maybe
we left it to some things that can appear in the future?

-- 
WBR, Andrey V. Elsukov
___
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: r242129 - head/sys/dev/sound/usb

2012-10-26 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Oct 26 12:41:01 2012
New Revision: 242129
URL: http://svn.freebsd.org/changeset/base/242129

Log:
  Make sure the vendor class quirk only matches the vendor specific
  class, else multiple pcm devices can appear on certain USB audio
  devices.
  
  MFC after:1 week

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Fri Oct 26 12:24:38 2012
(r242128)
+++ head/sys/dev/sound/usb/uaudio.c Fri Oct 26 12:41:01 2012
(r242129)
@@ -618,7 +618,8 @@ uaudio_probe(device_t dev)
/* lookup non-standard device */
 
if (uaa-info.bInterfaceClass != UICLASS_AUDIO) {
-   if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0)
+   if (uaa-info.bInterfaceClass != UICLASS_VENDOR ||
+   usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0)
return (ENXIO);
}
 
___
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: r242130 - head/lib/libgeom

2012-10-26 Thread Jaakko Heinonen
Author: jh
Date: Fri Oct 26 12:46:33 2012
New Revision: 242130
URL: http://svn.freebsd.org/changeset/base/242130

Log:
  Improve libgeom XML parsing error handling.
  
  - Abort parsing and return an error if we run out of memory.
  - Return EILSEQ from geom_xml2tree() for XML syntax errors.
  
  Silence on:   freebsd-geom

Modified:
  head/lib/libgeom/geom_xml2tree.c

Modified: head/lib/libgeom/geom_xml2tree.c
==
--- head/lib/libgeom/geom_xml2tree.cFri Oct 26 12:41:01 2012
(r242129)
+++ head/lib/libgeom/geom_xml2tree.cFri Oct 26 12:46:33 2012
(r242130)
@@ -56,6 +56,8 @@ struct mystate {
struct sbuf *sbuf[20];
struct gconf*config;
int nident;
+   XML_Parser  parser;
+   int error;
 };
 
 static void
@@ -85,6 +87,8 @@ StartElement(void *userData, const char 
if (!strcmp(name, class)  mt-class == NULL) {
mt-class = calloc(1, sizeof *mt-class);
if (mt-class == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
@@ -98,6 +102,8 @@ StartElement(void *userData, const char 
if (!strcmp(name, geom)  mt-geom == NULL) {
mt-geom = calloc(1, sizeof *mt-geom);
if (mt-geom == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
@@ -116,6 +122,8 @@ StartElement(void *userData, const char 
if (!strcmp(name, consumer)  mt-consumer == NULL) {
mt-consumer = calloc(1, sizeof *mt-consumer);
if (mt-consumer == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
@@ -137,6 +145,8 @@ StartElement(void *userData, const char 
if (!strcmp(name, provider)  mt-provider == NULL) {
mt-provider = calloc(1, sizeof *mt-provider);
if (mt-provider == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
@@ -180,16 +190,19 @@ EndElement(void *userData, const char *n
char *p;
 
mt = userData;
-   sbuf_finish(mt-sbuf[mt-level]);
-   p = strdup(sbuf_data(mt-sbuf[mt-level]));
+   p = NULL;
+   if (sbuf_finish(mt-sbuf[mt-level]) == 0)
+   p = strdup(sbuf_data(mt-sbuf[mt-level]));
+   sbuf_delete(mt-sbuf[mt-level]);
+   mt-sbuf[mt-level] = NULL;
+   mt-level--;
if (p == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
}
-   sbuf_delete(mt-sbuf[mt-level]);
-   mt-sbuf[mt-level] = NULL;
-   mt-level--;
if (strlen(p) == 0) {
free(p);
p = NULL;
@@ -249,12 +262,16 @@ EndElement(void *userData, const char *n
if (mt-config != NULL) {
gc = calloc(1, sizeof *gc);
if (gc == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
}
gc-lg_name = strdup(name);
if (gc-lg_name == NULL) {
+   mt-error = errno;
+   XML_StopParser(mt-parser, 0);
warn(Cannot allocate memory during processing of '%s' 
element, name);
return;
@@ -334,7 +351,7 @@ geom_xml2tree(struct gmesh *gmp, char *p
struct ggeom *ge;
struct gprovider *pr;
struct gconsumer *co;
-   int i;
+   int error, i;
 
memset(gmp, 0, sizeof *gmp);
LIST_INIT(gmp-lg_class);
@@ -347,14 +364,22 @@ geom_xml2tree(struct gmesh *gmp, char *p
return (ENOMEM);
}
mt-mesh = gmp;
+   mt-parser = parser;
+   error = 0;
XML_SetUserData(parser, mt);
XML_SetElementHandler(parser, StartElement, EndElement);
XML_SetCharacterDataHandler(parser, CharData);

Re: svn commit: r242079 - in head: sbin/ipfw share/man/man4 sys/conf sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw

2012-10-26 Thread Andre Oppermann

On 26.10.2012 14:29, Andrey V. Elsukov wrote:

On 26.10.2012 15:43, Andre Oppermann wrote:

A If you can show with your performance profiling that the sysctl
A isn't even necessary, you could leave it completely away and have
A pfil_forward enabled permanently.  That would be even better for
A everybody.

I'd prefer to have the sysctl. Benchmarking will definitely show
no regression, because in default case packets are tagless. But if
packets would carry 1 or 2 tags each, which don't actually belong
to PACKET_TAG_IPFORWARD, then processing would be pessimized.


With M_FASTFWD_OURS I used an overlay of the protocol specific M_PROTO[1-5]
mbuf flags.  The same can be done with M_IPFORWARD.  The ipfw code then
will not only add the m_tag but also set M_IPFORWARD flag.  That way no
sysctl is required and the feature is always available.  The overlay
definition is in ip_var.h.


It seems we have only one bit in the m_flags that can be used, so, maybe
we left it to some things that can appear in the future?


That's what the M_PROTO flags are for:

#define M_IPFW_FORWARD  M_PROTO2/* ip forwarding */

of course you have to do the same for ip6.

The M_PROTO[1-5] flags are only valid within a protocol layer.  For
example they get cleared in ip_output() before the packet is handed
to layer 2.

--
Andre

___
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: r242079 - in head: sbin/ipfw share/man/man4 sys/conf sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw

2012-10-26 Thread Andre Oppermann

On 26.10.2012 15:24, Andre Oppermann wrote:

On 26.10.2012 14:29, Andrey V. Elsukov wrote:

On 26.10.2012 15:43, Andre Oppermann wrote:

A If you can show with your performance profiling that the sysctl
A isn't even necessary, you could leave it completely away and have
A pfil_forward enabled permanently.  That would be even better for
A everybody.

I'd prefer to have the sysctl. Benchmarking will definitely show
no regression, because in default case packets are tagless. But if
packets would carry 1 or 2 tags each, which don't actually belong
to PACKET_TAG_IPFORWARD, then processing would be pessimized.


With M_FASTFWD_OURS I used an overlay of the protocol specific M_PROTO[1-5]
mbuf flags.  The same can be done with M_IPFORWARD.  The ipfw code then
will not only add the m_tag but also set M_IPFORWARD flag.  That way no
sysctl is required and the feature is always available.  The overlay
definition is in ip_var.h.


It seems we have only one bit in the m_flags that can be used, so, maybe
we left it to some things that can appear in the future?


That's what the M_PROTO flags are for:

#defineM_IPFW_FORWARDM_PROTO2/* ip forwarding */


Actually looking at it technically this isn't forwarding but specifying
a different nexthop.  Hence the #define and description should be more
like

#define M_IP_NEXTHOPM_PROTO2/* explicit ip nexthop */

Of course the userspace ipfw feature naming and usage doesn't change.
But within the kernel it's really nexthop manipulation within the
forwarding path.

--
Andre


of course you have to do the same for ip6.

The M_PROTO[1-5] flags are only valid within a protocol layer.  For
example they get cleared in ip_output() before the packet is handed
to layer 2.



___
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: r242120 - head/usr.sbin/cpucontrol

2012-10-26 Thread Jan Beich
Eitan Adler ead...@freebsd.org writes:

 Author: eadler
 Date: Fri Oct 26 02:50:16 2012
 New Revision: 242120
 URL: http://svn.freebsd.org/changeset/base/242120

 Log:
   This utility builds without NO_WCAST_ALIGN

Not for clang. It probably predates NO_WCAST_ALIGN.clang= support.

intel.c:66:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[0] = idargs.data[1];
 ^~
intel.c:67:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[1] = idargs.data[3];
 ^~
intel.c:68:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[2] = idargs.data[2];
 ^~
intel.c:211:7: warning: cast from 'char *' to 'intel_ext_header_t *' (aka 
'struct
  intel_ext_header *') increases required alignment from 1 to 4 
[-Wcast-align]
(intel_ext_header_t *)((char *)fw_image + payload_size);
^~~
amd.c:64:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[0] = idargs.data[1];
 ^~
amd.c:65:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[1] = idargs.data[3];
 ^~
amd.c:66:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[2] = idargs.data[2];
 ^~
via.c:64:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[0] = idargs.data[1];
 ^~
via.c:65:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[1] = idargs.data[3];
 ^~
via.c:66:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
  increases required alignment from 1 to 4 [-Wcast-align]
((uint32_t *)vendor)[2] = idargs.data[2];
 ^~
___
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: r242120 - head/usr.sbin/cpucontrol

2012-10-26 Thread Dimitry Andric

On 2012-10-26 15:37, Jan Beich wrote:

Eitan Adler ead...@freebsd.org writes:


Author: eadler
Date: Fri Oct 26 02:50:16 2012
New Revision: 242120
URL: http://svn.freebsd.org/changeset/base/242120

Log:
   This utility builds without NO_WCAST_ALIGN


Not for clang. It probably predates NO_WCAST_ALIGN.clang= support.

intel.c:66:3: warning: cast from 'char *' to 'uint32_t *' (aka 'unsigned int *')
   increases required alignment from 1 to 4 [-Wcast-align]
 ((uint32_t *)vendor)[0] = idargs.data[1];
  ^~


Yes, on x86, you can safely turn off the -Wcast-align warnings, if it is
easier.  It is probably not worth the trouble to go through the code and
fix the alignment issues, if it will never be run on alignment-sensitive
architectures.
___
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: r242134 - head/sys/conf

2012-10-26 Thread Warner Losh
Author: imp
Date: Fri Oct 26 14:36:02 2012
New Revision: 242134
URL: http://svn.freebsd.org/changeset/base/242134

Log:
  These no longer appera to be necessary for either 32-bit or 64-bit
  builds, eliminate them.

Modified:
  head/sys/conf/files.mips

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsFri Oct 26 14:30:52 2012(r242133)
+++ head/sys/conf/files.mipsFri Oct 26 14:36:02 2012(r242134)
@@ -49,12 +49,9 @@ kern/link_elf_obj.c  standard
 kern/subr_dummy_vdso_tc.c  standard
 
 # gcc/clang runtime
-libkern/ashldi3.c  standard
-libkern/ashrdi3.c  standard
 libkern/ffsl.c standard
 libkern/fls.c  standard
 libkern/flsl.c standard
-libkern/lshrdi3.c  standard
 libkern/memchr.c   optionalfdt
 libkern/memmove.c  standard
 libkern/ucmpdi2.c  optionalmips | mipsel
___
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: r242135 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2012-10-26 Thread Andriy Gapon
Author: avg
Date: Fri Oct 26 14:50:16 2012
New Revision: 242135
URL: http://svn.freebsd.org/changeset/base/242135

Log:
  zfs: fix label validation code in vdev_geom_read_config
  
  POOL_STATE_SPARE and POOL_STATE_L2CACHE were not handled correctly
  and thus the cache and spare disks would not be correctly probed.
  
  Reported by:  Michael Schmiedgen schmied...@gmx.net,
Matthew D. Fuller fulle...@over-yonder.net
  Tested by:Michael Schmiedgen schmied...@gmx.net,
flo
  MFC after:5 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Oct 
26 14:36:02 2012(r242134)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Oct 
26 14:50:16 2012(r242135)
@@ -270,14 +270,16 @@ vdev_geom_read_config(struct g_consumer 
continue;
 
if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
-   state) != 0 || state = POOL_STATE_DESTROYED) {
+   state) != 0 || state == POOL_STATE_DESTROYED ||
+   state  POOL_STATE_L2CACHE) {
nvlist_free(*config);
*config = NULL;
continue;
}
 
-   if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
-   txg) != 0 || txg == 0) {
+   if (state != POOL_STATE_SPARE  state != POOL_STATE_L2CACHE 
+   (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
+   txg) != 0 || txg == 0)) {
nvlist_free(*config);
*config = NULL;
continue;
___
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: r242136 - head/usr.bin/uuencode

2012-10-26 Thread Eitan Adler
Author: eadler
Date: Fri Oct 26 15:21:23 2012
New Revision: 242136
URL: http://svn.freebsd.org/changeset/base/242136

Log:
  Prefer an example users born after myself might use.
  
  Approved by:  bcr (mentor)
  MFC after:3 days

Modified:
  head/usr.bin/uuencode/uuencode.1

Modified: head/usr.bin/uuencode/uuencode.1
==
--- head/usr.bin/uuencode/uuencode.1Fri Oct 26 14:50:16 2012
(r242135)
+++ head/usr.bin/uuencode/uuencode.1Fri Oct 26 15:21:23 2012
(r242136)
@@ -183,7 +183,7 @@ tree.
 .Pp
 .Bd -literal -offset indent -compact
 tar cf \- src_tree \| compress \|
-uuencode src_tree.tar.Z \| mail sys1!sys2!user
+uuencode src_tree.tar.Z \| mail u...@example.com
 .Ed
 .Pp
 The following example unpacks all uuencoded
___
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: r242137 - in head: sys/dev/filemon tools/regression/filemon

2012-10-26 Thread David E. O'Brien
Author: obrien
Date: Fri Oct 26 15:44:29 2012
New Revision: 242137
URL: http://svn.freebsd.org/changeset/base/242137

Log:
  Iterate rather than use recursion.  We can blow out the kernel stack if there
  is a long chain of fork(2)s.

Added:
  head/tools/regression/filemon/timed-forkb.c   (contents, props changed)
Modified:
  head/sys/dev/filemon/filemon_wrapper.c
  head/tools/regression/filemon/Makefile

Modified: head/sys/dev/filemon/filemon_wrapper.c
==
--- head/sys/dev/filemon/filemon_wrapper.c  Fri Oct 26 15:21:23 2012
(r242136)
+++ head/sys/dev/filemon/filemon_wrapper.c  Fri Oct 26 15:44:29 2012
(r242137)
@@ -82,15 +82,14 @@ filemon_pid_check(struct proc *p)
 {
struct filemon *filemon;
 
-   TAILQ_FOREACH(filemon, filemons_inuse, link) {
-   if (p-p_pid == filemon-pid)
-   return (filemon);
+   while (p-p_pptr) {
+   TAILQ_FOREACH(filemon, filemons_inuse, link) {
+   if (p-p_pid == filemon-pid)
+   return (filemon);
+   }
+   p = p-p_pptr;
}
-
-   if (p-p_pptr == NULL)
-   return (NULL);
-
-   return (filemon_pid_check(p-p_pptr));
+   return (NULL);
 }
 
 static void

Modified: head/tools/regression/filemon/Makefile
==
--- head/tools/regression/filemon/Makefile  Fri Oct 26 15:21:23 2012
(r242136)
+++ head/tools/regression/filemon/Makefile  Fri Oct 26 15:44:29 2012
(r242137)
@@ -1,15 +1,33 @@
 # $FreeBSD$
 
-PROG=  filemontest
+BINS=  \
+   filemontest \
+   timed-forkb
+
+bins: filemontest timed-forkb
+all: bins
 
 NO_MAN=
 
 WARNS?=6
 CFLAGS+= -I${.CURDIR}/../../../sys
 
+# Should be WITHOUT_CTF= below, but stupid infastrurture fails:
+# /usr/share/mk/bsd.own.mk, line 489: WITH_CTF and WITHOUT_CTF can't both be 
set.
+WITHOUT_CDDL=
+
+CLEANFILES+=   ${BINS}
+
+tests: bins
+   kldstat | grep filemon
+   ${MAKE} test
+   ./timed-forkb
+   @echo filemon(4) tests passed.
+
 # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in .
-test: ${PROG} clean-test
-.for BIN in ${PROG} ${PROG}32
+#FILEMONTEST32=filemontest32
+test: filemontest clean-test
+.for BIN in filemontest ${FILEMONTEST32}
cd ${.CURDIR} ; \
for A in 1 2 3 4 5 6 7 8 9 0; do \
for B in 1 2 3 4 5 6 7 8 9 0; do \

Added: head/tools/regression/filemon/timed-forkb.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/filemon/timed-forkb.c Fri Oct 26 15:44:29 2012
(r242137)
@@ -0,0 +1,177 @@
+/*-
+ * Copyright (c) 2012 David O'Brien
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include sys/types.h
+#include sys/resource.h
+#include sys/sysctl.h
+#include sys/wait.h
+
+#include unistd.h
+#include stdlib.h
+#include signal.h
+#include errno.h
+#include stdio.h
+#include string.h
+#include time.h
+#include err.h
+#include assert.h
+
+#ifndef SLEEP
+#defineSLEEP   20  /* seconds */
+#endif
+
+int verbose;
+
+static void
+usage(void)
+{
+   fprintf(stderr, usage: %s\n, getprogname());
+   fprintf(stderr, \t\t-n : length of fork(2) chain\n);
+   fprintf(stderr, \t\t-t : limit run-time seconds\n);
+   exit(1);
+   /* NOTREACHED */
+}
+
+void term(int);
+void
+term(int signum)
+{
+
+   if (getpid() == getpgrp() || verbose) {
+   fprintf(stderr,

svn commit: r242138 - head/usr.bin/script

2012-10-26 Thread David E. O'Brien
Author: obrien
Date: Fri Oct 26 15:56:28 2012
New Revision: 242138
URL: http://svn.freebsd.org/changeset/base/242138

Log:
  Add -f to also output filemon(4) information.

Modified:
  head/usr.bin/script/script.1
  head/usr.bin/script/script.c

Modified: head/usr.bin/script/script.1
==
--- head/usr.bin/script/script.1Fri Oct 26 15:44:29 2012
(r242137)
+++ head/usr.bin/script/script.1Fri Oct 26 15:56:28 2012
(r242138)
@@ -28,7 +28,7 @@
 .\@(#)script.18.1 (Berkeley) 6/6/93
 .\ $FreeBSD$
 .\
-.Dd July 30, 2012
+.Dd Oct 27, 2012
 .Dt SCRIPT 1
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd make typescript of terminal session
 .Sh SYNOPSIS
 .Nm
-.Op Fl adkpqr
+.Op Fl adfkpqr
 .Op Fl t Ar time
 .Op Ar file Op Ar command ...
 .Sh DESCRIPTION
@@ -76,6 +76,13 @@ retaining the prior contents.
 When playing back a session with the
 .Fl p
 flag, do not sleep between records when playing back a timestamped session.
+.It Fl f
+Create
+.Ar file.filemon
+or
+.Pa typescript.filemon
+using
+.Xr filemon 4 .
 .It Fl k
 Log keys sent to the program as well as output.
 .It Fl p
@@ -151,6 +158,7 @@ is assumed.
 .El
 .Sh SEE ALSO
 .Xr csh 1
+.Xr filemon 4
 .Po
 for the
 .Em history

Modified: head/usr.bin/script/script.c
==
--- head/usr.bin/script/script.cFri Oct 26 15:44:29 2012
(r242137)
+++ head/usr.bin/script/script.cFri Oct 26 15:56:28 2012
(r242138)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2010, 2012  David E. O'Brien
  * Copyright (c) 1980, 1992, 1993
  * The Regents of the University of California.  All rights reserved.
  *
@@ -44,6 +45,7 @@ static const char sccsid[] = @(#)script
 #include sys/time.h
 #include sys/uio.h
 #include sys/endian.h
+#include dev/filemon/filemon.h
 
 #include err.h
 #include errno.h
@@ -70,7 +72,8 @@ static FILE *fscript;
 static int master, slave;
 static int child;
 static const char *fname;
-static int qflg, ttyflg;
+static char *fmfname;
+static int fflg, qflg, ttyflg;
 static int usesleep, rawout;
 
 static struct termios tt;
@@ -90,21 +93,23 @@ main(int argc, char *argv[])
int cc;
struct termios rtt, stt;
struct winsize win;
-   int aflg, kflg, pflg, ch, n;
struct timeval tv, *tvp;
time_t tvec, start;
char obuf[BUFSIZ];
char ibuf[BUFSIZ];
fd_set rfd;
-   int flushtime = 30;
-   int readstdin;
-   int k;
+   int aflg, kflg, pflg, ch, k, n;
+   int flushtime, readstdin;
+   int fm_fd, fm_log;
 
aflg = kflg = pflg = 0;
usesleep = 1;
rawout = 0;
+   flushtime = 30;
+   fm_fd = -1; /* Shut up stupid may be used uninitialized GCC
+  warning. (not needed w/clang) */
 
-   while ((ch = getopt(argc, argv, adkpqrt:)) != -1)
+   while ((ch = getopt(argc, argv, adfkpqrt:)) != -1)
switch(ch) {
case 'a':
aflg = 1;
@@ -112,6 +117,9 @@ main(int argc, char *argv[])
case 'd':
usesleep = 0;
break;
+   case 'f':
+   fflg = 1;
+   break;
case 'k':
kflg = 1;
break;
@@ -146,6 +154,23 @@ main(int argc, char *argv[])
if ((fscript = fopen(fname, pflg ? r : aflg ? a : w)) == NULL)
err(1, %s, fname);
 
+   if (fflg) {
+   asprintf(fmfname, %s.filemon, fname);
+   if (!fmfname)
+   err(1, %s.filemon, fname);
+   if ((fm_fd = open(/dev/filemon, O_RDWR)) == -1)
+   err(1, open(\/dev/filemon\, O_RDWR));
+   if ((fm_log = open(fmfname, O_WRONLY | O_CREAT | O_TRUNC,
+   S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
+   err(1, open(%s), fmfname);
+   if (ioctl(fm_fd, FILEMON_SET_FD, fm_log)  0)
+   err(1, Cannot set filemon log file descriptor);
+
+   /* Set up these two fd's to close on exec. */
+   (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC);
+   (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC);
+   }
+
if (pflg)
playback(fscript);
 
@@ -169,7 +194,7 @@ main(int argc, char *argv[])
(void)printf(Script started, output file is %s\n, fname);
if (!rawout) {
(void)fprintf(fscript, Script started on %s,
- ctime(tvec));
+   ctime(tvec));
if (argv[0]) {
fprintf(fscript, command: );
for (k = 0 ; argv[k] ; ++k)
@@ -179,6 +204,10 @@ main(int argc, char *argv[])
}
 

svn commit: r242139 - in head/sys: kern sys

2012-10-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Oct 26 16:01:08 2012
New Revision: 242139
URL: http://svn.freebsd.org/changeset/base/242139

Log:
  Add CPU percentage limit enforcement to RCTL.  The resouce name is pcpu.
  It was implemented by Rudolf Tomori during Google Summer of Code 2012.

Modified:
  head/sys/kern/kern_racct.c
  head/sys/kern/kern_rctl.c
  head/sys/kern/sched_4bsd.c
  head/sys/kern/subr_trap.c
  head/sys/sys/proc.h
  head/sys/sys/racct.h
  head/sys/sys/rctl.h
  head/sys/sys/sched.h

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Oct 26 15:56:28 2012(r242138)
+++ head/sys/kern/kern_racct.c  Fri Oct 26 16:01:08 2012(r242139)
@@ -33,6 +33,7 @@
 __FBSDID($FreeBSD$);
 
 #include opt_kdtrace.h
+#include opt_sched.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -50,10 +51,13 @@ __FBSDID($FreeBSD$);
 #include sys/sbuf.h
 #include sys/sched.h
 #include sys/sdt.h
+#include sys/smp.h
 #include sys/sx.h
+#include sys/sysctl.h
 #include sys/sysent.h
 #include sys/sysproto.h
 #include sys/umtx.h
+#include machine/smp.h
 
 #ifdef RCTL
 #include sys/rctl.h
@@ -63,6 +67,23 @@ __FBSDID($FreeBSD$);
 
 FEATURE(racct, Resource Accounting);
 
+/*
+ * Do not block processes that have their %cpu usage = pcpu_threshold.
+ */
+static int pcpu_threshold = 1;
+
+SYSCTL_NODE(_kern, OID_AUTO, racct, CTLFLAG_RW, 0, Resource Accounting);
+SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_threshold, CTLFLAG_RW, pcpu_threshold,
+0, Processes with higher %cpu usage than this value can be throttled.);
+
+/*
+ * How many seconds it takes to use the scheduler %cpu calculations.  When a
+ * process starts, we compute its %cpu usage by dividing its runtime by the
+ * process wall clock time.  After RACCT_PCPU_SECS pass, we use the value
+ * provided by the scheduler.
+ */
+#define RACCT_PCPU_SECS3
+
 static struct mtx racct_lock;
 MTX_SYSINIT(racct_lock, racct_lock, racct lock, MTX_DEF);
 
@@ -140,7 +161,217 @@ int racct_types[] = {
[RACCT_SHMSIZE] =
RACCT_RECLAIMABLE | RACCT_DENIABLE | RACCT_SLOPPY,
[RACCT_WALLCLOCK] =
-   RACCT_IN_MILLIONS };
+   RACCT_IN_MILLIONS,
+   [RACCT_PCTCPU] =
+   RACCT_DECAYING | RACCT_DENIABLE | RACCT_IN_MILLIONS };
+
+static const fixpt_t RACCT_DECAY_FACTOR = 0.3 * FSCALE;
+
+#ifdef SCHED_4BSD
+/*
+ * Contains intermediate values for %cpu calculations to avoid using floating
+ * point in the kernel.
+ * ccpu_exp[k] = FSCALE * (ccpu/FSCALE)^k = FSCALE * exp(-k/20)
+ * It is needed only for the 4BSD scheduler, because in ULE, the ccpu equals to
+ * zero so the calculations are more straightforward.
+ */
+fixpt_t ccpu_exp[] = {
+   [0] = FSCALE * 1,
+   [1] = FSCALE * 0.95122942450071400909,
+   [2] = FSCALE * 0.90483741803595957316,
+   [3] = FSCALE * 0.86070797642505780722,
+   [4] = FSCALE * 0.81873075307798185866,
+   [5] = FSCALE * 0.77880078307140486824,
+   [6] = FSCALE * 0.74081822068171786606,
+   [7] = FSCALE * 0.70468808971871343435,
+   [8] = FSCALE * 0.67032004603563930074,
+   [9] = FSCALE * 0.63762815162177329314,
+   [10] = FSCALE * 0.60653065971263342360,
+   [11] = FSCALE * 0.57694981038048669531,
+   [12] = FSCALE * 0.54881163609402643262,
+   [13] = FSCALE * 0.52204577676101604789,
+   [14] = FSCALE * 0.49658530379140951470,
+   [15] = FSCALE * 0.47236655274101470713,
+   [16] = FSCALE * 0.44932896411722159143,
+   [17] = FSCALE * 0.42741493194872666992,
+   [18] = FSCALE * 0.40656965974059911188,
+   [19] = FSCALE * 0.38674102345450120691,
+   [20] = FSCALE * 0.36787944117144232159,
+   [21] = FSCALE * 0.3499377495535467,
+   [22] = FSCALE * 0.33287108369807955328,
+   [23] = FSCALE * 0.31663676937905321821,
+   [24] = FSCALE * 0.30119421191220209664,
+   [25] = FSCALE * 0.28650479686019010032,
+   [26] = FSCALE * 0.27253179303401260312,
+   [27] = FSCALE * 0.25924026064589150757,
+   [28] = FSCALE * 0.24659696394160647693,
+   [29] = FSCALE * 0.23457028809379765313,
+   [30] = FSCALE * 0.22313016014842982893,
+   [31] = FSCALE * 0.21224797382674305771,
+   [32] = FSCALE * 0.20189651799465540848,
+   [33] = FSCALE * 0.19204990862075411423,
+   [34] = FSCALE * 0.18268352405273465022,
+   [35] = FSCALE * 0.17377394345044512668,
+   [36] = FSCALE * 0.1652922158653829,
+   [37] = FSCALE * 0.15723716631362761621,
+   [38] = FSCALE * 0.14956861922263505264,
+   [39] = FSCALE * 0.14227407158651357185,
+   [40] = FSCALE * 0.13533528323661269189,
+   [41] = FSCALE * 0.12873490358780421886,
+   [42] = FSCALE * 0.12245642825298191021,
+   [43] = FSCALE * 0.11648415777349695786,
+   [44] = FSCALE * 0.11080315836233388333,
+   [45] = FSCALE * 0.10539922456186433678,
+   [46] = FSCALE * 0.10025884372280373372,
+   

svn commit: r242140 - head/usr.bin/rctl

2012-10-26 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Oct 26 16:03:13 2012
New Revision: 242140
URL: http://svn.freebsd.org/changeset/base/242140

Log:
  Add pcpu to the the rctl(8) manual page.

Modified:
  head/usr.bin/rctl/rctl.8

Modified: head/usr.bin/rctl/rctl.8
==
--- head/usr.bin/rctl/rctl.8Fri Oct 26 16:01:08 2012(r242139)
+++ head/usr.bin/rctl/rctl.8Fri Oct 26 16:03:13 2012(r242140)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 16, 2012
+.Dd October 26, 2012
 .Dt RCTL 8
 .Os
 .Sh NAME
@@ -146,6 +146,7 @@ A filter that matches all defined rules 
 .It nshm Ta number of SysV shared memory segments
 .It shmsize Ta SysV shared memory size, in bytes
 .It wallclock Ta wallclock time, in seconds
+.It pcpu Ta %CPU, in percents of a single CPU core
 .El
 .Sh ACTIONS
 .Bl -column -offset 3n pseudoterminals
___
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: r242144 - head/sys/dev/ath

2012-10-26 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 26 16:31:12 2012
New Revision: 242144
URL: http://svn.freebsd.org/changeset/base/242144

Log:
  Since it's not immediately obvious whether the current TX path handles
  fragment rate lookups correctly, add a comment describing exactly that.
  
  The assumption in the fragment duration code is the duration of the next
  fragment will match the rate used by the current fragment.  But I think
  a rate lookup is being done for _each_ fragment.  For older pre-sample
  rate control this would almost always be the case, but for sample
  it may be incorrect more often then correct.

Modified:
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cFri Oct 26 16:30:49 2012
(r242143)
+++ head/sys/dev/ath/if_ath_tx.cFri Oct 26 16:31:12 2012
(r242144)
@@ -1067,6 +1067,10 @@ ath_tx_calc_duration(struct ath_softc *s
 * Include the size of next fragment so NAV is
 * updated properly.  The last fragment uses only
 * the ACK duration
+*
+* XXX TODO: ensure that the rate lookup for each
+* fragment is the same as the rate used by the
+* first fragment!
 */
dur += ath_hal_computetxtime(ah, rt,
bf-bf_m-m_nextpkt-m_pkthdr.len,
___
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: r242145 - head/sys/boot/common

2012-10-26 Thread Alexander Motin
Author: mav
Date: Fri Oct 26 16:32:20 2012
New Revision: 242145
URL: http://svn.freebsd.org/changeset/base/242145

Log:
  Fix loader crash when some unhalted exception happens during `include`
  command execution.  In case of such unhandled exception, vmReset() inside
  ficlExecC() flushes the VM state.  Attempt to return back to Forth after
  that cause garbage dereference with unexpected results.  To avoid that
  situation call vmThrow() directly instead of expecting Forth to do it.

Modified:
  head/sys/boot/common/interp_forth.c

Modified: head/sys/boot/common/interp_forth.c
==
--- head/sys/boot/common/interp_forth.c Fri Oct 26 16:31:12 2012
(r242144)
+++ head/sys/boot/common/interp_forth.c Fri Oct 26 16:32:20 2012
(r242145)
@@ -132,6 +132,12 @@ bf_command(FICL_VM *vm)
result=BF_PARSE;
 }
 free(line);
+/*
+ * If there was error during nested ficlExec(), we may no longer have
+ * valid environment to return.  Throw all exceptions from here.
+ */
+if (result != 0)
+   vmThrow(vm, result);
 /* This is going to be thrown!!! */
 stackPushINT(vm-pStack,result);
 }
___
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: r242146 - head/share/man/man9

2012-10-26 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri Oct 26 16:40:03 2012
New Revision: 242146
URL: http://svn.freebsd.org/changeset/base/242146

Log:
  mdoc: sort sections.

Modified:
  head/share/man/man9/zero_copy.9

Modified: head/share/man/man9/zero_copy.9
==
--- head/share/man/man9/zero_copy.9 Fri Oct 26 16:32:20 2012
(r242145)
+++ head/share/man/man9/zero_copy.9 Fri Oct 26 16:40:03 2012
(r242146)
@@ -156,8 +156,6 @@ variables respectively.
 .Xr sendfile 2 ,
 .Xr socket 2 ,
 .Xr ti 4
-.Sh BUGS
-The COW based send mechanism is not safe and may result in kernel crashes.
 .Sh HISTORY
 The zero copy sockets code first appeared in
 .Fx 5.0 ,
@@ -169,3 +167,5 @@ The zero copy sockets code was originall
 .An Andrew Gallatin Aq galla...@freebsd.org
 and substantially modified and updated by
 .An Kenneth Merry Aq k...@freebsd.org .
+.Sh BUGS
+The COW based send mechanism is not safe and may result in kernel crashes.
___
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: r242149 - head/sys/net80211

2012-10-26 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 26 16:56:55 2012
New Revision: 242149
URL: http://svn.freebsd.org/changeset/base/242149

Log:
  Fix up some initial issues with creation and deletion of hotplugged
  net80211 devices and vaps.
  
  * vnet sets vnet0 during kldload and device probe/attach, but not for
the hotplug event.  Thus, plugging in a NIC causes things to panic.
So, add a CURVNET_SET(vnet0) for now during the attach phase, until
the hotplug code is taught to set CURVNET_SET(vnet0).
  
  * there's also no implied detach vnet context - so teach the detach
path about ifp-if_vnet.
  
  * When creating/deleting vaps, also set the vnet context appropriately.
These can be done at any time.
  
  Now, the problems!
  
  * ieee80211.c is supposed to be OS-portable code, with no OS-specific stuff
like vnet. That should be fixed.
  
  * When the device hotplug code gets taught about CURVNET_SET(vnet0), the
device vnet set can go away; but the VAP vnet set still needs to be there.
  
  * .. and there still is the question about potentially adding an implied
CURVNET_SET(ifp-if_vnet) on if_free(), since any/all devices may end up
being detached by a hotplug event in today's world.  That's going to be
a topic of a subsequent commit.

Modified:
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_freebsd.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Fri Oct 26 16:52:56 2012
(r242148)
+++ head/sys/net80211/ieee80211.c   Fri Oct 26 16:56:55 2012
(r242149)
@@ -317,7 +317,11 @@ ieee80211_ifattach(struct ieee80211com *
 
ifp-if_addrlen = IEEE80211_ADDR_LEN;
ifp-if_hdrlen = 0;
+
+   CURVNET_SET(vnet0);
+
if_attach(ifp);
+
ifp-if_mtu = IEEE80211_MTU_MAX;
ifp-if_broadcastaddr = ieee80211broadcastaddr;
ifp-if_output = null_output;
@@ -331,6 +335,8 @@ ieee80211_ifattach(struct ieee80211com *
sdl-sdl_alen = IEEE80211_ADDR_LEN;
IEEE80211_ADDR_COPY(LLADDR(sdl), macaddr);
ifa_free(ifa);
+
+   CURVNET_RESTORE();
 }
 
 /*
@@ -345,8 +351,18 @@ ieee80211_ifdetach(struct ieee80211com *
struct ifnet *ifp = ic-ic_ifp;
struct ieee80211vap *vap;
 
+   /*
+* This detaches the main interface, but not the vaps.
+* Each VAP may be in a separate VIMAGE.
+*/
+   CURVNET_SET(ifp-if_vnet);
if_detach(ifp);
+   CURVNET_RESTORE();
 
+   /*
+* The VAP is responsible for setting and clearing
+* the VIMAGE context.
+*/
while ((vap = TAILQ_FIRST(ic-ic_vaps)) != NULL)
ieee80211_vap_destroy(vap);
ieee80211_waitfor_parent(ic);
@@ -365,7 +381,9 @@ ieee80211_ifdetach(struct ieee80211com *
ieee80211_power_detach(ic);
ieee80211_node_detach(ic);
 
+   /* XXX VNET needed? */
ifmedia_removeall(ic-ic_media);
+
taskqueue_free(ic-ic_tq);
IEEE80211_LOCK_DESTROY(ic);
 }
@@ -586,6 +604,8 @@ ieee80211_vap_detach(struct ieee80211vap
struct ieee80211com *ic = vap-iv_ic;
struct ifnet *ifp = vap-iv_ifp;
 
+   CURVNET_SET(ifp-if_vnet);
+
IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, %s: %s parent %s\n,
__func__, ieee80211_opmode_name[vap-iv_opmode],
ic-ic_ifp-if_xname);
@@ -638,6 +658,8 @@ ieee80211_vap_detach(struct ieee80211vap
ieee80211_sysctl_vdetach(vap);
 
if_free(ifp);
+
+   CURVNET_RESTORE();
 }
 
 /*

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Fri Oct 26 16:52:56 2012
(r242148)
+++ head/sys/net80211/ieee80211_freebsd.c   Fri Oct 26 16:56:55 2012
(r242149)
@@ -152,7 +152,9 @@ wlan_clone_destroy(struct ifnet *ifp)
 void
 ieee80211_vap_destroy(struct ieee80211vap *vap)
 {
+   CURVNET_SET(vap-iv_ifp-if_vnet);
if_clone_destroyif(wlan_cloner, vap-iv_ifp);
+   CURVNET_RESTORE();
 }
 
 int
___
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: r241610 - in head: . sys/dev/usb sys/net sys/net80211 sys/netpfil/ipfw sys/netpfil/pf sys/sys

2012-10-26 Thread Adrian Chadd
So with this change, you've broken building -HEAD net80211 on -9.

Can we please sit down and make this work on both freebsd-9 and
freebsd-head? I do a lot of wifi development on -9 with -HEAD wireless
and this change broke everything for me.

You could've at least asked the maintainers first before you did this.

Thanks,


Adrian

On 16 October 2012 06:37, Gleb Smirnoff gleb...@freebsd.org wrote:
 Author: glebius
 Date: Tue Oct 16 13:37:54 2012
 New Revision: 241610
 URL: http://svn.freebsd.org/changeset/base/241610

 Log:
   Make the struct if_clone opaque to users of the cloning API. Users
   now use function calls:

 if_clone_simple()
 if_clone_advanced()

   to initialize a cloner, instead of macros that initialize if_clone
   structure.

   Discussed with:   brooks, bz, 1 year ago

 Modified:
   head/UPDATING
   head/sys/dev/usb/usb_pf.c
   head/sys/net/if_bridge.c
   head/sys/net/if_clone.c
   head/sys/net/if_clone.h
   head/sys/net/if_disc.c
   head/sys/net/if_edsc.c
   head/sys/net/if_enc.c
   head/sys/net/if_epair.c
   head/sys/net/if_faith.c
   head/sys/net/if_gif.c
   head/sys/net/if_gre.c
   head/sys/net/if_lagg.c
   head/sys/net/if_loop.c
   head/sys/net/if_stf.c
   head/sys/net/if_tap.c
   head/sys/net/if_tun.c
   head/sys/net/if_vlan.c
   head/sys/net80211/ieee80211_freebsd.c
   head/sys/netpfil/ipfw/ip_fw_log.c
   head/sys/netpfil/pf/if_pflog.c
   head/sys/netpfil/pf/if_pfsync.c
   head/sys/sys/param.h

 Modified: head/UPDATING
 ==
 --- head/UPDATING   Tue Oct 16 13:27:20 2012(r241609)
 +++ head/UPDATING   Tue Oct 16 13:37:54 2012(r241610)
 @@ -24,6 +24,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 disable the most expensive debugging functionality run
 ln -s 'abort:false,junk:false' /etc/malloc.conf.)

 +20121016:
 +   The interface cloning API and ABI has changed. The following
 +   modules need to be recompiled together with kernel:
 +   ipfw(4), pfsync(4), pflog(4), usb(4), wlan(4), stf(4),
 +   vlan(4), disc(4), edsc(4), if_bridge(4), gif(4), tap(4),
 +   faith(4), epair(4), enc(4), tun(4), if_lagg(4), gre(4).
 +
  20121015:
 The sdhci driver was split in two parts: sdhci (generic SD Host
 Controller logic) and sdhci_pci (actual hardware driver).

 Modified: head/sys/dev/usb/usb_pf.c
 ==
 --- head/sys/dev/usb/usb_pf.c   Tue Oct 16 13:27:20 2012(r241609)
 +++ head/sys/dev/usb/usb_pf.c   Tue Oct 16 13:37:54 2012(r241610)
 @@ -60,8 +60,6 @@ __FBSDID($FreeBSD$);
  #include dev/usb/usb_pf.h
  #include dev/usb/usb_transfer.h

 -#defineUSBUSNAME   usbus
 -
  static void usbpf_init(void);
  static void usbpf_uninit(void);
  static int usbpf_ioctl(struct ifnet *, u_long, caddr_t);
 @@ -74,9 +72,8 @@ static uint32_t usbpf_aggregate_status(s
  static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t);
  static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int);

 -static struct if_clone usbpf_cloner = IFC_CLONE_INITIALIZER(
 -USBUSNAME, NULL, IF_MAXUNIT,
 -NULL, usbpf_clone_match, usbpf_clone_create, usbpf_clone_destroy);
 +static struct if_clone *usbpf_cloner;
 +static const char usbusname[] = usbus;

  SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL);
  SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL);
 @@ -85,7 +82,8 @@ static void
  usbpf_init(void)
  {

 -   if_clone_attach(usbpf_cloner);
 +   usbpf_cloner = if_clone_advanced(usbusname, 0, usbpf_clone_match,
 +   usbpf_clone_create, usbpf_clone_destroy);
  }

  static void
 @@ -98,9 +96,9 @@ usbpf_uninit(void)
 int error;
 int i;

 -   if_clone_detach(usbpf_cloner);
 +   if_clone_detach(usbpf_cloner);

 -   dc = devclass_find(USBUSNAME);
 +   dc = devclass_find(usbusname);
 if (dc == NULL)
 return;
 error = devclass_get_devices(dc, devlp, devlcnt);
 @@ -109,7 +107,7 @@ usbpf_uninit(void)
 for (i = 0; i  devlcnt; i++) {
 ubus = device_get_softc(devlp[i]);
 if (ubus != NULL  ubus-ifp != NULL)
 -   usbpf_clone_destroy(usbpf_cloner, ubus-ifp);
 +   usbpf_clone_destroy(usbpf_cloner, ubus-ifp);
 }
 free(devlp, M_TEMP);
  }
 @@ -130,12 +128,12 @@ usbpf_ifname2ubus(const char *ifname)
 int unit;
 int error;

 -   if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME) - 1) != 0)
 +   if (strncmp(ifname, usbusname, sizeof(usbusname) - 1) != 0)
 return (NULL);
 error = ifc_name2unit(ifname, unit);
 if (error || unit  0)
 return (NULL);
 -   dc = devclass_find(USBUSNAME);
 +   dc = devclass_find(usbusname);
 if (dc == NULL)
 return (NULL);

svn commit: r242151 - in head/sys: vm xen/evtchn

2012-10-26 Thread Andre Oppermann
Author: andre
Date: Fri Oct 26 17:31:35 2012
New Revision: 242151
URL: http://svn.freebsd.org/changeset/base/242151

Log:
  Move the corresponding MTX_SYSINIT() next to their struct mtx declaration
  to make their relationship more obvious as done with the other such mutexs.

Modified:
  head/sys/vm/vm_glue.c
  head/sys/xen/evtchn/evtchn.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Fri Oct 26 17:02:50 2012(r242150)
+++ head/sys/vm/vm_glue.c   Fri Oct 26 17:31:35 2012(r242151)
@@ -307,6 +307,8 @@ struct kstack_cache_entry *kstack_cache;
 static int kstack_cache_size = 128;
 static int kstacks;
 static struct mtx kstack_cache_mtx;
+MTX_SYSINIT(kstack_cache, kstack_cache_mtx, kstkch, MTX_DEF);
+
 SYSCTL_INT(_vm, OID_AUTO, kstack_cache_size, CTLFLAG_RW, kstack_cache_size, 0,
 );
 SYSCTL_INT(_vm, OID_AUTO, kstacks, CTLFLAG_RD, kstacks, 0,
@@ -486,7 +488,6 @@ kstack_cache_init(void *nulll)
EVENTHANDLER_PRI_ANY);
 }
 
-MTX_SYSINIT(kstack_cache, kstack_cache_mtx, kstkch, MTX_DEF);
 SYSINIT(vm_kstacks, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, kstack_cache_init, 
NULL);
 
 #ifndef NO_SWAPPING

Modified: head/sys/xen/evtchn/evtchn.c
==
--- head/sys/xen/evtchn/evtchn.cFri Oct 26 17:02:50 2012
(r242150)
+++ head/sys/xen/evtchn/evtchn.cFri Oct 26 17:31:35 2012
(r242151)
@@ -44,7 +44,15 @@ static inline unsigned long __ffs(unsign
 return word;
 }
 
+/*
+ * irq_mapping_update_lock: in order to allow an interrupt to occur in a 
critical
+ * section, to set pcpu-ipending (etc...) properly, we
+ * must be able to get the icu lock, so it can't be
+ * under witness.
+ */
 static struct mtx irq_mapping_update_lock;
+MTX_SYSINIT(irq_mapping_update_lock, irq_mapping_update_lock, xp, MTX_SPIN);
+
 static struct xenpic *xp;
 struct xenpic_intsrc {
struct intsrc xp_intsrc;
@@ -1130,11 +1138,4 @@ evtchn_init(void *dummy __unused)
 }
 
 SYSINIT(evtchn_init, SI_SUB_INTR, SI_ORDER_MIDDLE, evtchn_init, NULL);
-/*
- * irq_mapping_update_lock: in order to allow an interrupt to occur in a 
critical
- * section, to set pcpu-ipending (etc...) properly, we
- * must be able to get the icu lock, so it can't be
- * under witness.
- */
 
-MTX_SYSINIT(irq_mapping_update_lock, irq_mapping_update_lock, xp, MTX_SPIN);
___
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: r242152 - in head: lib/libmemstat sys/vm

2012-10-26 Thread Matthew D Fleming
Author: mdf
Date: Fri Oct 26 17:51:05 2012
New Revision: 242152
URL: http://svn.freebsd.org/changeset/base/242152

Log:
  Const-ify the zone name argument to uma_zcreate(9).
  
  MFC after:3 days

Modified:
  head/lib/libmemstat/memstat_uma.c
  head/sys/vm/uma.h
  head/sys/vm/uma_core.c
  head/sys/vm/uma_int.h

Modified: head/lib/libmemstat/memstat_uma.c
==
--- head/lib/libmemstat/memstat_uma.c   Fri Oct 26 17:31:35 2012
(r242151)
+++ head/lib/libmemstat/memstat_uma.c   Fri Oct 26 17:51:05 2012
(r242152)
@@ -254,7 +254,7 @@ kread(kvm_t *kvm, void *kvm_pointer, voi
 }
 
 static int
-kread_string(kvm_t *kvm, void *kvm_pointer, char *buffer, int buflen)
+kread_string(kvm_t *kvm, const void *kvm_pointer, char *buffer, int buflen)
 {
ssize_t ret;
int i;

Modified: head/sys/vm/uma.h
==
--- head/sys/vm/uma.h   Fri Oct 26 17:31:35 2012(r242151)
+++ head/sys/vm/uma.h   Fri Oct 26 17:51:05 2012(r242152)
@@ -165,9 +165,9 @@ typedef void (*uma_fini)(void *mem, int 
  * A pointer to a structure which is intended to be opaque to users of
  * the interface.  The value may be null if the wait flag is not set.
  */
-uma_zone_t uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
-   uma_init uminit, uma_fini fini, int align,
-   u_int32_t flags);
+uma_zone_t uma_zcreate(const char *name, size_t size, uma_ctor ctor,
+   uma_dtor dtor, uma_init uminit, uma_fini fini,
+   int align, u_int32_t flags);
 
 /*
  * Create a secondary uma zone

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Fri Oct 26 17:31:35 2012(r242151)
+++ head/sys/vm/uma_core.c  Fri Oct 26 17:51:05 2012(r242152)
@@ -158,7 +158,7 @@ static struct callout uma_callout;
  * a special allocation function just for zones.
  */
 struct uma_zctor_args {
-   char *name;
+   const char *name;
size_t size;
uma_ctor ctor;
uma_dtor dtor;
@@ -1828,7 +1828,7 @@ uma_set_align(int align)
 
 /* See uma.h */
 uma_zone_t
-uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
+uma_zcreate(const char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
uma_init uminit, uma_fini fini, int align, u_int32_t flags)
 
 {

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Fri Oct 26 17:31:35 2012(r242151)
+++ head/sys/vm/uma_int.h   Fri Oct 26 17:51:05 2012(r242152)
@@ -202,7 +202,7 @@ struct uma_keg {
struct mtx  uk_lock;/* Lock for the keg */
struct uma_hash uk_hash;
 
-   char*uk_name;   /* Name of creating zone. */
+   const char  *uk_name;   /* Name of creating zone. */
LIST_HEAD(,uma_zone)uk_zones;   /* Keg's zones */
LIST_HEAD(,uma_slab)uk_part_slab;   /* partially allocated slabs */
LIST_HEAD(,uma_slab)uk_free_slab;   /* empty slab list */
@@ -305,7 +305,7 @@ typedef struct uma_klink *uma_klink_t;
  *
  */
 struct uma_zone {
-   char*uz_name;   /* Text name of the zone */
+   const char  *uz_name;   /* Text name of the zone */
struct mtx  *uz_lock;   /* Lock for the zone (keg's lock) */
 
LIST_ENTRY(uma_zone)uz_link;/* List of all zones in keg */
___
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: r242154 - head/sys/net80211

2012-10-26 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 26 19:06:24 2012
New Revision: 242154
URL: http://svn.freebsd.org/changeset/base/242154

Log:
  Allow net80211 to be built on -9 and -8.
  
  There are some people who use the -HEAD net80211 and wireless drivers
  on earlier FreeBSD versions in order to get the updated 802.11n support.
  The previous if_clone API changes broke this.

Modified:
  head/sys/net80211/ieee80211_freebsd.c

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Fri Oct 26 18:06:49 2012
(r242153)
+++ head/sys/net80211/ieee80211_freebsd.c   Fri Oct 26 19:06:24 2012
(r242154)
@@ -65,9 +65,10 @@ SYSCTL_INT(_net_wlan, OID_AUTO, debug, C
 
 static MALLOC_DEFINE(M_80211_COM, 80211com, 802.11 com state);
 
+#if __FreeBSD_version = 120
 static const char wlanname[] = wlan;
-
 static struct if_clone *wlan_cloner;
+#endif
 
 /*
  * Allocate/free com structure in conjunction with ifnet;
@@ -133,10 +134,19 @@ wlan_clone_create(struct if_clone *ifc, 
if_printf(ifp, TDMA not supported\n);
return EOPNOTSUPP;
}
+#if __FreeBSD_version = 120
vap = ic-ic_vap_create(ic, wlanname, unit,
cp.icp_opmode, cp.icp_flags, cp.icp_bssid,
cp.icp_flags  IEEE80211_CLONE_MACADDR ?
cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp));
+#else
+   vap = ic-ic_vap_create(ic, ifc-ifc_name, unit,
+   cp.icp_opmode, cp.icp_flags, cp.icp_bssid,
+   cp.icp_flags  IEEE80211_CLONE_MACADDR ?
+   cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp));
+
+#endif
+
return (vap == NULL ? EIO : 0);
 }
 
@@ -149,11 +159,17 @@ wlan_clone_destroy(struct ifnet *ifp)
ic-ic_vap_delete(vap);
 }
 
+IFC_SIMPLE_DECLARE(wlan, 0);
+
 void
 ieee80211_vap_destroy(struct ieee80211vap *vap)
 {
CURVNET_SET(vap-iv_ifp-if_vnet);
+#if __FreeBSD_version = 120
if_clone_destroyif(wlan_cloner, vap-iv_ifp);
+#else
+   if_clone_destroyif(wlan_cloner, vap-iv_ifp);
+#endif
CURVNET_RESTORE();
 }
 
@@ -811,13 +827,21 @@ wlan_modevent(module_t mod, int type, vo
EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent);
return ENOMEM;
}
+#if __FreeBSD_version = 120
wlan_cloner = if_clone_simple(wlanname, wlan_clone_create,
wlan_clone_destroy, 0);
+#else
+   if_clone_attach(wlan_cloner);
+#endif
if_register_com_alloc(IFT_IEEE80211, wlan_alloc, wlan_free);
return 0;
case MOD_UNLOAD:
if_deregister_com_alloc(IFT_IEEE80211);
+#if __FreeBSD_version = 120
if_clone_detach(wlan_cloner);
+#else
+   if_clone_detach(wlan_cloner);
+#endif
EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent);
EVENTHANDLER_DEREGISTER(iflladdr_event, wlan_ifllevent);
return 0;
@@ -826,7 +850,11 @@ wlan_modevent(module_t mod, int type, vo
 }
 
 static moduledata_t wlan_mod = {
+#if __FreeBSD_version = 120
wlanname,
+#else
+   wlan,
+#endif
wlan_modevent,
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: r242155 - head/sys/net80211

2012-10-26 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 26 19:46:55 2012
New Revision: 242155
URL: http://svn.freebsd.org/changeset/base/242155

Log:
  Oops, missed in my last commit.

Modified:
  head/sys/net80211/ieee80211_freebsd.c

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Fri Oct 26 19:06:24 2012
(r242154)
+++ head/sys/net80211/ieee80211_freebsd.c   Fri Oct 26 19:46:55 2012
(r242155)
@@ -159,7 +159,9 @@ wlan_clone_destroy(struct ifnet *ifp)
ic-ic_vap_delete(vap);
 }
 
+#if __FreeBSD_version  120
 IFC_SIMPLE_DECLARE(wlan, 0);
+#endif
 
 void
 ieee80211_vap_destroy(struct ieee80211vap *vap)
___
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: r242156 - in head/sys/dev/ata: . chipsets

2012-10-26 Thread Alexander Motin
Author: mav
Date: Fri Oct 26 20:03:08 2012
New Revision: 242156
URL: http://svn.freebsd.org/changeset/base/242156

Log:
  Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) for
  ata(4) driver in ATA_CAM mode.  That slighty improves error reporting and
  also should fix `smartctl -l scterc /dev/adaX` operation.
  
  MFC after:3 weeks

Modified:
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ata/ata-all.h
  head/sys/dev/ata/ata-lowlevel.c
  head/sys/dev/ata/chipsets/ata-ahci.c
  head/sys/dev/ata/chipsets/ata-siliconimage.c

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Fri Oct 26 19:46:55 2012(r242155)
+++ head/sys/dev/ata/ata-all.c  Fri Oct 26 20:03:08 2012(r242156)
@@ -1492,6 +1492,8 @@ ata_cam_begin_transaction(device_t dev, 
request-u.ata.lba |= ((uint64_t)ccb-ataio.cmd.lba_high  16) 
|
  ((uint64_t)ccb-ataio.cmd.lba_mid  8) |
   (uint64_t)ccb-ataio.cmd.lba_low;
+   if (ccb-ataio.cmd.flags  CAM_ATAIO_NEEDRESULT)
+   request-flags |= ATA_R_NEEDRESULT;
if ((ccb-ccb_h.flags  CAM_DIR_MASK) != CAM_DIR_NONE 
ccb-ataio.cmd.flags  CAM_ATAIO_DMA)
request-flags |= ATA_R_DMA;

Modified: head/sys/dev/ata/ata-all.h
==
--- head/sys/dev/ata/ata-all.h  Fri Oct 26 19:46:55 2012(r242155)
+++ head/sys/dev/ata/ata-all.h  Fri Oct 26 20:03:08 2012(r242156)
@@ -397,6 +397,7 @@ struct ata_request {
 #define ATA_R_REQUEUE   0x0400
 #define ATA_R_THREAD0x0800
 #define ATA_R_DIRECT0x1000
+#define ATA_R_NEEDRESULT0x2000
 
 #define ATA_R_ATAPI16   0x0001
 #define ATA_R_ATAPI_INTR0x0002

Modified: head/sys/dev/ata/ata-lowlevel.c
==
--- head/sys/dev/ata/ata-lowlevel.c Fri Oct 26 19:46:55 2012
(r242155)
+++ head/sys/dev/ata/ata-lowlevel.c Fri Oct 26 20:03:08 2012
(r242156)
@@ -116,6 +116,7 @@ ata_begin_transaction(struct ata_request
} while (request-status  ATA_S_BUSY  timeout--);
if (request-status  ATA_S_ERROR)
request-error = ATA_IDX_INB(ch, ATA_ERROR);
+   ch-hw.tf_read(request);
goto begin_finished;
}
 
@@ -253,8 +254,9 @@ ata_end_transaction(struct ata_request *
if (request-flags  ATA_R_TIMEOUT)
goto end_finished;
 
-   /* on control commands read back registers to the request struct */
-   if (request-flags  ATA_R_CONTROL) {
+   /* Read back registers to the request struct. */
+   if ((request-status  ATA_S_ERROR) ||
+   (request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT))) {
ch-hw.tf_read(request);
}
 
@@ -332,6 +334,12 @@ ata_end_transaction(struct ata_request *
else if (!(request-flags  ATA_R_TIMEOUT))
request-donecount = request-bytecount;
 
+   /* Read back registers to the request struct. */
+   if ((request-status  ATA_S_ERROR) ||
+   (request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT))) {
+   ch-hw.tf_read(request);
+   }
+
/* release SG list etc */
ch-dma.unload(request);
 

Modified: head/sys/dev/ata/chipsets/ata-ahci.c
==
--- head/sys/dev/ata/chipsets/ata-ahci.cFri Oct 26 19:46:55 2012
(r242155)
+++ head/sys/dev/ata/chipsets/ata-ahci.cFri Oct 26 20:03:08 2012
(r242156)
@@ -555,8 +555,10 @@ ata_ahci_end_transaction(struct ata_requ
 if (request-status  ATA_S_ERROR)  
request-error = tf_data  8;
 
-/* on control commands read back registers to the request struct */
-if (request-flags  ATA_R_CONTROL) {
+/* Read back registers to the request struct. */
+if ((request-flags  ATA_R_ATAPI) == 0 
+   ((request-status  ATA_S_ERROR) ||
+(request-flags  (ATA_R_CONTROL | ATA_R_NEEDRESULT {
u_int8_t *fis = ch-dma.work + ATA_AHCI_FB_OFFSET + 0x40;
 
request-u.ata.count = fis[12] | ((u_int16_t)fis[13]  8);

Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c
==
--- head/sys/dev/ata/chipsets/ata-siliconimage.cFri Oct 26 19:46:55 
2012(r242155)
+++ head/sys/dev/ata/chipsets/ata-siliconimage.cFri Oct 26 20:03:08 
2012(r242156)
@@ -658,8 +658,10 @@ ata_siiprb_end_transaction(struct ata_re
}
 }
 
-/* on control commands read back registers to the request struct */
-if (request-flags  ATA_R_CONTROL) {
+   

svn commit: r242157 - head/tools/regression/filemon

2012-10-26 Thread David E. O'Brien
Author: obrien
Date: Fri Oct 26 20:14:40 2012
New Revision: 242157
URL: http://svn.freebsd.org/changeset/base/242157

Log:
  Test both active and non-active cases.

Modified:
  head/tools/regression/filemon/Makefile

Modified: head/tools/regression/filemon/Makefile
==
--- head/tools/regression/filemon/Makefile  Fri Oct 26 20:03:08 2012
(r242156)
+++ head/tools/regression/filemon/Makefile  Fri Oct 26 20:14:40 2012
(r242157)
@@ -21,7 +21,11 @@ CLEANFILES+= ${BINS}
 tests: bins
kldstat | grep filemon
${MAKE} test
+   @echo Without filemon(4) active:
./timed-forkb
+   @echo With filemon(4) active:
+   script -f typescript-timed-forkb ./timed-forkb
+   ls -l typescript-timed-forkb.filemon
@echo filemon(4) tests passed.
 
 # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in .
@@ -40,7 +44,11 @@ test: filemontest clean-test
grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo Time stamp 
format OK
 .endfor
 
+CLEANFILES+=   typescript-timed-forkb typescript-timed-forkb.filemon
+
 clean-test:
cd ${.CURDIR} ; rm -f filemon_log.*
 
+clean-tests: clean-test
+
 .include bsd.prog.mk
___
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: r242120 - head/usr.sbin/cpucontrol

2012-10-26 Thread Eitan Adler
On 26 October 2012 10:02, Dimitry Andric d...@freebsd.org wrote:
 Yes, on x86, you can safely turn off the -Wcast-align warnings, if it is
 easier.  It is probably not worth the trouble to go through the code and
 fix the alignment issues, if it will never be run on alignment-sensitive
 architectures.

Oh joy, I'll remember to test universe on clang; universe on gcc
next time. :(


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r242158 - head/sys/dev/filemon

2012-10-26 Thread David E. O'Brien
Author: obrien
Date: Fri Oct 26 20:24:13 2012
New Revision: 242158
URL: http://svn.freebsd.org/changeset/base/242158

Log:
  A little bit easier to read.

Modified:
  head/sys/dev/filemon/filemon.c

Modified: head/sys/dev/filemon/filemon.c
==
--- head/sys/dev/filemon/filemon.c  Fri Oct 26 20:14:40 2012
(r242157)
+++ head/sys/dev/filemon/filemon.c  Fri Oct 26 20:24:13 2012
(r242158)
@@ -136,6 +136,12 @@ filemon_dtr(void *data)
}
 }
 
+#if __FreeBSD_version  900041
+#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3))
+#else
+#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, 
(a3))
+#endif
+
 static int
 filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused,
 struct thread *td)
@@ -148,11 +154,6 @@ filemon_ioctl(struct cdev *dev, u_long c
switch (cmd) {
/* Set the output file descriptor. */
case FILEMON_SET_FD:
-#if __FreeBSD_version  900041
-#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3))
-#else
-#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, 
(a3))
-#endif
if ((error = FGET_WRITE(td, *(int *)data, filemon-fp)) == 0)
/* Write the file header. */
filemon_comment(filemon);
@@ -160,7 +161,7 @@ filemon_ioctl(struct cdev *dev, u_long c
 
/* Set the monitored process ID. */
case FILEMON_SET_PID:
-   filemon-pid = *((pid_t *) data);
+   filemon-pid = *((pid_t *)data);
break;
 
default:
___
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: r242159 - head/usr.sbin/cpucontrol

2012-10-26 Thread Eitan Adler
Author: eadler
Date: Fri Oct 26 20:25:05 2012
New Revision: 242159
URL: http://svn.freebsd.org/changeset/base/242159

Log:
  While 'make universe' passed this didn't work with clang.
  
  This reverts r242120
  
  Submitted by: Jan Beich
  Approved by: cperciva (implicit)

Modified:
  head/usr.sbin/cpucontrol/Makefile

Modified: head/usr.sbin/cpucontrol/Makefile
==
--- head/usr.sbin/cpucontrol/Makefile   Fri Oct 26 20:24:13 2012
(r242158)
+++ head/usr.sbin/cpucontrol/Makefile   Fri Oct 26 20:25:05 2012
(r242159)
@@ -4,4 +4,6 @@ PROG=   cpucontrol
 MAN=   cpucontrol.8
 SRCS=  cpucontrol.c intel.c amd.c via.c
 
+NO_WCAST_ALIGN=
+
 .include bsd.prog.mk
___
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: r242160 - head/sys/conf

2012-10-26 Thread Warner Losh
Author: imp
Date: Fri Oct 26 20:43:30 2012
New Revision: 242160
URL: http://svn.freebsd.org/changeset/base/242160

Log:
  Siba, in theory, is a architecturally neutral bus, so place it in
  files.  It used to be in files.mips before the clean-room rewrite and
  really doesn't belong there.  If we need to grow arch specific code,
  we can move it into $ARCH/$ACH/siba_machdep.c.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Oct 26 20:25:05 2012(r242159)
+++ head/sys/conf/files Fri Oct 26 20:43:30 2012(r242160)
@@ -1940,8 +1940,11 @@ dev/si/si3_t225.coptional si
 dev/si/si_eisa.c   optional si eisa
 dev/si/si_isa.coptional si isa
 dev/si/si_pci.coptional si pci
+dev/siba/siba.coptional siba
 dev/siba/siba_bwn.coptional siba_bwn pci
-dev/siba/siba_core.c   optional siba_bwn pci
+dev/siba/siba_cc.c optional siba
+dev/siba/siba_core.c   optional siba | siba_bwn pci
+dev/siba/siba_pcib.c   optional siba pci
 dev/siis/siis.coptional siis pci
 dev/sis/if_sis.c   optional sis pci
 dev/sk/if_sk.c optional sk pci
___
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: r242161 - in head/sys: net netinet netpfil/pf

2012-10-26 Thread Gleb Smirnoff
Author: glebius
Date: Fri Oct 26 21:06:33 2012
New Revision: 242161
URL: http://svn.freebsd.org/changeset/base/242161

Log:
  o Remove last argument to ip_fragment(), and obtain all needed information
on checksums directly from mbuf flags. This simplifies code.
  o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in
hardware. Some driver may not announce CSUM_IP in theur if_hwassist,
although try to do checksums if CSUM_IP set on mbuf. Example is em(4).
  o While here, consistently use CSUM_IP instead of its alias CSUM_DELAY_IP.
After this change CSUM_DELAY_IP vanishes from the stack.
  
  Submitted by: Sebastian Kuzminsky seb lineratesystems.com

Modified:
  head/sys/net/if_bridge.c
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_mroute.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/ip_var.h
  head/sys/netpfil/pf/pf.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cFri Oct 26 20:43:30 2012(r242160)
+++ head/sys/net/if_bridge.cFri Oct 26 21:06:33 2012(r242161)
@@ -3379,8 +3379,8 @@ bridge_fragment(struct ifnet *ifp, struc
goto out;
ip = mtod(m, struct ip *);
 
-   error = ip_fragment(ip, m, ifp-if_mtu, ifp-if_hwassist,
-   CSUM_DELAY_IP);
+   m-m_pkthdr.csum_flags |= CSUM_IP;
+   error = ip_fragment(ip, m, ifp-if_mtu, ifp-if_hwassist);
if (error)
goto out;
 

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Fri Oct 26 20:43:30 2012
(r242160)
+++ head/sys/netinet/ip_fastfwd.c   Fri Oct 26 21:06:33 2012
(r242161)
@@ -542,10 +542,8 @@ passout:
 * We have to fragment the packet
 */
m-m_pkthdr.csum_flags |= CSUM_IP;
-   if (ip_fragment(ip, m, mtu, ifp-if_hwassist,
-   (~ifp-if_hwassist  CSUM_DELAY_IP))) {
+   if (ip_fragment(ip, m, mtu, ifp-if_hwassist))
goto drop;
-   }
KASSERT(m != NULL, (null mbuf and no error));
/*
 * Send off the fragments via outgoing interface

Modified: head/sys/netinet/ip_mroute.c
==
--- head/sys/netinet/ip_mroute.cFri Oct 26 20:43:30 2012
(r242160)
+++ head/sys/netinet/ip_mroute.cFri Oct 26 21:06:33 2012
(r242161)
@@ -2404,7 +2404,8 @@ pim_register_prepare(struct ip *ip, stru
ip-ip_sum = in_cksum(mb_copy, ip-ip_hl  2);
 } else {
/* Fragment the packet */
-   if (ip_fragment(ip, mb_copy, mtu, 0, CSUM_DELAY_IP) != 0) {
+   mb_copy-m_pkthdr.csum_flags |= CSUM_IP;
+   if (ip_fragment(ip, mb_copy, mtu, 0) != 0) {
m_freem(mb_copy);
return NULL;
}

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cFri Oct 26 20:43:30 2012
(r242160)
+++ head/sys/netinet/ip_output.cFri Oct 26 21:06:33 2012
(r242161)
@@ -125,7 +125,7 @@ ip_output(struct mbuf *m, struct mbuf *o
struct sockaddr_in *dst;
struct in_ifaddr *ia;
int isbroadcast;
-   uint16_t ip_len, ip_off, sw_csum;
+   uint16_t ip_len, ip_off;
struct route iproute;
struct rtentry *rte;/* cache for ro-ro_rt */
struct in_addr odst;
@@ -583,18 +583,16 @@ passout:
}
 
m-m_pkthdr.csum_flags |= CSUM_IP;
-   sw_csum = m-m_pkthdr.csum_flags  ~ifp-if_hwassist;
-   if (sw_csum  CSUM_DELAY_DATA) {
+   if (m-m_pkthdr.csum_flags  CSUM_DELAY_DATA  ~ifp-if_hwassist) {
in_delayed_cksum(m);
-   sw_csum = ~CSUM_DELAY_DATA;
+   m-m_pkthdr.csum_flags = ~CSUM_DELAY_DATA;
}
 #ifdef SCTP
-   if (sw_csum  CSUM_SCTP) {
+   if (m-m_pkthdr.csum_flags  CSUM_SCTP  ~ifp-if_hwassist) {
sctp_delayed_cksum(m, (uint32_t)(ip-ip_hl  2));
-   sw_csum = ~CSUM_SCTP;
+   m-m_pkthdr.csum_flags = ~CSUM_SCTP;
}
 #endif
-   m-m_pkthdr.csum_flags = ifp-if_hwassist;
 
/*
 * If small enough for interface, or the interface will take
@@ -604,8 +602,10 @@ passout:
(m-m_pkthdr.csum_flags  ifp-if_hwassist  CSUM_TSO) != 0 ||
((ip_off  IP_DF) == 0  (ifp-if_hwassist  CSUM_FRAGMENT))) {
ip-ip_sum = 0;
-   if (sw_csum  CSUM_DELAY_IP)
+   if (m-m_pkthdr.csum_flags  CSUM_IP  ~ifp-if_hwassist) {
ip-ip_sum = in_cksum(m, hlen);
+   m-m_pkthdr.csum_flags = ~CSUM_IP;
+

svn commit: r242162 - head/sys/conf

2012-10-26 Thread Warner Losh
Author: imp
Date: Fri Oct 26 21:25:10 2012
New Revision: 242162
URL: http://svn.freebsd.org/changeset/base/242162

Log:
  stack_machdep.c is dependent on ddb or stack options, not standard.

Modified:
  head/sys/conf/files.mips

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsFri Oct 26 21:06:33 2012(r242161)
+++ head/sys/conf/files.mipsFri Oct 26 21:25:10 2012(r242162)
@@ -33,7 +33,7 @@ mips/mips/pm_machdep.cstandard
 mips/mips/pmap.c   standard
 mips/mips/ptrace_machdep.c standard
 mips/mips/sc_machdep.c standard
-mips/mips/stack_machdep.c  standard
+mips/mips/stack_machdep.c  optionalddb | stack
 mips/mips/support.Sstandard
 mips/mips/swtch.S  standard
 mips/mips/sys_machdep.cstandard
___
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: r242074 - head/etc/rc.d

2012-10-26 Thread Brian Somers
On Fri, Oct 26, 2012 at 03:52:15AM +0900, Hiroki Sato wrote:
 Brian Somers br...@freebsd.org wrote
   in 20121025171827.ga59...@thong.lan.awfulhak.org:
 
 br After upgrading from 8-STABLE to 9-STABLE on Monday, IPv6 routing
 br advertisments were broken.  Disabling accept (enabling send) appeared
 br to be necessary to get things up and running.
 br
 br As you say, net.inet6.ip6.accept_rtadv is set to zero (off, meaning
 br that we *can* send advertisments), so I don't now what the issue
 br is.  Irrespective of this, I think it's useful to explicitly set
 br the interface to be able to send advertisments when running rtadvd
 br - just in case the sysctl is set to 1 elsewhere.
 br
 br Doing an ifconfig interface inet6 accept_rtadv after boot doesn't
 br seem to disable sending advertisments, so I'm finding it difficult
 br to test this remotely...  testing is awkward when I'm not at home
 br as this machine is also suffering from the can't reboot issue!!
 br
 br I'll look into why the sysctl doesn't seem to behave as expected
 br when I get home this evening.
 
  In 9.X and later the meaning of net.inet6.ip6.accept_rtadv has been
  changed and the flag for whether receiving RAs or not is now in a
  per-IF basis.  9.0R release note says the following:
 
   | The sysctl(8) variable net.inet6.ip6.accept_rtadv has been
   | changed. It was a system-wide configuration knob which controlled
   | whether the system accepts ICMPv6 Router Advertisement messages or
   | not. In FreeBSD 9.0-RELEASE, this knob is converted into a
   | per-interface inet6 accept_rtadv ifconfig(8) option. Although the
   | sysctl(8) variable is available still in FreeBSD 9.0-RELEASE, it
   | now controls whether the per-interface option is set by default or
   | not. The default value is 0 (not accept the RA messages).
 
  So, by default RAs can be sent on any interface even if setting
  net.inet6.ip6.accept_rtadv=1 manually after a boot because no
  accept_rtadv per-IF flag is set.  I guess this was a source of the
  confusion.  I am not sure why setting accept_rtadv flag on an
  interface did not prevent from sending RAs in your case.  It is not
  an intended behavior.  If it is reproducible, please let me know.
 
  The release notes explains more details of IPv6 configuration
  migration from 8.X to 9.X.

When I reboot and don't use -accept_rtadv (and leave
net.inet6.ip6.accept_rtadv set to zero), I repeatedly see this in
/var/log/messages:

Oct 26 16:31:26 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface 
sk0.  Ignored.
Oct 26 16:31:33 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface 
bridge0.  Ignored.
Oct 26 16:31:42 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface 
sk0.  Ignored.
Oct 26 16:31:49 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface 
bridge0.  Ignored.

This seems to be the problem.  Because check_accept_rtadv() (in
rtadvd) reports the interface as being able to accept RAs (it finds
the ND6_IFF_ACCEPT_RTADV flag), it drops outgoing RAs and nothing
happens.

-- 
Brian Somers  br...@awfulhak.org
Don't _EVER_ lose your sense of humour !   br...@freebsd.org


pgpDiEVGHFZfw.pgp
Description: PGP signature


svn commit: r242171 - head/sys/arm/conf

2012-10-26 Thread Tim Kientzle
Author: kientzle
Date: Sat Oct 27 04:02:12 2012
New Revision: 242171
URL: http://svn.freebsd.org/changeset/base/242171

Log:
  Comment out the other BOOTP option
  This should make PANDABOARD suitable for building
  bootable SD images.
  
  Submitted by: Giovanni Trematerra

Modified:
  head/sys/arm/conf/PANDABOARD

Modified: head/sys/arm/conf/PANDABOARD
==
--- head/sys/arm/conf/PANDABOARDSat Oct 27 02:39:08 2012
(r242170)
+++ head/sys/arm/conf/PANDABOARDSat Oct 27 04:02:12 2012
(r242171)
@@ -54,7 +54,7 @@ options   NFS_ROOT#NFS usable as /, req
 #options   BOOTP_NFSROOT
 #options   BOOTP_COMPAT
 #options   BOOTP
-optionsBOOTP_NFSV3
+#options   BOOTP_NFSV3
 #options   BOOTP_WIRED_TO=ue0
 optionsMSDOSFS #MSDOS Filesystem
 #options   CD9660  #ISO 9660 Filesystem
___
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: r241610 - in head: . sys/dev/usb sys/net sys/net80211 sys/netpfil/ipfw sys/netpfil/pf sys/sys

2012-10-26 Thread Rui Paulo
I second Adrian's comments and I would like to add that you must NOT commit 
something like this, breaking the ABI, when you discussed this *ONE YEAR* ago 
with only two people (one of them is not very active in the networking stack). 
This is against all reasonable software development practices.

On 26 Oct 2012, at 10:00, Adrian Chadd adr...@freebsd.org wrote:

 So with this change, you've broken building -HEAD net80211 on -9.
 
 Can we please sit down and make this work on both freebsd-9 and
 freebsd-head? I do a lot of wifi development on -9 with -HEAD wireless
 and this change broke everything for me.
 
 You could've at least asked the maintainers first before you did this.
 
 Thanks,
 
 
 Adrian
 
 On 16 October 2012 06:37, Gleb Smirnoff gleb...@freebsd.org wrote:
 Author: glebius
 Date: Tue Oct 16 13:37:54 2012
 New Revision: 241610
 URL: http://svn.freebsd.org/changeset/base/241610
 
 Log:
  Make the struct if_clone opaque to users of the cloning API. Users
  now use function calls:
 
if_clone_simple()
if_clone_advanced()
 
  to initialize a cloner, instead of macros that initialize if_clone
  structure.
 
  Discussed with:   brooks, bz, 1 year ago



Regards,
--
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