svn commit: r223359 - head/sys/net

2011-06-21 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Jun 21 07:19:03 2011
New Revision: 223359
URL: http://svn.freebsd.org/changeset/base/223359

Log:
  Garbage collect never used global, sysctl, externs.
  
  MFC after:1 week

Modified:
  head/sys/net/route.c
  head/sys/net/route.h

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cTue Jun 21 06:06:47 2011(r223358)
+++ head/sys/net/route.cTue Jun 21 07:19:03 2011(r223359)
@@ -116,12 +116,6 @@ VNET_DEFINE(int, rttrash); /* routes no
 static VNET_DEFINE(uma_zone_t, rtzone);/* Routing table UMA 
zone. */
 #defineV_rtzoneVNET(rtzone)
 
-#if 0
-/* default fib for tunnels to use */
-u_int tunnel_fib = 0;
-SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, "");
-#endif
-
 /*
  * handler for net.my_fibnum
  */

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hTue Jun 21 06:06:47 2011(r223358)
+++ head/sys/net/route.hTue Jun 21 07:19:03 2011(r223359)
@@ -108,8 +108,6 @@ struct rt_metrics {
 #endif
 
 extern u_int rt_numfibs;   /* number fo usable routing tables */
-extern u_int tunnel_fib;   /* tunnels use these */
-extern u_int fwd_fib;  /* packets being forwarded use these routes */
 /*
  * XXX kernel function pointer `rt_output' is visible to applications.
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223356 - head/sbin/geom/class/part

2011-06-21 Thread Xin LI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 06/20/11 23:23, Andrey V. Elsukov wrote:
> On 21.06.2011 10:04, Xin LI wrote:
   Mod the offset padding by alignment.  Without this change we may
   pad too much when underlying GEOM object have a zero stripesize.
>>
>>> No. In any way offset value could not be greater than mediasize.
>> I don't think this changeset do anything with mediasize?
> 
> I did mean that it could not pad too much. When stripesize is zero the
> stripeoffset points to real offset from the beginning of device.
> In case when we have nested partitioning schemes like MBR + BSD,
> stripeoffset of BSD slice could help align partition to the device.

Yes agreed.

>>> And it do nothing when alignment value is 1.
>>
>> No, an alignment value of 1 makes offset = 0, which is the intended
>> behavior.
>>
>> Or did I misunderstood the code?
> 
> The problem that Kris reported was not here.
> I think this change is just for the reassurance.

Well, I think semantically the offset variable expects a value that
represents in-stripe offset rather than the real (against the media)
offset that GEOM returns.

I'll defer the merge until your change have been merged.

Cheers,
- -- 
Xin LI https://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (FreeBSD)

iQEcBAEBCAAGBQJOAFbgAAoJEATO+BI/yjfBNPkH/1HEUxWDuUFoO+4r8FGuTyek
8oFYip67HztN5l8CWiOP61utGPyMLcyk5hS6CwkvAiHaChQeGp75Sp/16D0xkyiT
qcJOZIUjtTRvkABrLD/M5vLM5nU3cg80quhPmAjXuPytJFBsy7QdP1cjXK7ql0sB
bCXMhqWR8oAbQ5rch8BkFlmRQmHEWFVlR2puxUoBi+YrUEKAiv83ghC9UE4H6NT8
trA+UYr+px2AC+opU0yijdscevdVPdJi6mo08EFqbC6ABzIwTR2Ky2LLhdGrmuk+
impuJz4r44LsKvAxOqFn9bZoBLRTxHMkSju4R8kaAfxT3dehTOK2RViI3FaH7Ko=
=jRrp
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223360 - stable/8/sys/dev/ata

2011-06-21 Thread Alexander Motin
Author: mav
Date: Tue Jun 21 08:37:55 2011
New Revision: 223360
URL: http://svn.freebsd.org/changeset/base/223360

Log:
  MFC r222897:
  Intel NM10 chipset's SATA controller has same PCI ID and revision as ICH7's,
  but has only 2 SATA ports instead of 4. The worst part is that SStatus and
  SError registers for missing ports are not implemented and return wrong
  values (0x), that caused infinite reset loop.
  
  Just ignore that SError value while I found no better way to identify them.

Modified:
  stable/8/sys/dev/ata/ata-sata.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/ata/ata-sata.c
==
--- stable/8/sys/dev/ata/ata-sata.c Tue Jun 21 07:19:03 2011
(r223359)
+++ stable/8/sys/dev/ata/ata-sata.c Tue Jun 21 08:37:55 2011
(r223360)
@@ -54,6 +54,11 @@ ata_sata_phy_check_events(device_t dev, 
 u_int32_t error, status;
 
 ata_sata_scr_read(ch, port, ATA_SERROR, &error);
+
+/* Check that SError value is sane. */
+if (error == 0x)
+   return;
+
 /* Clear set error bits/interrupt. */
 if (error)
ata_sata_scr_write(ch, port, ATA_SERROR, error);
@@ -163,18 +168,18 @@ ata_sata_phy_reset(device_t dev, int por
 
 if (bootverbose) {
if (port < 0) {
-   device_printf(dev, "hardware reset ...\n");
+   device_printf(dev, "hard reset ...\n");
} else {
-   device_printf(dev, "p%d: hardware reset ...\n", port);
+   device_printf(dev, "p%d: hard reset ...\n", port);
}
 }
 for (retry = 0; retry < 10; retry++) {
for (loop = 0; loop < 10; loop++) {
if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET))
-   return (0);
+   goto fail;
ata_udelay(100);
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
-   return (0);
+   goto fail;
if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_RESET)
break;
}
@@ -183,15 +188,26 @@ ata_sata_phy_reset(device_t dev, int por
if (ata_sata_scr_write(ch, port, ATA_SCONTROL,
ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 :
ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)))
-   return (0);
+   goto fail;
ata_udelay(100);
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
-   return (0);
+   goto fail;
if ((val & ATA_SC_DET_MASK) == 0)
return ata_sata_connect(ch, port, 0);
}
 }
-return 0;
+fail:
+/* Clear SATA error register. */
+ata_sata_scr_write(ch, port, ATA_SERROR, 0x);
+
+if (bootverbose) {
+   if (port < 0) {
+   device_printf(dev, "hard reset failed\n");
+   } else {
+   device_printf(dev, "p%d: hard reset failed\n", port);
+   }
+}
+return (0);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223361 - stable/8/sys/dev/ata/chipsets

2011-06-21 Thread Alexander Motin
Author: mav
Date: Tue Jun 21 08:39:09 2011
New Revision: 223361
URL: http://svn.freebsd.org/changeset/base/223361

Log:
  MFC r223097:
  Skip BAR(5) usage for SATA registers access on ICH8M Apples, because for
  some reason it causes system lock up. Linux does the same.

Modified:
  stable/8/sys/dev/ata/chipsets/ata-intel.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c
==
--- stable/8/sys/dev/ata/chipsets/ata-intel.c   Tue Jun 21 08:37:55 2011
(r223360)
+++ stable/8/sys/dev/ata/chipsets/ata-intel.c   Tue Jun 21 08:39:09 2011
(r223361)
@@ -288,7 +288,9 @@ ata_intel_chipinit(device_t dev)
ATA_OUTL(ctlr->r_res2, 0x0C,
ATA_INL(ctlr->r_res2, 0x0C) | 0xf);
}
-   } else {
+   /* Skip BAR(5) on ICH8M Apples, system locks up on access. */
+   } else if (ctlr->chip->chipid != ATA_I82801HBM_S1 ||
+   pci_get_subvendor(dev) != 0x106b) {
ctlr->r_type2 = SYS_RES_IOPORT;
ctlr->r_rid2 = PCIR_BAR(5);
ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223364 - head/sbin/geom/class/part

2011-06-21 Thread Andrey V. Elsukov
Author: ae
Date: Tue Jun 21 10:35:20 2011
New Revision: 223364
URL: http://svn.freebsd.org/changeset/base/223364

Log:
  When user specifies the bootcode with size smaller than VTOC_BOOTCODE,
  gpart_write_partcode_vtoc8 does access out of range of allocated memory.
  Check size of bootcode before writing it.
  
  Pointed out by:   ru
  MFC after:1 week

Modified:
  head/sbin/geom/class/part/geom_part.c

Modified: head/sbin/geom/class/part/geom_part.c
==
--- head/sbin/geom/class/part/geom_part.c   Tue Jun 21 09:19:38 2011
(r223363)
+++ head/sbin/geom/class/part/geom_part.c   Tue Jun 21 10:35:20 2011
(r223364)
@@ -1208,8 +1208,11 @@ gpart_bootcode(struct gctl_req *req, uns
if (idx == 0)
errx(EXIT_FAILURE, "missing -i option");
gpart_write_partcode(gp, idx, partcode, partsize);
-   } else
+   } else {
+   if (partsize != VTOC_BOOTSIZE)
+   errx(EXIT_FAILURE, "invalid bootcode");
gpart_write_partcode_vtoc8(gp, idx, partcode);
+   }
} else
if (bootcode == NULL)
errx(EXIT_FAILURE, "no -b nor -p");
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223365 - head/sys/ia64/conf

2011-06-21 Thread Alan Cox
Author: alc
Date: Tue Jun 21 12:38:40 2011
New Revision: 223365
URL: http://svn.freebsd.org/changeset/base/223365

Log:
  Use a non-standard page size that is supported.

Modified:
  head/sys/ia64/conf/NOTES

Modified: head/sys/ia64/conf/NOTES
==
--- head/sys/ia64/conf/NOTESTue Jun 21 10:35:20 2011(r223364)
+++ head/sys/ia64/conf/NOTESTue Jun 21 12:38:40 2011(r223365)
@@ -25,7 +25,7 @@ options   LOG2_ID_PAGE_SIZE=27# 128M
 # option: LOG2_PAGE_SIZE
 # Specify the log2 size of the page to be used for virtual memory management.
 # The page size being equal to 1

Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread John Baldwin
On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote:
> Author: jfv
> Date: Mon Jun 20 22:59:29 2011
> New Revision: 223350
> URL: http://svn.freebsd.org/changeset/base/223350
> 
> Log:
>   Eliminate some global tuneables in favor of adapter-specific,
>   particular flow control and dma coalesce. Also improve the
>   sysctl operation on those too.
>   
>   Add IPv6 detection in the ioctl code, this was done for
>   ixgbe first, carrying that over.
>   
>   Add resource ability to disable particular adapter.
>   
>   Add HW TSO capability so vlans can make use of TSO

The tunables are useful for setting defaults for all interfaces. :(

I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can 
ensure that all igb interfaces in a given system have that setting.   This is 
more scalable than having to set the right number of entries in 
/etc/sysctl.conf.local on different machines, etc, without spamming the 
console during boot with warnings about tweaking non-existing sysctls, etc.

Please consider keeping the tunables where the tunables are used to set
default settings for all adapters from the loader but per-device sysctls are
used post-boot to provide runtime, per-device settings.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r222866 - head/sys/x86/x86

2011-06-21 Thread John Baldwin
On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote:
> My questions to you:
> 
> a) Why do we care TSC timecounter when it is not invariant where we 
> *know* it is unusable and set to negative quality?

What if the user knows they will not enable CPU throttling so for them the TSC 
is safe?  In that case, TSC is a more efficient timecounter and if the user
constrains the system to make the TSC safe we should let them use it.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread Guy Helmer

On Jun 21, 2011, at 8:07 AM, John Baldwin wrote:

> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote:
>> Author: jfv
>> Date: Mon Jun 20 22:59:29 2011
>> New Revision: 223350
>> URL: http://svn.freebsd.org/changeset/base/223350
>> 
>> Log:
>>  Eliminate some global tuneables in favor of adapter-specific,
>>  particular flow control and dma coalesce. Also improve the
>>  sysctl operation on those too.
>> 
>>  Add IPv6 detection in the ioctl code, this was done for
>>  ixgbe first, carrying that over.
>> 
>>  Add resource ability to disable particular adapter.
>> 
>>  Add HW TSO capability so vlans can make use of TSO
> 
> The tunables are useful for setting defaults for all interfaces. :(
> 
> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can 
> ensure that all igb interfaces in a given system have that setting.   This is 
> more scalable than having to set the right number of entries in 
> /etc/sysctl.conf.local on different machines, etc, without spamming the 
> console during boot with warnings about tweaking non-existing sysctls, etc.
> 
> Please consider keeping the tunables where the tunables are used to set
> default settings for all adapters from the loader but per-device sysctls are
> used post-boot to provide runtime, per-device settings.


I agree.

Guy



This message has been scanned by ComplianceSafe, powered by Palisade's 
PacketSure.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r222866 - head/sys/x86/x86

2011-06-21 Thread Jung-uk Kim
On Tuesday 21 June 2011 09:10 am, John Baldwin wrote:
> On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote:
> > My questions to you:
> >
> > a) Why do we care TSC timecounter when it is not invariant where
> > we *know* it is unusable and set to negative quality?
>
> What if the user knows they will not enable CPU throttling so for
> them the TSC is safe?  In that case, TSC is a more efficient
> timecounter and if the user constrains the system to make the TSC
> safe we should let them use it.

In that case, it must be a UP system, the quality is still 800, and 
TSC value won't be shifted.

My question was specific to SMP cases.  Sorry, I didn't make that 
clear.

Jung-uk Kim
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r222866 - head/sys/x86/x86

2011-06-21 Thread John Baldwin
On Tuesday, June 21, 2011 11:48:55 am Jung-uk Kim wrote:
> On Tuesday 21 June 2011 09:10 am, John Baldwin wrote:
> > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote:
> > > My questions to you:
> > >
> > > a) Why do we care TSC timecounter when it is not invariant where
> > > we *know* it is unusable and set to negative quality?
> >
> > What if the user knows they will not enable CPU throttling so for
> > them the TSC is safe?  In that case, TSC is a more efficient
> > timecounter and if the user constrains the system to make the TSC
> > safe we should let them use it.
> 
> In that case, it must be a UP system, the quality is still 800, and 
> TSC value won't be shifted.
> 
> My question was specific to SMP cases.  Sorry, I didn't make that 
> clear.

What if the user has an SMP system where the TSCs are in sync but it's
older so it doesn't set the TSC invariant bit set in cpuid.  Are we
now forbidding that user from using the TSC?

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread Jack Vogel
LOL, the old adage is true, you just can't please all the people... :)

The way the code now is it assigns a default, but you could still have
a loader entry that would change it for all adapters if you wanted to,
but ok, if you prefer the older for this. What other globals do you
think should be retained?

Jack


On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin  wrote:

> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote:
> > Author: jfv
> > Date: Mon Jun 20 22:59:29 2011
> > New Revision: 223350
> > URL: http://svn.freebsd.org/changeset/base/223350
> >
> > Log:
> >   Eliminate some global tuneables in favor of adapter-specific,
> >   particular flow control and dma coalesce. Also improve the
> >   sysctl operation on those too.
> >
> >   Add IPv6 detection in the ioctl code, this was done for
> >   ixgbe first, carrying that over.
> >
> >   Add resource ability to disable particular adapter.
> >
> >   Add HW TSO capability so vlans can make use of TSO
>
> The tunables are useful for setting defaults for all interfaces. :(
>
> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can
> ensure that all igb interfaces in a given system have that setting.   This
> is
> more scalable than having to set the right number of entries in
> /etc/sysctl.conf.local on different machines, etc, without spamming the
> console during boot with warnings about tweaking non-existing sysctls, etc.
>
> Please consider keeping the tunables where the tunables are used to set
> default settings for all adapters from the loader but per-device sysctls
> are
> used post-boot to provide runtime, per-device settings.
>
> --
> John Baldwin
>
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r222866 - head/sys/x86/x86

2011-06-21 Thread Jung-uk Kim
On Tuesday 21 June 2011 11:56 am, John Baldwin wrote:
> On Tuesday, June 21, 2011 11:48:55 am Jung-uk Kim wrote:
> > On Tuesday 21 June 2011 09:10 am, John Baldwin wrote:
> > > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote:
> > > > My questions to you:
> > > >
> > > > a) Why do we care TSC timecounter when it is not invariant
> > > > where we *know* it is unusable and set to negative quality?
> > >
> > > What if the user knows they will not enable CPU throttling so
> > > for them the TSC is safe?  In that case, TSC is a more
> > > efficient timecounter and if the user constrains the system to
> > > make the TSC safe we should let them use it.
> >
> > In that case, it must be a UP system, the quality is still 800,
> > and TSC value won't be shifted.
> >
> > My question was specific to SMP cases.  Sorry, I didn't make that
> > clear.
>
> What if the user has an SMP system where the TSCs are in sync but
> it's older so it doesn't set the TSC invariant bit set in cpuid. 
> Are we now forbidding that user from using the TSC?

We do not forbid it but we cannot increase the quality because we 
don't compensate drift.

Jung-uk Kim
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread Guy Helmer
On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote:

> LOL, the old adage is true, you just can't please all the people... :) 
> 
> The way the code now is it assigns a default, but you could still have
> a loader entry that would change it for all adapters if you wanted to,
> but ok, if you prefer the older for this. What other globals do you 
> think should be retained?
> 

I'd like to be able to set the global default for flow control.  I'd also 
appreciate a global default for disabling TCP checksum offload, but that's 
above and beyond what we had before :-)

> Jack
> 
> 
> On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin  wrote:
> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote:
> > Author: jfv
> > Date: Mon Jun 20 22:59:29 2011
> > New Revision: 223350
> > URL: http://svn.freebsd.org/changeset/base/223350
> >
> > Log:
> >   Eliminate some global tuneables in favor of adapter-specific,
> >   particular flow control and dma coalesce. Also improve the
> >   sysctl operation on those too.
> >
> >   Add IPv6 detection in the ioctl code, this was done for
> >   ixgbe first, carrying that over.
> >
> >   Add resource ability to disable particular adapter.
> >
> >   Add HW TSO capability so vlans can make use of TSO
> 
> The tunables are useful for setting defaults for all interfaces. :(
> 
> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can
> ensure that all igb interfaces in a given system have that setting.   This is
> more scalable than having to set the right number of entries in
> /etc/sysctl.conf.local on different machines, etc, without spamming the
> console during boot with warnings about tweaking non-existing sysctls, etc.
> 
> Please consider keeping the tunables where the tunables are used to set
> default settings for all adapters from the loader but per-device sysctls are
> used post-boot to provide runtime, per-device settings.
> 
> --
> John Baldwin
> 




This message has been scanned by ComplianceSafe, powered by Palisade's 
PacketSure.

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread Jack Vogel
There IS a global default for flow control, its just hardcoded.. :)

Flow control was something my validation group specifically ragged on me
about... and was the reason I changed to a per-adapter setting.

Let me think about it.

Jack


On Tue, Jun 21, 2011 at 9:17 AM, Guy Helmer
wrote:

> On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote:
>
> LOL, the old adage is true, you just can't please all the people... :)
>
> The way the code now is it assigns a default, but you could still have
> a loader entry that would change it for all adapters if you wanted to,
> but ok, if you prefer the older for this. What other globals do you
> think should be retained?
>
>
> I'd like to be able to set the global default for flow control.  I'd also
> appreciate a global default for disabling TCP checksum offload, but that's
> above and beyond what we had before :-)
>
> Jack
>
>
> On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin  wrote:
>
>> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote:
>> > Author: jfv
>> > Date: Mon Jun 20 22:59:29 2011
>> > New Revision: 223350
>> > URL: http://svn.freebsd.org/changeset/base/223350
>> >
>> > Log:
>> >   Eliminate some global tuneables in favor of adapter-specific,
>> >   particular flow control and dma coalesce. Also improve the
>> >   sysctl operation on those too.
>> >
>> >   Add IPv6 detection in the ioctl code, this was done for
>> >   ixgbe first, carrying that over.
>> >
>> >   Add resource ability to disable particular adapter.
>> >
>> >   Add HW TSO capability so vlans can make use of TSO
>>
>> The tunables are useful for setting defaults for all interfaces. :(
>>
>> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can
>> ensure that all igb interfaces in a given system have that setting.   This
>> is
>> more scalable than having to set the right number of entries in
>> /etc/sysctl.conf.local on different machines, etc, without spamming the
>> console during boot with warnings about tweaking non-existing sysctls,
>> etc.
>>
>> Please consider keeping the tunables where the tunables are used to set
>> default settings for all adapters from the loader but per-device sysctls
>> are
>> used post-boot to provide runtime, per-device settings.
>>
>> --
>> John Baldwin
>>
>
>
>
>
>
> --
> *This message has been scanned by ComplianceSafe, powered by Palisade's
> PacketSure.*
>
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread Guy Helmer
Ahh, I meant to say "global tunables".

It is nice to have flow control as a per-interface setting also - didn't have 
that back in FreeBSD 8.1.

Thanks,
Guy

On Jun 21, 2011, at 11:34 AM, Jack Vogel wrote:

> There IS a global default for flow control, its just hardcoded.. :)
> 
> Flow control was something my validation group specifically ragged on me 
> about... and was the reason I changed to a per-adapter setting.
> 
> Let me think about it.
> 
> Jack
> 
> 
> On Tue, Jun 21, 2011 at 9:17 AM, Guy Helmer  
> wrote:
> On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote:
> 
>> LOL, the old adage is true, you just can't please all the people... :) 
>> 
>> The way the code now is it assigns a default, but you could still have
>> a loader entry that would change it for all adapters if you wanted to,
>> but ok, if you prefer the older for this. What other globals do you 
>> think should be retained?
>> 
> 
> I'd like to be able to set the global default for flow control.  I'd also 
> appreciate a global default for disabling TCP checksum offload, but that's 
> above and beyond what we had before :-)
> 
>> Jack
>> 
>> 
>> On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin  wrote:
>> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote:
>> > Author: jfv
>> > Date: Mon Jun 20 22:59:29 2011
>> > New Revision: 223350
>> > URL: http://svn.freebsd.org/changeset/base/223350
>> >
>> > Log:
>> >   Eliminate some global tuneables in favor of adapter-specific,
>> >   particular flow control and dma coalesce. Also improve the
>> >   sysctl operation on those too.
>> >
>> >   Add IPv6 detection in the ioctl code, this was done for
>> >   ixgbe first, carrying that over.
>> >
>> >   Add resource ability to disable particular adapter.
>> >
>> >   Add HW TSO capability so vlans can make use of TSO
>> 
>> The tunables are useful for setting defaults for all interfaces. :(
>> 
>> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can
>> ensure that all igb interfaces in a given system have that setting.   This is
>> more scalable than having to set the right number of entries in
>> /etc/sysctl.conf.local on different machines, etc, without spamming the
>> console during boot with warnings about tweaking non-existing sysctls, etc.
>> 
>> Please consider keeping the tunables where the tunables are used to set
>> default settings for all adapters from the loader but per-device sysctls are
>> used post-boot to provide runtime, per-device settings.
>> 
>> --
>> John Baldwin
>> 
> 
> 
> 




This message has been scanned by ComplianceSafe, powered by Palisade's 
PacketSure.

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223350 - head/sys/dev/e1000

2011-06-21 Thread John Baldwin
On Tuesday, June 21, 2011 12:07:23 pm Jack Vogel wrote:
> LOL, the old adage is true, you just can't please all the people... :)
> 
> The way the code now is it assigns a default, but you could still have
> a loader entry that would change it for all adapters if you wanted to,
> but ok, if you prefer the older for this. What other globals do you
> think should be retained?

I mostly care about the 'rxd', 'txd', 'rx_processing_limit', 'enable_aim', and 
'num_queues'.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223367 - head/libexec/ulog-helper

2011-06-21 Thread Ed Schouten
Author: ed
Date: Tue Jun 21 17:59:51 2011
New Revision: 223367
URL: http://svn.freebsd.org/changeset/base/223367

Log:
  Minor cleanups to ulog-helper:
  
  - Remove unneeded linking against libmd. libulog depends on this
library, but the ulog-helper tool itself does not.
  
  - Change the comment at the top to mention utmpx instead of utmp, wtmp
and lastlog.
  
  - Simply use user_from_uid() to translate to a username string.
  
  - Put variable declarations together.

Modified:
  head/libexec/ulog-helper/Makefile
  head/libexec/ulog-helper/ulog-helper.c

Modified: head/libexec/ulog-helper/Makefile
==
--- head/libexec/ulog-helper/Makefile   Tue Jun 21 14:31:36 2011
(r223366)
+++ head/libexec/ulog-helper/Makefile   Tue Jun 21 17:59:51 2011
(r223367)
@@ -5,7 +5,7 @@ BINOWN= root
 BINMODE=4555
 NO_MAN=
 
-DPADD= ${LIBULOG} ${LIBMD}
-LDADD= -lulog -lmd
+DPADD= ${LIBULOG}
+LDADD= -lulog
 
 .include 

Modified: head/libexec/ulog-helper/ulog-helper.c
==
--- head/libexec/ulog-helper/ulog-helper.c  Tue Jun 21 14:31:36 2011
(r223366)
+++ head/libexec/ulog-helper/ulog-helper.c  Tue Jun 21 17:59:51 2011
(r223367)
@@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$");
 
 /*
  * This setuid helper utility writes user login records to disk.
- * Unprivileged processes are not capable of writing records to utmp,
- * wtmp and lastlog, but we do want to allow this for pseudo-terminals.
- * Because a file descriptor to a pseudo-terminal master device can only
- * be obtained by processes using the pseudo-terminal, we expect such a
- * descriptor on stdin.
+ * Unprivileged processes are not capable of writing records to utmpx,
+ * but we do want to allow this for pseudo-terminals.  Because a file
+ * descriptor to a pseudo-terminal master device can only be obtained by
+ * processes using the pseudo-terminal, we expect such a descriptor on
+ * stdin.
  *
  * It uses the real user ID of the calling process to determine the
  * username.  It does allow users to log arbitrary hostnames.
@@ -49,26 +49,22 @@ __FBSDID("$FreeBSD$");
 int
 main(int argc, char *argv[])
 {
-   const char *line;
+   const char *line, *user, *host;
 
/* Device line name. */
if ((line = ptsname(STDIN_FILENO)) == NULL)
return (EX_USAGE);
 
if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) {
-   struct passwd *pwd;
-   const char *host = NULL;
-
/* Username. */
-   pwd = getpwuid(getuid());
-   if (pwd == NULL)
+   user = user_from_uid(getuid(), 1);
+   if (user == NULL)
return (EX_OSERR);
 
/* Hostname. */
-   if (argc == 3)
-   host = argv[2];
+   host = argc == 3 ? argv[2] : NULL;
 
-   ulog_login(line, pwd->pw_name, host);
+   ulog_login(line, user, host);
return (EX_OK);
} else if (argc == 2 && strcmp(argv[1], "logout") == 0) {
ulog_logout(line);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223369 - head/lib/libc/stdlib

2011-06-21 Thread Marius Strobl
Author: marius
Date: Tue Jun 21 19:15:23 2011
New Revision: 223369
URL: http://svn.freebsd.org/changeset/base/223369

Log:
  Change sparc64 to use the initial exec TLS model, too. This avoids random
  assertion failures in _malloc_thread_cleanup().

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Tue Jun 21 19:13:48 2011
(r223368)
+++ head/lib/libc/stdlib/malloc.c   Tue Jun 21 19:15:23 2011
(r223369)
@@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$");
 #ifdef __sparc64__
 #  define LG_QUANTUM   4
 #  define LG_SIZEOF_PTR3
-#  define TLS_MODEL/* default */
+#  define TLS_MODEL__attribute__((tls_model("initial-exec")))
 #endif
 #ifdef __amd64__
 #  define LG_QUANTUM   4
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223370 - head/sys/dev/acpica

2011-06-21 Thread John Baldwin
Author: jhb
Date: Tue Jun 21 19:29:27 2011
New Revision: 223370
URL: http://svn.freebsd.org/changeset/base/223370

Log:
  Use AcpiWalkResources() to parse the resource list from _CRS rather than
  using a home-rolled loop.  While here, add support for 64-bit address
  range resources.
  
  Silence on:   acpi@ (older version)

Modified:
  head/sys/dev/acpica/acpi_resource.c
  head/sys/dev/acpica/acpivar.h

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Tue Jun 21 19:15:23 2011
(r223369)
+++ head/sys/dev/acpica/acpi_resource.c Tue Jun 21 19:29:27 2011
(r223370)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -139,6 +140,248 @@ acpi_config_intr(device_t dev, ACPI_RESO
INTR_POLARITY_HIGH : INTR_POLARITY_LOW);
 }
 
+struct acpi_resource_context {
+struct acpi_parse_resource_set *set;
+device_t   dev;
+void   *context;
+};
+
+#ifdef ACPI_DEBUG_OUTPUT
+static const char *
+acpi_address_range_name(UINT8 ResourceType)
+{
+static char buf[16];
+
+switch (ResourceType) {
+case ACPI_MEMORY_RANGE:
+   return ("Memory");
+case ACPI_IO_RANGE:
+   return ("IO");
+case ACPI_BUS_NUMBER_RANGE:
+   return ("Bus Number");
+default:
+   snprintf(buf, sizeof(buf), "type %u", ResourceType);
+   return (buf);
+}
+}
+#endif
+   
+static ACPI_STATUS
+acpi_parse_resource(ACPI_RESOURCE *res, void *context)
+{
+struct acpi_parse_resource_set *set;
+struct acpi_resource_context *arc;
+UINT64 min, max, length, gran;
+const char *name;
+device_t dev;
+
+arc = context;
+dev = arc->dev;
+set = arc->set;
+
+switch (res->Type) {
+case ACPI_RESOURCE_TYPE_END_TAG:
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n"));
+   break;
+case ACPI_RESOURCE_TYPE_FIXED_IO:
+   if (res->Data.FixedIo.AddressLength <= 0)
+   break;
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n",
+   res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength));
+   set->set_ioport(dev, arc->context, res->Data.FixedIo.Address,
+   res->Data.FixedIo.AddressLength);
+   break;
+case ACPI_RESOURCE_TYPE_IO:
+   if (res->Data.Io.AddressLength <= 0)
+   break;
+   if (res->Data.Io.Minimum == res->Data.Io.Maximum) {
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n",
+   res->Data.Io.Minimum, res->Data.Io.AddressLength));
+   set->set_ioport(dev, arc->context, res->Data.Io.Minimum,
+   res->Data.Io.AddressLength);
+   } else {
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n",
+   res->Data.Io.Minimum, res->Data.Io.Maximum,
+   res->Data.Io.AddressLength));
+   set->set_iorange(dev, arc->context, res->Data.Io.Minimum,
+   res->Data.Io.Maximum, res->Data.Io.AddressLength,
+   res->Data.Io.Alignment);
+   }
+   break;
+case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
+   if (res->Data.FixedMemory32.AddressLength <= 0)
+   break;
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n",
+   res->Data.FixedMemory32.Address,
+   res->Data.FixedMemory32.AddressLength));
+   set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, 
+   res->Data.FixedMemory32.AddressLength);
+   break;
+case ACPI_RESOURCE_TYPE_MEMORY32:
+   if (res->Data.Memory32.AddressLength <= 0)
+   break;
+   if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) {
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n",
+   res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength));
+   set->set_memory(dev, arc->context, res->Data.Memory32.Minimum,
+   res->Data.Memory32.AddressLength);
+   } else {
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n",
+   res->Data.Memory32.Minimum, res->Data.Memory32.Maximum,
+   res->Data.Memory32.AddressLength));
+   set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum,
+   res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength,
+   res->Data.Memory32.Alignment);
+   }
+   break;
+case ACPI_RESOURCE_TYPE_MEMORY24:
+   if (res->Data.Memory24.AddressLength <= 0)
+   break;
+   if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) {
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n",
+   res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength));
+   set->set_memory(dev, arc->context, res->Data.Memory24.Minimum,
+   res->Data.Memory24.AddressLength);
+   } else {
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOU

svn commit: r223371 - head/sys/dev/pci

2011-06-21 Thread John Baldwin
Author: jhb
Date: Tue Jun 21 19:31:31 2011
New Revision: 223371
URL: http://svn.freebsd.org/changeset/base/223371

Log:
  Minor whitespace and style fixes.

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

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Tue Jun 21 19:29:27 2011(r223370)
+++ head/sys/dev/pci/pci.c  Tue Jun 21 19:31:31 2011(r223371)
@@ -297,7 +297,7 @@ static int pci_usb_takeover = 1;
 static int pci_usb_takeover = 0;
 #endif
 TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover);
-SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RD | CTLFLAG_TUN,
+SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN,
 &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\
 Disable this if you depend on BIOS emulation of USB devices, that is\n\
 you use USB devices (like keyboard or mouse) but do not load USB drivers");
@@ -2482,7 +2482,8 @@ pci_write_bar(device_t dev, struct pci_m
pci_write_config(dev, pm->pm_reg + 4, base >> 32, 4);
pm->pm_value = pci_read_config(dev, pm->pm_reg, 4);
if (ln2range == 64)
-   pm->pm_value |= (pci_addr_t)pci_read_config(dev, pm->pm_reg + 
4, 4) << 32;
+   pm->pm_value |= (pci_addr_t)pci_read_config(dev,
+   pm->pm_reg + 4, 4) << 32;
 }
 
 struct pci_map *
@@ -2680,7 +2681,7 @@ pci_add_map(device_t bus, device_t dev, 
count = (pci_addr_t)1 << mapsize;
if (basezero || base == pci_mapbase(testval)) {
start = 0;  /* Let the parent decide. */
-   end = ~0ULL;
+   end = ~0ul;
} else {
start = base;
end = base + count - 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223372 - head/bin/realpath

2011-06-21 Thread Ruslan Ermilov
Author: ru
Date: Tue Jun 21 19:34:57 2011
New Revision: 223372
URL: http://svn.freebsd.org/changeset/base/223372

Log:
  Make ``realpath'' behave like ``realpath .''.

Modified:
  head/bin/realpath/realpath.1
  head/bin/realpath/realpath.c

Modified: head/bin/realpath/realpath.1
==
--- head/bin/realpath/realpath.1Tue Jun 21 19:31:31 2011
(r223371)
+++ head/bin/realpath/realpath.1Tue Jun 21 19:34:57 2011
(r223372)
@@ -33,7 +33,7 @@
 .\" From: src/bin/pwd/pwd.1,v 1.11 2000/11/20 11:39:39 ru Exp
 .\" $FreeBSD$
 .\"
-.Dd November 24, 2000
+.Dd June 21, 2011
 .Dt REALPATH 1
 .Os
 .Sh NAME
@@ -42,8 +42,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl q
-.Ar path
-.Op Ar ...
+.Op Ar path ...
 .Sh DESCRIPTION
 The
 .Nm
@@ -57,6 +56,11 @@ and
 .Pa /../
 in
 .Ar path .
+If
+.Ar path
+is absent, the current working directory
+.Pq Sq Pa .\&
+is assumed.
 .Pp
 If
 .Fl q

Modified: head/bin/realpath/realpath.c
==
--- head/bin/realpath/realpath.cTue Jun 21 19:31:31 2011
(r223371)
+++ head/bin/realpath/realpath.cTue Jun 21 19:34:57 2011
(r223372)
@@ -44,7 +44,8 @@ main(int argc, char *argv[])
 {
char buf[PATH_MAX];
char *p;
-   int ch, i, qflag, rval;
+   const char *path;
+   int ch, qflag, rval;
 
qflag = 0;
while ((ch = getopt(argc, argv, "q")) != -1) {
@@ -59,17 +60,16 @@ main(int argc, char *argv[])
}
argc -= optind;
argv += optind;
-   if (argc < 1)
-   usage();
+   path = *argv != NULL ? *argv++ : ".";
rval  = 0;
-   for (i = 0; i < argc; i++) {
-   if ((p = realpath(argv[i], buf)) == NULL) {
+   do {
+   if ((p = realpath(path, buf)) == NULL) {
if (!qflag)
-   warn("%s", argv[i]);
+   warn("%s", path);
rval = 1;
} else
(void)printf("%s\n", p);
-   }
+   } while ((path = *argv++) != NULL);
exit(rval);
 }
 
@@ -77,6 +77,6 @@ static void
 usage(void)
 {
 
-   (void)fprintf(stderr, "usage: realpath [-q] path [...]\n");
+   (void)fprintf(stderr, "usage: realpath [-q] [path ...]\n");
exit(1);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223373 - head/sys/fs/nfsserver

2011-06-21 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 21 19:58:29 2011
New Revision: 223373
URL: http://svn.freebsd.org/changeset/base/223373

Log:
  Fix the new NFSv4 server so that it checks for VREAD_ACL when
  a client does a Getattr for an ACL and not VREAD_ATTRIBUTES.
  This was found during the recent NFSv4 interoperability Bakeathon.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- head/sys/fs/nfsserver/nfs_nfsdserv.cTue Jun 21 19:34:57 2011
(r223372)
+++ head/sys/fs/nfsserver/nfs_nfsdserv.cTue Jun 21 19:58:29 2011
(r223373)
@@ -172,11 +172,12 @@ nfsrvd_getattr(struct nfsrv_descript *nd
fhandle_t fh;
int at_root = 0, error = 0, supports_nfsv4acls;
struct nfsreferral *refp;
-   nfsattrbit_t attrbits;
+   nfsattrbit_t attrbits, tmpbits;
struct mount *mp;
struct vnode *tvp = NULL;
struct vattr va;
uint64_t mounted_on_fileno = 0;
+   accmode_t accmode;
 
if (nd->nd_repstat)
return (0);
@@ -197,11 +198,20 @@ nfsrvd_getattr(struct nfsrv_descript *nd
vput(vp);
return (0);
}
-   if (!nd->nd_repstat)
-   nd->nd_repstat = nfsvno_accchk(vp,
-   VREAD_ATTRIBUTES,
-   nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE,
-   NFSACCCHK_VPISLOCKED, NULL);
+   if (nd->nd_repstat == 0) {
+   accmode = 0;
+   NFSSET_ATTRBIT(&tmpbits, &attrbits);
+   if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_ACL)) {
+   NFSCLRBIT_ATTRBIT(&tmpbits, NFSATTRBIT_ACL);
+   accmode |= VREAD_ACL;
+   }
+   if (NFSNONZERO_ATTRBIT(&tmpbits))
+   accmode |= VREAD_ATTRIBUTES;
+   if (accmode != 0)
+   nd->nd_repstat = nfsvno_accchk(vp, accmode,
+   nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE,
+   NFSACCCHK_VPISLOCKED, NULL);
+   }
}
if (!nd->nd_repstat)
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223372 - head/bin/realpath

2011-06-21 Thread Jilles Tjoelker
On Tue, Jun 21, 2011 at 07:34:57PM +, Ruslan Ermilov wrote:
> Author: ru
> Date: Tue Jun 21 19:34:57 2011
> New Revision: 223372
> URL: http://svn.freebsd.org/changeset/base/223372

> Log:
>   Make ``realpath'' behave like ``realpath .''.

Is this being added for compatibility with something?

If not, why do we need this non-standard extension if the shorter and
standard pwd -P already fulfills this function?

-- 
Jilles Tjoelker
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Bjoern A. Zeeb
On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

Hi Alan,

> Author: alc
> Date: Sun Jun 19 19:13:24 2011
> New Revision: 223307
> URL: http://svn.freebsd.org/changeset/base/223307
> 
> Log:
>  Precisely document the synchronization rules for the page's dirty field.
>  (Saying that the lock on the object that the page belongs to must be held
>  only represents one aspect of the rules.)
> 
>  Eliminate the use of the page queues lock for atomically performing read-
>  modify-write operations on the dirty field when the underlying architecture
>  supports atomic operations on char and short types.
> 
>  Document the fact that 32KB pages aren't really supported.
> 

contrary to the tinderbox I'd like to point out that all mips kernels built by 
universe are broken with a SVN HEAD from earlier today.  Could you please check 
and see if you can fix it?  The errors I get are:

vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 
against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 
against `atomic_clear_8'

Thanks a lot!
/bz


>  Reviewed by: attilio, kib
> 
> Modified:
>  head/sys/vm/vm_fault.c
>  head/sys/vm/vm_page.c
>  head/sys/vm/vm_page.h
> 
> Modified: head/sys/vm/vm_fault.c
> ==
> --- head/sys/vm/vm_fault.cSun Jun 19 18:34:49 2011(r223306)
> +++ head/sys/vm/vm_fault.cSun Jun 19 19:13:24 2011(r223307)
> @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, 
>* caller's changes may go unnoticed because they are
>* performed through an unmanaged mapping or by a DMA
>* operation.
> +  *
> +  * The object lock is not held here.  Therefore, like
> +  * a pmap operation, the page queues lock may be
> +  * required in order to call vm_page_dirty().  See
> +  * vm_page_clear_dirty_mask().
>*/
> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
> +defined(__mips__)
> + vm_page_dirty(*mp);
> +#else
>   vm_page_lock_queues();
>   vm_page_dirty(*mp);
>   vm_page_unlock_queues();
> +#endif
>   }
>   }
>   if (pmap_failed) {
> 
> Modified: head/sys/vm/vm_page.c
> ==
> --- head/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011(r223306)
> +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011(r223307)
> @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m
> /*
>  *vm_page_dirty:
>  *
> - *   make page all dirty
> + *   Set all bits in the page's dirty field.
> + *
> + *   The object containing the specified page must be locked if the call is
> + *   made from the machine-independent layer.  If, however, the call is
> + *   made from the pmap layer, then the page queues lock may be required.
> + *   See vm_page_clear_dirty_mask().
>  */
> void
> vm_page_dirty(vm_page_t m)
> @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in
>   /*
>* If the object is locked and the page is neither VPO_BUSY nor
>* PG_WRITEABLE, then the page's dirty field cannot possibly be
> -  * modified by a concurrent pmap operation. 
> +  * set by a concurrent pmap operation. 
>*/
>   VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
>   if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0)
>   m->dirty &= ~pagebits;
>   else {
> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
> +defined(__mips__)
> + /*
> +  * On the aforementioned architectures, the page queues lock
> +  * is not required by the following read-modify-write
> +  * operation.  The combination of the object's lock and an
> +  * atomic operation suffice.  Moreover, the pmap layer on
> +  * these architectures can call vm_page_dirty() without
> +  * holding the page queues lock.
> +  */
> +#if PAGE_SIZE == 4096
> + atomic_clear_char(&m->dirty, pagebits);
> +#elif PAGE_SIZE == 8192
> + atomic_clear_short(&m->dirty, pagebits);
> +#elif PAGE_SIZE == 16384
> + atomic_clear_int(&m->dirty, pagebits);
> +#else
> +#error "PAGE_SIZE is not supported."
> +#endif
> +#else
> + /*
> +  * Otherwise, the page queues lock is required to ensure that
> +  * a concurrent pmap operation does not set the page's dirt

svn commit: r223374 - head/usr.bin/finger

2011-06-21 Thread Xin LI
Author: delphij
Date: Tue Jun 21 20:33:55 2011
New Revision: 223374
URL: http://svn.freebsd.org/changeset/base/223374

Log:
  Staticify cleanup() which is not referenced in other places.
  
  MFC after:2 weeks

Modified:
  head/usr.bin/finger/net.c

Modified: head/usr.bin/finger/net.c
==
--- head/usr.bin/finger/net.c   Tue Jun 21 19:58:29 2011(r223373)
+++ head/usr.bin/finger/net.c   Tue Jun 21 20:33:55 2011(r223374)
@@ -226,7 +226,7 @@ trying(const struct addrinfo *ai)
printf("Trying %s...\n", buf);
 }
 
-void
+static void
 cleanup(int sig __unused)
 {
 #defineERRSTR  "Timed out.\n"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223375 - head/usr.bin/lastcomm

2011-06-21 Thread Xin LI
Author: delphij
Date: Tue Jun 21 20:36:10 2011
New Revision: 223375
URL: http://svn.freebsd.org/changeset/base/223375

Log:
  Remove unneeded headers.
  
  MFC after:2 weeks

Modified:
  head/usr.bin/lastcomm/lastcomm.c
  head/usr.bin/lastcomm/readrec.c

Modified: head/usr.bin/lastcomm/lastcomm.c
==
--- head/usr.bin/lastcomm/lastcomm.cTue Jun 21 20:33:55 2011
(r223374)
+++ head/usr.bin/lastcomm/lastcomm.cTue Jun 21 20:36:10 2011
(r223375)
@@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 

Modified: head/usr.bin/lastcomm/readrec.c
==
--- head/usr.bin/lastcomm/readrec.c Tue Jun 21 20:33:55 2011
(r223374)
+++ head/usr.bin/lastcomm/readrec.c Tue Jun 21 20:36:10 2011
(r223375)
@@ -33,13 +33,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 
 int readrec_forward(FILE *f, struct acctv2 *av2);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223376 - head/usr.bin/cmp

2011-06-21 Thread Xin LI
Author: delphij
Date: Tue Jun 21 20:44:06 2011
New Revision: 223376
URL: http://svn.freebsd.org/changeset/base/223376

Log:
  Eliminate unneeded headers.

Modified:
  head/usr.bin/cmp/regular.c
  head/usr.bin/cmp/special.c

Modified: head/usr.bin/cmp/regular.c
==
--- head/usr.bin/cmp/regular.c  Tue Jun 21 20:36:10 2011(r223375)
+++ head/usr.bin/cmp/regular.c  Tue Jun 21 20:44:06 2011(r223376)
@@ -41,12 +41,10 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "extern.h"

Modified: head/usr.bin/cmp/special.c
==
--- head/usr.bin/cmp/special.c  Tue Jun 21 20:36:10 2011(r223375)
+++ head/usr.bin/cmp/special.c  Tue Jun 21 20:44:06 2011(r223376)
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include "extern.h"
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223370 - head/sys/dev/acpica

2011-06-21 Thread Jung-uk Kim
On Tuesday 21 June 2011 03:29 pm, John Baldwin wrote:
> Author: jhb
> Date: Tue Jun 21 19:29:27 2011
> New Revision: 223370
> URL: http://svn.freebsd.org/changeset/base/223370
>
> Log:
>   Use AcpiWalkResources() to parse the resource list from _CRS
> rather than using a home-rolled loop.  While here, add support for
> 64-bit address range resources.

This broke build with ACPI_DEBUG.  The attached patch should fix it.

>   Silence on: acpi@ (older version)

Sorry, I am quite busy at $work recently. :-(

Jung-uk Kim
Index: sys/dev/acpica/acpi_resource.c
===
--- sys/dev/acpica/acpi_resource.c  (revision 223372)
+++ sys/dev/acpica/acpi_resource.c  (working copy)
@@ -343,22 +343,23 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *cont
if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED &&
res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) {
if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n",
-   name, min, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n",
+   name, (uintmax_t)min, (uintmax_t)length));
set->set_memory(dev, arc->context, min, length);
} else {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name,
-   min, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name,
+   (uintmax_t)min, (uintmax_t)length));
set->set_ioport(dev, arc->context, min, length);
}
} else {
if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n",
-   name, min, max, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
+   "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min,
+   (uintmax_t)max, (uintmax_t)length));
set->set_memoryrange(dev, arc->context, min, max, length, gran);
} else {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n",
-   name, min, max, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n",
+   name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length));
set->set_iorange(dev, arc->context, min, max, length, gran);
}
}   
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r223377 - head/sys/sparc64/sparc64

2011-06-21 Thread Marius Strobl
Author: marius
Date: Tue Jun 21 20:47:03 2011
New Revision: 223377
URL: http://svn.freebsd.org/changeset/base/223377

Log:
  On machines where we don't need to lock the kernel TSB into the dTLB and
  thus may basically use the entire 64-bit kernel address space increase
  the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX.

Modified:
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/sparc64/sparc64/pmap.c
==
--- head/sys/sparc64/sparc64/pmap.c Tue Jun 21 20:44:06 2011
(r223376)
+++ head/sys/sparc64/sparc64/pmap.c Tue Jun 21 20:47:03 2011
(r223377)
@@ -384,11 +384,12 @@ pmap_bootstrap(u_int cpu_impl)
 * public documentation is available for these, the latter just might
 * not support it, yet.
 */
-   virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT));
if (cpu_impl == CPU_IMPL_SPARC64V ||
-   cpu_impl >= CPU_IMPL_ULTRASPARCIIIp)
+   cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) {
tsb_kernel_ldd_phys = 1;
-   else {
+   virtsz = roundup(5 / 3 * physsz, PAGE_SIZE_4M <<
+   (PAGE_SHIFT - TTE_SHIFT));
+   } else {
dtlb_slots_avail = 0;
for (i = 0; i < dtlb_slots; i++) {
data = dtlb_get_data(i);
@@ -401,6 +402,8 @@ pmap_bootstrap(u_int cpu_impl)
if (cpu_impl >= CPU_IMPL_ULTRASPARCI &&
cpu_impl < CPU_IMPL_ULTRASPARCIII)
dtlb_slots_avail /= 2;
+   virtsz = roundup(physsz, PAGE_SIZE_4M <<
+   (PAGE_SHIFT - TTE_SHIFT));
virtsz = MIN(virtsz, (dtlb_slots_avail * PAGE_SIZE_4M) <<
(PAGE_SHIFT - TTE_SHIFT));
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223378 - head/sys/sparc64/include

2011-06-21 Thread Marius Strobl
Author: marius
Date: Tue Jun 21 20:48:14 2011
New Revision: 223378
URL: http://svn.freebsd.org/changeset/base/223378

Log:
  On machines where we don't need to lock the kernel TSB into the dTLB and
  thus may basically use the entire 64-bit kernel address space reduce
  VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory.

Modified:
  head/sys/sparc64/include/tsb.h
  head/sys/sparc64/include/vmparam.h

Modified: head/sys/sparc64/include/tsb.h
==
--- head/sys/sparc64/include/tsb.h  Tue Jun 21 20:47:03 2011
(r223377)
+++ head/sys/sparc64/include/tsb.h  Tue Jun 21 20:48:14 2011
(r223378)
@@ -50,7 +50,6 @@ extern struct tte *tsb_kernel;
 extern vm_size_t tsb_kernel_mask;
 extern vm_size_t tsb_kernel_size;
 extern vm_paddr_t tsb_kernel_phys;
-extern u_int tsb_kernel_ldd_phys;
 
 static __inline struct tte *
 tsb_vpntobucket(pmap_t pm, vm_offset_t vpn)

Modified: head/sys/sparc64/include/vmparam.h
==
--- head/sys/sparc64/include/vmparam.h  Tue Jun 21 20:47:03 2011
(r223377)
+++ head/sys/sparc64/include/vmparam.h  Tue Jun 21 20:48:14 2011
(r223378)
@@ -218,7 +218,7 @@
  * is the total KVA space allocated for kmem_map.
  */
 #ifndef VM_KMEM_SIZE_SCALE
-#defineVM_KMEM_SIZE_SCALE  (3)
+#defineVM_KMEM_SIZE_SCALE  (tsb_kernel_ldd_phys == 0 ? 3 : 1)
 #endif
 
 /*
@@ -238,6 +238,7 @@
 
 #defineUMA_MD_SMALL_ALLOC
 
+extern u_int tsb_kernel_ldd_phys;
 extern vm_offset_t vm_max_kernel_address;
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223379 - head/sys/sparc64/include

2011-06-21 Thread Marius Strobl
Author: marius
Date: Tue Jun 21 20:50:55 2011
New Revision: 223379
URL: http://svn.freebsd.org/changeset/base/223379

Log:
  Fix whitespace

Modified:
  head/sys/sparc64/include/vmparam.h

Modified: head/sys/sparc64/include/vmparam.h
==
--- head/sys/sparc64/include/vmparam.h  Tue Jun 21 20:48:14 2011
(r223378)
+++ head/sys/sparc64/include/vmparam.h  Tue Jun 21 20:50:55 2011
(r223379)
@@ -70,7 +70,7 @@
  * The number of PHYSSEG entries must be one greater than the number
  * of phys_avail entries because the phys_avail entry that spans the
  * largest physical address that is accessible by ISA DMA is split
- * into two PHYSSEG entries. 
+ * into two PHYSSEG entries.
  */
 #defineVM_PHYSSEG_MAX  64
 
@@ -136,13 +136,13 @@
  * 43 bits of user address space is considered to be "enough", so we ignore it.
  *
  * Upper region:   0x
- * 0xf800
- * 
+ * 0xf800
+ *
  * Hole:   0xf7ff
- * 0x0800
+ * 0x0800
  *
  * Lower region:   0x07ff
- * 0x
+ * 0x
  *
  * In general we ignore the upper region, and use the lower region as mappable
  * space.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223380 - head/sys/dev/xl

2011-06-21 Thread Warner Losh
Author: imp
Date: Tue Jun 21 20:51:09 2011
New Revision: 223380
URL: http://svn.freebsd.org/changeset/base/223380

Log:
  Supress warning that command didn't complete when the parent bus
  thinks the card is gone.

Modified:
  head/sys/dev/xl/if_xl.c

Modified: head/sys/dev/xl/if_xl.c
==
--- head/sys/dev/xl/if_xl.c Tue Jun 21 20:50:55 2011(r223379)
+++ head/sys/dev/xl/if_xl.c Tue Jun 21 20:51:09 2011(r223380)
@@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme
  * only a finite amount of time to avoid getting caught in an
  * infinite loop. Normally this delay routine would be a macro,
  * but it isn't called during normal operation so we can afford
- * to make it a function.
+ * to make it a function.  Spress warning when card gone.
  */
 static void
 xl_wait(struct xl_softc *sc)
@@ -346,7 +346,7 @@ xl_wait(struct xl_softc *sc)
break;
}
 
-   if (i == XL_TIMEOUT)
+   if (i == XL_TIMEOUT && bus_child_present(sc->xl_dev))
device_printf(sc->xl_dev, "command never completed!\n");
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223381 - head/sys/dev/dc

2011-06-21 Thread Warner Losh
Author: imp
Date: Tue Jun 21 20:52:55 2011
New Revision: 223381
URL: http://svn.freebsd.org/changeset/base/223381

Log:
  Supress command completion failure warning when the card isn't
  present.  Only call the bus to check if we actually do timeout so we
  don't affect the normal case (since this case needn't be optimized and
  this guards against all races).

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Tue Jun 21 20:51:09 2011(r223380)
+++ head/sys/dev/dc/if_dc.c Tue Jun 21 20:52:55 2011(r223381)
@@ -1385,7 +1385,7 @@ dc_netcfg_wait(struct dc_softc *sc)
break;
DELAY(10);
}
-   if (i == DC_TIMEOUT) {
+   if (i == DC_TIMEOUT && bus_child_present(sc->dc_dev)) {
if (!(isr & DC_ISR_TX_IDLE) && !DC_IS_ASIX(sc))
device_printf(sc->dc_dev,
"%s: failed to force tx to idle state\n", __func__);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223380 - head/sys/dev/xl

2011-06-21 Thread Ben Kaduk
On Tue, Jun 21, 2011 at 4:51 PM, Warner Losh  wrote:
> Author: imp
> Date: Tue Jun 21 20:51:09 2011
> New Revision: 223380
> URL: http://svn.freebsd.org/changeset/base/223380
>
> --- head/sys/dev/xl/if_xl.c     Tue Jun 21 20:50:55 2011        (r223379)
> +++ head/sys/dev/xl/if_xl.c     Tue Jun 21 20:51:09 2011        (r223380)
> @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme
>  * only a finite amount of time to avoid getting caught in an
>  * infinite loop. Normally this delay routine would be a macro,
>  * but it isn't called during normal operation so we can afford
> - * to make it a function.
> + * to make it a function.  Spress warning when card gone.
 ^^^u

-Ben Kaduk
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Bruce Evans

On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:


On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

Hi Alan,


Author: alc
Date: Sun Jun 19 19:13:24 2011
New Revision: 223307
URL: http://svn.freebsd.org/changeset/base/223307

Log:
 Precisely document the synchronization rules for the page's dirty field.
 (Saying that the lock on the object that the page belongs to must be held
 only represents one aspect of the rules.)

 Eliminate the use of the page queues lock for atomically performing read-
 modify-write operations on the dirty field when the underlying architecture
 supports atomic operations on char and short types.

 Document the fact that 32KB pages aren't really supported.


contrary to the tinderbox I'd like to point out that all mips kernels built by 
universe are broken with a SVN HEAD from earlier today.  Could you please check 
and see if you can fix it?  The errors I get are:

vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 
against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 
against `atomic_clear_8'


Atomic types shorter than int cannot be used in MI code, since they might
not exist.  Apparently they don't exist on mips.  jake@ fixed all their
old uses for sparc4 in ~Y2K.


Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Sun Jun 19 18:34:49 2011(r223306)
+++ head/sys/vm/vm_fault.c  Sun Jun 19 19:13:24 2011(r223307)
@@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map,
 * caller's changes may go unnoticed because they are
 * performed through an unmanaged mapping or by a DMA
 * operation.
+*
+* The object lock is not held here.  Therefore, like
+* a pmap operation, the page queues lock may be
+* required in order to call vm_page_dirty().  See
+* vm_page_clear_dirty_mask().
 */
+#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
+defined(__mips__)
+   vm_page_dirty(*mp);
+#else
vm_page_lock_queues();
vm_page_dirty(*mp);
vm_page_unlock_queues();
+#endif


Apparently, it used to work by using a global lock, so it didn't need to
use atomic ops that don't exist because the data sizes are too small.


Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Sun Jun 19 18:34:49 2011(r223306)
+++ head/sys/vm/vm_page.c   Sun Jun 19 19:13:24 2011(r223307)
...
@@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in
/*
 * If the object is locked and the page is neither VPO_BUSY nor
 * PG_WRITEABLE, then the page's dirty field cannot possibly be
-* modified by a concurrent pmap operation.
+* set by a concurrent pmap operation.
 */
VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0)
m->dirty &= ~pagebits;
else {
+#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
+defined(__mips__)
+   /*
+* On the aforementioned architectures, the page queues lock
+* is not required by the following read-modify-write
+* operation.  The combination of the object's lock and an
+* atomic operation suffice.  Moreover, the pmap layer on
+* these architectures can call vm_page_dirty() without
+* holding the page queues lock.
+*/
+#if PAGE_SIZE == 4096
+   atomic_clear_char(&m->dirty, pagebits);


Cannot do that in MI code, though it might work accidentally because all
archies with PAGE_SIZE == 4096 might support it.


+#elif PAGE_SIZE == 8192
+   atomic_clear_short(&m->dirty, pagebits);


Cannot do that...


+#elif PAGE_SIZE == 16384
+   atomic_clear_int(&m->dirty, pagebits);
+#else
+#error "PAGE_SIZE is not supported."
+#endif
+#else
+   /*
+* Otherwise, the page queues lock is required to ensure that
+* a concurrent pmap operation does not set the page's dirty
+* field during the following read-modify-write operation.
+*/
vm_page_lock_queues();
m->dirty &= ~pagebits;
vm_page_unlock_queues();
+#endif
}
}


Modi

svn commit: r223382 - head/usr.sbin/nfsuserd

2011-06-21 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 21 21:07:33 2011
New Revision: 223382
URL: http://svn.freebsd.org/changeset/base/223382

Log:
  Change the NFSv4 nfsuserd(8) daemon so that it doesn't preload the
  uid<->username mapping cache with an entry when another entry
  for that uid is already loaded. This fixes a case where the
  mapping of "toor" would replace "root" when the daemon was started,
  resulting in no mapping for "root" until the cache entry for "toor"
  timed out.
  The algorithm is inefficient, but since it is only done once when
  the daemon is started up, I don't think that's an issue.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/nfsuserd/nfsuserd.c

Modified: head/usr.sbin/nfsuserd/nfsuserd.c
==
--- head/usr.sbin/nfsuserd/nfsuserd.c   Tue Jun 21 20:52:55 2011
(r223381)
+++ head/usr.sbin/nfsuserd/nfsuserd.c   Tue Jun 21 21:07:33 2011
(r223382)
@@ -76,6 +76,8 @@ static bool_t xdr_retval(XDR *, caddr_t)
 #defineMAXNAME 1024
 #defineMAXNFSUSERD 20
 #defineDEFNFSUSERD 4
+#defineMAXUSERMAX  10
+#defineMINUSERMAX  10
 #defineDEFUSERMAX  200
 #defineDEFUSERTIMEOUT  (1 * 60)
 struct info {
@@ -96,8 +98,8 @@ pid_t slaves[MAXNFSUSERD];
 int
 main(int argc, char *argv[])
 {
-   int i;
-   int error, len, mustfreeai = 0;
+   int i, j;
+   int error, fnd_dup, len, mustfreeai = 0, start_uidpos;
struct nfsd_idargs nid;
struct passwd *pwd;
struct group *grp;
@@ -107,6 +109,7 @@ main(int argc, char *argv[])
sigset_t signew;
char hostname[MAXHOSTNAMELEN + 1], *cp;
struct addrinfo *aip, hints;
+   static uid_t check_dups[MAXUSERMAX];
 
if (modfind("nfscommon") < 0) {
/* Not present in kernel, try loading it */
@@ -163,9 +166,10 @@ main(int argc, char *argv[])
argc--;
argv++;
i = atoi(*argv);
-   if (i < 10 || i > 10) {
+   if (i < MINUSERMAX || i > MAXUSERMAX) {
fprintf(stderr,
-   "usermax %d out of range 10<->10\n", i);
+   "usermax %d out of range %d<->%d\n", i,
+   MINUSERMAX, MAXUSERMAX);
usage();
}
nid.nid_usermax = i;
@@ -326,8 +330,25 @@ main(int argc, char *argv[])
/*
 * Loop around adding all users.
 */
+   start_uidpos = i;
setpwent();
while (i < nid.nid_usermax && (pwd = getpwent())) {
+   fnd_dup = 0;
+   /*
+* Yes, this is inefficient, but it is only done once when
+* the daemon is started and will run in a fraction of a second
+* for nid_usermax at 1. If nid_usermax is cranked up to
+* 10, it will take several seconds, depending on the CPU.
+*/
+   for (j = 0; j < (i - start_uidpos); j++)
+   if (check_dups[j] == pwd->pw_uid) {
+   /* Found another entry for uid, so skip it */
+   fnd_dup = 1;
+   break;
+   }
+   if (fnd_dup != 0)
+   continue;
+   check_dups[i - start_uidpos] = pwd->pw_uid;
nid.nid_uid = pwd->pw_uid;
nid.nid_name = pwd->pw_name;
nid.nid_namelen = strlen(pwd->pw_name);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Attilio Rao
2011/6/21 Bruce Evans :
> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:
>
>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
>>
>> Hi Alan,
>>
>>> Author: alc
>>> Date: Sun Jun 19 19:13:24 2011
>>> New Revision: 223307
>>> URL: http://svn.freebsd.org/changeset/base/223307
>>>
>>> Log:
>>>  Precisely document the synchronization rules for the page's dirty field.
>>>  (Saying that the lock on the object that the page belongs to must be
>>> held
>>>  only represents one aspect of the rules.)
>>>
>>>  Eliminate the use of the page queues lock for atomically performing
>>> read-
>>>  modify-write operations on the dirty field when the underlying
>>> architecture
>>>  supports atomic operations on char and short types.
>>>
>>>  Document the fact that 32KB pages aren't really supported.
>>
>> contrary to the tinderbox I'd like to point out that all mips kernels
>> built by universe are broken with a SVN HEAD from earlier today.  Could you
>> please check and see if you can fix it?  The errors I get are:
>>
>> vm_page.o: In function `vm_page_clear_dirty':
>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
>> against `atomic_clear_8'
>> vm_page.o: In function `vm_page_set_validclean':
>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
>> against `atomic_clear_8'
>
> Atomic types shorter than int cannot be used in MI code, since they might
> not exist.  Apparently they don't exist on mips.  jake@ fixed all their
> old uses for sparc4 in ~Y2K.

I'm sure they do, they exist in support.S though and may not have the
_8 form (they may just have the _char version). I may look at the code
again to be sure.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223380 - head/sys/dev/xl

2011-06-21 Thread Bruce Evans

On Tue, 21 Jun 2011, Ben Kaduk wrote:


On Tue, Jun 21, 2011 at 4:51 PM, Warner Losh  wrote:

Author: imp
Date: Tue Jun 21 20:51:09 2011
New Revision: 223380
URL: http://svn.freebsd.org/changeset/base/223380

--- head/sys/dev/xl/if_xl.c ? ? Tue Jun 21 20:50:55 2011 ? ? ? ?(r223379)
+++ head/sys/dev/xl/if_xl.c ? ? Tue Jun 21 20:51:09 2011 ? ? ? ?(r223380)
@@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme
?* only a finite amount of time to avoid getting caught in an
?* infinite loop. Normally this delay routine would be a macro,
?* but it isn't called during normal operation so we can afford
- * to make it a function.
+ * to make it a function. ?Spress warning when card gone.

^^^u


Still a srrising selling :-).

Bruce___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r223383 - head/sys/dev/acpica

2011-06-21 Thread John Baldwin
Author: jhb
Date: Tue Jun 21 21:30:20 2011
New Revision: 223383
URL: http://svn.freebsd.org/changeset/base/223383

Log:
  Fix build with ACPI_DEBUG defined.
  
  Submitted by: jkim
  Pointy hat to:jhb

Modified:
  head/sys/dev/acpica/acpi_resource.c

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Tue Jun 21 21:07:33 2011
(r223382)
+++ head/sys/dev/acpica/acpi_resource.c Tue Jun 21 21:30:20 2011
(r223383)
@@ -343,22 +343,23 @@ acpi_parse_resource(ACPI_RESOURCE *res, 
if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED &&
res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) {
if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n",
-   name, min, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n",
+   name, (uintmax_t)min, (uintmax_t)length));
set->set_memory(dev, arc->context, min, length);
} else {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name,
-   min, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name,
+   (uintmax_t)min, (uintmax_t)length));
set->set_ioport(dev, arc->context, min, length);
}
} else {
if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n",
-   name, min, max, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
+   "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min,
+   (uintmax_t)max, (uintmax_t)length));
set->set_memoryrange(dev, arc->context, min, max, length, gran);
} else {
-   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n",
-   name, min, max, length));
+   ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n",
+   name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length));
set->set_iorange(dev, arc->context, min, max, length, gran);
}
}   
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223384 - head/sys/dev/xl

2011-06-21 Thread Warner Losh
Author: imp
Date: Tue Jun 21 22:16:04 2011
New Revision: 223384
URL: http://svn.freebsd.org/changeset/base/223384

Log:
  My broken 'u' key scks!

Modified:
  head/sys/dev/xl/if_xl.c

Modified: head/sys/dev/xl/if_xl.c
==
--- head/sys/dev/xl/if_xl.c Tue Jun 21 21:30:20 2011(r223383)
+++ head/sys/dev/xl/if_xl.c Tue Jun 21 22:16:04 2011(r223384)
@@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme
  * only a finite amount of time to avoid getting caught in an
  * infinite loop. Normally this delay routine would be a macro,
  * but it isn't called during normal operation so we can afford
- * to make it a function.  Spress warning when card gone.
+ * to make it a function.  Supress warning when card gone.
  */
 static void
 xl_wait(struct xl_softc *sc)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223385 - head/sys/dev/xl

2011-06-21 Thread Warner Losh
Author: imp
Date: Tue Jun 21 22:17:28 2011
New Revision: 223385
URL: http://svn.freebsd.org/changeset/base/223385

Log:
  Really spell suppress the right way

Modified:
  head/sys/dev/xl/if_xl.c

Modified: head/sys/dev/xl/if_xl.c
==
--- head/sys/dev/xl/if_xl.c Tue Jun 21 22:16:04 2011(r223384)
+++ head/sys/dev/xl/if_xl.c Tue Jun 21 22:17:28 2011(r223385)
@@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme
  * only a finite amount of time to avoid getting caught in an
  * infinite loop. Normally this delay routine would be a macro,
  * but it isn't called during normal operation so we can afford
- * to make it a function.  Supress warning when card gone.
+ * to make it a function.  Suppress warning when card gone.
  */
 static void
 xl_wait(struct xl_softc *sc)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Warner Losh

On Jun 21, 2011, at 2:30 PM, Bjoern A. Zeeb wrote:

> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
> 
> Hi Alan,
> 
>> Author: alc
>> Date: Sun Jun 19 19:13:24 2011
>> New Revision: 223307
>> URL: http://svn.freebsd.org/changeset/base/223307
>> 
>> Log:
>> Precisely document the synchronization rules for the page's dirty field.
>> (Saying that the lock on the object that the page belongs to must be held
>> only represents one aspect of the rules.)
>> 
>> Eliminate the use of the page queues lock for atomically performing read-
>> modify-write operations on the dirty field when the underlying architecture
>> supports atomic operations on char and short types.
>> 
>> Document the fact that 32KB pages aren't really supported.
>> 
> 
> contrary to the tinderbox I'd like to point out that all mips kernels built 
> by universe are broken with a SVN HEAD from earlier today.  Could you please 
> check and see if you can fix it?  The errors I get are:
> 
> vm_page.o: In function `vm_page_clear_dirty':
> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 
> against `atomic_clear_8'
> vm_page.o: In function `vm_page_set_validclean':
> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 
> against `atomic_clear_8'

atomic_clear_8  I only see atomic_clear_int, which should be atomic_clear_4 
in the mips impl.


Warner

> Thanks a lot!
> /bz
> 
> 
>> Reviewed by: attilio, kib
>> 
>> Modified:
>> head/sys/vm/vm_fault.c
>> head/sys/vm/vm_page.c
>> head/sys/vm/vm_page.h
>> 
>> Modified: head/sys/vm/vm_fault.c
>> ==
>> --- head/sys/vm/vm_fault.c   Sun Jun 19 18:34:49 2011(r223306)
>> +++ head/sys/vm/vm_fault.c   Sun Jun 19 19:13:24 2011(r223307)
>> @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, 
>>   * caller's changes may go unnoticed because they are
>>   * performed through an unmanaged mapping or by a DMA
>>   * operation.
>> + *
>> + * The object lock is not held here.  Therefore, like
>> + * a pmap operation, the page queues lock may be
>> + * required in order to call vm_page_dirty().  See
>> + * vm_page_clear_dirty_mask().
>>   */
>> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
>> +defined(__mips__)
>> +vm_page_dirty(*mp);
>> +#else
>>  vm_page_lock_queues();
>>  vm_page_dirty(*mp);
>>  vm_page_unlock_queues();
>> +#endif
>>  }
>>  }
>>  if (pmap_failed) {
>> 
>> Modified: head/sys/vm/vm_page.c
>> ==
>> --- head/sys/vm/vm_page.cSun Jun 19 18:34:49 2011(r223306)
>> +++ head/sys/vm/vm_page.cSun Jun 19 19:13:24 2011(r223307)
>> @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m
>> /*
>> *vm_page_dirty:
>> *
>> - *  make page all dirty
>> + *  Set all bits in the page's dirty field.
>> + *
>> + *  The object containing the specified page must be locked if the call is
>> + *  made from the machine-independent layer.  If, however, the call is
>> + *  made from the pmap layer, then the page queues lock may be required.
>> + *  See vm_page_clear_dirty_mask().
>> */
>> void
>> vm_page_dirty(vm_page_t m)
>> @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in
>>  /*
>>   * If the object is locked and the page is neither VPO_BUSY nor
>>   * PG_WRITEABLE, then the page's dirty field cannot possibly be
>> - * modified by a concurrent pmap operation. 
>> + * set by a concurrent pmap operation. 
>>   */
>>  VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
>>  if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0)
>>  m->dirty &= ~pagebits;
>>  else {
>> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
>> +defined(__mips__)
>> +/*
>> + * On the aforementioned architectures, the page queues lock
>> + * is not required by the following read-modify-write
>> + * operation.  The combination of the object's lock and an
>> + * atomic operation suffice.  Moreover, the pmap layer on
>> + * these architectures can call vm_page_dirty() without
>> + * holding the page queues lock.
>> + */
>> +#if PAGE_SIZE == 4096
>> +atomic_clear_char(&m->dirty, pagebits);
>> +#elif PAGE_SIZE == 8192
>> +atomic_clear_short(&m->dirty, pagebits);
>> +#elif PAGE_SIZE == 16384
>> +atomic_clear_int(&m->dirty, pagebits);
>> 

svn commit: r223386 - head/sys/dev/cardbus

2011-06-21 Thread Warner Losh
Author: imp
Date: Tue Jun 21 22:45:31 2011
New Revision: 223386
URL: http://svn.freebsd.org/changeset/base/223386

Log:
  Minor cleanup:
  o Consider No CIS a normal event and stop whining about it so much
(too many cards are like this, espeically usb/firewire cards).
  o Add comments to the cis reading code.
  o Made the read from config space a smidge easier to read and eliminate
a loop that can be done mathematically.

Modified:
  head/sys/dev/cardbus/cardbus_cis.c

Modified: head/sys/dev/cardbus/cardbus_cis.c
==
--- head/sys/dev/cardbus/cardbus_cis.c  Tue Jun 21 22:17:28 2011
(r223385)
+++ head/sys/dev/cardbus/cardbus_cis.c  Tue Jun 21 22:45:31 2011
(r223386)
@@ -369,6 +369,14 @@ decode_tuple_end(device_t cbdev, device_
  * Functions to read the a tuple from the card
  */
 
+/*
+ * Read CIS bytes out of the config space.  We have to read it 4 bytes at a
+ * time and do the usual mask and shift to return the bytes.  The standard
+ * defines the byte order to be little endian.  pci_read_config converts it to
+ * host byte order.  This is why we have no endian conversion functions: the
+ * shifts wind up being endian neutral.  This is also why we avoid the obvious
+ * memcpy optimization.
+ */
 static int
 cardbus_read_tuple_conf(device_t cbdev, device_t child, uint32_t start,
 uint32_t *off, int *tupleid, int *len, uint8_t *tupledata)
@@ -379,12 +387,11 @@ cardbus_read_tuple_conf(device_t cbdev, 
 
loc = start + *off;
 
-   e = pci_read_config(child, loc - loc % 4, 4);
-   for (j = loc % 4; j > 0; j--)
-   e >>= 8;
+   e = pci_read_config(child, loc & ~0x3, 4);
+   e >>= 8 * (loc & 0x3);
*len = 0;
for (i = loc, j = -2; j < *len; j++, i++) {
-   if (i % 4 == 0)
+   if ((i & 0x3) == 0)
e = pci_read_config(child, i, 4);
if (j == -2)
*tupleid = 0xff & e;
@@ -398,6 +405,10 @@ cardbus_read_tuple_conf(device_t cbdev, 
return (0);
 }
 
+/*
+ * Read the CIS data out of memroy.  We indirect through the bus space
+ * routines to ensure proper byte ordering conversions when necessary.
+ */
 static int
 cardbus_read_tuple_mem(device_t cbdev, struct resource *res, uint32_t start,
 uint32_t *off, int *tupleid, int *len, uint8_t *tupledata)
@@ -580,7 +591,7 @@ cardbus_parse_cis(device_t cbdev, device
expect_linktarget = TRUE;
if ((start = pci_read_config(child, PCIR_CIS, 4)) == 0) {
DEVPRINTF((cbdev, "Warning: CIS pointer is 0: (no CIS)\n"));
-   return (ENXIO);
+   return (0);
}
DEVPRINTF((cbdev, "CIS pointer is %#x\n", start));
off = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Bruce Evans

On Tue, 21 Jun 2011, Attilio Rao wrote:


2011/6/21 Bruce Evans :

vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
against `atomic_clear_8'


Atomic types shorter than int cannot be used in MI code, since they might
not exist. ??Apparently they don't exist on mips. ??jake@ fixed all their
old uses for sparc4 in ~Y2K.


I'm sure they do, they exist in support.S though and may not have the
_8 form (they may just have the _char version). I may look at the code
again to be sure.


Perhaps more like the reverse.  They are correctly spelled with _char
form in the C code.  This is needed to match the declarations of the
variables literally.  They are translated to the _8 form by
 but the _8 form doesn't exist.  I think the acq and
rel forms exist in .  mips/support.S only has a limited
set of atomics, including clear_16 but not including clear_8.

Anyway, they shouldn't be used in either form.  They certainly don't
exist on sparc64, but sparc64 compiles because it is on the other half
of the ifdef.  sparc64 atomic support is actually 4 times smaller than
mips atomic support, not just 2.5 times, since it doesn't have extras
in support.S.

Bruce___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Alan Cox

On 06/21/2011 16:09, Attilio Rao wrote:

2011/6/21 Bruce Evans:

On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:


On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

Hi Alan,


Author: alc
Date: Sun Jun 19 19:13:24 2011
New Revision: 223307
URL: http://svn.freebsd.org/changeset/base/223307

Log:
  Precisely document the synchronization rules for the page's dirty field.
  (Saying that the lock on the object that the page belongs to must be
held
  only represents one aspect of the rules.)

  Eliminate the use of the page queues lock for atomically performing
read-
  modify-write operations on the dirty field when the underlying
architecture
  supports atomic operations on char and short types.

  Document the fact that 32KB pages aren't really supported.

contrary to the tinderbox I'd like to point out that all mips kernels
built by universe are broken with a SVN HEAD from earlier today.  Could you
please check and see if you can fix it?  The errors I get are:

vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
against `atomic_clear_8'

Atomic types shorter than int cannot be used in MI code, since they might
not exist.  Apparently they don't exist on mips.  jake@ fixed all their
old uses for sparc4 in ~Y2K.

I'm sure they do, they exist in support.S though and may not have the
_8 form (they may just have the _char version). I may look at the code
again to be sure.



It appears that while mips/include/atomic.h declares the existence of 
atomic_clear_8, mips/mips/support.S doesn't implement it.  In other 
words, only support for int's and short's is currently implemented, not 
char's:


# grep atomic_clear mips/mips/support.S
 * atomic_clear_32(u_int32_t *a, u_int32_t b)
LEAF(atomic_clear_32)
END(atomic_clear_32)
 * atomic_clear_16(u_int16_t *a, u_int16_t b)
LEAF(atomic_clear_16)
END(atomic_clear_16)


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223387 - stable/8/sys/dev/bge

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:16:40 2011
New Revision: 223387
URL: http://svn.freebsd.org/changeset/base/223387

Log:
  MFC r221818:
Add initial BCM5719 support. TSO and jumbo frame was intentionally
disabled for BCM5719 A0 revision due to known hardware errata.
Many thanks to Broadcom for continuing support of FreeBSD.
  
Submitted by:   Geans Pin at Broadcom

Modified:
  stable/8/sys/dev/bge/if_bge.c
  stable/8/sys/dev/bge/if_bgereg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==
--- stable/8/sys/dev/bge/if_bge.c   Tue Jun 21 22:45:31 2011
(r223386)
+++ stable/8/sys/dev/bge/if_bge.c   Wed Jun 22 00:16:40 2011
(r223387)
@@ -171,6 +171,7 @@ static const struct bge_type {
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5715S },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5717 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5718 },
+   { BCOM_VENDORID,BCOM_DEVICEID_BCM5719 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5720 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5721 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5722 },
@@ -299,6 +300,7 @@ static const struct bge_revision {
{ BGE_CHIPID_BCM5715_A3,"BCM5715 A3" },
{ BGE_CHIPID_BCM5717_A0,"BCM5717 A0" },
{ BGE_CHIPID_BCM5717_B0,"BCM5717 B0" },
+   { BGE_CHIPID_BCM5719_A0,"BCM5719 A0" },
{ BGE_CHIPID_BCM5755_A0,"BCM5755 A0" },
{ BGE_CHIPID_BCM5755_A1,"BCM5755 A1" },
{ BGE_CHIPID_BCM5755_A2,"BCM5755 A2" },
@@ -346,6 +348,7 @@ static const struct bge_revision const b
{ BGE_ASICREV_BCM57765, "unknown BCM57765" },
{ BGE_ASICREV_BCM57780, "unknown BCM57780" },
{ BGE_ASICREV_BCM5717,  "unknown BCM5717" },
+   { BGE_ASICREV_BCM5719,  "unknown BCM5719" },
 
{ 0, NULL }
 };
@@ -1481,6 +1484,14 @@ bge_chipinit(struct bge_softc *sc)
dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT;
if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0)
dma_rw_ctl &= ~BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK;
+   /*
+* Enable HW workaround for controllers that misinterpret
+* a status tag update and leave interrupts permanently
+* disabled.
+*/
+   if (sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
+   sc->bge_asicrev != BGE_ASICREV_BCM57765)
+   dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA;
}
pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4);
 
@@ -1537,7 +1548,7 @@ bge_blockinit(struct bge_softc *sc)
struct bge_rcb *rcb;
bus_size_t vrcb;
bge_hostaddr taddr;
-   uint32_t val;
+   uint32_t dmactl, val;
int i, limit;
 
/*
@@ -1594,8 +1605,16 @@ bge_blockinit(struct bge_softc *sc)
CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10);
 
/* Enable buffer manager */
-   CSR_WRITE_4(sc, BGE_BMAN_MODE,
-   BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN);
+   val = BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN;
+   /*
+* Change the arbitration algorithm of TXMBUF read request to
+* round-robin instead of priority based for BCM5719.  When
+* TXFIFO is almost empty, RDMA will hold its request until
+* TXFIFO is not almost empty.
+*/
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5719)
+   val |= BGE_BMANMODE_NO_TX_UNDERRUN;
+   CSR_WRITE_4(sc, BGE_BMAN_MODE, val);
 
/* Poll for buffer manager start indication */
for (i = 0; i < BGE_TIMEOUT; i++) {
@@ -1692,7 +1711,8 @@ bge_blockinit(struct bge_softc *sc)
rcb->bge_maxlen_flags =
BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0);
}
-   if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5717 ||
+   sc->bge_asicrev == BGE_ASICREV_BCM5719)
rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717;
else
rcb->bge_nicaddr = BGE_STD_RX_RINGS;
@@ -1724,7 +1744,8 @@ bge_blockinit(struct bge_softc *sc)
BUS_DMASYNC_PREREAD);
rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0,
BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED);
-   if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5717 ||
+   sc->bge_asicrev == BGE_ASICREV_BCM5719)
rcb->bge_nicaddr = BGE_JUMB

svn commit: r223388 - stable/7/sys/dev/bge

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:17:48 2011
New Revision: 223388
URL: http://svn.freebsd.org/changeset/base/223388

Log:
  MFC r221818:
Add initial BCM5719 support. TSO and jumbo frame was intentionally
disabled for BCM5719 A0 revision due to known hardware errata.
Many thanks to Broadcom for continuing support of FreeBSD.
  
Submitted by:   Geans Pin at Broadcom

Modified:
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/bge/if_bgereg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==
--- stable/7/sys/dev/bge/if_bge.c   Wed Jun 22 00:16:40 2011
(r223387)
+++ stable/7/sys/dev/bge/if_bge.c   Wed Jun 22 00:17:48 2011
(r223388)
@@ -171,6 +171,7 @@ static const struct bge_type {
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5715S },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5717 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5718 },
+   { BCOM_VENDORID,BCOM_DEVICEID_BCM5719 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5720 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5721 },
{ BCOM_VENDORID,BCOM_DEVICEID_BCM5722 },
@@ -299,6 +300,7 @@ static const struct bge_revision {
{ BGE_CHIPID_BCM5715_A3,"BCM5715 A3" },
{ BGE_CHIPID_BCM5717_A0,"BCM5717 A0" },
{ BGE_CHIPID_BCM5717_B0,"BCM5717 B0" },
+   { BGE_CHIPID_BCM5719_A0,"BCM5719 A0" },
{ BGE_CHIPID_BCM5755_A0,"BCM5755 A0" },
{ BGE_CHIPID_BCM5755_A1,"BCM5755 A1" },
{ BGE_CHIPID_BCM5755_A2,"BCM5755 A2" },
@@ -346,6 +348,7 @@ static const struct bge_revision const b
{ BGE_ASICREV_BCM57765, "unknown BCM57765" },
{ BGE_ASICREV_BCM57780, "unknown BCM57780" },
{ BGE_ASICREV_BCM5717,  "unknown BCM5717" },
+   { BGE_ASICREV_BCM5719,  "unknown BCM5719" },
 
{ 0, NULL }
 };
@@ -1481,6 +1484,14 @@ bge_chipinit(struct bge_softc *sc)
dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT;
if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0)
dma_rw_ctl &= ~BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK;
+   /*
+* Enable HW workaround for controllers that misinterpret
+* a status tag update and leave interrupts permanently
+* disabled.
+*/
+   if (sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
+   sc->bge_asicrev != BGE_ASICREV_BCM57765)
+   dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA;
}
pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4);
 
@@ -1537,7 +1548,7 @@ bge_blockinit(struct bge_softc *sc)
struct bge_rcb *rcb;
bus_size_t vrcb;
bge_hostaddr taddr;
-   uint32_t val;
+   uint32_t dmactl, val;
int i, limit;
 
/*
@@ -1594,8 +1605,16 @@ bge_blockinit(struct bge_softc *sc)
CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10);
 
/* Enable buffer manager */
-   CSR_WRITE_4(sc, BGE_BMAN_MODE,
-   BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN);
+   val = BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN;
+   /*
+* Change the arbitration algorithm of TXMBUF read request to
+* round-robin instead of priority based for BCM5719.  When
+* TXFIFO is almost empty, RDMA will hold its request until
+* TXFIFO is not almost empty.
+*/
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5719)
+   val |= BGE_BMANMODE_NO_TX_UNDERRUN;
+   CSR_WRITE_4(sc, BGE_BMAN_MODE, val);
 
/* Poll for buffer manager start indication */
for (i = 0; i < BGE_TIMEOUT; i++) {
@@ -1692,7 +1711,8 @@ bge_blockinit(struct bge_softc *sc)
rcb->bge_maxlen_flags =
BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0);
}
-   if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5717 ||
+   sc->bge_asicrev == BGE_ASICREV_BCM5719)
rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717;
else
rcb->bge_nicaddr = BGE_STD_RX_RINGS;
@@ -1724,7 +1744,8 @@ bge_blockinit(struct bge_softc *sc)
BUS_DMASYNC_PREREAD);
rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0,
BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED);
-   if (sc->bge_asicrev == BGE_ASICREV_BCM5717)
+   if (sc->bge_asicrev == BGE_ASICREV_BCM5717 ||
+   sc->bge_asicrev == BGE_ASICREV_BCM5719)
rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717;
else
  

svn commit: r223389 - stable/8/sys/dev/bge

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:21:19 2011
New Revision: 223389
URL: http://svn.freebsd.org/changeset/base/223389

Log:
  MFC r221974:
Correctly disable jumbo frame support for BCM5719 A0.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==
--- stable/8/sys/dev/bge/if_bge.c   Wed Jun 22 00:17:48 2011
(r223388)
+++ stable/8/sys/dev/bge/if_bge.c   Wed Jun 22 00:21:19 2011
(r223389)
@@ -2836,7 +2836,7 @@ bge_attach(device_t dev)
if (sc->bge_asicrev == BGE_ASICREV_BCM5719 &&
sc->bge_chipid == BGE_CHIPID_BCM5719_A0) {
/* Jumbo frame on BCM5719 A0 does not work. */
-   sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME;
+   sc->bge_flags &= ~BGE_FLAG_JUMBO;
}
break;
case BGE_ASICREV_BCM5755:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223390 - stable/7/sys/dev/bge

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:22:26 2011
New Revision: 223390
URL: http://svn.freebsd.org/changeset/base/223390

Log:
  MFC r221974:
Correctly disable jumbo frame support for BCM5719 A0.

Modified:
  stable/7/sys/dev/bge/if_bge.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==
--- stable/7/sys/dev/bge/if_bge.c   Wed Jun 22 00:21:19 2011
(r223389)
+++ stable/7/sys/dev/bge/if_bge.c   Wed Jun 22 00:22:26 2011
(r223390)
@@ -2836,7 +2836,7 @@ bge_attach(device_t dev)
if (sc->bge_asicrev == BGE_ASICREV_BCM5719 &&
sc->bge_chipid == BGE_CHIPID_BCM5719_A0) {
/* Jumbo frame on BCM5719 A0 does not work. */
-   sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME;
+   sc->bge_flags &= ~BGE_FLAG_JUMBO;
}
break;
case BGE_ASICREV_BCM5755:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223391 - stable/8/sys/dev/usb/net

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:35:42 2011
New Revision: 223391
URL: http://svn.freebsd.org/changeset/base/223391

Log:
  MFC r222581:
Poke correct GPIO pins for newer axe(4) controllers with Marvell
PHY. Newer models seem to use different LED mode that requires
enabling both GPIO1 and GPIO2.

Modified:
  stable/8/sys/dev/usb/net/if_axe.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/net/if_axe.c
==
--- stable/8/sys/dev/usb/net/if_axe.c   Wed Jun 22 00:22:26 2011
(r223390)
+++ stable/8/sys/dev/usb/net/if_axe.c   Wed Jun 22 00:35:42 2011
(r223391)
@@ -517,7 +517,7 @@ static void
 axe_ax88178_init(struct axe_softc *sc)
 {
struct usb_ether *ue;
-   int gpio0, phymode;
+   int gpio0, ledmode, phymode;
uint16_t eeprom, val;
 
ue = &sc->sc_ue;
@@ -531,9 +531,11 @@ axe_ax88178_init(struct axe_softc *sc)
if (eeprom == 0x) {
phymode = AXE_PHY_MODE_MARVELL;
gpio0 = 1;
+   ledmode = 0;
} else {
phymode = eeprom & 0x7f;
gpio0 = (eeprom & 0x80) ? 0 : 1;
+   ledmode = eeprom >> 8;
}
 
if (bootverbose)
@@ -551,9 +553,22 @@ axe_ax88178_init(struct axe_softc *sc)
AXE_GPIO_WRITE(AXE_GPIO0_EN | AXE_GPIO2_EN, hz / 4);
AXE_GPIO_WRITE(AXE_GPIO0_EN | AXE_GPIO2 | AXE_GPIO2_EN,
hz / 32);
-   } else
+   } else {
AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM | AXE_GPIO1 |
-   AXE_GPIO1_EN, hz / 32);
+   AXE_GPIO1_EN, hz / 3);
+   if (ledmode == 1) {
+   AXE_GPIO_WRITE(AXE_GPIO1_EN, hz / 3);
+   AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN,
+   hz / 3);
+   } else {
+   AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN |
+   AXE_GPIO2 | AXE_GPIO2_EN, hz / 32);
+   AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN |
+   AXE_GPIO2_EN, hz / 4);
+   AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN |
+   AXE_GPIO2 | AXE_GPIO2_EN, hz / 32);
+   }
+   }
break;
case AXE_PHY_MODE_CICADA:
case AXE_PHY_MODE_CICADA_V2:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223392 - stable/8/sys/dev/nfe

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:38:25 2011
New Revision: 223392
URL: http://svn.freebsd.org/changeset/base/223392

Log:
  MFC r222542:
If driver is not running, disable interrupts and do not try to
process received frames.  Previously it was possible to handle RX
interrupts even if controller is not fully initialized. This
resulted in non-working driver after system is up and running.
  
Reported by:hselasky
Tested by:  hselasky

Modified:
  stable/8/sys/dev/nfe/if_nfe.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/nfe/if_nfe.c
==
--- stable/8/sys/dev/nfe/if_nfe.c   Wed Jun 22 00:35:42 2011
(r223391)
+++ stable/8/sys/dev/nfe/if_nfe.c   Wed Jun 22 00:38:25 2011
(r223392)
@@ -1889,7 +1889,7 @@ nfe_int_task(void *arg, int pending)
 
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
NFE_UNLOCK(sc);
-   nfe_enable_intr(sc);
+   nfe_disable_intr(sc);
return;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223393 - stable/7/sys/dev/nfe

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:39:36 2011
New Revision: 223393
URL: http://svn.freebsd.org/changeset/base/223393

Log:
  MFC r222542:
If driver is not running, disable interrupts and do not try to
process received frames.  Previously it was possible to handle RX
interrupts even if controller is not fully initialized. This
resulted in non-working driver after system is up and running.
  
Reported by:hselasky
Tested by:  hselasky

Modified:
  stable/7/sys/dev/nfe/if_nfe.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/nfe/if_nfe.c
==
--- stable/7/sys/dev/nfe/if_nfe.c   Wed Jun 22 00:38:25 2011
(r223392)
+++ stable/7/sys/dev/nfe/if_nfe.c   Wed Jun 22 00:39:36 2011
(r223393)
@@ -1888,7 +1888,7 @@ nfe_int_task(void *arg, int pending)
 
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
NFE_UNLOCK(sc);
-   nfe_enable_intr(sc);
+   nfe_disable_intr(sc);
return;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223394 - stable/8/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:48:13 2011
New Revision: 223394
URL: http://svn.freebsd.org/changeset/base/223394

Log:
  MFC r205091,216860:
  r205091:
Implement Rx checksum offloading for Yukon EC, Yukon Ultra,
Yukon FE and Yukon Ultra2. These controllers provide very simple
checksum computation mechanism and it requires additional pseudo
header checksum computation in upper stack. Even though I couldn't
see much performance difference with/without Rx checksum offloading
it may help notebook based controllers.
  
Actually controller can compute two checksum value by giving
different starting position of checksum computation on received
frame. However, for long time, Marvell's checksum offloading engine
have been known to have several silicon bugs so don't blindly trust
computed partial checksum value. Instead, compute partial checksum
twice by giving the same checksum computation position and compare
the result. If the value is different it's clear indication of
hardware bug. This configuration lose IP checksum offloading
capability but I think it's better to take safe route.
Note, Rx checksum offloading for Yukon XL was still disabled due to
known silicon bug.
  
  r216860:
Fix endianness bug introduced in r205091.
After controller updates control word in a RX LE, driver converts
it to host byte order. The checksum value in the control word is
stored in big endian form by controller. r205091 didn't account for
the host byte order conversion such that the checksum value was
incorrectly interpreted on big endian architectures which in turn
made all TCP/UDP frames dropped. Make RX checksum offload work
on any architectures by swapping the checksum value.
  
Reported by:Sreekanth M. ( kanthms <> netlogicmicro dot com )
Tested by:  Sreekanth M. ( kanthms <> netlogicmicro dot com )

Modified:
  stable/8/sys/dev/msk/if_msk.c
  stable/8/sys/dev/msk/if_mskreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/msk/if_msk.c
==
--- stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 00:39:36 2011
(r223393)
+++ stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 00:48:13 2011
(r223394)
@@ -270,6 +270,7 @@ static void msk_intr_hwerr(struct msk_so
 #ifndef __NO_STRICT_ALIGNMENT
 static __inline void msk_fixup_rx(struct mbuf *);
 #endif
+static __inline void msk_rxcsum(struct msk_if_softc *, uint32_t, struct mbuf 
*);
 static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int);
 static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int);
 static void msk_txeof(struct msk_if_softc *, int);
@@ -294,6 +295,7 @@ static int msk_txrx_dma_alloc(struct msk
 static int msk_rx_dma_jalloc(struct msk_if_softc *);
 static void msk_txrx_dma_free(struct msk_if_softc *);
 static void msk_rx_dma_jfree(struct msk_if_softc *);
+static int msk_rx_fill(struct msk_if_softc *, int);
 static int msk_init_rx_ring(struct msk_if_softc *);
 static int msk_init_jumbo_rx_ring(struct msk_if_softc *);
 static void msk_init_tx_ring(struct msk_if_softc *);
@@ -642,6 +644,54 @@ msk_setvlan(struct msk_if_softc *sc_if, 
 }
 
 static int
+msk_rx_fill(struct msk_if_softc *sc_if, int jumbo)
+{
+   uint16_t idx;
+   int i;
+
+   if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 &&
+   (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) {
+   /* Wait until controller executes OP_TCPSTART command. */
+   for (i = 10; i > 0; i--) {
+   DELAY(10);
+   idx = CSR_READ_2(sc_if->msk_softc,
+   Y2_PREF_Q_ADDR(sc_if->msk_rxq,
+   PREF_UNIT_GET_IDX_REG));
+   if (idx != 0)
+   break;
+   }
+   if (i == 0) {
+   device_printf(sc_if->msk_if_dev,
+   "prefetch unit stuck?\n");
+   return (ETIMEDOUT);
+   }
+   /*
+* Fill consumed LE with free buffer. This can be done
+* in Rx handler but we don't want to add special code
+* in fast handler.
+*/
+   if (jumbo > 0) {
+   if (msk_jumbo_newbuf(sc_if, 0) != 0)
+   return (ENOBUFS);
+   bus_dmamap_sync(sc_if->msk_cdata.msk_jumbo_rx_ring_tag,
+   sc_if->msk_cdata.msk_jumbo_rx_ring_map,
+   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+   } else {
+   if (msk_newb

svn commit: r223395 - stable/7/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 00:49:24 2011
New Revision: 223395
URL: http://svn.freebsd.org/changeset/base/223395

Log:
  MFC r205091,216860:
  r205091:
Implement Rx checksum offloading for Yukon EC, Yukon Ultra,
Yukon FE and Yukon Ultra2. These controllers provide very simple
checksum computation mechanism and it requires additional pseudo
header checksum computation in upper stack. Even though I couldn't
see much performance difference with/without Rx checksum offloading
it may help notebook based controllers.
  
Actually controller can compute two checksum value by giving
different starting position of checksum computation on received
frame. However, for long time, Marvell's checksum offloading engine
have been known to have several silicon bugs so don't blindly trust
computed partial checksum value. Instead, compute partial checksum
twice by giving the same checksum computation position and compare
the result. If the value is different it's clear indication of
hardware bug. This configuration lose IP checksum offloading
capability but I think it's better to take safe route.
Note, Rx checksum offloading for Yukon XL was still disabled due to
known silicon bug.
  
  r216860:
Fix endianness bug introduced in r205091.
After controller updates control word in a RX LE, driver converts
it to host byte order. The checksum value in the control word is
stored in big endian form by controller. r205091 didn't account for
the host byte order conversion such that the checksum value was
incorrectly interpreted on big endian architectures which in turn
made all TCP/UDP frames dropped. Make RX checksum offload work
on any architectures by swapping the checksum value.
  
Reported by:Sreekanth M. ( kanthms <> netlogicmicro dot com )
Tested by:  Sreekanth M. ( kanthms <> netlogicmicro dot com )

Modified:
  stable/7/sys/dev/msk/if_msk.c
  stable/7/sys/dev/msk/if_mskreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/msk/if_msk.c
==
--- stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 00:48:13 2011
(r223394)
+++ stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 00:49:24 2011
(r223395)
@@ -270,6 +270,7 @@ static void msk_intr_hwerr(struct msk_so
 #ifndef __NO_STRICT_ALIGNMENT
 static __inline void msk_fixup_rx(struct mbuf *);
 #endif
+static __inline void msk_rxcsum(struct msk_if_softc *, uint32_t, struct mbuf 
*);
 static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int);
 static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int);
 static void msk_txeof(struct msk_if_softc *, int);
@@ -294,6 +295,7 @@ static int msk_txrx_dma_alloc(struct msk
 static int msk_rx_dma_jalloc(struct msk_if_softc *);
 static void msk_txrx_dma_free(struct msk_if_softc *);
 static void msk_rx_dma_jfree(struct msk_if_softc *);
+static int msk_rx_fill(struct msk_if_softc *, int);
 static int msk_init_rx_ring(struct msk_if_softc *);
 static int msk_init_jumbo_rx_ring(struct msk_if_softc *);
 static void msk_init_tx_ring(struct msk_if_softc *);
@@ -642,6 +644,54 @@ msk_setvlan(struct msk_if_softc *sc_if, 
 }
 
 static int
+msk_rx_fill(struct msk_if_softc *sc_if, int jumbo)
+{
+   uint16_t idx;
+   int i;
+
+   if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 &&
+   (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) {
+   /* Wait until controller executes OP_TCPSTART command. */
+   for (i = 10; i > 0; i--) {
+   DELAY(10);
+   idx = CSR_READ_2(sc_if->msk_softc,
+   Y2_PREF_Q_ADDR(sc_if->msk_rxq,
+   PREF_UNIT_GET_IDX_REG));
+   if (idx != 0)
+   break;
+   }
+   if (i == 0) {
+   device_printf(sc_if->msk_if_dev,
+   "prefetch unit stuck?\n");
+   return (ETIMEDOUT);
+   }
+   /*
+* Fill consumed LE with free buffer. This can be done
+* in Rx handler but we don't want to add special code
+* in fast handler.
+*/
+   if (jumbo > 0) {
+   if (msk_jumbo_newbuf(sc_if, 0) != 0)
+   return (ENOBUFS);
+   bus_dmamap_sync(sc_if->msk_cdata.msk_jumbo_rx_ring_tag,
+   sc_if->msk_cdata.msk_jumbo_rx_ring_map,
+   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+   } else {
+   if (msk_newbuf(sc_if, 0) != 0)
+   r

svn commit: r223396 - stable/8/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:42:52 2011
New Revision: 223396
URL: http://svn.freebsd.org/changeset/base/223396

Log:
  MFC r19,21,23,26-27,31,222516:
Merge all relevant changes from HEAD to fix long standing
instability issues of msk(4).  To get desired effect of this
merge, cold restarting is required because incorrectly programmed
registers are not reset to default value.
PR: kern/114631, kern/116853, kern/139093, kern/144206,
kern/147824, kern/151169, kern/154591, kern/155636,
kern/156493
  
  r19:
Do not blindly clear entire GPHY control register. It seems some
bits of the register is used for other purposes such that clearing
these bits resulted in unexpected results such as corrupted RX
frames or missing LE status updates.  For old controllers like
Yukon EC it had no effect but it caused all kind of troubles on
Yukon Supreme.
This change shall improve stability of controllers like Yukon
Ultra, Ultra2, Extreme, Optima and Supreme.
  
  r21:
Rework store and forward configuration of TX MAC FIFO. Basically it
enables store and forward mode except for jumbo frame on Yukon
Ultra.
  
  r23:
Do not configure RAM registers for controllers that do not have
them.  These registers are defined only for Yukon XL, Yukon EC and
Yukon FE.
  
  r26:
Make sure to enable all clocks before accessing registers.
Releasing PHY from power down/COMA is done after enabling all
clocks. While I'm here remove unnecessary controller reset.
  
  r27:
Do not touch ASF related register for controllers that do not have
these registers. Also disable Watchdog of ASF microcontroller.
  
  r31:
When MTU is changed, check whether driver should be reinitialized or
not.  If reinitialized is required, clear driver running flag.
  
  r222516:
Correctly check MAC running status before disabling TX/RX MACs.

Modified:
  stable/8/sys/dev/msk/if_msk.c
  stable/8/sys/dev/msk/if_mskreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/msk/if_msk.c
==
--- stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 00:49:24 2011
(r223395)
+++ stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 01:42:52 2011
(r223396)
@@ -562,7 +562,7 @@ msk_miibus_statchg(device_t dev)
msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0);
/* Disable Rx/Tx MAC. */
gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL);
-   if ((GM_GPCR_RX_ENA | GM_GPCR_TX_ENA) != 0) {
+   if ((gmac & (GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)) != 0) {
gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac);
/* Read again to ensure writing. */
@@ -1030,7 +1030,10 @@ msk_ioctl(struct ifnet *ifp, u_long comm
}
}
ifp->if_mtu = ifr->ifr_mtu;
-   msk_init_locked(sc_if);
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+   ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+   msk_init_locked(sc_if);
+   }
}
MSK_IF_UNLOCK(sc_if);
break;
@@ -1212,37 +1215,30 @@ msk_phy_power(struct msk_softc *sc, int 
 */
CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val);
 
-   val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1);
-   val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD);
+   our = CSR_PCI_READ_4(sc, PCI_OUR_REG_1);
+   our &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD);
if (sc->msk_hw_id == CHIP_ID_YUKON_XL) {
if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) {
/* Deassert Low Power for 1st PHY. */
-   val |= PCI_Y2_PHY1_COMA;
+   our |= PCI_Y2_PHY1_COMA;
if (sc->msk_num_port > 1)
-   val |= PCI_Y2_PHY2_COMA;
+   our |= PCI_Y2_PHY2_COMA;
}
}
-   /* Release PHY from PowerDown/COMA mode. */
-   CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val);
-   switch (sc->msk_hw_id) {
-   case CHIP_ID_YUKON_EC_U:
-   case CHIP_ID_YUKON_EX:
-   case CHIP_ID_YUKON_FE_P:
-   case CHIP_ID_YUKON_UL_2:
-   case CHIP_ID_YUKON_OPT:
- 

svn commit: r223397 - stable/7/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:44:09 2011
New Revision: 223397
URL: http://svn.freebsd.org/changeset/base/223397

Log:
  MFC r19,21,23,26-27,31,222516:
Merge all relevant changes from HEAD to fix long standing
instability issues of msk(4).  To get desired effect of this
merge, cold restarting is required because incorrectly programmed
registers are not reset to default value.
PR: kern/114631, kern/116853, kern/139093, kern/144206,
kern/147824, kern/151169, kern/154591, kern/155636,
kern/156493
  
  r19:
Do not blindly clear entire GPHY control register. It seems some
bits of the register is used for other purposes such that clearing
these bits resulted in unexpected results such as corrupted RX
frames or missing LE status updates.  For old controllers like
Yukon EC it had no effect but it caused all kind of troubles on
Yukon Supreme.
This change shall improve stability of controllers like Yukon
Ultra, Ultra2, Extreme, Optima and Supreme.
  
  r21:
Rework store and forward configuration of TX MAC FIFO. Basically it
enables store and forward mode except for jumbo frame on Yukon
Ultra.
  
  r23:
Do not configure RAM registers for controllers that do not have
them.  These registers are defined only for Yukon XL, Yukon EC and
Yukon FE.
  
  r26:
Make sure to enable all clocks before accessing registers.
Releasing PHY from power down/COMA is done after enabling all
clocks. While I'm here remove unnecessary controller reset.
  
  r27:
Do not touch ASF related register for controllers that do not have
these registers. Also disable Watchdog of ASF microcontroller.
  
  r31:
When MTU is changed, check whether driver should be reinitialized or
not.  If reinitialized is required, clear driver running flag.
  
  r222516:
Correctly check MAC running status before disabling TX/RX MACs.

Modified:
  stable/7/sys/dev/msk/if_msk.c
  stable/7/sys/dev/msk/if_mskreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/msk/if_msk.c
==
--- stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 01:42:52 2011
(r223396)
+++ stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 01:44:09 2011
(r223397)
@@ -562,7 +562,7 @@ msk_miibus_statchg(device_t dev)
msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0);
/* Disable Rx/Tx MAC. */
gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL);
-   if ((GM_GPCR_RX_ENA | GM_GPCR_TX_ENA) != 0) {
+   if ((gmac & (GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)) != 0) {
gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac);
/* Read again to ensure writing. */
@@ -1030,7 +1030,10 @@ msk_ioctl(struct ifnet *ifp, u_long comm
}
}
ifp->if_mtu = ifr->ifr_mtu;
-   msk_init_locked(sc_if);
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+   ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+   msk_init_locked(sc_if);
+   }
}
MSK_IF_UNLOCK(sc_if);
break;
@@ -1212,37 +1215,30 @@ msk_phy_power(struct msk_softc *sc, int 
 */
CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val);
 
-   val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1);
-   val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD);
+   our = CSR_PCI_READ_4(sc, PCI_OUR_REG_1);
+   our &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD);
if (sc->msk_hw_id == CHIP_ID_YUKON_XL) {
if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) {
/* Deassert Low Power for 1st PHY. */
-   val |= PCI_Y2_PHY1_COMA;
+   our |= PCI_Y2_PHY1_COMA;
if (sc->msk_num_port > 1)
-   val |= PCI_Y2_PHY2_COMA;
+   our |= PCI_Y2_PHY2_COMA;
}
}
-   /* Release PHY from PowerDown/COMA mode. */
-   CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val);
-   switch (sc->msk_hw_id) {
-   case CHIP_ID_YUKON_EC_U:
-   case CHIP_ID_YUKON_EX:
-   case CHIP_ID_YUKON_FE_P:
-   case CHIP_ID_YUKON_UL_2:
-   case CHIP_ID_YUKON_OPT:
-   CSR_WRITE_2(sc, B0_CTST, Y2_HW

svn commit: r223398 - stable/8/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:47:23 2011
New Revision: 223398
URL: http://svn.freebsd.org/changeset/base/223398

Log:
  MFC r30:
Add initial support for Marvell 88E8055/88E8075 Yukon Supreme.

Modified:
  stable/8/sys/dev/msk/if_msk.c
  stable/8/sys/dev/msk/if_mskreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/msk/if_msk.c
==
--- stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 01:44:09 2011
(r223397)
+++ stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 01:47:23 2011
(r223398)
@@ -221,6 +221,10 @@ static struct msk_product {
"Marvell Yukon 88E8071 Gigabit Ethernet" },
{ VENDORID_MARVELL, DEVICEID_MRVL_436C,
"Marvell Yukon 88E8072 Gigabit Ethernet" },
+   { VENDORID_MARVELL, DEVICEID_MRVL_436D,
+   "Marvell Yukon 88E8055 Gigabit Ethernet" },
+   { VENDORID_MARVELL, DEVICEID_MRVL_4370,
+   "Marvell Yukon 88E8075 Gigabit Ethernet" },
{ VENDORID_MARVELL, DEVICEID_MRVL_4380,
"Marvell Yukon 88E8057 Gigabit Ethernet" },
{ VENDORID_MARVELL, DEVICEID_MRVL_4381,
@@ -1369,11 +1373,16 @@ mskc_reset(struct msk_softc *sc)
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET);
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR);
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF);
-   if (sc->msk_hw_id == CHIP_ID_YUKON_EX)
+   if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
+   sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL),
GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON |
GMC_BYP_RETR_ON);
}
+
+   if (sc->msk_hw_id == CHIP_ID_YUKON_SUPR &&
+   sc->msk_hw_rev > CHIP_REV_YU_SU_B0)
+   CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, PCI_CLK_MACSEC_DIS);
if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) {
/* Disable PCIe PHY powerdown(reg 0x80, bit7). */
CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080);
@@ -1724,7 +1733,6 @@ mskc_attach(device_t dev)
/* Bail out if chip is not recognized. */
if (sc->msk_hw_id < CHIP_ID_YUKON_XL ||
sc->msk_hw_id > CHIP_ID_YUKON_OPT ||
-   sc->msk_hw_id == CHIP_ID_YUKON_SUPR ||
sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) {
device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n",
sc->msk_hw_id, sc->msk_hw_rev);
@@ -1831,6 +1839,11 @@ mskc_attach(device_t dev)
sc->msk_clock = 156;/* 156 MHz */
sc->msk_pflags |= MSK_FLAG_JUMBO;
break;
+   case CHIP_ID_YUKON_SUPR:
+   sc->msk_clock = 125;/* 125 MHz */
+   sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 |
+   MSK_FLAG_AUTOTX_CSUM;
+   break;
case CHIP_ID_YUKON_UL_2:
sc->msk_clock = 125;/* 125 MHz */
sc->msk_pflags |= MSK_FLAG_JUMBO;
@@ -3733,7 +3746,8 @@ msk_init_locked(struct msk_if_softc *sc_
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
-   if (sc->msk_hw_id == CHIP_ID_YUKON_EX)
+   if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
+   sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL),
GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON |
GMC_BYP_RETR_ON);
@@ -3928,7 +3942,8 @@ msk_init_locked(struct msk_if_softc *sc_
msk_stop(sc_if);
return;
}
-   if (sc->msk_hw_id == CHIP_ID_YUKON_EX) {
+   if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
+   sc->msk_hw_id == CHIP_ID_YUKON_SUPR) {
/* Disable flushing of non-ASF packets. */
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T),
GMF_RX_MACSEC_FLUSH_OFF);

Modified: stable/8/sys/dev/msk/if_mskreg.h
==
--- stable/8/sys/dev/msk/if_mskreg.hWed Jun 22 01:44:09 2011
(r223397)
+++ stable/8/sys/dev/msk/if_mskreg.hWed Jun 22 01:47:23 2011
(r223398)
@@ -144,6 +144,8 @@
 #define DEVICEID_MRVL_436A 0x436A
 #define DEVICEID_MRVL_436B 0x436B
 #define DEVICEID_MRVL_436C 0x436C
+#define DEVICEID_MRVL_436D 0x436D
+#define DEVICEID_MRVL_4370 0x4370
 #define DEVICEID_MRVL_4380 0x4380
 #define

svn commit: r223399 - stable/7/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:48:41 2011
New Revision: 223399
URL: http://svn.freebsd.org/changeset/base/223399

Log:
  MFC r30:
Add initial support for Marvell 88E8055/88E8075 Yukon Supreme.

Modified:
  stable/7/sys/dev/msk/if_msk.c
  stable/7/sys/dev/msk/if_mskreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/msk/if_msk.c
==
--- stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 01:47:23 2011
(r223398)
+++ stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 01:48:41 2011
(r223399)
@@ -221,6 +221,10 @@ static struct msk_product {
"Marvell Yukon 88E8071 Gigabit Ethernet" },
{ VENDORID_MARVELL, DEVICEID_MRVL_436C,
"Marvell Yukon 88E8072 Gigabit Ethernet" },
+   { VENDORID_MARVELL, DEVICEID_MRVL_436D,
+   "Marvell Yukon 88E8055 Gigabit Ethernet" },
+   { VENDORID_MARVELL, DEVICEID_MRVL_4370,
+   "Marvell Yukon 88E8075 Gigabit Ethernet" },
{ VENDORID_MARVELL, DEVICEID_MRVL_4380,
"Marvell Yukon 88E8057 Gigabit Ethernet" },
{ VENDORID_MARVELL, DEVICEID_MRVL_4381,
@@ -1369,11 +1373,16 @@ mskc_reset(struct msk_softc *sc)
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET);
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR);
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF);
-   if (sc->msk_hw_id == CHIP_ID_YUKON_EX)
+   if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
+   sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL),
GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON |
GMC_BYP_RETR_ON);
}
+
+   if (sc->msk_hw_id == CHIP_ID_YUKON_SUPR &&
+   sc->msk_hw_rev > CHIP_REV_YU_SU_B0)
+   CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, PCI_CLK_MACSEC_DIS);
if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) {
/* Disable PCIe PHY powerdown(reg 0x80, bit7). */
CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080);
@@ -1724,7 +1733,6 @@ mskc_attach(device_t dev)
/* Bail out if chip is not recognized. */
if (sc->msk_hw_id < CHIP_ID_YUKON_XL ||
sc->msk_hw_id > CHIP_ID_YUKON_OPT ||
-   sc->msk_hw_id == CHIP_ID_YUKON_SUPR ||
sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) {
device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n",
sc->msk_hw_id, sc->msk_hw_rev);
@@ -1831,6 +1839,11 @@ mskc_attach(device_t dev)
sc->msk_clock = 156;/* 156 MHz */
sc->msk_pflags |= MSK_FLAG_JUMBO;
break;
+   case CHIP_ID_YUKON_SUPR:
+   sc->msk_clock = 125;/* 125 MHz */
+   sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 |
+   MSK_FLAG_AUTOTX_CSUM;
+   break;
case CHIP_ID_YUKON_UL_2:
sc->msk_clock = 125;/* 125 MHz */
sc->msk_pflags |= MSK_FLAG_JUMBO;
@@ -3733,7 +3746,8 @@ msk_init_locked(struct msk_if_softc *sc_
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
-   if (sc->msk_hw_id == CHIP_ID_YUKON_EX)
+   if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
+   sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL),
GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON |
GMC_BYP_RETR_ON);
@@ -3928,7 +3942,8 @@ msk_init_locked(struct msk_if_softc *sc_
msk_stop(sc_if);
return;
}
-   if (sc->msk_hw_id == CHIP_ID_YUKON_EX) {
+   if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
+   sc->msk_hw_id == CHIP_ID_YUKON_SUPR) {
/* Disable flushing of non-ASF packets. */
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T),
GMF_RX_MACSEC_FLUSH_OFF);

Modified: stable/7/sys/dev/msk/if_mskreg.h
==
--- stable/7/sys/dev/msk/if_mskreg.hWed Jun 22 01:47:23 2011
(r223398)
+++ stable/7/sys/dev/msk/if_mskreg.hWed Jun 22 01:48:41 2011
(r223399)
@@ -144,6 +144,8 @@
 #define DEVICEID_MRVL_436A 0x436A
 #define DEVICEID_MRVL_436B 0x436B
 #define DEVICEID_MRVL_436C 0x436C
+#define DEVICEID_MRVL_436D 0x436D
+#define DEVICEID_MRVL_4370 0x4370
 #define DEVICEID_MRVL_4380 0x4380
 #define DEVICEID_MRVL_4381 0x4381
 
@@ -321,6 +323,9 @@

svn commit: r223400 - stable/8/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:54:49 2011
New Revision: 223400
URL: http://svn.freebsd.org/changeset/base/223400

Log:
  MFC r69:
style(9)

Modified:
  stable/8/sys/dev/msk/if_msk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/msk/if_msk.c
==
--- stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 01:48:41 2011
(r223399)
+++ stable/8/sys/dev/msk/if_msk.c   Wed Jun 22 01:54:49 2011
(r223400)
@@ -1018,7 +1018,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm
if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN)
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu) {
-   if (ifr->ifr_mtu > ETHERMTU) {
+   if (ifr->ifr_mtu > ETHERMTU) {
if ((sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) {
error = EINVAL;
MSK_IF_UNLOCK(sc_if);
@@ -1638,7 +1638,7 @@ msk_attach(device_t dev)
 * this workaround does not work so disable checksum offload
 * for VLAN interface.
 */
-   ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO;
+   ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO;
/*
 * Enable Rx checksum offloading for VLAN tagged frames
 * if controller support new descriptor format.
@@ -1923,7 +1923,8 @@ mskc_attach(device_t dev)
error = ENXIO;
goto fail;
}
-   mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | 
M_ZERO);
+   mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK |
+   M_ZERO);
if (mmd == NULL) {
device_printf(dev, "failed to allocate memory for "
"ivars of PORT_B\n");
@@ -1932,9 +1933,9 @@ mskc_attach(device_t dev)
}
mmd->port = MSK_PORT_B;
mmd->pmd = sc->msk_pmd;
-   if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S')
+   if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S')
mmd->mii_flags |= MIIF_HAVEFIBER;
-   if (sc->msk_pmd == 'P')
+   if (sc->msk_pmd == 'P')
mmd->mii_flags |= MIIF_HAVEFIBER | MIIF_MACPRIV0;
device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd);
}
@@ -3742,10 +3743,10 @@ msk_init_locked(struct msk_if_softc *sc_
ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM);
}
 
-   /* GMAC Control reset. */
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
+   /* GMAC Control reset. */
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL),
@@ -3855,13 +3856,13 @@ msk_init_locked(struct msk_if_softc *sc_
msk_set_tx_stfwd(sc_if);
}
 
-   if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P &&
-   sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) {
-   /* Disable dynamic watermark - from Linux. */
-   reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA));
-   reg &= ~0x03;
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg);
-   }
+   if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P &&
+   sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) {
+   /* Disable dynamic watermark - from Linux. */
+   reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA));
+   reg &= ~0x03;
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg);
+   }
 
/*
 * Disable Force Sync bit and Alloc bit in Tx RAM interface
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223401 - stable/7/sys/dev/msk

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:55:47 2011
New Revision: 223401
URL: http://svn.freebsd.org/changeset/base/223401

Log:
  MFC r69:
style(9)

Modified:
  stable/7/sys/dev/msk/if_msk.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/msk/if_msk.c
==
--- stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 01:54:49 2011
(r223400)
+++ stable/7/sys/dev/msk/if_msk.c   Wed Jun 22 01:55:47 2011
(r223401)
@@ -1018,7 +1018,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm
if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN)
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu) {
-   if (ifr->ifr_mtu > ETHERMTU) {
+   if (ifr->ifr_mtu > ETHERMTU) {
if ((sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) {
error = EINVAL;
MSK_IF_UNLOCK(sc_if);
@@ -1638,7 +1638,7 @@ msk_attach(device_t dev)
 * this workaround does not work so disable checksum offload
 * for VLAN interface.
 */
-   ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO;
+   ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO;
/*
 * Enable Rx checksum offloading for VLAN taggedd frames
 * if controller support new descriptor format.
@@ -1923,7 +1923,8 @@ mskc_attach(device_t dev)
error = ENXIO;
goto fail;
}
-   mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | 
M_ZERO);
+   mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK |
+   M_ZERO);
if (mmd == NULL) {
device_printf(dev, "failed to allocate memory for "
"ivars of PORT_B\n");
@@ -1932,9 +1933,9 @@ mskc_attach(device_t dev)
}
mmd->port = MSK_PORT_B;
mmd->pmd = sc->msk_pmd;
-   if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S')
+   if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S')
mmd->mii_flags |= MIIF_HAVEFIBER;
-   if (sc->msk_pmd == 'P')
+   if (sc->msk_pmd == 'P')
mmd->mii_flags |= MIIF_HAVEFIBER | MIIF_MACPRIV0;
device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd);
}
@@ -3742,10 +3743,10 @@ msk_init_locked(struct msk_if_softc *sc_
ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM);
}
 
-   /* GMAC Control reset. */
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
+   /* GMAC Control reset. */
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL),
@@ -3855,13 +3856,13 @@ msk_init_locked(struct msk_if_softc *sc_
msk_set_tx_stfwd(sc_if);
}
 
-   if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P &&
-   sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) {
-   /* Disable dynamic watermark - from Linux. */
-   reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA));
-   reg &= ~0x03;
-   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg);
-   }
+   if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P &&
+   sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) {
+   /* Disable dynamic watermark - from Linux. */
+   reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA));
+   reg &= ~0x03;
+   CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg);
+   }
 
/*
 * Disable Force Sync bit and Alloc bit in Tx RAM interface
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223402 - stable/8/share/man/man4

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:57:31 2011
New Revision: 223402
URL: http://svn.freebsd.org/changeset/base/223402

Log:
  MFC r32:
Add 88E8075 Yukon Supreme to the list of supported hardware list.

Modified:
  stable/8/share/man/man4/msk.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/msk.4
==
--- stable/8/share/man/man4/msk.4   Wed Jun 22 01:55:47 2011
(r223401)
+++ stable/8/share/man/man4/msk.4   Wed Jun 22 01:57:31 2011
(r223402)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 23, 2010
+.Dd May 23, 2011
 .Dt MSK 4
 .Os
 .Sh NAME
@@ -195,6 +195,8 @@ Marvell Yukon 88E8071 Gigabit Ethernet
 .It
 Marvell Yukon 88E8072 Gigabit Ethernet
 .It
+Marvell Yukon 88E8075 Gigabit Ethernet
+.It
 SysKonnect SK-9Sxx Gigabit Ethernet
 .It
 SysKonnect SK-9Exx Gigabit Ethernet
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223403 - stable/7/share/man/man4

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 01:57:45 2011
New Revision: 223403
URL: http://svn.freebsd.org/changeset/base/223403

Log:
  MFC r32:
Add 88E8075 Yukon Supreme to the list of supported hardware list.

Modified:
  stable/7/share/man/man4/msk.4
Directory Properties:
  stable/7/share/man/man4/   (props changed)

Modified: stable/7/share/man/man4/msk.4
==
--- stable/7/share/man/man4/msk.4   Wed Jun 22 01:57:31 2011
(r223402)
+++ stable/7/share/man/man4/msk.4   Wed Jun 22 01:57:45 2011
(r223403)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 23, 2010
+.Dd May 23, 2011
 .Dt MSK 4
 .Os
 .Sh NAME
@@ -195,6 +195,8 @@ Marvell Yukon 88E8071 Gigabit Ethernet
 .It
 Marvell Yukon 88E8072 Gigabit Ethernet
 .It
+Marvell Yukon 88E8075 Gigabit Ethernet
+.It
 SysKonnect SK-9Sxx Gigabit Ethernet
 .It
 SysKonnect SK-9Exx Gigabit Ethernet
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Warner Losh

On Jun 21, 2011, at 5:29 PM, Bruce Evans wrote:

> On Tue, 21 Jun 2011, Attilio Rao wrote:
> 
>> 2011/6/21 Bruce Evans :
 vm_page.o: In function `vm_page_clear_dirty':
 /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
 /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
 against `atomic_clear_8'
 vm_page.o: In function `vm_page_set_validclean':
 /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
 /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
 against `atomic_clear_8'
>>> 
>>> Atomic types shorter than int cannot be used in MI code, since they might
>>> not exist. Â Apparently they don't exist on mips. Â jake@ fixed all their
>>> old uses for sparc4 in ~Y2K.
>> 
>> I'm sure they do, they exist in support.S though and may not have the
>> _8 form (they may just have the _char version). I may look at the code
>> again to be sure.
> 
> Perhaps more like the reverse.  They are correctly spelled with _char
> form in the C code.  This is needed to match the declarations of the
> variables literally.  They are translated to the _8 form by
>  but the _8 form doesn't exist.  I think the acq and
> rel forms exist in .  mips/support.S only has a limited
> set of atomics, including clear_16 but not including clear_8.

Yup.

> Anyway, they shouldn't be used in either form.  They certainly don't
> exist on sparc64, but sparc64 compiles because it is on the other half
> of the ifdef.  sparc64 atomic support is actually 4 times smaller than
> mips atomic support, not just 2.5 times, since it doesn't have extras
> in support.S.

I'm not sure what you are saying...

Warner

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Warner Losh

On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:

> On 06/21/2011 16:09, Attilio Rao wrote:
>> 2011/6/21 Bruce Evans:
>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:
>>> 
 On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
 
 Hi Alan,
 
> Author: alc
> Date: Sun Jun 19 19:13:24 2011
> New Revision: 223307
> URL: http://svn.freebsd.org/changeset/base/223307
> 
> Log:
>  Precisely document the synchronization rules for the page's dirty field.
>  (Saying that the lock on the object that the page belongs to must be
> held
>  only represents one aspect of the rules.)
> 
>  Eliminate the use of the page queues lock for atomically performing
> read-
>  modify-write operations on the dirty field when the underlying
> architecture
>  supports atomic operations on char and short types.
> 
>  Document the fact that 32KB pages aren't really supported.
 contrary to the tinderbox I'd like to point out that all mips kernels
 built by universe are broken with a SVN HEAD from earlier today.  Could you
 please check and see if you can fix it?  The errors I get are:
 
 vm_page.o: In function `vm_page_clear_dirty':
 /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
 /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
 against `atomic_clear_8'
 vm_page.o: In function `vm_page_set_validclean':
 /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
 /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
 against `atomic_clear_8'
>>> Atomic types shorter than int cannot be used in MI code, since they might
>>> not exist.  Apparently they don't exist on mips.  jake@ fixed all their
>>> old uses for sparc4 in ~Y2K.
>> I'm sure they do, they exist in support.S though and may not have the
>> _8 form (they may just have the _char version). I may look at the code
>> again to be sure.
>> 
> 
> It appears that while mips/include/atomic.h declares the existence of 
> atomic_clear_8, mips/mips/support.S doesn't implement it.  In other words, 
> only support for int's and short's is currently implemented, not char's:
> 
> # grep atomic_clear mips/mips/support.S
> * atomic_clear_32(u_int32_t *a, u_int32_t b)
> LEAF(atomic_clear_32)
> END(atomic_clear_32)
> * atomic_clear_16(u_int16_t *a, u_int16_t b)
> LEAF(atomic_clear_16)
> END(atomic_clear_16

Doh!  I was confused.  I thought _8 was '64 bits' given the bus_space 
convention.  I'll look at implementing the _8 version tonight.

Warner

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223404 - head/sys/powerpc/ps3

2011-06-21 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Jun 22 02:11:42 2011
New Revision: 223404
URL: http://svn.freebsd.org/changeset/base/223404

Log:
  The IOMMU is not involved for the storage bus.

Modified:
  head/sys/powerpc/ps3/ps3bus.c

Modified: head/sys/powerpc/ps3/ps3bus.c
==
--- head/sys/powerpc/ps3/ps3bus.c   Wed Jun 22 01:57:45 2011
(r223403)
+++ head/sys/powerpc/ps3/ps3bus.c   Wed Jun 22 02:11:42 2011
(r223404)
@@ -631,8 +631,7 @@ ps3bus_get_dma_tag(device_t dev, device_
struct ps3bus_softc *sc = device_get_softc(dev);
int i, err, flags;
 
-   if (dinfo->bustype != PS3_BUSTYPE_SYSBUS &&
-   dinfo->bustype != PS3_BUSTYPE_STORAGE)
+   if (dinfo->bustype != PS3_BUSTYPE_SYSBUS)
return (bus_get_dma_tag(dev));
 
mtx_lock(&dinfo->iommu_mtx);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223405 - head/sys/dev/vr

2011-06-21 Thread Pyun YongHyeon
Author: yongari
Date: Wed Jun 22 02:18:45 2011
New Revision: 223405
URL: http://svn.freebsd.org/changeset/base/223405

Log:
  Remove link state change callback handler.  There is no need to
  register both status change and link state change callbacks.
  Implement checking valid link in state change callback and poll
  active link state in vr_tick().  This allows immediate detection of
  lost link as well as protecting driver from frequent link flips during
  link renegotiation.  taskq implementation was removed because driver
  now needs to poll link state in vr_tick().
  While I'm here do not report current link state if interface is not
  running.
  
  Tested by:n_hibma
  MFC after:1 week

Modified:
  head/sys/dev/vr/if_vr.c
  head/sys/dev/vr/if_vrreg.h

Modified: head/sys/dev/vr/if_vr.c
==
--- head/sys/dev/vr/if_vr.c Wed Jun 22 02:11:42 2011(r223404)
+++ head/sys/dev/vr/if_vr.c Wed Jun 22 02:18:45 2011(r223405)
@@ -185,7 +185,6 @@ static int vr_miibus_readreg(device_t, i
 static int vr_miibus_writereg(device_t, int, int, int);
 static void vr_miibus_statchg(device_t);
 
-static void vr_link_task(void *, int);
 static void vr_cam_mask(struct vr_softc *, uint32_t, int);
 static int vr_cam_data(struct vr_softc *, int, int, uint8_t *);
 static void vr_set_filter(struct vr_softc *);
@@ -226,7 +225,6 @@ static device_method_t vr_methods[] = {
DEVMETHOD(miibus_readreg,   vr_miibus_readreg),
DEVMETHOD(miibus_writereg,  vr_miibus_writereg),
DEVMETHOD(miibus_statchg,   vr_miibus_statchg),
-   DEVMETHOD(miibus_linkchg,   vr_miibus_statchg),
 
{ NULL, NULL }
 };
@@ -290,22 +288,13 @@ vr_miibus_writereg(device_t dev, int phy
return (0);
 }
 
-static void
-vr_miibus_statchg(device_t dev)
-{
-   struct vr_softc *sc;
-
-   sc = device_get_softc(dev);
-   taskqueue_enqueue(taskqueue_swi, &sc->vr_link_task);
-}
-
 /*
  * In order to fiddle with the
  * 'full-duplex' and '100Mbps' bits in the netconfig register, we
  * first have to put the transmit and/or receive logic in the idle state.
  */
 static void
-vr_link_task(void *arg, int pending)
+vr_miibus_statchg(device_t dev)
 {
struct vr_softc *sc;
struct mii_data *mii;
@@ -313,22 +302,25 @@ vr_link_task(void *arg, int pending)
int lfdx, mfdx;
uint8_t cr0, cr1, fc;
 
-   sc = (struct vr_softc *)arg;
-
-   VR_LOCK(sc);
+   sc = device_get_softc(dev);
mii = device_get_softc(sc->vr_miibus);
ifp = sc->vr_ifp;
if (mii == NULL || ifp == NULL ||
-   (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
-   VR_UNLOCK(sc);
+   (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
-   }
 
-   if (mii->mii_media_status & IFM_ACTIVE) {
-   if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)
+   sc->vr_link = 0;
+   if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
+   (IFM_ACTIVE | IFM_AVALID)) {
+   switch (IFM_SUBTYPE(mii->mii_media_active)) {
+   case IFM_10_T:
+   case IFM_100_TX:
sc->vr_link = 1;
-   } else
-   sc->vr_link = 0;
+   break;
+   default:
+   break;
+   }
+   }
 
if (sc->vr_link != 0) {
cr0 = CSR_READ_1(sc, VR_CR0);
@@ -384,11 +376,8 @@ vr_link_task(void *arg, int pending)
"%s: Tx/Rx shutdown error -- resetting\n",
__func__);
sc->vr_flags |= VR_F_RESTART;
-   VR_UNLOCK(sc);
-   return;
}
}
-   VR_UNLOCK(sc);
 }
 
 
@@ -621,7 +610,6 @@ vr_attach(device_t dev)
mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF);
callout_init_mtx(&sc->vr_stat_callout, &sc->vr_mtx, 0);
-   TASK_INIT(&sc->vr_link_task, 0, vr_link_task, sc);
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
@@ -841,7 +829,6 @@ vr_detach(device_t dev)
vr_stop(sc);
VR_UNLOCK(sc);
callout_drain(&sc->vr_stat_callout);
-   taskqueue_drain(taskqueue_swi, &sc->vr_link_task);
ether_ifdetach(ifp);
}
if (sc->vr_miibus)
@@ -1559,6 +1546,8 @@ vr_tick(void *xsc)
 
mii = device_get_softc(sc->vr_miibus);
mii_tick(mii);
+   if (sc->vr_link == 0)
+   vr_miibus_statchg(sc->vr_dev);
vr_watchdog(sc);
callout_reset(&sc->vr_stat_callout, hz, vr_tick, sc);
 }
@@ -2161,6 +2150,10 @@ vr_ifmedia_sts(struct ifnet *ifp, struct
 

svn commit: r223406 - head/sys/powerpc/ps3

2011-06-21 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Jun 22 02:23:18 2011
New Revision: 223406
URL: http://svn.freebsd.org/changeset/base/223406

Log:
  This is more complicated than I expected. Storage devices need the IOMMU
  set up, but must not use it.

Modified:
  head/sys/powerpc/ps3/ps3bus.c

Modified: head/sys/powerpc/ps3/ps3bus.c
==
--- head/sys/powerpc/ps3/ps3bus.c   Wed Jun 22 02:18:45 2011
(r223405)
+++ head/sys/powerpc/ps3/ps3bus.c   Wed Jun 22 02:23:18 2011
(r223406)
@@ -631,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_
struct ps3bus_softc *sc = device_get_softc(dev);
int i, err, flags;
 
-   if (dinfo->bustype != PS3_BUSTYPE_SYSBUS)
+   if (dinfo->bustype != PS3_BUSTYPE_SYSBUS &&
+   dinfo->bustype != PS3_BUSTYPE_STORAGE)
return (bus_get_dma_tag(dev));
 
mtx_lock(&dinfo->iommu_mtx);
@@ -671,7 +672,15 @@ ps3bus_get_dma_tag(device_t dev, device_
NULL, NULL, BUS_SPACE_MAXSIZE, 0, BUS_SPACE_MAXSIZE,
0, NULL, NULL, &dinfo->dma_tag);
 
-   bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo);
+   /*
+* Note: storage devices have IOMMU mappings set up by the hypervisor,
+* but use physical, non-translated addresses. The above IOMMU
+* initialization is necessary for the hypervisor to be able to set up
+* the mappings, but actual DMA mappings should not use the IOMMU
+* routines.
+*/
+   if (dinfo->bustype != PS3_BUSTYPE_STORAGE)
+   bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo);
 
 fail:
mtx_unlock(&dinfo->iommu_mtx);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Warner Losh

On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:

> On 06/21/2011 16:09, Attilio Rao wrote:
>> 2011/6/21 Bruce Evans:
>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:
>>> 
 On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
 
 Hi Alan,
 
> Author: alc
> Date: Sun Jun 19 19:13:24 2011
> New Revision: 223307
> URL: http://svn.freebsd.org/changeset/base/223307
> 
> Log:
>  Precisely document the synchronization rules for the page's dirty field.
>  (Saying that the lock on the object that the page belongs to must be
> held
>  only represents one aspect of the rules.)
> 
>  Eliminate the use of the page queues lock for atomically performing
> read-
>  modify-write operations on the dirty field when the underlying
> architecture
>  supports atomic operations on char and short types.
> 
>  Document the fact that 32KB pages aren't really supported.
 contrary to the tinderbox I'd like to point out that all mips kernels
 built by universe are broken with a SVN HEAD from earlier today.  Could you
 please check and see if you can fix it?  The errors I get are:
 
 vm_page.o: In function `vm_page_clear_dirty':
 /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
 /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
 against `atomic_clear_8'
 vm_page.o: In function `vm_page_set_validclean':
 /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
 /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
 against `atomic_clear_8'
>>> Atomic types shorter than int cannot be used in MI code, since they might
>>> not exist.  Apparently they don't exist on mips.  jake@ fixed all their
>>> old uses for sparc4 in ~Y2K.
>> I'm sure they do, they exist in support.S though and may not have the
>> _8 form (they may just have the _char version). I may look at the code
>> again to be sure.
>> 
> 
> It appears that while mips/include/atomic.h declares the existence of 
> atomic_clear_8, mips/mips/support.S doesn't implement it.  In other words, 
> only support for int's and short's is currently implemented, not char's:
> 
> # grep atomic_clear mips/mips/support.S
> * atomic_clear_32(u_int32_t *a, u_int32_t b)
> LEAF(atomic_clear_32)
> END(atomic_clear_32)
> * atomic_clear_16(u_int16_t *a, u_int16_t b)
> LEAF(atomic_clear_16)
> END(atomic_clear_16)

The current crop of atomic*16 and atomic*8 functions have the restriction that 
the address must be 32-bit aligned (and it forces this by aligning to 32-bits 
silently and then operates on the low 8 or 16 bits in that word!)

I'm guessing that this is likely just wrong.  Comments?

Warner

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Alan Cox

On 06/21/2011 21:27, Warner Losh wrote:


On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:


On 06/21/2011 16:09, Attilio Rao wrote:
2011/6/21 Bruce Evans>:

On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:


On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

Hi Alan,


Author: alc
Date: Sun Jun 19 19:13:24 2011
New Revision: 223307
URL: http://svn.freebsd.org/changeset/base/223307

Log:
 Precisely document the synchronization rules for the page's 
dirty field.

 (Saying that the lock on the object that the page belongs to must be
held
 only represents one aspect of the rules.)

 Eliminate the use of the page queues lock for atomically performing
read-
 modify-write operations on the dirty field when the underlying
architecture
 supports atomic operations on char and short types.

 Document the fact that 32KB pages aren't really supported.

contrary to the tinderbox I'd like to point out that all mips kernels
built by universe are broken with a SVN HEAD from earlier today. 
 Could you

please check and see if you can fix it?  The errors I get are:

vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to 
`atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: 
R_MIPS_26

against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to 
`atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: 
R_MIPS_26

against `atomic_clear_8'
Atomic types shorter than int cannot be used in MI code, since they 
might

not exist.  Apparently they don't exist on mips.  jake@ fixed all their
old uses for sparc4 in ~Y2K.

I'm sure they do, they exist in support.S though and may not have the
_8 form (they may just have the _char version). I may look at the code
again to be sure.



It appears that while mips/include/atomic.h declares the existence of 
atomic_clear_8, mips/mips/support.S doesn't implement it.  In other 
words, only support for int's and short's is currently implemented, 
not char's:


# grep atomic_clear mips/mips/support.S
* atomic_clear_32(u_int32_t *a, u_int32_t b)
LEAF(atomic_clear_32)
END(atomic_clear_32)
* atomic_clear_16(u_int16_t *a, u_int16_t b)
LEAF(atomic_clear_16)
END(atomic_clear_16)


The current crop of atomic*16 and atomic*8 functions have the 
restriction that the address must be 32-bit aligned (and it forces 
this by aligning to 32-bits silently and then operates on the low 8 or 
16 bits in that word!)


I'm guessing that this is likely just wrong.  Comments?


Yes, that would be wrong.

Alan

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Julian Elischer

On 6/21/11 7:27 PM, Warner Losh wrote:


On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:


On 06/21/2011 16:09, Attilio Rao wrote:
2011/6/21 Bruce Evans>:

On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:


On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

Hi Alan,


Author: alc
Date: Sun Jun 19 19:13:24 2011
New Revision: 223307
URL: http://svn.freebsd.org/changeset/base/223307

Log:
 Precisely document the synchronization rules for the page's 
dirty field.
 (Saying that the lock on the object that the page belongs to 
must be

held
 only represents one aspect of the rules.)

 Eliminate the use of the page queues lock for atomically 
performing

read-
 modify-write operations on the dirty field when the underlying
architecture
 supports atomic operations on char and short types.

 Document the fact that 32KB pages aren't really supported.
contrary to the tinderbox I'd like to point out that all mips 
kernels
built by universe are broken with a SVN HEAD from earlier today. 
 Could you

please check and see if you can fix it?  The errors I get are:

vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to 
`atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: 
R_MIPS_26

against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to 
`atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: 
R_MIPS_26

against `atomic_clear_8'
Atomic types shorter than int cannot be used in MI code, since 
they might
not exist.  Apparently they don't exist on mips.  jake@ fixed all 
their

old uses for sparc4 in ~Y2K.

I'm sure they do, they exist in support.S though and may not have the
_8 form (they may just have the _char version). I may look at the code
again to be sure.



It appears that while mips/include/atomic.h declares the existence 
of atomic_clear_8, mips/mips/support.S doesn't implement it.  In 
other words, only support for int's and short's is currently 
implemented, not char's:


# grep atomic_clear mips/mips/support.S
* atomic_clear_32(u_int32_t *a, u_int32_t b)
LEAF(atomic_clear_32)
END(atomic_clear_32)
* atomic_clear_16(u_int16_t *a, u_int16_t b)
LEAF(atomic_clear_16)
END(atomic_clear_16)


The current crop of atomic*16 and atomic*8 functions have the 
restriction that the address must be 32-bit aligned (and it forces 
this by aligning to 32-bits silently and then operates on the low 8 
or 16 bits in that word!)


I'm guessing that this is likely just wrong.  Comments?


I'm guessing it depends on whether the hardware supports atomic 
sub-wordline accesses.
(mind you it's getting really hard to work out what a wordline means 
these days)




Warner



___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r223307 - head/sys/vm

2011-06-21 Thread Warner Losh

On Jun 21, 2011, at 9:27 PM, Julian Elischer wrote:

> On 6/21/11 7:27 PM, Warner Losh wrote:
>> 
>> 
>> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:
>> 
>>> On 06/21/2011 16:09, Attilio Rao wrote:
 2011/6/21 Bruce Evans:
> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:
> 
>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
>> 
>> Hi Alan,
>> 
>>> Author: alc
>>> Date: Sun Jun 19 19:13:24 2011
>>> New Revision: 223307
>>> URL: http://svn.freebsd.org/changeset/base/223307
>>> 
>>> Log:
>>>  Precisely document the synchronization rules for the page's dirty 
>>> field.
>>>  (Saying that the lock on the object that the page belongs to must be
>>> held
>>>  only represents one aspect of the rules.)
>>> 
>>>  Eliminate the use of the page queues lock for atomically performing
>>> read-
>>>  modify-write operations on the dirty field when the underlying
>>> architecture
>>>  supports atomic operations on char and short types.
>>> 
>>>  Document the fact that 32KB pages aren't really supported.
>> contrary to the tinderbox I'd like to point out that all mips kernels
>> built by universe are broken with a SVN HEAD from earlier today.  Could 
>> you
>> please check and see if you can fix it?  The errors I get are:
>> 
>> vm_page.o: In function `vm_page_clear_dirty':
>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
>> against `atomic_clear_8'
>> vm_page.o: In function `vm_page_set_validclean':
>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
>> against `atomic_clear_8'
> Atomic types shorter than int cannot be used in MI code, since they might
> not exist.  Apparently they don't exist on mips.  jake@ fixed all their
> old uses for sparc4 in ~Y2K.
 I'm sure they do, they exist in support.S though and may not have the
 _8 form (they may just have the _char version). I may look at the code
 again to be sure.
 
>>> 
>>> It appears that while mips/include/atomic.h declares the existence of 
>>> atomic_clear_8, mips/mips/support.S doesn't implement it.  In other words, 
>>> only support for int's and short's is currently implemented, not char's:
>>> 
>>> # grep atomic_clear mips/mips/support.S
>>> * atomic_clear_32(u_int32_t *a, u_int32_t b)
>>> LEAF(atomic_clear_32)
>>> END(atomic_clear_32)
>>> * atomic_clear_16(u_int16_t *a, u_int16_t b)
>>> LEAF(atomic_clear_16)
>>> END(atomic_clear_16)
>> 
>> The current crop of atomic*16 and atomic*8 functions have the restriction 
>> that the address must be 32-bit aligned (and it forces this by aligning to 
>> 32-bits silently and then operates on the low 8 or 16 bits in that word!)
>> 
>> I'm guessing that this is likely just wrong.  Comments?
> 
> I'm guessing it depends on whether the hardware supports atomic sub-wordline 
> accesses.
> (mind you it's getting really hard to work out what a wordline means these 
> days)

Generally, they don't.  ll and lld are for 4 and 8 byte values.  You're 
supposed to load the word or doubleword with the instruction, mask off the byte 
you want to change, change it, and then write it back with the sc or scd 
insturction.  That will only succeed of none of the bytes in that word could 
have changed (yes, weasel words usually meaning anything in the cache line, but 
really can mean anything).

I know that some cores do support special instructions to do this, but they are 
with extensions to the ISA...

Warner___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223408 - head/etc/rc.d

2011-06-21 Thread Doug Barton
Author: dougb
Date: Wed Jun 22 06:27:32 2011
New Revision: 223408
URL: http://svn.freebsd.org/changeset/base/223408

Log:
  I knew there was something funny about this line

Modified:
  head/etc/rc.d/netwait

Modified: head/etc/rc.d/netwait
==
--- head/etc/rc.d/netwait   Wed Jun 22 04:11:27 2011(r223407)
+++ head/etc/rc.d/netwait   Wed Jun 22 06:27:32 2011(r223408)
@@ -14,7 +14,8 @@
 . /etc/rc.subr
 
 name="netwait"
-rc_var=`set_rcvar`
+rcvar=`set_rcvar`
+
 start_cmd="${name}_start"
 stop_cmd=":"
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r223409 - in stable/8: share/man/man4 sys/dev/amdsbwd

2011-06-21 Thread Andriy Gapon
Author: avg
Date: Wed Jun 22 06:45:34 2011
New Revision: 223409
URL: http://svn.freebsd.org/changeset/base/223409

Log:
  MFC r222805: amdsbwd: update to support SB8xx southbridges
  
  PR:   kern/157568

Modified:
  stable/8/share/man/man4/amdsbwd.4
  stable/8/sys/dev/amdsbwd/amdsbwd.c
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/share/man/man4/amdsbwd.4
==
--- stable/8/share/man/man4/amdsbwd.4   Wed Jun 22 06:27:32 2011
(r223408)
+++ stable/8/share/man/man4/amdsbwd.4   Wed Jun 22 06:45:34 2011
(r223409)
@@ -25,12 +25,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 30, 2009
+.Dd June 7, 2011
 .Dt AMDSBWD 4
 .Os
 .Sh NAME
 .Nm amdsbwd
-.Nd device driver for the AMD SB600/SB700/SB710/SB750 watchdog timer
+.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following line in your
@@ -51,7 +51,7 @@ The
 driver provides
 .Xr watchdog 4
 support for the watchdog timers present on
-AMD SB600 and SB7xx south bridge chips.
+AMD SB600, SB7xx and SB8xx southbridges.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,

Modified: stable/8/sys/dev/amdsbwd/amdsbwd.c
==
--- stable/8/sys/dev/amdsbwd/amdsbwd.c  Wed Jun 22 06:27:32 2011
(r223408)
+++ stable/8/sys/dev/amdsbwd/amdsbwd.c  Wed Jun 22 06:45:34 2011
(r223409)
@@ -25,8 +25,8 @@
  */
 
 /*
- * This is a driver for watchdog timer present in AMD SB600/SB7xx
- * south bridges and other watchdog timers advertised via WDRT ACPI table.
+ * This is a driver for watchdog timer present in AMD SB600/SB7xx/SB8xx
+ * southbridges.
  * Please see the following specifications for the descriptions of the
  * registers and flags:
  * - AMD SB600 Register Reference Guide, Public Version,  Rev. 3.03 (SB600 RRG)
@@ -35,11 +35,13 @@
  *   http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf
  * - AMD SB700/710/750 Register Programming Requirements (RPR)
  *   http://developer.amd.com/assets/42413_sb7xx_rpr_pub_1.00.pdf
+ * - AMD SB800-Series Southbridges Register Reference Guide (RRG)
+ *   http://support.amd.com/us/Embedded_TechDocs/45482.pdf
  * Please see the following for Watchdog Resource Table specification:
  * - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT)
  *   http://www.microsoft.com/whdc/system/sysinternals/watchdog.mspx
- * AMD SB600/SB7xx watchdog hardware seems to conform to the above,
- * but my system doesn't provide the table.
+ * AMD SB600/SB7xx/SB8xx watchdog hardware seems to conform to the above
+ * specifications, but the table hasn't been spotted in the wild yet.
  */
 
 #include 
@@ -59,15 +61,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-/* RRG 2.3.3.1.1, page 161. */
+/* SB7xx RRG 2.3.3.1.1. */
 #defineAMDSB_PMIO_INDEX0xcd6
 #defineAMDSB_PMIO_DATA (PMIO_INDEX + 1)
 #defineAMDSB_PMIO_WIDTH2
-/* RRG 2.3.3.2, page 181. */
+/* SB7xx RRG 2.3.3.2. */
 #defineAMDSB_PM_RESET_STATUS0  0x44
 #defineAMDSB_PM_RESET_STATUS1  0x45
 #defineAMDSB_WD_RST_STS0x02
-/* RRG 2.3.3.2, page 188; RPR 2.36, page 30. */
+/* SB7xx RRG 2.3.3.2, RPR 2.36. */
 #defineAMDSB_PM_WDT_CTRL   0x69
 #defineAMDSB_WDT_DISABLE   0x01
 #defineAMDSB_WDT_RES_MASK  (0x02 | 0x04)
@@ -77,7 +79,18 @@ __FBSDID("$FreeBSD$");
 #defineAMDSB_WDT_RES_1S0x06
 #defineAMDSB_PM_WDT_BASE_LSB   0x6c
 #defineAMDSB_PM_WDT_BASE_MSB   0x6f
-/* RRG 2.3.4, page 223, WDRT. */
+/* SB8xx RRG 2.3.3. */
+#defineAMDSB8_PM_WDT_EN0x48
+#defineAMDSB8_WDT_DEC_EN   0x01
+#defineAMDSB8_WDT_DISABLE  0x02
+#defineAMDSB8_PM_WDT_CTRL  0x4c
+#defineAMDSB8_WDT_32KHZ0x00
+#defineAMDSB8_WDT_1HZ  0x03
+#defineAMDSB8_WDT_RES_MASK 0x03
+#defineAMDSB8_PM_RESET_STATUS0 0xC0
+#defineAMDSB8_PM_RESET_STATUS1 0xC1
+#defineAMDSB8_WD_RST_STS   0x20
+/* SB7xx RRG 2.3.4, WDRT. */
 #defineAMDSB_WD_CTRL   0x00
 #defineAMDSB_WD_RUN0x01
 #defineAMDSB_WD_FIRED  0x02
@@ -90,8 +103,9 @@ __FBSDID("$FreeBSD$");
 #defineAMDSB_WDIO_REG_WIDTH4
 /* WDRT */
 #defineMAXCOUNT_MIN_VALUE  511
-/* RRG 2.3.1.1, page 122; SB600 RRG 2.3.1.1, page

svn commit: r223410 - in stable/7: share/man/man4 sys/dev/amdsbwd

2011-06-21 Thread Andriy Gapon
Author: avg
Date: Wed Jun 22 06:58:42 2011
New Revision: 223410
URL: http://svn.freebsd.org/changeset/base/223410

Log:
  MFC r222805: amdsbwd: update to support SB8xx southbridges
  
  PR:   kern/157568

Modified:
  stable/7/share/man/man4/amdsbwd.4
  stable/7/sys/dev/amdsbwd/amdsbwd.c
Directory Properties:
  stable/7/share/man/man4/   (props changed)
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/share/man/man4/amdsbwd.4
==
--- stable/7/share/man/man4/amdsbwd.4   Wed Jun 22 06:45:34 2011
(r223409)
+++ stable/7/share/man/man4/amdsbwd.4   Wed Jun 22 06:58:42 2011
(r223410)
@@ -25,12 +25,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 30, 2009
+.Dd June 7, 2011
 .Dt AMDSBWD 4
 .Os
 .Sh NAME
 .Nm amdsbwd
-.Nd device driver for the AMD SB600/SB700/SB710/SB750 watchdog timer
+.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following line in your
@@ -51,7 +51,7 @@ The
 driver provides
 .Xr watchdog 4
 support for the watchdog timers present on
-AMD SB600 and SB7xx south bridge chips.
+AMD SB600, SB7xx and SB8xx southbridges.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,

Modified: stable/7/sys/dev/amdsbwd/amdsbwd.c
==
--- stable/7/sys/dev/amdsbwd/amdsbwd.c  Wed Jun 22 06:45:34 2011
(r223409)
+++ stable/7/sys/dev/amdsbwd/amdsbwd.c  Wed Jun 22 06:58:42 2011
(r223410)
@@ -25,8 +25,8 @@
  */
 
 /*
- * This is a driver for watchdog timer present in AMD SB600/SB7xx
- * south bridges and other watchdog timers advertised via WDRT ACPI table.
+ * This is a driver for watchdog timer present in AMD SB600/SB7xx/SB8xx
+ * southbridges.
  * Please see the following specifications for the descriptions of the
  * registers and flags:
  * - AMD SB600 Register Reference Guide, Public Version,  Rev. 3.03 (SB600 RRG)
@@ -35,11 +35,13 @@
  *   http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf
  * - AMD SB700/710/750 Register Programming Requirements (RPR)
  *   http://developer.amd.com/assets/42413_sb7xx_rpr_pub_1.00.pdf
+ * - AMD SB800-Series Southbridges Register Reference Guide (RRG)
+ *   http://support.amd.com/us/Embedded_TechDocs/45482.pdf
  * Please see the following for Watchdog Resource Table specification:
  * - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT)
  *   http://www.microsoft.com/whdc/system/sysinternals/watchdog.mspx
- * AMD SB600/SB7xx watchdog hardware seems to conform to the above,
- * but my system doesn't provide the table.
+ * AMD SB600/SB7xx/SB8xx watchdog hardware seems to conform to the above
+ * specifications, but the table hasn't been spotted in the wild yet.
  */
 
 #include 
@@ -59,15 +61,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-/* RRG 2.3.3.1.1, page 161. */
+/* SB7xx RRG 2.3.3.1.1. */
 #defineAMDSB_PMIO_INDEX0xcd6
 #defineAMDSB_PMIO_DATA (PMIO_INDEX + 1)
 #defineAMDSB_PMIO_WIDTH2
-/* RRG 2.3.3.2, page 181. */
+/* SB7xx RRG 2.3.3.2. */
 #defineAMDSB_PM_RESET_STATUS0  0x44
 #defineAMDSB_PM_RESET_STATUS1  0x45
 #defineAMDSB_WD_RST_STS0x02
-/* RRG 2.3.3.2, page 188; RPR 2.36, page 30. */
+/* SB7xx RRG 2.3.3.2, RPR 2.36. */
 #defineAMDSB_PM_WDT_CTRL   0x69
 #defineAMDSB_WDT_DISABLE   0x01
 #defineAMDSB_WDT_RES_MASK  (0x02 | 0x04)
@@ -77,7 +79,18 @@ __FBSDID("$FreeBSD$");
 #defineAMDSB_WDT_RES_1S0x06
 #defineAMDSB_PM_WDT_BASE_LSB   0x6c
 #defineAMDSB_PM_WDT_BASE_MSB   0x6f
-/* RRG 2.3.4, page 223, WDRT. */
+/* SB8xx RRG 2.3.3. */
+#defineAMDSB8_PM_WDT_EN0x48
+#defineAMDSB8_WDT_DEC_EN   0x01
+#defineAMDSB8_WDT_DISABLE  0x02
+#defineAMDSB8_PM_WDT_CTRL  0x4c
+#defineAMDSB8_WDT_32KHZ0x00
+#defineAMDSB8_WDT_1HZ  0x03
+#defineAMDSB8_WDT_RES_MASK 0x03
+#defineAMDSB8_PM_RESET_STATUS0 0xC0
+#defineAMDSB8_PM_RESET_STATUS1 0xC1
+#defineAMDSB8_WD_RST_STS   0x20
+/* SB7xx RRG 2.3.4, WDRT. */
 #defineAMDSB_WD_CTRL   0x00
 #defineAMDSB_WD_RUN0x01
 #defineAMDSB_WD_FIRED  0x02
@@ -90,8 +103,9 @@ __FBSDID("$FreeBSD$");
 #defineAMDSB_WDIO_REG_WIDTH4
 /* WDRT */
 #defineMAXCOUNT_MIN_VALUE  511
-/* RRG 2.3.1.1, page 122; SB600 RRG 2.3.1.1, page 97. */
-#defineAMDSB7xx_SMBUS_DEVID