Re: svn commit: r277199 - in head/sys: fs/devfs kern

2015-01-16 Thread Konstantin Belousov
On Thu, Jan 15, 2015 at 01:14:39PM +0100, Hans Petter Selasky wrote:
 On 01/15/15 12:51, Konstantin Belousov wrote:
  On Thu, Jan 15, 2015 at 11:49:09AM +0100, Hans Petter Selasky wrote:
 
  I see no leakage in that case either!
  Because these cases come through destroy_dev().
 
 
  Are there more cases which I don't see?
  You are breaking existig devfs KPI by your hack.  You introduce yet another
  reference on the device, which is not supposed to be there.
 
 Hi Konstantin,
 
 I need a non-sleeping way to say a character device is no longer 
 supposed to be used and be able to re-use the device name right away 
 creating a new device. I guess you got that.
Yes, I got it.  The devfs design is not suitable for this, and your
hack is the good witness of the fact.

My opinion is that you should have tried to handle the issue at the driver
level, instead of making this devfs issue.  I.e., if you already have
cdev node with the correct name, driver should have replaced the private
data to point to new device.

This would also close a window where /dev node is non-existent or operate
erronously.

 
 
  If some code calls delist_dev(), it could be said that it is a contract
  of the new function that destroy_dev() must be called eventually on
  the cdev. Then, the reference could be said to be shared-owned by
  delist_dev() and destroy_dev(). But, for arbitrary devfs user this new
  reference is unacceptable and breaks interface.
 
 delist_dev() changes no references. It can be called multiple times 
 even, also inside destroy_devl(). Also I think that the 
 destroy_dev_sched_cbl() function should call delist_dev() first so 
 that we don't have a time from when the destroy_dev_sched_cbl() 
 function is called where the device entry still exists in devfs mounts 
 until the final destroy_devl() is done by a taskqueue.
You do not understand my point.

I object against imposing one additional global reference on all cdevs
just to cope with the delist hack.  See the patch at the end of the message.

WRT destroy_dev_sched_cb() calling delist_dev(), even after calling
delist_dev(), the node still exists in the /dev. It is only removed
after populate loop is run sometime later. dev_sched() KPI is inheritly
racy, drivers must handle the races for other reasons.

 
  In the case of direct free through #1, the reference count is ignored
  and it doesn't matter if it is one or zero. Only in the case of
  destruction through destroy_dev() it matters.
 
  Like the comment says in destroy_devl():
 
  /* Avoid race with dev_rel() */
 
  The problem is that the cdev-si_refcount is zero when the initial
  devfs_create() is called. Then one ref is made. When we clear the
  CDP_ACTIVE flag in devfs_destroy() it instructs a !parallel! running
  process to destroy all the FS related structures and the reference count
  goes back to zero when the cdp is removed from the cdevp_list. Then
  the cdev is freed too early. This happens because destroy_devl() is
  dropping the dev_lock() to sleep waiting for pending references.
  Basically, this is very good explanation why your delist hack is wrong,
  for one of the reason.  Another reason is explained below.
  You are trying to cover it with additional reference, but this is wrong
  as well.
 
 
  Do you see something else?
 
  I think that what you are trying to do with the CDP_ACTIVE hack is doomed
  anyway, because you are allowing for devfs directory to have two entries
  with the same name, until the populate loop cleans up the inactive one.
  In the meantime, any access to the directory operates on random entry.
 
  The entry will not be random, because upon an open() call to a character
  device, I believe the devfs_lookup() function will be called, which
  always populate the devfs tree at first by calls to
  devfs_populate_xxx(). Any delisted devices which don't have the
  CDP_ACTIVE bit set, will never be seen by any open.
  Entry can be random, since after the populate loop is ran, your code in
  other thread could start and create duplicate entry. There is a window
  in the lookup where both directory vnode lock and mount point sx locks
  are dropped. So running the populate does not guarantee anything.
 
 If there is such a race, it is already there! My patch changes nothing 
 in that area:
 
 Thread1:
 Calls destroy_dev() and clears CDP_ACTIVE, after dev_unlock() it goes 
 waiting for some refs for xxx milliseconds.
 Thread2:
 Tries to create create a new character device having the same name like 
 the one in thread1. Device name duplication check is missed because 
 CDP_ACTIVE is cleared. Still thread1 is waiting.
 Thread3:
 Tries to open character device created by thread2 while thread1 is still 
 waiting for some ref held by a userspace app to go away.
 
 This can happen already before my patches! What do you think?
Possibly.

 
 
 
  Regarding leftover filedescriptors which still access the old cdev
  this is not a problem, and these will be closed when the 

Re: svn commit: r277199 - in head/sys: fs/devfs kern

2015-01-16 Thread Hans Petter Selasky

Hi Konstantin,

On 01/16/15 09:03, Konstantin Belousov wrote:

On Thu, Jan 15, 2015 at 01:14:39PM +0100, Hans Petter Selasky wrote:

On 01/15/15 12:51, Konstantin Belousov wrote:

On Thu, Jan 15, 2015 at 11:49:09AM +0100, Hans Petter Selasky wrote:


I see no leakage in that case either!

Because these cases come through destroy_dev().



Are there more cases which I don't see?

You are breaking existig devfs KPI by your hack.  You introduce yet another
reference on the device, which is not supposed to be there.


Hi Konstantin,

I need a non-sleeping way to say a character device is no longer
supposed to be used and be able to re-use the device name right away
creating a new device. I guess you got that.

Yes, I got it.  The devfs design is not suitable for this, and your
hack is the good witness of the fact.

My opinion is that you should have tried to handle the issue at the driver
level, instead of making this devfs issue.  I.e., if you already have
cdev node with the correct name, driver should have replaced the private
data to point to new device.


I think this way cannot be implemented in a clean way, because of 
locking order reversal. And if you try to avoid the LOR you end up with 
the race. Chess mate sort of ;-)  Let me explain:


Thread 1:
usb_sx_lock();
  cdev = Look in freelist for existing device();
else
  cdev = make_dev();
usb_sx_unlock();

Thread 2:
usb_sx_lock();
put cdev on freelist
usb_sx_unlock();

Thread 3:
usb_sx_lock();
cdev = remove first entry in freelist
usb_sx_unlock();

/*
 * XXX because USB needs to call destroy_dev() unlocked we
 * are racing with Thread 1 again
 */
destroy_dev(cdev);



This would also close a window where /dev node is non-existent or operate
erronously.


I'm not saying I plan so, but I think cdevs at some point need to 
understand mutexes and locks. That means like with other API's in the 
kernel we can associate a lock with the cdev, and this lock is then 
used to ensure an atomic shutdown of the system in a non-blocking 
fashion. In my past experience multithreaded APIs should be high level 
implemented like this:


NON-BLOCKING methods:
lock(); **
xxx_start();
xxx_stop();
unlock();

BLOCKING methods:
setup(); // init
unsetup(); // drain

Any callbacks should always be called locked **

In devfs there was no non-blocking stop before I added the delist_dev() 
function.




You do not understand my point.

I object against imposing one additional global reference on all cdevs
just to cope with the delist hack.  See the patch at the end of the message.


It's fine by me.


WRT destroy_dev_sched_cb() calling delist_dev(), even after calling
delist_dev(), the node still exists in the /dev. It is only removed
after populate loop is run sometime later. dev_sched() KPI is inheritly
racy, drivers must handle the races for other reasons.


The populate loop is all running under the dev_lock() from what I can 
see and make_dev() is also keeping the same lock when inserting and 
removing new cdevs. The populate loop should always give a consistent 
view of the character devices available, and I don't see how cdev 
structures without the CDP_ACTIVE flag can appear with recently created 
ones, even if the name is the same.







Entry can be random, since after the populate loop is ran, your code in
other thread could start and create duplicate entry. There is a window
in the lookup where both directory vnode lock and mount point sx locks
are dropped. So running the populate does not guarantee anything.


If there is such a race, it is already there! My patch changes nothing
in that area:

Thread1:
Calls destroy_dev() and clears CDP_ACTIVE, after dev_unlock() it goes
waiting for some refs for xxx milliseconds.
Thread2:
Tries to create create a new character device having the same name like
the one in thread1. Device name duplication check is missed because
CDP_ACTIVE is cleared. Still thread1 is waiting.
Thread3:
Tries to open character device created by thread2 while thread1 is still
waiting for some ref held by a userspace app to go away.

This can happen already before my patches! What do you think?

Possibly.





At what level do you mean duplicate names, I don't get this fully? At
the directory level (DE nodes)? Or inside the list of character devices
(LIST_XXX)?

It does not matter, dup at either one directory level, or dup of full
names in the global list are equivalent (bad) things.


Like I write above I don't see where the problem is. At the cdev level, 
we are protecting the cdev's LIST with dev_lock() and only one entry 
will exist having CDP_ACTIVE bit set per unique cdev name and path. Else 
we will hit a panic in make_dev() and friends.


In the directory entry level the populate loop will also ensure a 
consistent view, and hence the cdev's LIST is consistent, the view 
presented to userspace will also be consistent.


That system functions can still call into the dangling read/write/ioctl 
functions is another story, and that is why I tell, 

svn commit: r277237 - head/lib/libpam/modules/pam_radius

2015-01-16 Thread Dag-Erling Smørgrav
Author: des
Date: Fri Jan 16 09:07:31 2015
New Revision: 277237
URL: https://svnweb.freebsd.org/changeset/base/277237

Log:
  If PAM_RHOST is non-NULL, pass it in the Calling-Station-ID attribute of
  the RADIUS access request.
  
  MFC after:1 week

Modified:
  head/lib/libpam/modules/pam_radius/pam_radius.c

Modified: head/lib/libpam/modules/pam_radius/pam_radius.c
==
--- head/lib/libpam/modules/pam_radius/pam_radius.c Fri Jan 16 07:06:58 
2015(r277236)
+++ head/lib/libpam/modules/pam_radius/pam_radius.c Fri Jan 16 09:07:31 
2015(r277237)
@@ -62,11 +62,11 @@ __FBSDID($FreeBSD$);
 #definePASSWORD_PROMPT RADIUS Password:
 
 static int  build_access_request(struct rad_handle *, const char *,
-   const char *, const char *, const char *, const void *,
-   size_t);
+   const char *, const char *, const char *, const char *,
+   const void *, size_t);
 static int  do_accept(pam_handle_t *, struct rad_handle *);
 static int  do_challenge(pam_handle_t *, struct rad_handle *,
-   const char *, const char *, const char *);
+   const char *, const char *, const char *, const char *);
 
 /*
  * Construct an access request, but don't send it.  Returns 0 on success,
@@ -75,7 +75,7 @@ static int do_challenge(pam_handle_t *,
 static int
 build_access_request(struct rad_handle *radh, const char *user,
 const char *pass, const char *nas_id, const char *nas_ipaddr,
-const void *state, size_t state_len)
+const char *rhost, const void *state, size_t state_len)
 {
int error;
char host[MAXHOSTNAMELEN];
@@ -121,8 +121,13 @@ build_access_request(struct rad_handle *
}
}
}
-   if (state != NULL  rad_put_attr(radh, RAD_STATE, state,
-   state_len) == -1) {
+   if (rhost != NULL 
+   rad_put_string(radh, RAD_CALLING_STATION_ID, rhost) == -1) {
+   syslog(LOG_CRIT, rad_put_string: %s, rad_strerror(radh));
+   return (-1);
+   }
+   if (state != NULL 
+   rad_put_attr(radh, RAD_STATE, state, state_len) == -1) {
syslog(LOG_CRIT, rad_put_attr: %s, rad_strerror(radh));
return (-1);
}
@@ -162,7 +167,7 @@ do_accept(pam_handle_t *pamh, struct rad
 
 static int
 do_challenge(pam_handle_t *pamh, struct rad_handle *radh, const char *user,
-const char *nas_id, const char *nas_ipaddr)
+const char *nas_id, const char *nas_ipaddr, const char *rhost)
 {
int retval;
int attrtype;
@@ -230,7 +235,7 @@ do_challenge(pam_handle_t *pamh, struct 
conv-appdata_ptr)) != PAM_SUCCESS)
return (retval);
if (build_access_request(radh, user, resp[num_msgs-1].resp, nas_id,
-   nas_ipaddr, state, statelen) == -1)
+   nas_ipaddr, rhost, state, statelen) == -1)
return (PAM_SERVICE_ERR);
memset(resp[num_msgs-1].resp, 0, strlen(resp[num_msgs-1].resp));
free(resp[num_msgs-1].resp);
@@ -246,7 +251,7 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 {
struct rad_handle *radh;
const char *user, *pass;
-   const void *tmpuser;
+   const void *rhost, *tmpuser;
const char *conf_file, *template_user, *nas_id, *nas_ipaddr;
int retval;
int e;
@@ -255,6 +260,7 @@ pam_sm_authenticate(pam_handle_t *pamh, 
template_user = openpam_get_option(pamh, PAM_OPT_TEMPLATE_USER);
nas_id = openpam_get_option(pamh, PAM_OPT_NAS_ID);
nas_ipaddr = openpam_get_option(pamh, PAM_OPT_NAS_IPADDR);
+   pam_get_item(pamh, PAM_RHOST, rhost);
 
retval = pam_get_user(pamh, user, NULL);
if (retval != PAM_SUCCESS)
@@ -284,8 +290,8 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 
PAM_LOG(Radius config file read);
 
-   if (build_access_request(radh, user, pass, nas_id, nas_ipaddr, NULL,
-   0) == -1) {
+   if (build_access_request(radh, user, pass, nas_id, nas_ipaddr, rhost,
+   NULL, 0) == -1) {
rad_close(radh);
return (PAM_SERVICE_ERR);
}
@@ -330,7 +336,7 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 
case RAD_ACCESS_CHALLENGE:
retval = do_challenge(pamh, radh, user, nas_id,
-   nas_ipaddr);
+   nas_ipaddr, rhost);
if (retval != PAM_SUCCESS) {
rad_close(radh);
return (retval);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277238 - in head: share/man/man4 sys/net

2015-01-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Jan 16 10:09:28 2015
New Revision: 277238
URL: https://svnweb.freebsd.org/changeset/base/277238

Log:
  Eliminate SIOCGIFADDR handling in bpf.
  
  Quoting 19 years bpf.4 manual from bpf-1.2a1:
  
  (SIOCGIFADDR is obsolete under BSD systems.  SIOCGIFCONF should be
   used to query link-level addresses.)
  
  * SIOCGIFADDR was not imported in NetBSD (bpf.c 1.36) and OpenBSD.
  * Last bits (e.g. manpage claiming SIOCGIFADDR exists) was cleaned
from NetBSD via kern/21513 5 years ago,
from OpenBSD via documentation/6352 5 years ago.

Modified:
  head/share/man/man4/bpf.4
  head/sys/net/bpf.c

Modified: head/share/man/man4/bpf.4
==
--- head/share/man/man4/bpf.4   Fri Jan 16 09:07:31 2015(r277237)
+++ head/share/man/man4/bpf.4   Fri Jan 16 10:09:28 2015(r277238)
@@ -290,8 +290,6 @@ and
 .Pp
 In addition to
 .Dv FIONREAD
-and
-.Dv SIOCGIFADDR ,
 the following commands may be applied to any open
 .Nm
 file.

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Fri Jan 16 09:07:31 2015(r277237)
+++ head/sys/net/bpf.c  Fri Jan 16 10:09:28 2015(r277238)
@@ -1192,7 +1192,6 @@ reset_d(struct bpf_d *d)
 
 /*
  *  FIONREAD   Check for read packet available.
- *  SIOCGIFADDRGet interface address - convenient hook to 
driver.
  *  BIOCGBLEN  Get buffer len [for read()].
  *  BIOCSETF   Set read filter.
  *  BIOCSETFNR Set read filter without resetting descriptor.
@@ -1322,19 +1321,6 @@ bpfioctl(struct cdev *dev, u_long cmd, c
break;
}
 
-   case SIOCGIFADDR:
-   {
-   struct ifnet *ifp;
-
-   if (d-bd_bif == NULL)
-   error = EINVAL;
-   else {
-   ifp = d-bd_bif-bif_ifp;
-   error = (*ifp-if_ioctl)(ifp, cmd, addr);
-   }
-   break;
-   }
-
/*
 * Get buffer len [for read()].
 */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf

2015-01-16 Thread Dag-Erling Smørgrav
Alexey Dokuchaev da...@freebsd.org writes:
 Edward, Andrey, since you two seem to have some working code already,
 maybe you can work together to push out something that can be
 committed? :)


r241053 | ae | 2012-09-29 18:47:56 +0200 (Sat, 29 Sep 2012) | 17 lines

Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.

Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.



DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

svn commit: r277239 - head/cddl/contrib/opensolaris/lib/libzfs/common

2015-01-16 Thread Steven Hartland
Author: smh
Date: Fri Jan 16 10:44:39 2015
New Revision: 277239
URL: https://svnweb.freebsd.org/changeset/base/277239

Log:
  Eliminate illumos whole disk special case when searching for a ZFS vdev
  
  This special case prevented locating vdevs which start with c[0-9] e.g.
  gptid/c6cde092-504b-11e4-ba52-c4553598 hence it was impossible to
  online a vdev via its path.
  
  Submitted by: Peter Xu xzpe...@gmail.com
  MFC after:2 weeks
  Sponsored by: Multiplay

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c   Fri Jan 
16 10:09:28 2015(r277238)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c   Fri Jan 
16 10:44:39 2015(r277239)
@@ -1916,6 +1916,7 @@ zpool_scan(zpool_handle_t *zhp, pool_sca
}
 }
 
+#ifdef illumos
 /*
  * This provides a very minimal check whether a given string is likely a
  * c#t#d# style string.  Users of this are expected to do their own
@@ -1947,6 +1948,7 @@ ctd_check_path(char *str) {
}
return (CTD_CHECK(str));
 }
+#endif
 
 /*
  * Find a vdev that matches the search criteria specified. We use the
@@ -2002,6 +2004,7 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist
 *
 * Otherwise, all other searches are simple string compares.
 */
+#ifdef illumos
if (strcmp(srchkey, ZPOOL_CONFIG_PATH) == 0 
ctd_check_path(val)) {
uint64_t wholedisk = 0;
@@ -2041,6 +2044,9 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist
break;
}
} else if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0  val) {
+#else
+   if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0  val) {
+#endif
char *type, *idx, *end, *p;
uint64_t id, vdev_id;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277240 - head/sys/netpfil/ipfw

2015-01-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Jan 16 10:49:27 2015
New Revision: 277240
URL: https://svnweb.freebsd.org/changeset/base/277240

Log:
  Use ipfw runtime lock only when real modification is required.

Modified:
  head/sys/netpfil/ipfw/ip_fw_nat.c

Modified: head/sys/netpfil/ipfw/ip_fw_nat.c
==
--- head/sys/netpfil/ipfw/ip_fw_nat.c   Fri Jan 16 10:44:39 2015
(r277239)
+++ head/sys/netpfil/ipfw/ip_fw_nat.c   Fri Jan 16 10:49:27 2015
(r277240)
@@ -105,7 +105,7 @@ ifaddr_change(void *arg __unused, struct
KASSERT(curvnet == ifp-if_vnet,
(curvnet(%p) differs from iface vnet(%p), curvnet, ifp-if_vnet));
chain = V_layer3_chain;
-   IPFW_WLOCK(chain);
+   IPFW_UH_WLOCK(chain);
/* Check every nat entry... */
LIST_FOREACH(ptr, chain-nat, _next) {
/* ...using nic 'ifp-if_xname' as dynamic alias address. */
@@ -117,13 +117,15 @@ ifaddr_change(void *arg __unused, struct
continue;
if (ifa-ifa_addr-sa_family != AF_INET)
continue;
+   IPFW_WLOCK(chain);
ptr-ip = ((struct sockaddr_in *)
(ifa-ifa_addr))-sin_addr;
LibAliasSetAddress(ptr-lib, ptr-ip);
+   IPFW_WUNLOCK(chain);
}
if_addr_runlock(ifp);
}
-   IPFW_WUNLOCK(chain);
+   IPFW_UH_WUNLOCK(chain);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277241 - head/sbin/route

2015-01-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Jan 16 11:17:30 2015
New Revision: 277241
URL: https://svnweb.freebsd.org/changeset/base/277241

Log:
  Eliminate incorrect IPv6 mask guessing:
  RFC 2374 concept of 'IPv6 Aggregatable Global Unicast Address Format' was
  deprecated by RFC 3587 12 years ago.
  
  Before:
  
  15:06 [1] edge# netstat -rn6 | grep 2a02:6b8::
  2a02:6b8::/32 2a02:978:2::1 UGS 
em0
  15:06 [1] edge# route -6n get 2a02:6b8::
  route: writing to routing socket: No such process
  
  After:
  15:07 [1] edge# /usr/obj/usr/src/sbin/route/route -n6 get 2a02:6b8::
 route to: 2a02:6b8::
  destination: 2a02:6b8::
 mask: :::
  gateway: 2a02:978:2::1
  fib: 0
interface: em0
flags: UP,GATEWAY,DONE,STATIC
   recvpipe  sendpipe  ssthresh  rtt,msecmtuweightexpire
 0 0 0 0  1500 1 0
  
  MFC after:2 weeks

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==
--- head/sbin/route/route.c Fri Jan 16 10:49:27 2015(r277240)
+++ head/sbin/route/route.c Fri Jan 16 11:17:30 2015(r277241)
@@ -1137,19 +1137,11 @@ inet_makenetandmask(u_long net, struct s
 static int
 inet6_makenetandmask(struct sockaddr_in6 *sin6, const char *plen)
 {
-   struct in6_addr in6;
 
if (plen == NULL) {
if (IN6_IS_ADDR_UNSPECIFIED(sin6-sin6_addr) 
-   sin6-sin6_scope_id == 0) {
+   sin6-sin6_scope_id == 0)
plen = 0;
-   } else if ((sin6-sin6_addr.s6_addr[0]  0xe0) == 0x20) {
-   /* aggregatable global unicast - RFC2374 */
-   memset(in6, 0, sizeof(in6));
-   if (!memcmp(sin6-sin6_addr.s6_addr[8],
-   in6.s6_addr[8], 8))
-   plen = 64;
-   }
}
 
if (plen == NULL || strcmp(plen, 128) == 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277245 - head/lib/libusb

2015-01-16 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 16 12:11:01 2015
New Revision: 277245
URL: https://svnweb.freebsd.org/changeset/base/277245

Log:
  Add more USB request definitions. The values are described in section
  9.4.11 and 9.4.12 of the Universal Serial Bus 3.0 Specification
  
  Submitted by: Dmitry Luhtionov dmitryluhtio...@gmail.com
  MFC after:1 week

Modified:
  head/lib/libusb/libusb.h
  head/lib/libusb/libusb20_desc.h

Modified: head/lib/libusb/libusb.h
==
--- head/lib/libusb/libusb.hFri Jan 16 11:51:47 2015(r277244)
+++ head/lib/libusb/libusb.hFri Jan 16 12:11:01 2015(r277245)
@@ -128,6 +128,8 @@ enum libusb_standard_request {
LIBUSB_REQUEST_GET_INTERFACE = 0x0A,
LIBUSB_REQUEST_SET_INTERFACE = 0x0B,
LIBUSB_REQUEST_SYNCH_FRAME = 0x0C,
+   LIBUSB_REQUEST_SET_SEL = 0x30,
+   LIBUSB_REQUEST_SET_ISOCH_DELAY = 0x31,
 };
 
 enum libusb_request_type {

Modified: head/lib/libusb/libusb20_desc.h
==
--- head/lib/libusb/libusb20_desc.h Fri Jan 16 11:51:47 2015
(r277244)
+++ head/lib/libusb/libusb20_desc.h Fri Jan 16 12:11:01 2015
(r277245)
@@ -481,6 +481,12 @@ enum libusb20_standard_request {
 
/** Set then report an endpoint's synchronization frame */
LIBUSB20_REQUEST_SYNCH_FRAME = 0x0C,
+
+   /** Set U1 and U2 system exit latency */
+   LIBUSB20_REQUEST_SET_SEL = 0x30,
+
+   /** Set isochronous delay */
+   LIBUSB20_REQUEST_SET_ISOCH_DELAY = 0x31,
 };
 
 /** \ingroup misc
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277246 - in head/sys/dev/usb: . serial

2015-01-16 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 16 12:16:21 2015
New Revision: 277246
URL: https://svnweb.freebsd.org/changeset/base/277246

Log:
  Add more USB device IDs.
  
  Submitted by: max.n.boya...@gmail.com
  PR:   196362
  MFC after:1 week

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Fri Jan 16 12:11:01 2015
(r277245)
+++ head/sys/dev/usb/serial/u3g.c   Fri Jan 16 12:16:21 2015
(r277246)
@@ -239,6 +239,8 @@ static const STRUCT_USB_HOST_ID u3g_devs
U3G_DEV(DELL, U740, 0),
U3G_DEV(DLINK, DWR510_CD, U3GINIT_SCSIEJECT),
U3G_DEV(DLINK, DWR510, 0),
+   U3G_DEV(DLINK, DWM157_CD, U3GINIT_SCSIEJECT),
+   U3G_DEV(DLINK, DWM157, 0),
U3G_DEV(DLINK3, DWM652, 0),
U3G_DEV(HP, EV2200, 0),
U3G_DEV(HP, HS2300, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Jan 16 12:11:01 2015(r277245)
+++ head/sys/dev/usb/usbdevsFri Jan 16 12:16:21 2015(r277246)
@@ -1627,6 +1627,8 @@ product DLINK DSB650  0xabc1  10/100 Ethe
 product DLINK DUBH70xf103  DUB-H7 USB 2.0 7-Port Hub
 product DLINK DWR510_CD0xa805  DWR-510 CD-ROM Mode
 product DLINK DWR510   0x7e12  DWR-510
+product DLINK DWM157   0x7d02  DWM-157
+product DLINK DWM157_CD0xa707  DWM-157 CD-ROM Mode
 product DLINK RTL8188CU0x3308  RTL8188CU
 productDLINK RTL8192CU_1   0x3307  RTL8192CU
 productDLINK RTL8192CU_2   0x3309  RTL8192CU
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r275422 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf

2015-01-16 Thread Jia-Shiun Li
On Wed, Dec 3, 2014 at 3:55 AM, George V. Neville-Neil g...@freebsd.org
wrote:

 Author: gnn
 Date: Tue Dec  2 19:55:43 2014
 New Revision: 275422
 URL: https://svnweb.freebsd.org/changeset/base/275422

 Log:
   This configuration file removes several debugging options, including
   WITNESS and INVARIANTS checking, which are known to have significant
   performance impact on running systems.  When benchmarking new features
   this kernel should be used instead of the standard GENERIC.
   This kernel configuration should never appear outside of the HEAD
   of the FreeBSD tree.



Just noticed the newly added config file. Shall we mention it in foreword
of
/usr/src/UPDATING to tell people interested in benchmarking -current
to use it instead?

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


svn commit: r277247 - head/sys/cam/ctl

2015-01-16 Thread Alexander Motin
Author: mav
Date: Fri Jan 16 12:35:55 2015
New Revision: 277247
URL: https://svnweb.freebsd.org/changeset/base/277247

Log:
  Don't count status as sent until CTIO completes successfully.
  
  If we aggregated status sending with data move and got error, allow status
  to be updated and resent again separately.  Without this command may stuck
  without status sent at all.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Jan 16 12:16:21 2015(r277246)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Jan 16 12:35:55 2015(r277247)
@@ -891,7 +891,6 @@ ctlfestart(struct cam_periph *periph, un
(cmd_info-flags  CTLFE_CMD_PIECEWISE) == 0 
((io-io_hdr.flags  CTL_FLAG_DMA_QUEUED) == 0 ||
 io-io_hdr.status == CTL_SUCCESS)) {
-   io-io_hdr.flags |= CTL_FLAG_STATUS_SENT;
flags |= CAM_SEND_STATUS;
scsi_status = io-scsiio.scsi_status;
csio-sense_len = io-scsiio.sense_len;
@@ -1265,6 +1264,10 @@ ctlfedone(struct cam_periph *periph, uni
break;
}
 
+   if ((done_ccb-ccb_h.flags  CAM_SEND_STATUS) 
+   (done_ccb-ccb_h.status  CAM_STATUS_MASK) == CAM_REQ_CMP)
+   io-io_hdr.flags |= CTL_FLAG_STATUS_SENT;
+
/*
 * If we were sending status back to the initiator, free up
 * resources.  If we were doing a datamove, call the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r277215 - in head/sys: amd64/include boot/common boot/fdt boot/forth boot/i386/libi386 boot/i386/loader i386/include x86/xen

2015-01-16 Thread Roger Pau Monné
El 16/01/15 a les 0.03, Ian Lepore ha escrit:
 On Thu, 2015-01-15 at 16:27 +, Roger Pau Monné wrote:
 Author: royger
 Date: Thu Jan 15 16:27:20 2015
 New Revision: 277215
 URL: https://svnweb.freebsd.org/changeset/base/277215

 Log:
   loader: implement multiboot support for Xen Dom0
   [...]

 Added:
   head/sys/boot/i386/libi386/multiboot.c   (contents, props changed)
   head/sys/boot/i386/libi386/multiboot.h   (contents, props changed)
   head/sys/boot/i386/libi386/multiboot_tramp.S   (contents, props changed)
 Modified:
   head/sys/amd64/include/metadata.h
   head/sys/boot/common/bootstrap.h
   head/sys/boot/common/load_elf.c
   head/sys/boot/common/load_elf_obj.c
   head/sys/boot/common/module.c
   head/sys/boot/fdt/fdt_loader_cmd.c
   head/sys/boot/forth/beastie.4th
   head/sys/boot/forth/loader.4th
   head/sys/boot/forth/support.4th
   head/sys/boot/i386/libi386/Makefile
   head/sys/boot/i386/libi386/bootinfo64.c
   head/sys/boot/i386/libi386/elf64_freebsd.c
   head/sys/boot/i386/libi386/libi386.h
   head/sys/boot/i386/loader/conf.c
   head/sys/i386/include/metadata.h
   head/sys/x86/xen/pv.c
 
 Something about this change breaks ubldr on arm (it works @ r277214).
 Now on an RPi I get this:
 
 /boot/kernel/kernel data=0x4cf8a4+0x3475c syms=[0x4+0x91650+0x4+0x53354]
 panic: Address offset 0x4000 bigger than size 0x1E00
 
 There is a single physical extent of ram from 0-0x1e00.

Sorry for this, the above patch solved the problem for me. I'm 
currently running a tinderbox with it to make sure nothing else breaks, 
but the fix is quite straightforward.

---
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index 6860815..4c801e9 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -77,7 +77,7 @@ static int __elfN(lookup_symbol)(struct preloaded_file *mp, 
elf_file_t ef, const
 static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
 Elf_Addr p, void *val, size_t len);
 static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef,
-u_int64_t p_start, u_int64_t p_end);
+Elf_Addr p_start, Elf_Addr p_end);
 static symaddr_fn __elfN(symaddr);
 static char*fake_modname(const char *name);
 
@@ -300,7 +300,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, 
u_int64_t off)
 Elf_Size   size;
 u_int  fpcopy;
 Elf_Symsym;
-u_int64_t  p_start, p_end;
+Elf_Addr   p_start, p_end;
 
 dp = NULL;
 shdr = NULL;
@@ -712,7 +712,7 @@ __elfN(load_modmetadata)(struct preloaded_file *fp, 
u_int64_t dest)
Elf_Shdr*sh_data[2];
char*shstrtab = NULL;
size_t   size;
-   u_int64_tp_start, p_end;
+   Elf_Addr p_start, p_end;
 
bzero(ef, sizeof(struct elf_file));
ef.fd = -1;
@@ -820,7 +820,7 @@ out:
 
 int
 __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef,
-u_int64_t p_start, u_int64_t p_end)
+Elf_Addr p_start, Elf_Addr p_end)
 {
 struct mod_metadata md;
 #if (defined(__i386__) || defined(__powerpc__))  __ELF_WORD_SIZE == 64

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


svn commit: r277249 - head/contrib/elftoolchain/libelf

2015-01-16 Thread Ed Maste
Author: emaste
Date: Fri Jan 16 15:16:19 2015
New Revision: 277249
URL: https://svnweb.freebsd.org/changeset/base/277249

Log:
  Verify that section header offset is not past EOF
  
  MFC After:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/libelf/elf_scn.c

Modified: head/contrib/elftoolchain/libelf/elf_scn.c
==
--- head/contrib/elftoolchain/libelf/elf_scn.c  Fri Jan 16 15:10:55 2015
(r277248)
+++ head/contrib/elftoolchain/libelf/elf_scn.c  Fri Jan 16 15:16:19 2015
(r277249)
@@ -60,7 +60,8 @@ _libelf_load_section_headers(Elf *e, voi
assert((e-e_flags  LIBELF_F_SHDRS_LOADED) == 0);
 
 #defineCHECK_EHDR(E,EH)do {\
-   if (fsz != (EH)-e_shentsize || \
+   if (shoff  e-e_rawsize || \
+   fsz != (EH)-e_shentsize || \
shnum  SIZE_MAX / fsz ||   \
fsz * shnum  e-e_rawsize - shoff) {   \
LIBELF_SET_ERROR(HEADER, 0);\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf

2015-01-16 Thread Alexey Dokuchaev
On Fri, Jan 16, 2015 at 11:11:14AM +0100, Dag-Erling Smorgrav wrote:
 Alexey Dokuchaev da...@freebsd.org writes:
  Edward, Andrey, since you two seem to have some working code already,
  maybe you can work together to push out something that can be
  committed? :)
 
 
 r241053 | ae | 2012-09-29 18:47:56 +0200 (Sat, 29 Sep 2012) | 17 lines

Thanks; I wonder why this commit was not mentioned 16 months ago, esp. with
ae@ CCed.

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


svn commit: r277254 - head/sys/powerpc/conf

2015-01-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Jan 16 17:41:21 2015
New Revision: 277254
URL: https://svnweb.freebsd.org/changeset/base/277254

Log:
  Make netbooting work again by disabling BOOTP_NFSV3. Investigate why this
  causes bad RPC errors later.

Modified:
  head/sys/powerpc/conf/MPC85XX

Modified: head/sys/powerpc/conf/MPC85XX
==
--- head/sys/powerpc/conf/MPC85XX   Fri Jan 16 17:40:30 2015
(r277253)
+++ head/sys/powerpc/conf/MPC85XX   Fri Jan 16 17:41:21 2015
(r277254)
@@ -20,7 +20,7 @@ options   ALT_BREAK_TO_DEBUGGER
 optionsBREAK_TO_DEBUGGER
 optionsBOOTP
 optionsBOOTP_NFSROOT
-optionsBOOTP_NFSV3
+#options   BOOTP_NFSV3
 optionsBOOTP_WIRED_TO=tsec0
 optionsCD9660
 optionsCOMPAT_43
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Warner Losh

 On Jan 15, 2015, at 6:23 AM, Slawa Olhovchenkov s...@zxy.spb.ru wrote:
 
 On Thu, Jan 15, 2015 at 12:42:07AM +, Warner Losh wrote:
 
 Author: imp
 Date: Thu Jan 15 00:42:06 2015
 New Revision: 277204
 URL: https://svnweb.freebsd.org/changeset/base/277204
 
 Log:
  New MINIMAL kernel config. The goal with this configuration is to
  only compile in those options in GENERIC that cannot be loaded as
  modules. ufs is still included because many of its options aren't
  present in the kernel module. There's some other exceptions documented
 
 Are you sure?
 I think defining UFS options in kernel connfig affect to module too.
 When I define this options in kernel config (w/o options FFS) I got
 ufs.ko with this SU, quota, acl etc.

While one could set options in the kernel to affect the ufs.ko build,
there’s not a universal ufs.ko that can be loaded easily that switches
between the different types of options. You can create modules
that do this, but that’s a very very different problem than the one I
want to solve, namely you get the same[*] functionality having
device fred in the kernel config as kldloading fred.ko. So rather than
bite off that problem also, I’m opting for simplicity.

 +options SOFTUPDATES # Enable FFS soft updates support
 +options UFS_ACL # Support for access control lists
 +options UFS_DIRHASH # Improve performance on big directories
 +options UFS_GJOURNAL# Enable gjournal-based UFS journaling
 +options QUOTA   # Enable disk quotas for UFS
 
 +options SYSVSHM # SYSV-style shared memory
 +options SYSVMSG # SYSV-style message queues
 +options SYSVSEM # SYSV-style semaphores
 +device  agp # support several AGP chipsets
 +device  random  # Entropy device
 +device  padlock_rng # VIA Padlock RNG
 +device  rdrand_rng  # Intel Bull Mountain RNG
 +device  vlan# 802.1Q VLAN support
 +device  tun # Packet tunnel.
 +device  gif # IPv6 and IPv4 tunneling
 
 This is loadable too.

True

 And please include:
 
 NETMAP
 NFS_ROOT

OK.

 IEEE80211_DEBUG
 IEEE80211_AMPDU_AGE
 IEEE80211_SUPPORT_MESH
 AH_SUPPORT_AR5416
 AH_AR5416_INTERRUPT_MITIGATION
 ATH_ENABLE_11N

These are already the default for the ath or wlan modules, if I’m reading 
things correctly.

Warner


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Warner Losh

 On Jan 15, 2015, at 6:44 AM, Alexey Dokuchaev da...@freebsd.org wrote:
 
 On Thu, Jan 15, 2015 at 04:23:03PM +0300, Slawa Olhovchenkov wrote:
 On Thu, Jan 15, 2015 at 12:42:07AM +, Warner Losh wrote:
 New Revision: 277204
 URL: https://svnweb.freebsd.org/changeset/base/277204
 
 Log:
  New MINIMAL kernel config. The goal with this configuration is to
  only compile in those options in GENERIC that cannot be loaded as
  modules. ufs is still included because many of its options aren't
  present in the kernel module. There's some other exceptions documented
 
 Are you sure?
 I think defining UFS options in kernel connfig affect to module too.
 When I define this options in kernel config (w/o options FFS) I got
 ufs.ko with this SU, quota, acl etc.
 
 [...]
 This is loadable too.
 
 Right, it does not look like minimal to me either.

Too many things, sadly, are kernel options and the functionality is absent
when or reduced when loading from a module.

 But I welcome the
 intention.  AFAIR last time we had a discussion about why our default
 kernel is not MINIMAL, it boiled down to two main problems: 1) loader's
 caching of disk reads (which makes loading *.ko's from /boot/loader.conf
 a PITA, esp. on ZFS), and 2) robust way to figure out which modules to
 load on an arbitrary user's system (so they won't have to write their
 /boot/loader.conf from scratch themselves).

(2) is the exact problem I’m working on. Since the design of that will allow
us to read from the kernel these modules, (1) becomes largely irrelevant
because the only /boot/loader incursion would be to load drivers for any
storage devices that are on the PCIe bus.

 Speaking of (1), I recall there was one or two attempts to address it
 (keyword: fast-loader-3.diff).  Can someone with more details on their
 hands comment a bit what had happened to that work and are there any
 ETA for it to get committed?  That would be a big leap forward towards
 minimal kernel which can be feasible enough to replace (or be a real
 alternative to) GENERIC in the future.

Perhaps. Let’s see how my stuff plays out, since it generally would mean
we could use a more minimal kernel and let the system figure out what other
things should be loaded.

Warner


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Warner Losh

 On Jan 15, 2015, at 9:20 AM, Alexey Dokuchaev da...@freebsd.org wrote:
 
 On Thu, Jan 15, 2015 at 10:51:55AM -0500, John Baldwin wrote:
 [...]
 +# Pseudo devices.
 +device loop# Network loopback
 +device random  # Entropy device
 +device padlock_rng # VIA Padlock RNG
 +device rdrand_rng  # Intel Bull Mountain RNG
 +device ether   # Ethernet support
 +device vlan# 802.1Q VLAN support
 +device tun # Packet tunnel.
 +device gif # IPv6 and IPv4 tunneling
 
 These last three definitely work as modules.  (vlan(4) was only recently
 added to GENERIC).
 
 And many other things as well (like SYSV* for example).  I usually go as
 far as nodevice'ing io and mem, FWIW.
 
 That said, if we supply reference MINIMAL, it should *really* be minimal.
 And it should not be limited to amd64; lest we forget, our primary target
 should still be i386.

Noted. However, the driver here is an automated loading system. This isn’t
a theoretical ‘least you can have in the kernel’ thing but rather GENERIC
with all the stuff you can practically kldload taken out.

But you bring up a good point. i386 is easy, once the basics are done. PowerPC 
is
only slightly harder, since it has good /boot/loader support as well as a 
GENERIC
kernel or two. Ditto sparc64. But stepping into arm and mips then all hell 
breaks
loose.

It’s also desirable to refactor GENERIC, for the transition period, to be
include MINIMAL + more stuff. I’ll do that as time permits.

Warner


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r277255 - head/sys/vm

2015-01-16 Thread Alan Cox
Author: alc
Date: Fri Jan 16 18:17:09 2015
New Revision: 277255
URL: https://svnweb.freebsd.org/changeset/base/277255

Log:
  Revamp the default page clustering strategy that is used by the page fault
  handler.  For roughly twenty years, the page fault handler has used the
  same basic strategy: Fetch a fixed number of non-resident pages both ahead
  and behind the virtual page that was faulted on.  Over the years,
  alternative strategies have been implemented for optimizing the handling
  of random and sequential access patterns, but the only change to the
  default strategy has been to increase the number of pages read ahead to 7
  and behind to 8.
  
  The problem with the default page clustering strategy becomes apparent
  when you look at how it behaves on the code section of an executable or
  shared library.  (To simplify the following explanation, I'm going to
  ignore the read that is performed to obtain the header and assume that no
  pages are resident at the start of execution.)  Suppose that we have a
  code section consisting of 32 pages.  Further, suppose that we access
  pages 4, 28, and 16 in that order.  Under the default page clustering
  strategy, we page fault three times and perform three I/O operations,
  because the first and second page faults only read a truncated cluster of
  12 pages.  In contrast, if we access pages 8, 24, and 16 in that order, we
  only fault twice and perform two I/O operations, because the first and
  second page faults read a full cluster of 16 pages.  In general, truncated
  clusters are more common than full clusters.
  
  To address this problem, this revision changes the default page clustering
  strategy to align the start of the cluster to a page offset within the vm
  object that is a multiple of the cluster size.  This results in many fewer
  truncated clusters.  Returning to our example, if we now access pages 4,
  28, and 16 in that order, the cluster that is read to satisfy the page
  fault on page 28 will now include page 16.  So, the access to page 16 will
  no longer page fault and perform an I/O operation.
  
  Since the revised default page clustering strategy is typically reading
  more pages at a time, we are likely to read a few more pages that are
  never accessed.  However, for the various programs that we looked at,
  including clang, emacs, firefox, and openjdk, the reduction in the number
  of page faults and I/O operations far outweighed the increase in the
  number of pages that are never accessed.  Moreover, the extra resident
  pages allowed for many more superpage mappings.  For example, if we look
  at the execution of clang during a buildworld, the number of (hard) page
  faults on the code section drops by 26%, the number of superpage mappings
  increases by about 29,000, but the number of never accessed pages only
  increases from 30.38% to 33.66%.  Finally, this leads to a small but
  measureable reduction in execution time.
  
  In collaboration with:Emily Pettigrew e...@rice.edu
  Differential Revision:https://reviews.freebsd.org/D1500
  Reviewed by:  jhb, kib
  MFC after:6 weeks

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Fri Jan 16 17:41:21 2015(r277254)
+++ head/sys/vm/vm_fault.c  Fri Jan 16 18:17:09 2015(r277255)
@@ -108,6 +108,7 @@ __FBSDID($FreeBSD$);
 static int vm_fault_additional_pages(vm_page_t, int, int, vm_page_t *, int *);
 
 #defineVM_FAULT_READ_BEHIND8
+#defineVM_FAULT_READ_DEFAULT   (1 + VM_FAULT_READ_AHEAD_INIT)
 #defineVM_FAULT_READ_MAX   (1 + VM_FAULT_READ_AHEAD_MAX)
 #defineVM_FAULT_NINCR  (VM_FAULT_READ_MAX / 
VM_FAULT_READ_BEHIND)
 #defineVM_FAULT_SUM(VM_FAULT_NINCR * (VM_FAULT_NINCR + 1) 
/ 2)
@@ -292,7 +293,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
 int fault_flags, vm_page_t *m_hold)
 {
vm_prot_t prot;
-   long ahead, behind;
int alloc_req, era, faultcount, nera, reqpage, result;
boolean_t growstack, is_first_object_locked, wired;
int map_generation;
@@ -302,7 +302,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
struct faultstate fs;
struct vnode *vp;
vm_page_t m;
-   int locked, error;
+   int ahead, behind, cluster_offset, error, locked;
 
hardfault = 0;
growstack = TRUE;
@@ -555,45 +555,59 @@ readrest:
int rv;
u_char behavior = vm_map_entry_behavior(fs.entry);
 
+   era = fs.entry-read_ahead;
if (behavior == MAP_ENTRY_BEHAV_RANDOM ||
P_KILLED(curproc)) {
behind = 0;
+   nera = 0;
ahead = 0;
} else if (behavior == 

svn commit: r277256 - head/usr.sbin/ofwdump

2015-01-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Jan 16 18:42:49 2015
New Revision: 277256
URL: https://svnweb.freebsd.org/changeset/base/277256

Log:
  Instead of iterating through all properties looking for a match, if asked
  for a specific property, look it up directly.
  
  MFC after:1 week

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

Modified: head/usr.sbin/ofwdump/ofwdump.c
==
--- head/usr.sbin/ofwdump/ofwdump.c Fri Jan 16 18:17:09 2015
(r277255)
+++ head/usr.sbin/ofwdump/ofwdump.c Fri Jan 16 18:42:49 2015
(r277256)
@@ -49,8 +49,9 @@ __FBSDID($FreeBSD$);
 
 static voidusage(void);
 static voidofw_indent(int);
-static voidofw_dump_properties(int, phandle_t, int, const char *, int,
-   int);
+static voidofw_dump_properties(int, phandle_t, int, int, int);
+static voidofw_dump_property(int fd, phandle_t n, int level,
+   const char *prop, int raw, int str);
 static voidofw_dump(int, const char *, int, int, const char *, int, int);
 
 static void
@@ -140,62 +141,67 @@ ofw_indent(int level)
 }
 
 static void
-ofw_dump_properties(int fd, phandle_t n, int level, const char *pmatch, int 
raw,
+ofw_dump_properties(int fd, phandle_t n, int level, int raw, int str)
+{
+   int nlen;
+   char prop[32];
+
+   for (nlen = ofw_firstprop(fd, n, prop, sizeof(prop)); nlen != 0;
+nlen = ofw_nextprop(fd, n, prop, prop, sizeof(prop)))
+   ofw_dump_property(fd, n, level, prop, raw, str);
+}
+
+static void
+ofw_dump_property(int fd, phandle_t n, int level, const char *prop, int raw,
 int str)
 {
static void *pbuf = NULL;
static char *visbuf = NULL;
static char printbuf[CHARSPERLINE + 1];
static int pblen = 0, vblen = 0;
-   char prop[32];
-   int nlen, len, i, j, max, vlen;
+   int len, i, j, max, vlen;
 
-   for (nlen = ofw_firstprop(fd, n, prop, sizeof(prop)); nlen != 0;
-nlen = ofw_nextprop(fd, n, prop, prop, sizeof(prop))) {
-   if (pmatch != NULL  strcmp(pmatch, prop) != 0)
-   continue;
-   len = ofw_getprop_alloc(fd, n, prop, pbuf, pblen, 1);
-   if (len  0)
-   continue;
-   if (raw)
-   write(STDOUT_FILENO, pbuf, len);
-   else if (str)
-   printf(%.*s\n, len, (char *)pbuf);
-   else {
-   ofw_indent(level * LVLINDENT + NAMEINDENT);
-   printf(%s:\n, prop);
-   /* Print in hex. */
-   for (i = 0; i  len; i += BYTESPERLINE) {
-   max = len - i;
-   max = max  BYTESPERLINE ? BYTESPERLINE : max;
-   ofw_indent(level * LVLINDENT + DUMPINDENT);
-   for (j = 0; j  max; j++)
-   printf(%02x ,
-   ((unsigned char *)pbuf)[i + j]);
-   printf(\n);
-   }
-   /*
-* strvis() and print if it looks like it is
-* zero-terminated.
-*/
-   if (((char *)pbuf)[len - 1] == '\0' 
-   strlen(pbuf) == (unsigned)len - 1) {
-   if (vblen  (len - 1) * 4 + 1) {
-   if (visbuf != NULL)
-   free(visbuf);
-   vblen = (OFIOCMAXVALUE + len) * 4 + 1;
+   len = ofw_getprop_alloc(fd, n, prop, pbuf, pblen, 1);
+   if (len  0)
+   return;
+   if (raw)
+   write(STDOUT_FILENO, pbuf, len);
+   else if (str)
+   printf(%.*s\n, len, (char *)pbuf);
+   else {
+   ofw_indent(level * LVLINDENT + NAMEINDENT);
+   printf(%s:\n, prop);
+   /* Print in hex. */
+   for (i = 0; i  len; i += BYTESPERLINE) {
+   max = len - i;
+   max = max  BYTESPERLINE ? BYTESPERLINE : max;
+   ofw_indent(level * LVLINDENT + DUMPINDENT);
+   for (j = 0; j  max; j++)
+   printf(%02x ,
+   ((unsigned char *)pbuf)[i + j]);
+   printf(\n);
+   }
+   /*
+* strvis() and print if it looks like it is
+* zero-terminated.
+*/
+   if (((char *)pbuf)[len - 1] == '\0' 
+   strlen(pbuf) == (unsigned)len - 1) {
+   if (vblen  (len - 1) * 4 + 1) {
+   if (visbuf != NULL)
+   

Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Adrian Chadd
On 16 January 2015 at 09:57, Warner Losh i...@bsdimp.com wrote:

 On Jan 15, 2015, at 6:23 AM, Slawa Olhovchenkov s...@zxy.spb.ru wrote:

 On Thu, Jan 15, 2015 at 12:42:07AM +, Warner Losh wrote:

 Author: imp
 Date: Thu Jan 15 00:42:06 2015
 New Revision: 277204
 URL: https://svnweb.freebsd.org/changeset/base/277204

 Log:
  New MINIMAL kernel config. The goal with this configuration is to
  only compile in those options in GENERIC that cannot be loaded as
  modules. ufs is still included because many of its options aren't
  present in the kernel module. There's some other exceptions documented

 Are you sure?
 I think defining UFS options in kernel connfig affect to module too.
 When I define this options in kernel config (w/o options FFS) I got
 ufs.ko with this SU, quota, acl etc.

 While one could set options in the kernel to affect the ufs.ko build,
 there’s not a universal ufs.ko that can be loaded easily that switches
 between the different types of options. You can create modules
 that do this, but that’s a very very different problem than the one I
 want to solve, namely you get the same[*] functionality having
 device fred in the kernel config as kldloading fred.ko. So rather than
 bite off that problem also, I’m opting for simplicity.

 +options SOFTUPDATES # Enable FFS soft updates support
 +options UFS_ACL # Support for access control lists
 +options UFS_DIRHASH # Improve performance on big 
 directories
 +options UFS_GJOURNAL# Enable gjournal-based UFS journaling
 +options QUOTA   # Enable disk quotas for UFS

 +options SYSVSHM # SYSV-style shared memory
 +options SYSVMSG # SYSV-style message queues
 +options SYSVSEM # SYSV-style semaphores
 +device  agp # support several AGP chipsets
 +device  random  # Entropy device
 +device  padlock_rng # VIA Padlock RNG
 +device  rdrand_rng  # Intel Bull Mountain RNG
 +device  vlan# 802.1Q VLAN support
 +device  tun # Packet tunnel.
 +device  gif # IPv6 and IPv4 tunneling

 This is loadable too.

 True

 And please include:

 NETMAP
 NFS_ROOT

 OK.

 IEEE80211_DEBUG
 IEEE80211_AMPDU_AGE
 IEEE80211_SUPPORT_MESH
 AH_SUPPORT_AR5416
 AH_AR5416_INTERRUPT_MITIGATION
 ATH_ENABLE_11N

 These are already the default for the ath or wlan modules, if I’m reading 
 things correctly.

Nope.

The other half of this problem is where some modules (did? do?)
populate an opt_wlan.h with their own options. Some modules did this
with the inet option.

When I've done what you're doing, I end up having these options in my
minimal config file so opt_xxx.h is correctly populated. That way when
I point SYSDIR (or whichever variable it is) at the configured kernel
directory with the opt_xxx.h files, it all works out correctly.

(I still think we shouldn't be relying on defaults, but should ship
the opt_xxx.h files or something to derive the opt_xxx.h and makefile
config bits so things like external module building is possible
against a kernel. Or, we just kill all module options that change
behaviour/ABI of things in an incompatible way.)

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

svn commit: r277257 - head/sys/dev/ofw

2015-01-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Jan 16 18:47:20 2015
New Revision: 277257
URL: https://svnweb.freebsd.org/changeset/base/277257

Log:
  Add two fake properties (fdtbootcpu and fdtmemreserv) to the device
  tree's /chosen node to provide out-of-band header fields of the FDT. This
  emulation is not perfect without corresponding changes to ofw_fdt_nextprop(),
  but is enough to enable lookup by memory-map-parsing code.
  
  MFC after:1 week

Modified:
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/ofw/ofw_fdt.c
==
--- head/sys/dev/ofw/ofw_fdt.c  Fri Jan 16 18:42:49 2015(r277256)
+++ head/sys/dev/ofw/ofw_fdt.c  Fri Jan 16 18:47:20 2015(r277257)
@@ -231,6 +231,13 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t 
return (len + 1);
}
 
+   if (prop == NULL  offset == fdt_path_offset(fdtp, /chosen)) {
+   if (strcmp(propname, fdtbootcpu) == 0)
+   return (sizeof(cell_t));
+   if (strcmp(propname, fdtmemreserv) == 0)
+   return (sizeof(uint64_t)*2*fdt_num_mem_rsv(fdtp));
+   }
+
return (len);
 }
 
@@ -242,6 +249,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac
const void *prop;
const char *name;
int len, offset;
+   uint32_t cpuid;
 
offset = fdt_phandle_offset(package);
if (offset  0)
@@ -258,6 +266,18 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac
return (len + 1);
}
 
+   if (prop == NULL  offset == fdt_path_offset(fdtp, /chosen)) {
+   if (strcmp(propname, fdtbootcpu) == 0) {
+   cpuid = cpu_to_fdt32(fdt_boot_cpuid_phys(fdtp));
+   len = sizeof(cpuid);
+   prop = cpuid;
+   }
+   if (strcmp(propname, fdtmemreserv) == 0) {
+   prop = (char *)fdtp + fdt_off_mem_rsvmap(fdtp);
+   len = sizeof(uint64_t)*2*fdt_num_mem_rsv(fdtp);
+   }
+   }
+
if (prop == NULL)
return (-1);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Warner Losh

 On Jan 16, 2015, at 11:43 AM, Adrian Chadd adr...@freebsd.org wrote:
 
 On 16 January 2015 at 09:57, Warner Losh i...@bsdimp.com wrote:
 
 On Jan 15, 2015, at 6:23 AM, Slawa Olhovchenkov s...@zxy.spb.ru wrote:
 
 On Thu, Jan 15, 2015 at 12:42:07AM +, Warner Losh wrote:
 
 Author: imp
 Date: Thu Jan 15 00:42:06 2015
 New Revision: 277204
 URL: https://svnweb.freebsd.org/changeset/base/277204
 
 Log:
 New MINIMAL kernel config. The goal with this configuration is to
 only compile in those options in GENERIC that cannot be loaded as
 modules. ufs is still included because many of its options aren't
 present in the kernel module. There's some other exceptions documented
 
 Are you sure?
 I think defining UFS options in kernel connfig affect to module too.
 When I define this options in kernel config (w/o options FFS) I got
 ufs.ko with this SU, quota, acl etc.
 
 While one could set options in the kernel to affect the ufs.ko build,
 there’s not a universal ufs.ko that can be loaded easily that switches
 between the different types of options. You can create modules
 that do this, but that’s a very very different problem than the one I
 want to solve, namely you get the same[*] functionality having
 device fred in the kernel config as kldloading fred.ko. So rather than
 bite off that problem also, I’m opting for simplicity.
 
 +options SOFTUPDATES # Enable FFS soft updates support
 +options UFS_ACL # Support for access control lists
 +options UFS_DIRHASH # Improve performance on big 
 directories
 +options UFS_GJOURNAL# Enable gjournal-based UFS journaling
 +options QUOTA   # Enable disk quotas for UFS
 
 +options SYSVSHM # SYSV-style shared memory
 +options SYSVMSG # SYSV-style message queues
 +options SYSVSEM # SYSV-style semaphores
 +device  agp # support several AGP chipsets
 +device  random  # Entropy device
 +device  padlock_rng # VIA Padlock RNG
 +device  rdrand_rng  # Intel Bull Mountain RNG
 +device  vlan# 802.1Q VLAN support
 +device  tun # Packet tunnel.
 +device  gif # IPv6 and IPv4 tunneling
 
 This is loadable too.
 
 True
 
 And please include:
 
 NETMAP
 NFS_ROOT
 
 OK.
 
 IEEE80211_DEBUG
 IEEE80211_AMPDU_AGE
 IEEE80211_SUPPORT_MESH
 AH_SUPPORT_AR5416
 AH_AR5416_INTERRUPT_MITIGATION
 ATH_ENABLE_11N
 
 These are already the default for the ath or wlan modules, if I’m reading 
 things correctly.
 
 Nope.

It’s simple to add any of the last 3 to modules/ath, but I see your point.

 The other half of this problem is where some modules (did? do?)
 populate an opt_wlan.h with their own options. Some modules did this
 with the inet option.

You might thing that, but you’d be behind the times. The IEEE options
are centralized, as are the INET options.

 When I've done what you're doing, I end up having these options in my
 minimal config file so opt_xxx.h is correctly populated. That way when
 I point SYSDIR (or whichever variable it is) at the configured kernel
 directory with the opt_xxx.h files, it all works out correctly.

Yea, that’s a different issue.

 (I still think we shouldn't be relying on defaults, but should ship
 the opt_xxx.h files or something to derive the opt_xxx.h and makefile
 config bits so things like external module building is possible
 against a kernel. Or, we just kill all module options that change
 behaviour/ABI of things in an incompatible way.)

Options aren’t supposed to change KBI. Some do, and that’s unfortunate.

But don’t turn this into a rant on how sub-optimal the opt_.h
intersect with modules. That’s another set of problems to solve.

Warner


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r277258 - head/usr.sbin/ngctl

2015-01-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 16 18:51:26 2015
New Revision: 277258
URL: https://svnweb.freebsd.org/changeset/base/277258

Log:
  Plug mutex leak.
  
  MFC after:1 week
  Sponsored by: Nginx, Inc.

Modified:
  head/usr.sbin/ngctl/main.c

Modified: head/usr.sbin/ngctl/main.c
==
--- head/usr.sbin/ngctl/main.c  Fri Jan 16 18:47:20 2015(r277257)
+++ head/usr.sbin/ngctl/main.c  Fri Jan 16 18:51:26 2015(r277258)
@@ -324,8 +324,10 @@ DoInteractive(void)
history(hist, hev, H_ENTER, buf);
pthread_kill(monitor, SIGUSR1);
pthread_mutex_lock(mutex);
-   if (DoParseCommand(buf) == CMDRTN_QUIT)
+   if (DoParseCommand(buf) == CMDRTN_QUIT) {
+   pthread_mutex_unlock(mutex);
break;
+   }
pthread_cond_signal(cond);
pthread_mutex_unlock(mutex);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Adrian Chadd
On 16 January 2015 at 10:48, Warner Losh i...@bsdimp.com wrote:


 Options aren’t supposed to change KBI. Some do, and that’s unfortunate.

Yup, and at least for net80211 I'm going to try really hard to fix that.

 But don’t turn this into a rant on how sub-optimal the opt_.h
 intersect with modules. That’s another set of problems to solve.

Yeah. Please don't take this as a derail attempt; I am not expecting
to address/solve that at the moment.



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

Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Warner Losh

 On Jan 16, 2015, at 11:52 AM, Adrian Chadd adr...@freebsd.org wrote:
 
 On 16 January 2015 at 10:48, Warner Losh i...@bsdimp.com wrote:
 
 
 Options aren’t supposed to change KBI. Some do, and that’s unfortunate.
 
 Yup, and at least for net80211 I'm going to try really hard to fix that.
 
 But don’t turn this into a rant on how sub-optimal the opt_.h
 intersect with modules. That’s another set of problems to solve.
 
 Yeah. Please don't take this as a derail attempt; I am not expecting
 to address/solve that at the moment.

At least we’ve fixed the identical copies problem…

Warner



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r277259 - head/usr.sbin/crunch/crunchide

2015-01-16 Thread Ed Maste
Author: emaste
Date: Fri Jan 16 18:59:15 2015
New Revision: 277259
URL: https://svnweb.freebsd.org/changeset/base/277259

Log:
  crunchide: Correct 64-bit section header offset
  
  For 64-bit binaries the Elf_Ehdr e_shoff is at offset 40, not 44.
  Instead of using an incorrect hardcoded offset, let the compiler
  figure it out for us with offsetof().
  
  Differential Revision:https://reviews.freebsd.org/D1543
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/crunch/crunchide/exec_elf32.c

Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c
==
--- head/usr.sbin/crunch/crunchide/exec_elf32.c Fri Jan 16 18:51:26 2015
(r277258)
+++ head/usr.sbin/crunch/crunchide/exec_elf32.c Fri Jan 16 18:59:15 2015
(r277259)
@@ -46,6 +46,7 @@ __FBSDID($FreeBSD$);
 
 #include errno.h
 #include limits.h
+#include stddef.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -464,7 +465,7 @@ ELFNAMEEND(hide)(int fd, const char *fn)
if (layoutp[i].shdr == shdrshdr 
ehdr.e_shoff != shdrshdr.sh_offset) {
ehdr.e_shoff = shdrshdr.sh_offset;
-   off = (ELFSIZE == 32) ? 32 : 44;
+   off = offsetof(Elf_Ehdr, e_shoff);
size = sizeof(Elf_Off);
if ((size_t)xwriteatoff(fd, ehdr.e_shoff, off, 
size,
fn) != size)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277262 - head/sys/dev/ixl

2015-01-16 Thread Jack F Vogel
Author: jfv
Date: Fri Jan 16 19:11:58 2015
New Revision: 277262
URL: https://svnweb.freebsd.org/changeset/base/277262

Log:
  Some RSS issues discovered by Adrian, missing header, variable
  names fat fingered, incorrect hash config setup. Thanks :)
  
  MFC after: 1 week

Modified:
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/ixl/ixl_txrx.c

Modified: head/sys/dev/ixl/if_ixl.c
==
--- head/sys/dev/ixl/if_ixl.c   Fri Jan 16 19:07:13 2015(r277261)
+++ head/sys/dev/ixl/if_ixl.c   Fri Jan 16 19:11:58 2015(r277262)
@@ -38,6 +38,10 @@
 #include ixl.h
 #include ixl_pf.h
 
+#ifdef RSS
+#include net/rss_config.h
+#endif
+
 /*
  *  Driver version
  */
@@ -3249,7 +3253,7 @@ static void ixl_config_rss(struct ixl_vs
 * num_queues.)
 */
que_id = rss_get_indirection_to_bucket(i);
-   que_id = que_id % adapter-num_queues;
+   que_id = que_id % vsi-num_queues;
 #else
que_id = j;
 #endif

Modified: head/sys/dev/ixl/if_ixlv.c
==
--- head/sys/dev/ixl/if_ixlv.c  Fri Jan 16 19:07:13 2015(r277261)
+++ head/sys/dev/ixl/if_ixlv.c  Fri Jan 16 19:11:58 2015(r277262)
@@ -38,10 +38,14 @@
 #include ixl.h
 #include ixlv.h
 
+#ifdef RSS
+#include net/rss_config.h
+#endif
+
 /*
  *  Driver version
  */
-char ixlv_driver_version[] = 1.2.0;
+char ixlv_driver_version[] = 1.2.1;
 
 /*
  *  PCI Device ID Table
@@ -2596,12 +2600,12 @@ ixlv_config_rss(struct ixlv_sc *sc)
 set_hena |= ((u64)1  I40E_FILTER_PCTYPE_NONF_IPV4_UDP);
if (rss_hash_config  RSS_HASHTYPE_RSS_IPV6)
 set_hena |= ((u64)1  I40E_FILTER_PCTYPE_NONF_IPV6_OTHER);
+if (rss_hash_config  RSS_HASHTYPE_RSS_IPV6_EX)
+   set_hena |= ((u64)1  I40E_FILTER_PCTYPE_FRAG_IPV6);
if (rss_hash_config  RSS_HASHTYPE_RSS_TCP_IPV6)
 set_hena |= ((u64)1  I40E_FILTER_PCTYPE_NONF_IPV6_TCP);
 if (rss_hash_config  RSS_HASHTYPE_RSS_UDP_IPV6)
 set_hena |= ((u64)1  I40E_FILTER_PCTYPE_NONF_IPV6_UDP);
-if (rss_hash_config  RSS_HASHTYPE_RSS_UDP_IPV6_EX)
-set_hena |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP;
 #else
set_hena =
((u64)1  I40E_FILTER_PCTYPE_NONF_IPV4_UDP) |
@@ -2633,7 +2637,7 @@ ixlv_config_rss(struct ixlv_sc *sc)
 * num_queues.)
 */
que_id = rss_get_indirection_to_bucket(i);
-   que_id = que_id % adapter-num_queues;
+   que_id = que_id % vsi-num_queues;
 #else
que_id = j;
 #endif

Modified: head/sys/dev/ixl/ixl_txrx.c
==
--- head/sys/dev/ixl/ixl_txrx.c Fri Jan 16 19:07:13 2015(r277261)
+++ head/sys/dev/ixl/ixl_txrx.c Fri Jan 16 19:11:58 2015(r277262)
@@ -43,6 +43,10 @@
 #include opt_rss.h
 #include ixl.h
 
+#ifdef RSS 
+#include net/rss_config.h
+#endif
+
 /* Local Prototypes */
 static voidixl_rx_checksum(struct mbuf *, u32, u32, u8);
 static voidixl_refresh_mbufs(struct ixl_queue *, int);
@@ -1367,7 +1371,7 @@ ixl_rx_discard(struct rx_ring *rxr, int 
 
 #ifdef RSS
 /*
-** i40e_ptype_to_hash: parse the packet type
+** ixl_ptype_to_hash: parse the packet type
 ** to determine the appropriate hash.
 */
 static inline int
@@ -1376,7 +1380,7 @@ ixl_ptype_to_hash(u8 ptype)
 struct i40e_rx_ptype_decoded   decoded;
u8  ex = 0
 
-   decode = decode_rx_desc_ptype(ptype);
+   decoded = decode_rx_desc_ptype(ptype);
ex = decoded.outer_frag;
 
if (!decoded.known)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277265 - head/sys/arm/xilinx

2015-01-16 Thread Ian Lepore
Author: ian
Date: Fri Jan 16 19:49:10 2015
New Revision: 277265
URL: https://svnweb.freebsd.org/changeset/base/277265

Log:
  Enable the snoop control unit during MP startup, rather than relying on
  the bootloader to have done so.
  
  Submitted by: Thomas Skibo thomassk...@sbcglobal.net

Modified:
  head/sys/arm/xilinx/zy7_mp.c

Modified: head/sys/arm/xilinx/zy7_mp.c
==
--- head/sys/arm/xilinx/zy7_mp.cFri Jan 16 19:38:24 2015
(r277264)
+++ head/sys/arm/xilinx/zy7_mp.cFri Jan 16 19:49:10 2015
(r277265)
@@ -39,6 +39,9 @@ __FBSDID($FreeBSD$);
 
 #defineZYNQ7_CPU1_ENTRY0xfff0
 
+#defineSCU_CONTROL_REG 0xf8f0
+#define   SCU_CONTROL_ENABLE   (1  0)
+
 void
 platform_mp_init_secondary(void)
 {
@@ -64,7 +67,21 @@ platform_mp_probe(void)
 void
 platform_mp_start_ap(void)
 {
+   bus_space_handle_t scu_handle;
bus_space_handle_t ocm_handle;
+   uint32_t scu_ctrl;
+
+   /* Map in SCU control register. */
+   if (bus_space_map(fdtbus_bs_tag, SCU_CONTROL_REG, 4,
+ 0, scu_handle) != 0)
+   panic(platform_mp_start_ap: Couldn't map SCU config reg\n);
+
+   /* Set SCU enable bit. */
+   scu_ctrl = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0);
+   scu_ctrl |= SCU_CONTROL_ENABLE;
+   bus_space_write_4(fdtbus_bs_tag, scu_handle, 0, scu_ctrl);
+
+   bus_space_unmap(fdtbus_bs_tag, scu_handle, 4);
 
/* Map in magic location to give entry address to CPU1. */
if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4,
@@ -75,8 +92,10 @@ platform_mp_start_ap(void)
bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0,
pmap_kextract((vm_offset_t)mpentry));
 
+   bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4);
+
/*
-* The SCU is enabled by the BOOTROM but I think the second CPU doesn't
+* The SCU is enabled above but I think the second CPU doesn't
 * turn on filtering until after the wake-up below. I think that's why
 * things don't work if I don't put these cache ops here.  Also, the
 * magic location, 0xfff0, isn't in the SCU's filtering range so it
@@ -87,8 +106,6 @@ platform_mp_start_ap(void)
 
/* Wake up CPU1. */
armv7_sev();
-
-   bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r277204 - head/sys/amd64/conf

2015-01-16 Thread Slawa Olhovchenkov
On Fri, Jan 16, 2015 at 10:57:54AM -0700, Warner Losh wrote:

 
  On Jan 15, 2015, at 6:23 AM, Slawa Olhovchenkov s...@zxy.spb.ru wrote:
  
  On Thu, Jan 15, 2015 at 12:42:07AM +, Warner Losh wrote:
  
  Author: imp
  Date: Thu Jan 15 00:42:06 2015
  New Revision: 277204
  URL: https://svnweb.freebsd.org/changeset/base/277204
  
  Log:
   New MINIMAL kernel config. The goal with this configuration is to
   only compile in those options in GENERIC that cannot be loaded as
   modules. ufs is still included because many of its options aren't
   present in the kernel module. There's some other exceptions documented
  
  Are you sure?
  I think defining UFS options in kernel connfig affect to module too.
  When I define this options in kernel config (w/o options FFS) I got
  ufs.ko with this SU, quota, acl etc.
 
 While one could set options in the kernel to affect the ufs.ko build,
 there's not a universal ufs.ko that can be loaded easily that switches
 between the different types of options. You can create modules

But this is equal to current condition.

  IEEE80211_DEBUG
  IEEE80211_AMPDU_AGE
  IEEE80211_SUPPORT_MESH
  AH_SUPPORT_AR5416
  AH_AR5416_INTERRUPT_MITIGATION
  ATH_ENABLE_11N
 
 These are already the default for the ath or wlan modules, if I'm reading 
 things correctly.

This is new for me.

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


svn commit: r277270 - in head: crypto/openssl crypto/openssl/crypto crypto/openssl/crypto/ecdsa crypto/openssl/crypto/x509v3 crypto/openssl/util secure/lib/libcrypto secure/lib/libcrypto/man secure...

2015-01-16 Thread Jung-uk Kim
Author: jkim
Date: Fri Jan 16 21:03:23 2015
New Revision: 277270
URL: https://svnweb.freebsd.org/changeset/base/277270

Log:
  Merge OpenSSL 1.0.1l.
  
  MFC after:1 week
  Relnotes: yes

Modified:
  head/crypto/openssl/CHANGES
  head/crypto/openssl/Makefile
  head/crypto/openssl/NEWS
  head/crypto/openssl/README
  head/crypto/openssl/crypto/Makefile
  head/crypto/openssl/crypto/ecdsa/Makefile
  head/crypto/openssl/crypto/ecdsa/ecs_vrf.c
  head/crypto/openssl/crypto/opensslv.h
  head/crypto/openssl/crypto/x509v3/v3_ncons.c
  head/crypto/openssl/e_os.h
  head/crypto/openssl/util/mk1mf.pl
  head/secure/lib/libcrypto/Makefile.inc
  head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
  head/secure/lib/libcrypto/man/ASN1_STRING_length.3
  head/secure/lib/libcrypto/man/ASN1_STRING_new.3
  head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
  head/secure/lib/libcrypto/man/ASN1_generate_nconf.3
  head/secure/lib/libcrypto/man/BIO_ctrl.3
  head/secure/lib/libcrypto/man/BIO_f_base64.3
  head/secure/lib/libcrypto/man/BIO_f_buffer.3
  head/secure/lib/libcrypto/man/BIO_f_cipher.3
  head/secure/lib/libcrypto/man/BIO_f_md.3
  head/secure/lib/libcrypto/man/BIO_f_null.3
  head/secure/lib/libcrypto/man/BIO_f_ssl.3
  head/secure/lib/libcrypto/man/BIO_find_type.3
  head/secure/lib/libcrypto/man/BIO_new.3
  head/secure/lib/libcrypto/man/BIO_new_CMS.3
  head/secure/lib/libcrypto/man/BIO_push.3
  head/secure/lib/libcrypto/man/BIO_read.3
  head/secure/lib/libcrypto/man/BIO_s_accept.3
  head/secure/lib/libcrypto/man/BIO_s_bio.3
  head/secure/lib/libcrypto/man/BIO_s_connect.3
  head/secure/lib/libcrypto/man/BIO_s_fd.3
  head/secure/lib/libcrypto/man/BIO_s_file.3
  head/secure/lib/libcrypto/man/BIO_s_mem.3
  head/secure/lib/libcrypto/man/BIO_s_null.3
  head/secure/lib/libcrypto/man/BIO_s_socket.3
  head/secure/lib/libcrypto/man/BIO_set_callback.3
  head/secure/lib/libcrypto/man/BIO_should_retry.3
  head/secure/lib/libcrypto/man/BN_BLINDING_new.3
  head/secure/lib/libcrypto/man/BN_CTX_new.3
  head/secure/lib/libcrypto/man/BN_CTX_start.3
  head/secure/lib/libcrypto/man/BN_add.3
  head/secure/lib/libcrypto/man/BN_add_word.3
  head/secure/lib/libcrypto/man/BN_bn2bin.3
  head/secure/lib/libcrypto/man/BN_cmp.3
  head/secure/lib/libcrypto/man/BN_copy.3
  head/secure/lib/libcrypto/man/BN_generate_prime.3
  head/secure/lib/libcrypto/man/BN_mod_inverse.3
  head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
  head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
  head/secure/lib/libcrypto/man/BN_new.3
  head/secure/lib/libcrypto/man/BN_num_bytes.3
  head/secure/lib/libcrypto/man/BN_rand.3
  head/secure/lib/libcrypto/man/BN_set_bit.3
  head/secure/lib/libcrypto/man/BN_swap.3
  head/secure/lib/libcrypto/man/BN_zero.3
  head/secure/lib/libcrypto/man/CMS_add0_cert.3
  head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
  head/secure/lib/libcrypto/man/CMS_add1_signer.3
  head/secure/lib/libcrypto/man/CMS_compress.3
  head/secure/lib/libcrypto/man/CMS_decrypt.3
  head/secure/lib/libcrypto/man/CMS_encrypt.3
  head/secure/lib/libcrypto/man/CMS_final.3
  head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
  head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
  head/secure/lib/libcrypto/man/CMS_get0_type.3
  head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
  head/secure/lib/libcrypto/man/CMS_sign.3
  head/secure/lib/libcrypto/man/CMS_sign_receipt.3
  head/secure/lib/libcrypto/man/CMS_uncompress.3
  head/secure/lib/libcrypto/man/CMS_verify.3
  head/secure/lib/libcrypto/man/CMS_verify_receipt.3
  head/secure/lib/libcrypto/man/CONF_modules_free.3
  head/secure/lib/libcrypto/man/CONF_modules_load_file.3
  head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
  head/secure/lib/libcrypto/man/DH_generate_key.3
  head/secure/lib/libcrypto/man/DH_generate_parameters.3
  head/secure/lib/libcrypto/man/DH_get_ex_new_index.3
  head/secure/lib/libcrypto/man/DH_new.3
  head/secure/lib/libcrypto/man/DH_set_method.3
  head/secure/lib/libcrypto/man/DH_size.3
  head/secure/lib/libcrypto/man/DSA_SIG_new.3
  head/secure/lib/libcrypto/man/DSA_do_sign.3
  head/secure/lib/libcrypto/man/DSA_dup_DH.3
  head/secure/lib/libcrypto/man/DSA_generate_key.3
  head/secure/lib/libcrypto/man/DSA_generate_parameters.3
  head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
  head/secure/lib/libcrypto/man/DSA_new.3
  head/secure/lib/libcrypto/man/DSA_set_method.3
  head/secure/lib/libcrypto/man/DSA_sign.3
  head/secure/lib/libcrypto/man/DSA_size.3
  head/secure/lib/libcrypto/man/ERR_GET_LIB.3
  head/secure/lib/libcrypto/man/ERR_clear_error.3
  head/secure/lib/libcrypto/man/ERR_error_string.3
  head/secure/lib/libcrypto/man/ERR_get_error.3
  head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
  head/secure/lib/libcrypto/man/ERR_load_strings.3
  head/secure/lib/libcrypto/man/ERR_print_errors.3
  head/secure/lib/libcrypto/man/ERR_put_error.3
  head/secure/lib/libcrypto/man/ERR_remove_state.3
  head/secure/lib/libcrypto/man/ERR_set_mark.3
  

svn commit: r277271 - head/release/doc/en_US.ISO8859-1/relnotes

2015-01-16 Thread Glen Barber
Author: gjb
Date: Fri Jan 16 21:08:04 2015
New Revision: 277271
URL: https://svnweb.freebsd.org/changeset/base/277271

Log:
  Document r277270, OpenSSL update to 1.0.1l.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jan 16 
21:03:23 2015(r277270)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jan 16 
21:08:04 2015(r277271)
@@ -763,15 +763,9 @@
role=mergedapplicationSendmail/application has been
updated from 8.14.7 to 8.14.9./para
 
-  para revision=267256applicationOpenSSL/application has
-   been updated to version 1.0.1h./para
-
   para revision=276577applicationfile/application has been
updated to version 5.22./para
 
-  para revision=273146applicationOpenSSL/application has
-   been updated to version 1.0.1j./para
-
   para revision=275718The applicationbinutils/application
suite of utilities has been updated to include upstream
patches that add new relocations for arch.powerpc;
@@ -797,6 +791,8 @@
applicationstrings/application were switched to the
versions from the ELF Tool Chain project./para
 
+  para revision=277270applicationOpenSSL/application has
+   been updated to version 1.0.1l./para
 /sect2
 
 sect2 xml:id=ports
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277272 - head/contrib/ofed/management/opensm/osmtest

2015-01-16 Thread Garrett Cooper
Author: ngie
Date: Fri Jan 16 21:12:36 2015
New Revision: 277272
URL: https://svnweb.freebsd.org/changeset/base/277272

Log:
  Don't call abort on usage errors; print out the usage message instead
  
  PR: 196793
  MFC after: 3 days
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/ofed/management/opensm/osmtest/main.c

Modified: head/contrib/ofed/management/opensm/osmtest/main.c
==
--- head/contrib/ofed/management/opensm/osmtest/main.c  Fri Jan 16 21:08:04 
2015(r277271)
+++ head/contrib/ofed/management/opensm/osmtest/main.c  Fri Jan 16 21:12:36 
2015(r277272)
@@ -565,8 +565,9 @@ int main(int argc, char *argv[])
printf(Done with args\n);
break;
 
-   default:/* something wrong */
-   abort();
+   default:
+   show_usage();
+   return 1;
}
 
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277273 - in head: bin/csh etc/mail gnu/usr.bin/grep kerberos5/lib/libasn1 kerberos5/lib/libgssapi_spnego kerberos5/lib/libhdb kerberos5/lib/libhx509 lib/libc lib/libexpat lib/libunboun...

2015-01-16 Thread Will Andrews
Author: will
Date: Fri Jan 16 21:39:08 2015
New Revision: 277273
URL: https://svnweb.freebsd.org/changeset/base/277273

Log:
  Add a ${CP} alias for copying files in the build.
  
  Some users build FreeBSD as non-root in Perforce workspaces.  By default,
  Perforce sets files read-only unless they're explicitly being edited.
  As a result, the -f argument must be used to cp in order to override the
  read-only flag when copying source files to object directories.  Bare use of
  'cp' should be avoided in the future.
  
  Update all current users of 'cp' in the src tree.
  
  Reviewed by:  emaste
  MFC after:1 week
  Sponsored by: Spectra Logic

Modified:
  head/bin/csh/Makefile
  head/etc/mail/Makefile
  head/gnu/usr.bin/grep/Makefile
  head/kerberos5/lib/libasn1/Makefile
  head/kerberos5/lib/libgssapi_spnego/Makefile
  head/kerberos5/lib/libhdb/Makefile
  head/kerberos5/lib/libhx509/Makefile
  head/lib/libc/Makefile
  head/lib/libexpat/Makefile
  head/lib/libunbound/Makefile
  head/secure/lib/libcrypto/Makefile
  head/share/mk/sys.mk
  head/tools/regression/execve/Makefile
  head/tools/test/dtrace/Makefile
  head/usr.bin/grep/Makefile
  head/usr.bin/lex/Makefile
  head/usr.bin/make/Makefile
  head/usr.sbin/mtree/Makefile

Modified: head/bin/csh/Makefile
==
--- head/bin/csh/Makefile   Fri Jan 16 21:12:36 2015(r277272)
+++ head/bin/csh/Makefile   Fri Jan 16 21:39:08 2015(r277273)
@@ -93,7 +93,7 @@ GENHDRS+= iconv.h
 SRCS+= iconv_stub.c
 
 iconv.h: ${.CURDIR}/iconv_stub.h
-   cp -f ${.CURDIR}/iconv_stub.h ${.TARGET}
+   ${CP} ${.CURDIR}/iconv_stub.h ${.TARGET}
 .endif
 .endif
 

Modified: head/etc/mail/Makefile
==
--- head/etc/mail/Makefile  Fri Jan 16 21:12:36 2015(r277272)
+++ head/etc/mail/Makefile  Fri Jan 16 21:39:08 2015(r277273)
@@ -69,7 +69,7 @@ SENDMAIL_MC!=   hostname
 SENDMAIL_MC:=   ${SENDMAIL_MC}.mc
 
 ${SENDMAIL_MC}:
-   cp -f freebsd.mc ${SENDMAIL_MC}
+   ${CP} freebsd.mc ${SENDMAIL_MC}
 .endif
 
 .ifndef SENDMAIL_SUBMIT_MC
@@ -77,7 +77,7 @@ SENDMAIL_SUBMIT_MC!=  hostname
 SENDMAIL_SUBMIT_MC:=   ${SENDMAIL_SUBMIT_MC}.submit.mc
 
 ${SENDMAIL_SUBMIT_MC}:
-   cp -f freebsd.submit.mc ${SENDMAIL_SUBMIT_MC}
+   ${CP} freebsd.submit.mc ${SENDMAIL_SUBMIT_MC}
 .endif
 
 INSTALL_CF=${SENDMAIL_MC:R}.cf

Modified: head/gnu/usr.bin/grep/Makefile
==
--- head/gnu/usr.bin/grep/Makefile  Fri Jan 16 21:12:36 2015
(r277272)
+++ head/gnu/usr.bin/grep/Makefile  Fri Jan 16 21:39:08 2015
(r277273)
@@ -43,7 +43,7 @@ MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 g
 .endif
 
 gnugrep.1: grep.1
-   cp ${.ALLSRC} ${.TARGET}
+   ${CP} ${.ALLSRC} ${.TARGET}
 
 check: all
@failed=0; total=0; \

Modified: head/kerberos5/lib/libasn1/Makefile
==
--- head/kerberos5/lib/libasn1/Makefile Fri Jan 16 21:12:36 2015
(r277272)
+++ head/kerberos5/lib/libasn1/Makefile Fri Jan 16 21:39:08 2015
(r277273)
@@ -111,10 +111,10 @@ ${GEN_KX509}: kx509.asn1
 .SUFFIXES: .h .c .x .hx
 
 .x.c:
-   cp -f ${.IMPSRC} ${.TARGET}
+   ${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-   cp -f ${.IMPSRC} ${.TARGET}
+   ${CP} ${.IMPSRC} ${.TARGET}

 .include bsd.lib.mk
 

Modified: head/kerberos5/lib/libgssapi_spnego/Makefile
==
--- head/kerberos5/lib/libgssapi_spnego/MakefileFri Jan 16 21:12:36 
2015(r277272)
+++ head/kerberos5/lib/libgssapi_spnego/MakefileFri Jan 16 21:39:08 
2015(r277273)
@@ -45,10 +45,10 @@ ${GEN}: spnego.asn1 spnego.opt
 .SUFFIXES: .h .c .x .hx
 
 .x.c:   
-   cp ${.IMPSRC} ${.TARGET}
+   ${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-   cp ${.IMPSRC} ${.TARGET}
+   ${CP} ${.IMPSRC} ${.TARGET}
 
 .include bsd.lib.mk
 

Modified: head/kerberos5/lib/libhdb/Makefile
==
--- head/kerberos5/lib/libhdb/Makefile  Fri Jan 16 21:12:36 2015
(r277272)
+++ head/kerberos5/lib/libhdb/Makefile  Fri Jan 16 21:39:08 2015
(r277273)
@@ -91,10 +91,10 @@ ${GEN}: hdb.asn1
 .SUFFIXES: .h .c .x .hx
 
 .x.c:   
-   cp ${.IMPSRC} ${.TARGET}
+   ${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-   cp ${.IMPSRC} ${.TARGET}
+   ${CP} ${.IMPSRC} ${.TARGET}
 
 .include bsd.lib.mk
 

Modified: head/kerberos5/lib/libhx509/Makefile
==
--- head/kerberos5/lib/libhx509/MakefileFri Jan 16 21:12:36 2015
(r277272)
+++ head/kerberos5/lib/libhx509/MakefileFri Jan 16 21:39:08 2015
(r277273)
@@ -285,10 

svn commit: r277274 - head/secure/lib/libcrypto

2015-01-16 Thread Jung-uk Kim
Author: jkim
Date: Fri Jan 16 22:11:02 2015
New Revision: 277274
URL: https://svnweb.freebsd.org/changeset/base/277274

Log:
  Update buildinf.h to make SSLeay_version(3) little bit more useful.
  
  MFC after:1 week

Modified:
  head/secure/lib/libcrypto/Makefile

Modified: head/secure/lib/libcrypto/Makefile
==
--- head/secure/lib/libcrypto/Makefile  Fri Jan 16 21:39:08 2015
(r277273)
+++ head/secure/lib/libcrypto/Makefile  Fri Jan 16 22:11:02 2015
(r277274)
@@ -390,9 +390,9 @@ CLEANFILES= buildinf.h opensslconf.h
 
 buildinf.h: ${.CURDIR}/Makefile
( echo #ifndef MK1MF_BUILD; \
-   echo   /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c 
*/; \
-   echo   #define CFLAGS \$(CC)\; \
-   echo   #define PLATFORM \FreeBSD-${MACHINE_ARCH}\; \
+   echo /* auto-generated by util/mkbuildinf.pl for crypto/cversion.c 
*/; \
+   echo #define CFLAGS \compiler: ${COMPILER_TYPE}\; \
+   echo #define PLATFORM \platform: FreeBSD-${MACHINE_ARCH}\; \
echo #endif )  ${.TARGET}
 
 .if ${MACHINE_CPUARCH} == amd64 || ${MACHINE_CPUARCH} == i386
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277275 - head/sys/dev/ath/ath_hal

2015-01-16 Thread Adrian Chadd
Author: adrian
Date: Fri Jan 16 23:47:42 2015
New Revision: 277275
URL: https://svnweb.freebsd.org/changeset/base/277275

Log:
  Add bluetooth MCI coexistence HAL methods - used for AR9462 and AR9565 NICs.
  
  It's found, amongst other things, in the Acer Chromebook (Intel)
  devices.
  
  Tested:
  
  * AR9462 (WB222)
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ah.h

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Fri Jan 16 22:11:02 2015
(r277274)
+++ head/sys/dev/ath/ath_hal/ah.h   Fri Jan 16 23:47:42 2015
(r277275)
@@ -1589,6 +1589,18 @@ struct ath_hal {
void__ahdecl(*ah_btCoexDisable)(struct ath_hal *);
int __ahdecl(*ah_btCoexEnable)(struct ath_hal *);
 
+   /* Bluetooth MCI methods */
+   void__ahdecl(*ah_btMciSetup)(struct ath_hal *,
+   uint32_t, void *, uint16_t, uint32_t);
+   HAL_BOOL__ahdecl(*ah_btMciSendMessage)(struct ath_hal *,
+   uint8_t, uint32_t, uint32_t *, uint8_t,
+   HAL_BOOL, HAL_BOOL);
+   uint32_t__ahdecl(*ah_btMciGetInterrupt)(struct ath_hal *,
+   uint32_t *, uint32_t *);
+   uint32_t__ahdecl(*ah_btMciGetState)(struct ath_hal *,
+   uint32_t, uint32_t *);
+   void__ahdecl(*ah_btMciDetach)(struct ath_hal *);
+
/* LNA diversity configuration */
void__ahdecl(*ah_divLnaConfGet)(struct ath_hal *,
HAL_ANT_COMB_CONFIG *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277276 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-01-16 Thread Adrian Chadd
Author: adrian
Date: Fri Jan 16 23:48:28 2015
New Revision: 277276
URL: https://svnweb.freebsd.org/changeset/base/277276

Log:
  Tie in the MCI bluetooth coexistence functions into the HAL.
  
  Tested:
  
  * AR9462 (WB222)

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.cFri Jan 16 
23:47:42 2015(r277275)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.cFri Jan 16 
23:48:28 2015(r277276)
@@ -249,6 +249,13 @@ ar9300_attach_freebsd_ops(struct ath_hal
ah-ah_btCoexDisable= ar9300_bt_coex_disable;
ah-ah_btCoexEnable = ar9300_bt_coex_enable;
 
+   /* MCI bluetooth functions */
+   ah-ah_btMciSetup   = ar9300_mci_setup;
+   ah-ah_btMciSendMessage = ar9300_mci_send_message;
+   ah-ah_btMciGetInterrupt= ar9300_mci_get_interrupt;
+   ah-ah_btMciGetState= ar9300_mci_state;
+   ah-ah_btMciDetach  = ar9300_mci_detach;
+
/* LNA diversity functions */
ah-ah_divLnaConfGet = ar9300_ant_div_comb_get_config;
ah-ah_divLnaConfSet = ar9300_ant_div_comb_set_config;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277277 - head/sys/dev/ath

2015-01-16 Thread Adrian Chadd
Author: adrian
Date: Sat Jan 17 00:02:18 2015
New Revision: 277277
URL: https://svnweb.freebsd.org/changeset/base/277277

Log:
  Until there's a full MCI implementation - just implement a placeholder
  MCI bluetooth coexistence method for WB222.
  
  The rest of MCI requires a bunch more work, including adding a DMA buffer
  for the MCI hardware to bounce messages in/out of and handling MCI
  interrupts.  But the more important part here is telling the HAL
  the btcoex is enabled and MCI is in use so it configures the correct
  initial bluetooth parameters in the wireless NIC and configures
  things like bluetooth traffic weights and such.
  
  So, this at least gets the HAL to do some of the right things in
  configuring the inital bluetooth coexistence stuff, but doesn't
  actually do full btcoex.  That'll take.. some effort.
  
  Tested:
  
  * AR9462 (WB222), STA mode

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

Modified: head/sys/dev/ath/if_ath_btcoex.c
==
--- head/sys/dev/ath/if_ath_btcoex.cFri Jan 16 23:48:28 2015
(r277276)
+++ head/sys/dev/ath/if_ath_btcoex.cSat Jan 17 00:02:18 2015
(r277277)
@@ -188,6 +188,72 @@ ath_btcoex_cfg_wb225(struct ath_softc *s
return (0);
 }
 
+/*
+ * Initial AR9462 / (WB222) bluetooth coexistence settings,
+ * just for experimentation.
+ *
+ * Return 0 for OK; errno for error.
+ */
+static int
+ath_btcoex_cfg_wb222(struct ath_softc *sc)
+{
+   HAL_BT_COEX_INFO btinfo;
+   HAL_BT_COEX_CONFIG btconfig;
+   struct ath_hal *ah = sc-sc_ah;
+
+   if (! ath_hal_btcoex_supported(ah))
+   return (EINVAL);
+
+   bzero(btinfo, sizeof(btinfo));
+   bzero(btconfig, sizeof(btconfig));
+
+   device_printf(sc-sc_dev, Enabling WB222 BTCOEX\n);
+
+   btinfo.bt_module = HAL_BT_MODULE_JANUS; /* XXX not used? */
+   btinfo.bt_coex_config = HAL_BT_COEX_CFG_MCI;
+
+   /*
+* MCI uses a completely different interface to speak
+* to the bluetooth module - it's a command based
+* thing over a serial line, rather than
+* state pins to/from the bluetooth module.
+*
+* So, the GPIO configuration, polarity, etc
+* doesn't matter on MCI devices; it's just
+* completely ignored by the HAL.
+*/
+   btinfo.bt_gpio_bt_active = 4;
+   btinfo.bt_gpio_bt_priority = 8;
+   btinfo.bt_gpio_wlan_active = 5;
+
+   btinfo.bt_active_polarity = 1;  /* XXX not used */
+   btinfo.bt_single_ant = 0;   /* 2 antenna on WB222 */
+   btinfo.bt_isolation = 0;/* in dB, not used */
+
+   ath_hal_btcoex_set_info(ah, btinfo);
+
+   btconfig.bt_time_extend = 0;
+   btconfig.bt_txstate_extend = 1; /* true */
+   btconfig.bt_txframe_extend = 1; /* true */
+   btconfig.bt_mode = HAL_BT_COEX_MODE_SLOTTED;
+   btconfig.bt_quiet_collision = 1;/* true */
+   btconfig.bt_rxclear_polarity = 1;   /* true */
+   btconfig.bt_priority_time = 2;
+   btconfig.bt_first_slot_time = 5;
+   btconfig.bt_hold_rxclear = 1;   /* true */
+
+   ath_hal_btcoex_set_config(ah, btconfig);
+
+   /*
+* Enable antenna diversity.
+*/
+   ath_hal_btcoex_set_parameter(ah, HAL_BT_COEX_ANTENNA_DIVERSITY, 1);
+
+   return (0);
+}
+
+
+
 
 #if 0
 /*
@@ -243,6 +309,8 @@ ath_btcoex_attach(struct ath_softc *sc)
 
if (strncmp(profname, wb195, 5) == 0) {
ret = ath_btcoex_cfg_wb195(sc);
+   } else if (strncmp(profname, wb222, 5) == 0) {
+   ret = ath_btcoex_cfg_wb222(sc);
} else if (strncmp(profname, wb225, 5) == 0) {
ret = ath_btcoex_cfg_wb225(sc);
} else {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r255323 - in head/sys: amd64/conf i386/conf

2015-01-16 Thread Warner Losh

 On Jan 15, 2015, at 7:27 AM, Alexey Dokuchaev da...@freebsd.org wrote:
 
 On Sun, Sep 08, 2013 at 01:02:44AM +0400, Slawa Olhovchenkov wrote:
 On Sat, Sep 07, 2013 at 10:48:48PM +0200, Edward Tomasz Napiera?a wrote:
 I'll be happy if someone does this right now, by populating a
 /boot/loader.modules or something, and then force the fixing of
 loader to cache metadata to make the reads faster.
 
 I have no idea on what's the loader(8) state right now, but long time
 ago I've made a patch that made it significantly faster by making
 caching actually work.  No idea if anyone picked up the patch
 (http://people.freebsd.org/~trasz/fast-loader-3.diff), though.
 
 Some time ago Andrey V. Elsukov do improvement in loader for more
 efficient caching and partition handling. Now loader load a lot of
 modules faster. I am insert hist in CC: list.
 
 It's kind of funny we seem to have similar discussion happening right now
 again -- sixteen months later.
 
 Edward, Andrey, since you two seem to have some working code already, maybe
 you can work together to push out something that can be committed? :)

Orthogonal to these issues, I’m improving the loader to (optionally) load any 
drivers
for storage-class devices it finds on the PCI / PCIe bus. I’m augmenting
/boot/$KERNEL/linker.hints with some additional data so /boot/loader knows
what to load.

Warner



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r277278 - head/contrib/netbsd-tests/lib/libpthread

2015-01-16 Thread Garrett Cooper
Author: ngie
Date: Sat Jan 17 00:58:24 2015
New Revision: 277278
URL: https://svnweb.freebsd.org/changeset/base/277278

Log:
  Fix lib/libthr/tests/detach_test
  
  - Eliminate race with liberal use of sleep(3) [1]
  - Fix NetBSD-specific implementation way of testing result from pthread_cancel
by testing with `td` instead of `NULL` [2]
  
  PR: 196738 [1]
  PR: 191906 [2]
  
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libpthread/t_detach.c

Modified: head/contrib/netbsd-tests/lib/libpthread/t_detach.c
==
--- head/contrib/netbsd-tests/lib/libpthread/t_detach.c Sat Jan 17 00:02:18 
2015(r277277)
+++ head/contrib/netbsd-tests/lib/libpthread/t_detach.c Sat Jan 17 00:58:24 
2015(r277278)
@@ -38,11 +38,18 @@ __RCSID($NetBSD: t_detach.c,v 1.1 2011/
 
 #include h_common.h
 
+#ifdef __FreeBSD__
+#include time.h
+#endif
+
 static void*func(void *);
 
 static void *
 func(void *arg)
 {
+#ifdef __FreeBSD__
+   sleep(2);
+#endif
return NULL;
 }
 
@@ -72,18 +79,25 @@ ATF_TC_BODY(pthread_detach, tc)
 */
PTHREAD_REQUIRE(pthread_detach(t));
 
+#ifdef __FreeBSD__
+   sleep(1);
+#endif
rv = pthread_join(t, NULL);
ATF_REQUIRE(rv == EINVAL);
 
 #ifdef __FreeBSD__
-   atf_tc_expect_fail(PR # 191906: fails with EINVAL, not ESRCH);
+   sleep(3);
 #endif
 
/*
 * As usual, ESRCH should follow if
 * we try to detach an invalid thread.
 */
+#ifdef __NetBSD__
rv = pthread_cancel(NULL);
+#else
+   rv = pthread_cancel(t);
+#endif
ATF_REQUIRE(rv == ESRCH);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277283 - head/sys/modules

2015-01-16 Thread Warner Losh
Author: imp
Date: Sat Jan 17 02:17:55 2015
New Revision: 277283
URL: https://svnweb.freebsd.org/changeset/base/277283

Log:
  The sn driver isn't UCODE sourceless. While it is true there's an
  binary FPGA image that's in an include file in this directory, that
  include file isn't actually used. It is only for certain Trump Cards
  that we don't yet support. When support was anticipated for them, we
  got permission to include the required FPGA image in our sources under
  the BSDL, but didn't start actually including the file. This was done
  to provide a public paper trail for this file.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sat Jan 17 01:21:30 2015(r277282)
+++ head/sys/modules/Makefile   Sat Jan 17 02:17:55 2015(r277283)
@@ -317,7 +317,7 @@ SUBDIR= \
sis \
sk \
${_smbfs} \
-   ${_sn} \
+   sn \
${_snc} \
snp \
${_sound} \
@@ -438,7 +438,6 @@ _ispfw= ispfw
 _mwlfw=mwlfw
 _ralfw=ralfw
 _sf=   sf
-_sn=   sn
 _ti=   ti
 _txp=  txp
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277285 - head/sys/x86/isa

2015-01-16 Thread Warner Losh
Author: imp
Date: Sat Jan 17 02:17:59 2015
New Revision: 277285
URL: https://svnweb.freebsd.org/changeset/base/277285

Log:
  Need to include opt_mca.h to test for DEV_MCA.

Modified:
  head/sys/x86/isa/atpic.c

Modified: head/sys/x86/isa/atpic.c
==
--- head/sys/x86/isa/atpic.cSat Jan 17 02:17:57 2015(r277284)
+++ head/sys/x86/isa/atpic.cSat Jan 17 02:17:59 2015(r277285)
@@ -33,6 +33,7 @@ __FBSDID($FreeBSD$);
 
 #include opt_auto_eoi.h
 #include opt_isa.h
+#include opt_mca.h
 
 #include sys/param.h
 #include sys/systm.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277284 - head/sys/conf

2015-01-16 Thread Warner Losh
Author: imp
Date: Sat Jan 17 02:17:57 2015
New Revision: 277284
URL: https://svnweb.freebsd.org/changeset/base/277284

Log:
  Move DEV_ entries scattered to their common section. Add DEV_PCI.

Modified:
  head/sys/conf/options

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Sat Jan 17 02:17:55 2015(r277283)
+++ head/sys/conf/options   Sat Jan 17 02:17:57 2015(r277284)
@@ -396,11 +396,6 @@ BOOTP_NFSROOT  opt_bootp.h
 BOOTP_NFSV3opt_bootp.h
 BOOTP_WIRED_TO opt_bootp.h
 DEVICE_POLLING
-DEV_ENCopt_enc.h
-DEV_PF opt_pf.h
-DEV_PFLOG  opt_pf.h
-DEV_PFSYNC opt_pf.h
-DEV_VLAN   opt_vlan.h
 DUMMYNET   opt_ipdn.h
 INET   opt_inet.h
 INET6  opt_inet6.h
@@ -698,10 +693,16 @@ ISAPNPopt_isa.h
 
 # various 'device presence' options.
 DEV_BPFopt_bpf.h
-DEV_NETMAP opt_global.h
-DEV_MCAopt_mca.h
 DEV_CARP   opt_carp.h
+DEV_ENCopt_enc.h
+DEV_MCAopt_mca.h
+DEV_NETMAP opt_global.h
+DEV_PCIopt_pci.h
+DEV_PF opt_pf.h
+DEV_PFLOG  opt_pf.h
+DEV_PFSYNC opt_pf.h
 DEV_SPLASH opt_splash.h
+DEV_VLAN   opt_vlan.h
 
 # EISA support
 DEV_EISA   opt_eisa.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277288 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-01-16 Thread Adrian Chadd
Author: adrian
Date: Sat Jan 17 06:43:30 2015
New Revision: 277288
URL: https://svnweb.freebsd.org/changeset/base/277288

Log:
  Override the bt enable/disable methods for AR9462 (jupiter) and
  AR9565 (Aphrodite.)  These need to use the MCI routines, not
  the legacy 2-wire / 3-wire bluetooth coexistence methods.
  
  Tested:
  
  * AR9462 (WB222); STA mode

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.cSat Jan 17 
06:18:45 2015(r277287)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.cSat Jan 17 
06:43:30 2015(r277288)
@@ -250,6 +250,11 @@ ar9300_attach_freebsd_ops(struct ath_hal
ah-ah_btCoexEnable = ar9300_bt_coex_enable;
 
/* MCI bluetooth functions */
+   if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) {
+   ah-ah_btCoexSetWeights = ar9300_mci_bt_coex_set_weights;
+   ah-ah_btCoexDisable = ar9300_mci_bt_coex_disable;
+   ah-ah_btCoexEnable = ar9300_mci_bt_coex_enable;
+   }
ah-ah_btMciSetup   = ar9300_mci_setup;
ah-ah_btMciSendMessage = ar9300_mci_send_message;
ah-ah_btMciGetInterrupt= ar9300_mci_get_interrupt;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277289 - head/sys/dev/ofw

2015-01-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Jan 17 07:01:51 2015
New Revision: 277289
URL: https://svnweb.freebsd.org/changeset/base/277289

Log:
  Return an appropriate error code in the case of a missing property rather
  than random numbers.
  
  MFC after:1 week

Modified:
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/ofw/ofw_fdt.c
==
--- head/sys/dev/ofw/ofw_fdt.c  Sat Jan 17 06:43:30 2015(r277288)
+++ head/sys/dev/ofw/ofw_fdt.c  Sat Jan 17 07:01:51 2015(r277289)
@@ -238,6 +238,9 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t 
return (sizeof(uint64_t)*2*fdt_num_mem_rsv(fdtp));
}
 
+   if (prop == NULL)
+   return (-1);
+
return (len);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277290 - head/sys/dev/ath/ath_hal/ar5416

2015-01-16 Thread Adrian Chadd
Author: adrian
Date: Sat Jan 17 07:33:02 2015
New Revision: 277290
URL: https://svnweb.freebsd.org/changeset/base/277290

Log:
  Oops; correctly reload the CCA registers with the uncapped value
  in prep for the next NF calibration pass.
  
  Totally missing braces.  Damn you C.
  
  Submitted by: Sascha Wildner swild...@dragonflybsd.org
  MFC after:1 week

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cSat Jan 17 07:01:51 
2015(r277289)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cSat Jan 17 07:33:02 
2015(r277290)
@@ -663,7 +663,7 @@ ar5416LoadNF(struct ath_hal *ah, const s
 * by the median we just loaded.  This will be initial (and max) value
 * of next noise floor calibration the baseband does.  
 */
-   for (i = 0; i  AR5416_NUM_NF_READINGS; i ++)
+   for (i = 0; i  AR5416_NUM_NF_READINGS; i ++) {
 
/* Don't write to EXT radio CCA registers unless in HT/40 mode 
*/
/* XXX this check should really be cleaner! */
@@ -676,6 +676,7 @@ ar5416LoadNF(struct ath_hal *ah, const s
val |= (((uint32_t)(-50)  1)  0x1ff);
OS_REG_WRITE(ah, ar5416_cca_regs[i], val);
}
+   }
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org