svn commit: r300264 - head/lib/libstand

2016-05-19 Thread Warner Losh
Author: imp
Date: Fri May 20 05:33:26 2016
New Revision: 300264
URL: https://svnweb.freebsd.org/changeset/base/300264

Log:
  Fix a bug in the parsing code: always use the len and not 8.

Modified:
  head/lib/libstand/uuid_from_string.c

Modified: head/lib/libstand/uuid_from_string.c
==
--- head/lib/libstand/uuid_from_string.cFri May 20 05:00:05 2016
(r300263)
+++ head/lib/libstand/uuid_from_string.cFri May 20 05:33:26 2016
(r300264)
@@ -57,7 +57,7 @@ fromhex(const char *s, int len, int *ok)
if (!*ok)
return 0;
v = 0;
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < len; i++) {
h = hex2int(s[i]);
if (h == 16) {
*ok = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300262 - in head/sys: kern netinet6 sys

2016-05-19 Thread Mark Johnston
Author: markj
Date: Fri May 20 04:45:08 2016
New Revision: 300262
URL: https://svnweb.freebsd.org/changeset/base/300262

Log:
  Move IPv6 malloc tag definitions into the IPv6 code.

Modified:
  head/sys/kern/kern_malloc.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h
  head/sys/sys/malloc.h

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Fri May 20 04:43:56 2016(r300261)
+++ head/sys/kern/kern_malloc.c Fri May 20 04:45:08 2016(r300262)
@@ -110,9 +110,6 @@ MALLOC_DEFINE(M_CACHE, "cache", "Various
 MALLOC_DEFINE(M_DEVBUF, "devbuf", "device driver memory");
 MALLOC_DEFINE(M_TEMP, "temp", "misc temporary data buffers");
 
-MALLOC_DEFINE(M_IP6OPT, "ip6opt", "IPv6 options");
-MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery");
-
 static struct malloc_type *kmemstatistics;
 static int kmemcount;
 

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Fri May 20 04:43:56 2016
(r300261)
+++ head/sys/netinet6/ip6_output.c  Fri May 20 04:45:08 2016
(r300262)
@@ -135,6 +135,8 @@ struct ip6_exthdrs {
struct mbuf *ip6e_dest2;
 };
 
+static MALLOC_DEFINE(M_IP6OPT, "ip6opt", "IPv6 options");
+
 static int ip6_pcbopt(int, u_char *, int, struct ip6_pktopts **,
   struct ucred *, int);
 static int ip6_pcbopts(struct ip6_pktopts **, struct mbuf *,

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Fri May 20 04:43:56 2016(r300261)
+++ head/sys/netinet6/nd6.c Fri May 20 04:45:08 2016(r300262)
@@ -85,6 +85,8 @@ __FBSDID("$FreeBSD$");
 
 #define SIN6(s) ((const struct sockaddr_in6 *)(s))
 
+MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery");
+
 /* timer values */
 VNET_DEFINE(int, nd6_prune)= 1;/* walk list every 1 seconds */
 VNET_DEFINE(int, nd6_delay)= 5;/* delay first probe time 5 second */

Modified: head/sys/netinet6/nd6.h
==
--- head/sys/netinet6/nd6.h Fri May 20 04:43:56 2016(r300261)
+++ head/sys/netinet6/nd6.h Fri May 20 04:45:08 2016(r300262)
@@ -316,6 +316,10 @@ struct nd_pfxrouter {
 
 LIST_HEAD(nd_prhead, nd_prefix);
 
+#ifdef MALLOC_DECLARE
+MALLOC_DECLARE(M_IP6NDP);
+#endif
+
 /* nd6.c */
 VNET_DECLARE(int, nd6_prune);
 VNET_DECLARE(int, nd6_delay);

Modified: head/sys/sys/malloc.h
==
--- head/sys/sys/malloc.h   Fri May 20 04:43:56 2016(r300261)
+++ head/sys/sys/malloc.h   Fri May 20 04:45:08 2016(r300262)
@@ -146,9 +146,6 @@ MALLOC_DECLARE(M_CACHE);
 MALLOC_DECLARE(M_DEVBUF);
 MALLOC_DECLARE(M_TEMP);
 
-MALLOC_DECLARE(M_IP6OPT); /* for INET6 */
-MALLOC_DECLARE(M_IP6NDP); /* for INET6 */
-
 /*
  * Deprecated macro versions of not-quite-malloc() and free().
  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300261 - head/sys/sys

2016-05-19 Thread Mark Johnston
Author: markj
Date: Fri May 20 04:43:56 2016
New Revision: 300261
URL: https://svnweb.freebsd.org/changeset/base/300261

Log:
  Fix the style of the paging target predicates.
  
  Discussed with:   alc, kib
  MFC after:1 week

Modified:
  head/sys/sys/vmmeter.h

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Fri May 20 03:22:41 2016(r300260)
+++ head/sys/sys/vmmeter.h  Fri May 20 04:43:56 2016(r300261)
@@ -125,13 +125,12 @@ extern int vm_pageout_wakeup_thresh;
  * This routine is typically used at the user<->system interface to determine
  * whether we need to block in order to avoid a low memory deadlock.
  */
-
-static __inline 
-int
+static inline int
 vm_page_count_severe(void)
 {
-return (vm_cnt.v_free_severe > (vm_cnt.v_free_count +
-  vm_cnt.v_cache_count));
+
+   return (vm_cnt.v_free_severe > vm_cnt.v_free_count +
+   vm_cnt.v_cache_count);
 }
 
 /*
@@ -143,50 +142,46 @@ vm_page_count_severe(void)
  * to wake waiters up, and when (after making a pass) to become more
  * desperate.
  */
-
-static __inline 
-int
+static inline int
 vm_page_count_min(void)
 {
-return (vm_cnt.v_free_min > (vm_cnt.v_free_count + vm_cnt.v_cache_count));
+
+   return (vm_cnt.v_free_min > vm_cnt.v_free_count + vm_cnt.v_cache_count);
 }
 
 /*
  * Return TRUE if we have not reached our free page target during
  * free page recovery operations.
  */
-
-static __inline 
-int
+static inline int
 vm_page_count_target(void)
 {
-return (vm_cnt.v_free_target > (vm_cnt.v_free_count +
-  vm_cnt.v_cache_count));
+
+   return (vm_cnt.v_free_target > vm_cnt.v_free_count +
+   vm_cnt.v_cache_count);
 }
 
 /*
  * Return the number of pages we need to free-up or cache
  * A positive number indicates that we do not have enough free pages.
  */
-
-static __inline 
-int
+static inline int
 vm_paging_target(void)
 {
-return (vm_cnt.v_free_target - (vm_cnt.v_free_count +
-  vm_cnt.v_cache_count));
+
+   return (vm_cnt.v_free_target - (vm_cnt.v_free_count +
+   vm_cnt.v_cache_count));
 }
 
 /*
  * Returns TRUE if the pagedaemon needs to be woken up.
  */
-
-static __inline 
-int
+static inline int
 vm_paging_needed(void)
 {
-return (vm_cnt.v_free_count + vm_cnt.v_cache_count <
-(u_int)vm_pageout_wakeup_thresh);
+
+   return (vm_cnt.v_free_count + vm_cnt.v_cache_count <
+   (u_int)vm_pageout_wakeup_thresh);
 }
 
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300258 - head/sys/dev/iicbus

2016-05-19 Thread Ravi Pokala
-Original Message-
From: Jason Harmening 
Date: 2016-05-19, Thursday at 21:05
To: Ravi Pokala , "Jason A. Harmening" , 
, , 

Subject: Re: svn commit: r300258 - head/sys/dev/iicbus

>On 05/19/16 20:50, Ravi Pokala wrote:
>> -Original Message-
>> From:  on behalf of "Jason A. Harmening" 
>> 
>> Date: 2016-05-19, Thursday at 20:03
>> To: , , 
>> 
>> Subject: svn commit: r300258 - head/sys/dev/iicbus
>> 
>> Hi Jason,
>> 
>> If I’m reading that right, it’s not preventing any allocations, but it is 
>> preventing a leak. Is that correct?
>> 
>> Thanks,
>> 
>> Ravi (rpokala@)
>
>Hi Ravi,
>
>There shouldn't be a leak in here, but checking the result prevents
>falling through the rest of the function, including the unnecessary
>malloc of usrbufs right after this.

How did I miss that earlier? Time for new glasses! :-P

>It also makes the error handling clearer.

Yeah.

>Thanks,
>Jason

Thank *you*,

Ravi (rpokala@)



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

Re: svn commit: r300258 - head/sys/dev/iicbus

2016-05-19 Thread Jason Harmening


On 05/19/16 20:50, Ravi Pokala wrote:
> -Original Message-
> From:  on behalf of "Jason A. Harmening" 
> 
> Date: 2016-05-19, Thursday at 20:03
> To: , , 
> 
> Subject: svn commit: r300258 - head/sys/dev/iicbus
> 
>> Author: jah
>> Date: Fri May 20 03:03:04 2016
>> New Revision: 300258
>> URL: https://svnweb.freebsd.org/changeset/base/300258
>>
>> Log:
>>  iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages 
>> to prevent memory exhaustion and short allocations on 32-bit systems. Since 
>> iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same 
>> limit of 42 that Linux uses.
>>  
>>  Also check the return value of copyin(9) to prevent unnecessary allocation 
>> in the failure case.
>>  
>>  ...
>>  
>>  error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs);
>> +if (error != 0) {
>> +free(buf, M_IIC);
>> +return (error);
>> +}
>>
> 
> Hi Jason,
> 
> If I’m reading that right, it’s not preventing any allocations, but it is 
> preventing a leak. Is that correct?
> 
> Thanks,
> 
> Ravi (rpokala@)
> 
> 

Hi Ravi,

There shouldn't be a leak in here, but checking the result prevents
falling through the rest of the function, including the unnecessary
malloc of usrbufs right after this.  It also makes the error handling
clearer.

Thanks,
Jason



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r300258 - head/sys/dev/iicbus

2016-05-19 Thread Ravi Pokala
-Original Message-
From:  on behalf of "Jason A. Harmening" 

Date: 2016-05-19, Thursday at 20:03
To: , , 

Subject: svn commit: r300258 - head/sys/dev/iicbus

>Author: jah
>Date: Fri May 20 03:03:04 2016
>New Revision: 300258
>URL: https://svnweb.freebsd.org/changeset/base/300258
>
>Log:
>  iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages 
> to prevent memory exhaustion and short allocations on 32-bit systems. Since 
> iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same 
> limit of 42 that Linux uses.
>  
>  Also check the return value of copyin(9) to prevent unnecessary allocation 
> in the failure case.
>  
>  ...
>  
>   error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs);
>+  if (error != 0) {
>+  free(buf, M_IIC);
>+  return (error);
>+  }
> 

Hi Jason,

If I’m reading that right, it’s not preventing any allocations, but it is 
preventing a leak. Is that correct?

Thanks,

Ravi (rpokala@)


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

Re: svn commit: r300259 - head/sys/contrib/ipfilter/netinet

2016-05-19 Thread Cy Schubert
In message <201605200304.u4k34ntl019...@repo.freebsd.org>, Cy Schubert 
writes:
> Author: cy
> Date: Fri May 20 03:04:22 2016
> New Revision: 300259
> URL: https://svnweb.freebsd.org/changeset/base/300259
> 
> Log:
>   Enable the two ip_frag tuneables. The code is there but the two
>   ip_frag tuneables aren't registered in the ipf_tuners linked list.
>   This commmit enables the two existing ip_frag tuneables by registering
>   them.
>   
>   MFC after:  1 month
> 
> Modified:
>   head/sys/contrib/ipfilter/netinet/ip_frag.c
>   head/sys/contrib/ipfilter/netinet/ip_frag.h
> 
> Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c
> =
> =
> --- head/sys/contrib/ipfilter/netinet/ip_frag.c   Fri May 20 03:03:04 201
> 6 (r300258)
> +++ head/sys/contrib/ipfilter/netinet/ip_frag.c   Fri May 20 03:04:22 201
> 6 (r300259)
> @@ -112,7 +112,7 @@ static void ipf_frag_free __P((ipf_frag_
>  
>  static frentry_t ipfr_block;
>  
> -const ipftuneable_t ipf_tuneables[] = {
> +static ipftuneable_t ipf_frag_tuneables[] = {
>   { { (void *)offsetof(ipf_frag_softc_t, ipfr_size) },
>   "frag_size",1,  0x7fff,
>   stsizeof(ipf_frag_softc_t, ipfr_size),
> @@ -189,6 +189,18 @@ ipf_frag_soft_create(softc)
>   RWLOCK_INIT(>ipfr_frag, "ipf fragment rwlock");
>   RWLOCK_INIT(>ipfr_natfrag, "ipf NAT fragment rwlock");
>  
> + softf->ipf_frag_tune = ipf_tune_array_copy(softf,
> +sizeof(ipf_frag_tuneables),
> +ipf_frag_tuneables);
> + if (softf->ipf_frag_tune == NULL) {
> + ipf_frag_soft_destroy(softc, softf);
> + return NULL;
> + }
> + if (ipf_tune_array_link(softc, softf->ipf_frag_tune) == -1) {
> + ipf_frag_soft_destroy(softc, softf);
> + return NULL;
> + }
> +
>   softf->ipfr_size = IPFT_SIZE;
>   softf->ipfr_ttl = IPF_TTLVAL(60);
>   softf->ipfr_lock = 1;
> @@ -219,6 +231,13 @@ ipf_frag_soft_destroy(softc, arg)
>   RW_DESTROY(>ipfr_frag);
>   RW_DESTROY(>ipfr_natfrag);
>  
> + if (softf->ipf_frag_tune != NULL) {
> + ipf_tune_array_unlink(softc, softf->ipf_frag_tune);
> + KFREES(softf->ipf_frag_tune, sizeof(ipf_frag_tuneables));
> + softf->ipf_frag_tune = NULL;
> + }
> +
> +
>   KFREE(softf);
>  }
>  
> 
> Modified: head/sys/contrib/ipfilter/netinet/ip_frag.h
> =
> =
> --- head/sys/contrib/ipfilter/netinet/ip_frag.h   Fri May 20 03:03:04 201
> 6 (r300258)
> +++ head/sys/contrib/ipfilter/netinet/ip_frag.h   Fri May 20 03:04:22 201
> 6 (r300259)
> @@ -78,6 +78,7 @@ typedef struct ipf_frag_softc_s  {
>   int ipfr_ttl;
>   int ipfr_lock;
>   int ipfr_inited;
> + ipftuneable_t   *ipf_frag_tune;
>   ipfr_t  *ipfr_list;
>   ipfr_t  **ipfr_tail;
>   ipfr_t  *ipfr_natlist;
> 

Darren Reed has been notified so that this patch can be included in the 
upline ipfilter repo.


-- 
Cheers,
Cy Schubert  or 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


svn commit: r300260 - head/sys/contrib/ipfilter/netinet

2016-05-19 Thread Cy Schubert
Author: cy
Date: Fri May 20 03:22:41 2016
New Revision: 300260
URL: https://svnweb.freebsd.org/changeset/base/300260

Log:
  Remove extraneous blank line.
  
  MFC after:1 month
  X-MFC with:   r300259

Modified:
  head/sys/contrib/ipfilter/netinet/ip_frag.c

Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c
==
--- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:04:22 2016
(r300259)
+++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:22:41 2016
(r300260)
@@ -237,7 +237,6 @@ ipf_frag_soft_destroy(softc, arg)
softf->ipf_frag_tune = NULL;
}
 
-
KFREE(softf);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300253 - in head: . share/man/man9 sys/sys

2016-05-19 Thread Adrian Chadd
Know what's funny? The broadcom siba/bhnd resources almost kinda want
this ... :P



-adrian


On 19 May 2016 at 18:17, John Baldwin <j...@freebsd.org> wrote:
> Author: jhb
> Date: Fri May 20 01:17:38 2016
> New Revision: 300253
> URL: https://svnweb.freebsd.org/changeset/base/300253
>
> Log:
>   Remove dangling references to rman_await_resource().
>
>   This function was removed when RF_TIMESHARE was removed a couple of years
>   ago.
>
>   MFC after:3 days
>
> Modified:
>   head/ObsoleteFiles.inc
>   head/share/man/man9/Makefile
>   head/share/man/man9/rman.9
>   head/sys/sys/rman.h
>
> Modified: head/ObsoleteFiles.inc
> ==
> --- head/ObsoleteFiles.inc  Fri May 20 01:02:58 2016(r300252)
> +++ head/ObsoleteFiles.inc  Fri May 20 01:17:38 2016(r300253)
> @@ -38,6 +38,8 @@
>  #   xargs -n1 | sort | uniq -d;
>  # done
>
> +# 20160519: stale MLINK removed
> +OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz
>  # 20160517: ReiserFS removed
>  OLD_FILES+=usr/share/man/man5/reiserfs.5.gz
>  # 20160430: kvm_getfiles(3) removed from kvm(3)
>
> Modified: head/share/man/man9/Makefile
> ==
> --- head/share/man/man9/MakefileFri May 20 01:02:58 2016
> (r300252)
> +++ head/share/man/man9/MakefileFri May 20 01:17:38 2016
> (r300253)
> @@ -1373,7 +1373,6 @@ MLINKS+=resource_int_value.9 resource_lo
> resource_int_value.9 resource_string_value.9
>  MLINKS+=rman.9 rman_activate_resource.9 \
> rman.9 rman_adjust_resource.9 \
> -   rman.9 rman_await_resource.9 \
> rman.9 rman_deactivate_resource.9 \
> rman.9 rman_fini.9 \
> rman.9 rman_first_free_region.9 \
>
> Modified: head/share/man/man9/rman.9
> ==
> --- head/share/man/man9/rman.9  Fri May 20 01:02:58 2016(r300252)
> +++ head/share/man/man9/rman.9  Fri May 20 01:17:38 2016(r300253)
> @@ -25,14 +25,13 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd July 15, 2014
> +.Dd May 19, 2016
>  .Dt RMAN 9
>  .Os
>  .Sh NAME
>  .Nm rman ,
>  .Nm rman_activate_resource ,
>  .Nm rman_adjust_resource ,
> -.Nm rman_await_resource ,
>  .Nm rman_deactivate_resource ,
>  .Nm rman_fini ,
>  .Nm rman_init ,
> @@ -67,8 +66,6 @@
>  .Ft int
>  .Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t 
> end"
>  .Ft int
> -.Fn rman_await_resource "struct resource *r" "int pri2" "int timo"
> -.Ft int
>  .Fn rman_deactivate_resource "struct resource *r"
>  .Ft int
>  .Fn rman_fini "struct rman *rm"
> @@ -387,23 +384,6 @@ flag.
>  If other consumers are waiting for this range, it will wakeup their threads.
>  .Pp
>  The
> -.Fn rman_await_resource
> -function performs an asynchronous wait for a resource
> -.Fa r
> -to become inactive, that is, for the
> -.Dv RF_ACTIVE
> -flag to be cleared.
> -It is used to enable cooperative sharing of a resource
> -which can only be safely used by one thread at a time.
> -The arguments
> -.Fa pri
> -and
> -.Fa timo
> -are passed to the
> -.Fn rman_await_resource
> -function.
> -.Pp
> -The
>  .Fn rman_get_start ,
>  .Fn rman_get_end ,
>  .Fn rman_get_size ,
>
> Modified: head/sys/sys/rman.h
> ==
> --- head/sys/sys/rman.h Fri May 20 01:02:58 2016(r300252)
> +++ head/sys/sys/rman.h Fri May 20 01:17:38 2016(r300253)
> @@ -121,7 +121,6 @@ TAILQ_HEAD(rman_head, rman);
>
>  intrman_activate_resource(struct resource *r);
>  intrman_adjust_resource(struct resource *r, rman_res_t start, rman_res_t 
> end);
> -intrman_await_resource(struct resource *r, int pri, int timo);
>  intrman_first_free_region(struct rman *rm, rman_res_t *start, rman_res_t 
> *end);
>  bus_space_handle_t rman_get_bushandle(struct resource *);
>  bus_space_tag_t rman_get_bustag(struct resource *);
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300259 - head/sys/contrib/ipfilter/netinet

2016-05-19 Thread Cy Schubert
Author: cy
Date: Fri May 20 03:04:22 2016
New Revision: 300259
URL: https://svnweb.freebsd.org/changeset/base/300259

Log:
  Enable the two ip_frag tuneables. The code is there but the two
  ip_frag tuneables aren't registered in the ipf_tuners linked list.
  This commmit enables the two existing ip_frag tuneables by registering
  them.
  
  MFC after:1 month

Modified:
  head/sys/contrib/ipfilter/netinet/ip_frag.c
  head/sys/contrib/ipfilter/netinet/ip_frag.h

Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c
==
--- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:03:04 2016
(r300258)
+++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri May 20 03:04:22 2016
(r300259)
@@ -112,7 +112,7 @@ static void ipf_frag_free __P((ipf_frag_
 
 static frentry_t ipfr_block;
 
-const ipftuneable_t ipf_tuneables[] = {
+static ipftuneable_t ipf_frag_tuneables[] = {
{ { (void *)offsetof(ipf_frag_softc_t, ipfr_size) },
"frag_size",1,  0x7fff,
stsizeof(ipf_frag_softc_t, ipfr_size),
@@ -189,6 +189,18 @@ ipf_frag_soft_create(softc)
RWLOCK_INIT(>ipfr_frag, "ipf fragment rwlock");
RWLOCK_INIT(>ipfr_natfrag, "ipf NAT fragment rwlock");
 
+   softf->ipf_frag_tune = ipf_tune_array_copy(softf,
+  sizeof(ipf_frag_tuneables),
+  ipf_frag_tuneables);
+   if (softf->ipf_frag_tune == NULL) {
+   ipf_frag_soft_destroy(softc, softf);
+   return NULL;
+   }
+   if (ipf_tune_array_link(softc, softf->ipf_frag_tune) == -1) {
+   ipf_frag_soft_destroy(softc, softf);
+   return NULL;
+   }
+
softf->ipfr_size = IPFT_SIZE;
softf->ipfr_ttl = IPF_TTLVAL(60);
softf->ipfr_lock = 1;
@@ -219,6 +231,13 @@ ipf_frag_soft_destroy(softc, arg)
RW_DESTROY(>ipfr_frag);
RW_DESTROY(>ipfr_natfrag);
 
+   if (softf->ipf_frag_tune != NULL) {
+   ipf_tune_array_unlink(softc, softf->ipf_frag_tune);
+   KFREES(softf->ipf_frag_tune, sizeof(ipf_frag_tuneables));
+   softf->ipf_frag_tune = NULL;
+   }
+
+
KFREE(softf);
 }
 

Modified: head/sys/contrib/ipfilter/netinet/ip_frag.h
==
--- head/sys/contrib/ipfilter/netinet/ip_frag.h Fri May 20 03:03:04 2016
(r300258)
+++ head/sys/contrib/ipfilter/netinet/ip_frag.h Fri May 20 03:04:22 2016
(r300259)
@@ -78,6 +78,7 @@ typedef struct ipf_frag_softc_s  {
int ipfr_ttl;
int ipfr_lock;
int ipfr_inited;
+   ipftuneable_t   *ipf_frag_tune;
ipfr_t  *ipfr_list;
ipfr_t  **ipfr_tail;
ipfr_t  *ipfr_natlist;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300258 - head/sys/dev/iicbus

2016-05-19 Thread Jason A. Harmening
Author: jah
Date: Fri May 20 03:03:04 2016
New Revision: 300258
URL: https://svnweb.freebsd.org/changeset/base/300258

Log:
  iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages 
to prevent memory exhaustion and short allocations on 32-bit systems. Since 
iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same 
limit of 42 that Linux uses.
  
  Also check the return value of copyin(9) to prevent unnecessary allocation in 
the failure case.
  
  Submitted by: ngie
  Reviewed by:  kib
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D5155

Modified:
  head/sys/dev/iicbus/iic.c
  head/sys/dev/iicbus/iic.h

Modified: head/sys/dev/iicbus/iic.c
==
--- head/sys/dev/iicbus/iic.c   Fri May 20 01:41:47 2016(r300257)
+++ head/sys/dev/iicbus/iic.c   Fri May 20 03:03:04 2016(r300258)
@@ -300,9 +300,16 @@ iicrdwr(struct iic_cdevpriv *priv, struc
parent = device_get_parent(iicdev);
error = 0;
 
+   if (d->nmsgs > IIC_RDRW_MAX_MSGS)
+   return (EINVAL);
+
buf = malloc(sizeof(*d->msgs) * d->nmsgs, M_IIC, M_WAITOK);
 
error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs);
+   if (error != 0) {
+   free(buf, M_IIC);
+   return (error);
+   }
 
/* Alloc kernel buffers for userland data, copyin write data */
usrbufs = malloc(sizeof(void *) * d->nmsgs, M_IIC, M_WAITOK | M_ZERO);
@@ -318,6 +325,8 @@ iicrdwr(struct iic_cdevpriv *priv, struc
m->buf = NULL;
if (error != 0)
continue;
+
+   /* m->len is uint16_t, so allocation size is capped at 64K. */
m->buf = malloc(m->len, M_IIC, M_WAITOK);
if (!(m->flags & IIC_M_RD))
error = copyin(usrbufs[i], m->buf, m->len);

Modified: head/sys/dev/iicbus/iic.h
==
--- head/sys/dev/iicbus/iic.h   Fri May 20 01:41:47 2016(r300257)
+++ head/sys/dev/iicbus/iic.h   Fri May 20 03:03:04 2016(r300258)
@@ -56,6 +56,8 @@ struct iic_rdwr_data {
uint32_t nmsgs;
 };
 
+#define IIC_RDRW_MAX_MSGS  42
+
 #define I2CSTART   _IOW('i', 1, struct iiccmd) /* start condition */
 #define I2CSTOP_IO('i', 2) /* stop 
condition */
 #define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300257 - in head/sys/boot/i386: libi386 zfsboot

2016-05-19 Thread Allan Jude
Author: allanjude
Date: Fri May 20 01:41:47 2016
New Revision: 300257
URL: https://svnweb.freebsd.org/changeset/base/300257

Log:
  Fixup the geliboot sector rounding code
  
  Replace all rounding with the round{up,down}2 macros
  a missing set of braces caused the previous code to be incorrect
  
  replace alloca() with malloc() because alloca() can return an allocation
  that is actually invalid, causing boot to fail
  
  Reviewed by:  emaste, ed
  Thanks To:peter
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D6213

Modified:
  head/sys/boot/i386/libi386/biosdisk.c
  head/sys/boot/i386/zfsboot/zfsboot.c

Modified: head/sys/boot/i386/libi386/biosdisk.c
==
--- head/sys/boot/i386/libi386/biosdisk.c   Fri May 20 01:38:31 2016
(r300256)
+++ head/sys/boot/i386/libi386/biosdisk.c   Fri May 20 01:41:47 2016
(r300257)
@@ -749,21 +749,29 @@ bd_read(struct disk_devdesc *dev, daddr_
 * sectors cannot be decrypted. Round the requested LBA down to
 * nearest multiple of DEV_GELIBOOT_BSIZE bytes.
 */
-   alignlba = dblk &
-   ~(daddr_t)((DEV_GELIBOOT_BSIZE / BIOSDISK_SECSIZE) - 1);
+   alignlba = rounddown2(dblk * BD(dev).bd_sectorsize,
+   DEV_GELIBOOT_BSIZE) / BD(dev).bd_sectorsize;
/*
 * Round number of blocks to read up to nearest multiple of
 * DEV_GELIBOOT_BSIZE
 */
-   alignblks = blks + (dblk - alignlba) +
-   ((DEV_GELIBOOT_BSIZE / BIOSDISK_SECSIZE) - 1) &
-   ~(int)((DEV_GELIBOOT_BSIZE / BIOSDISK_SECSIZE) - 1);
-   diff = (dblk - alignlba) * BIOSDISK_SECSIZE;
+   diff = (dblk - alignlba) * BD(dev).bd_sectorsize;
+   alignblks = roundup2(blks * BD(dev).bd_sectorsize + diff,
+   DEV_GELIBOOT_BSIZE) / BD(dev).bd_sectorsize;
+
/*
-* Use a temporary buffer here because the buffer provided by
-* the caller may be too small.
+* If the read is rounded up to a larger size, use a temporary
+* buffer here because the buffer provided by the caller may be
+* too small.
 */
-   tmpbuf = alloca(alignblks * BIOSDISK_SECSIZE);
+   if (diff == 0) {
+   tmpbuf = dest;
+   } else {
+   tmpbuf = malloc(alignblks * BD(dev).bd_sectorsize);
+   if (tmpbuf == NULL) {
+   return (-1);
+   }
+   }
 
err = bd_io(dev, alignlba, alignblks, tmpbuf, 0);
if (err)
@@ -779,12 +787,15 @@ bd_read(struct disk_devdesc *dev, daddr_
/* GELI needs the offset relative to the partition start */
p_off = alignlba - dskp.start;
 
-   err = geli_read(, p_off * BIOSDISK_SECSIZE, tmpbuf,
-   alignblks * BIOSDISK_SECSIZE);
+   err = geli_read(, p_off * BD(dev).bd_sectorsize, tmpbuf,
+   alignblks * BD(dev).bd_sectorsize);
if (err)
return (err);
 
-   bcopy(tmpbuf + diff, dest, blks * BIOSDISK_SECSIZE);
+   if (tmpbuf != dest) {
+   bcopy(tmpbuf + diff, dest, blks * 
BD(dev).bd_sectorsize);
+   free(tmpbuf);
+   }
return (0);
}
 #endif /* LOADER_GELI_SUPPORT */
@@ -898,10 +909,10 @@ bios_read(void *vdev __unused, struct ds
dev.d_partition = priv->part;
dev.d_offset = priv->start;
 
-   off = off / BIOSDISK_SECSIZE;
+   off = off / BD().bd_sectorsize;
/* GELI gives us the offset relative to the partition start */
off += dev.d_offset;
-   bytes = bytes / BIOSDISK_SECSIZE;
+   bytes = bytes / BD().bd_sectorsize;
 
return (bd_io(, off, bytes, buf, 0));
 }

Modified: head/sys/boot/i386/zfsboot/zfsboot.c
==
--- head/sys/boot/i386/zfsboot/zfsboot.cFri May 20 01:38:31 2016
(r300256)
+++ head/sys/boot/i386/zfsboot/zfsboot.cFri May 20 01:41:47 2016
(r300257)
@@ -200,7 +200,7 @@ vdev_read(vdev_t *vdev, void *priv, off_
 {
char *p;
daddr_t lba, alignlba;
-   off_t alignoff, diff;
+   off_t diff;
unsigned int nb, alignnb;
struct dsk *dsk = (struct dsk *) priv;
 
@@ -210,10 +210,11 @@ vdev_read(vdev_t *vdev, void *priv, off_
p = buf;
lba = off / DEV_BSIZE;
lba += dsk->start;
-   /* Align reads to 4k else 4k sector GELIs will not decrypt. */
-   alignoff = off & ~ (off_t)(DEV_GELIBOOT_BSIZE - 1);
-   /* Round LBA 

svn commit: r300256 - in head: . etc/mtree

2016-05-19 Thread George V. Neville-Neil
Author: gnn
Date: Fri May 20 01:38:31 2016
New Revision: 300256
URL: https://svnweb.freebsd.org/changeset/base/300256

Log:
  Remove DTrace tooklkit from the mtree and add the files to remove
  to the ObsoleteFiles list.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.usr.dist

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri May 20 01:25:14 2016(r300255)
+++ head/ObsoleteFiles.inc  Fri May 20 01:38:31 2016(r300256)
@@ -38,6 +38,13 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20160519: remove DTrace Toolkit from base
+OLD_FILES+=usr/share/dtrace/toolkit/execsnoop*
+OLD_FILES+=usr/share/dtrace/toolkit/hotkernel*
+OLD_FILES+=usr/share/dtrace/toolkit/hotuser*
+OLD_FILES+=usr/share/dtrace/toolkit/opensnoop*
+OLD_FILES+=usr/share/dtrace/toolkit/procsystime*
+OLD_DIRS+=usr/share/dtrace/toolkit
 # 20160519: stale MLINK removed
 OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz
 # 20160517: ReiserFS removed

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Fri May 20 01:25:14 2016(r300255)
+++ head/etc/mtree/BSD.usr.dist Fri May 20 01:38:31 2016(r300256)
@@ -309,8 +309,6 @@
 ..
 ..
 dtrace
-toolkit
-..
 ..
 examples
 BSD_daemon
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300255 - stable/9/sys/fs/nfsserver

2016-05-19 Thread Rick Macklem
Author: rmacklem
Date: Fri May 20 01:25:14 2016
New Revision: 300255
URL: https://svnweb.freebsd.org/changeset/base/300255

Log:
  MFC: r299201
  Give mountd -S priority over outstanding RPC requests when suspending the 
nfsd.
  
  It was reported via email that under certain heavy RPC loads
  long delays before the exports would be updated was observed
  when using "mountd -S". This patch reverses the priority between
  the exclusive lock request to suspend the nfsd threads and the
  shared lock request for performing RPCs.
  As such, when mountd attempts to suspend the nfsd threads, it
  gets priority over outstanding RPC requests to do this.
  I suspect that the case reported was an artificial test load,
  but this patch did fix the problem for the reporter.

Modified:
  stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
==
--- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.cFri May 20 01:19:30 2016
(r300254)
+++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.cFri May 20 01:25:14 2016
(r300255)
@@ -234,10 +234,16 @@ nfssvc_program(struct svc_req *rqst, SVC
 * Get a refcnt (shared lock) on nfsd_suspend_lock.
 * NFSSVC_SUSPENDNFSD will take an exclusive lock on
 * nfsd_suspend_lock to suspend these threads.
+* The call to nfsv4_lock() that preceeds nfsv4_getref()
+* ensures that the acquisition of the exclusive lock
+* takes priority over acquisition of the shared lock by
+* waiting for any exclusive lock request to complete.
 * This must be done here, before the check of
 * nfsv4root exports by nfsvno_v4rootexport().
 */
NFSLOCKV4ROOTMUTEX();
+   nfsv4_lock(_suspend_lock, 0, NULL, NFSV4ROOTLOCKMUTEXPTR,
+   NULL);
nfsv4_getref(_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR,
NULL);
NFSUNLOCKV4ROOTMUTEX();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300254 - stable/10/sys/fs/nfsserver

2016-05-19 Thread Rick Macklem
Author: rmacklem
Date: Fri May 20 01:19:30 2016
New Revision: 300254
URL: https://svnweb.freebsd.org/changeset/base/300254

Log:
  MFC: r299201
  Give mountd -S priority over outstanding RPC requests when suspending the 
nfsd.
  
  It was reported via email that under certain heavy RPC loads
  long delays before the exports would be updated was observed
  when using "mountd -S". This patch reverses the priority between
  the exclusive lock request to suspend the nfsd threads and the
  shared lock request for performing RPCs.
  As such, when mountd attempts to suspend the nfsd threads, it
  gets priority over outstanding RPC requests to do this.
  I suspect that the case reported was an artificial test load,
  but this patch did fix the problem for the reporter.

Modified:
  stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c   Fri May 20 01:17:38 2016
(r300253)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c   Fri May 20 01:19:30 2016
(r300254)
@@ -234,10 +234,16 @@ nfssvc_program(struct svc_req *rqst, SVC
 * Get a refcnt (shared lock) on nfsd_suspend_lock.
 * NFSSVC_SUSPENDNFSD will take an exclusive lock on
 * nfsd_suspend_lock to suspend these threads.
+* The call to nfsv4_lock() that preceeds nfsv4_getref()
+* ensures that the acquisition of the exclusive lock
+* takes priority over acquisition of the shared lock by
+* waiting for any exclusive lock request to complete.
 * This must be done here, before the check of
 * nfsv4root exports by nfsvno_v4rootexport().
 */
NFSLOCKV4ROOTMUTEX();
+   nfsv4_lock(_suspend_lock, 0, NULL, NFSV4ROOTLOCKMUTEXPTR,
+   NULL);
nfsv4_getref(_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR,
NULL);
NFSUNLOCKV4ROOTMUTEX();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300253 - in head: . share/man/man9 sys/sys

2016-05-19 Thread John Baldwin
Author: jhb
Date: Fri May 20 01:17:38 2016
New Revision: 300253
URL: https://svnweb.freebsd.org/changeset/base/300253

Log:
  Remove dangling references to rman_await_resource().
  
  This function was removed when RF_TIMESHARE was removed a couple of years
  ago.
  
  MFC after:3 days

Modified:
  head/ObsoleteFiles.inc
  head/share/man/man9/Makefile
  head/share/man/man9/rman.9
  head/sys/sys/rman.h

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri May 20 01:02:58 2016(r300252)
+++ head/ObsoleteFiles.inc  Fri May 20 01:17:38 2016(r300253)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20160519: stale MLINK removed
+OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz
 # 20160517: ReiserFS removed
 OLD_FILES+=usr/share/man/man5/reiserfs.5.gz
 # 20160430: kvm_getfiles(3) removed from kvm(3)

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileFri May 20 01:02:58 2016
(r300252)
+++ head/share/man/man9/MakefileFri May 20 01:17:38 2016
(r300253)
@@ -1373,7 +1373,6 @@ MLINKS+=resource_int_value.9 resource_lo
resource_int_value.9 resource_string_value.9
 MLINKS+=rman.9 rman_activate_resource.9 \
rman.9 rman_adjust_resource.9 \
-   rman.9 rman_await_resource.9 \
rman.9 rman_deactivate_resource.9 \
rman.9 rman_fini.9 \
rman.9 rman_first_free_region.9 \

Modified: head/share/man/man9/rman.9
==
--- head/share/man/man9/rman.9  Fri May 20 01:02:58 2016(r300252)
+++ head/share/man/man9/rman.9  Fri May 20 01:17:38 2016(r300253)
@@ -25,14 +25,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2014
+.Dd May 19, 2016
 .Dt RMAN 9
 .Os
 .Sh NAME
 .Nm rman ,
 .Nm rman_activate_resource ,
 .Nm rman_adjust_resource ,
-.Nm rman_await_resource ,
 .Nm rman_deactivate_resource ,
 .Nm rman_fini ,
 .Nm rman_init ,
@@ -67,8 +66,6 @@
 .Ft int
 .Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t 
end"
 .Ft int
-.Fn rman_await_resource "struct resource *r" "int pri2" "int timo"
-.Ft int
 .Fn rman_deactivate_resource "struct resource *r"
 .Ft int
 .Fn rman_fini "struct rman *rm"
@@ -387,23 +384,6 @@ flag.
 If other consumers are waiting for this range, it will wakeup their threads.
 .Pp
 The
-.Fn rman_await_resource
-function performs an asynchronous wait for a resource
-.Fa r
-to become inactive, that is, for the
-.Dv RF_ACTIVE
-flag to be cleared.
-It is used to enable cooperative sharing of a resource
-which can only be safely used by one thread at a time.
-The arguments
-.Fa pri
-and
-.Fa timo
-are passed to the
-.Fn rman_await_resource
-function.
-.Pp
-The
 .Fn rman_get_start ,
 .Fn rman_get_end ,
 .Fn rman_get_size ,

Modified: head/sys/sys/rman.h
==
--- head/sys/sys/rman.h Fri May 20 01:02:58 2016(r300252)
+++ head/sys/sys/rman.h Fri May 20 01:17:38 2016(r300253)
@@ -121,7 +121,6 @@ TAILQ_HEAD(rman_head, rman);
 
 intrman_activate_resource(struct resource *r);
 intrman_adjust_resource(struct resource *r, rman_res_t start, rman_res_t 
end);
-intrman_await_resource(struct resource *r, int pri, int timo);
 intrman_first_free_region(struct rman *rm, rman_res_t *start, rman_res_t 
*end);
 bus_space_handle_t rman_get_bushandle(struct resource *);
 bus_space_tag_t rman_get_bustag(struct resource *);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300252 - in head/sys/dev/bhnd: bcma soc

2016-05-19 Thread Adrian Chadd
Author: adrian
Date: Fri May 20 01:02:58 2016
New Revision: 300252
URL: https://svnweb.freebsd.org/changeset/base/300252

Log:
  [bhnd] Add BHND SoC support (only BCMA case)
  
  This patch introduces support of BHND on SoC: nexus-to-bhnd drivers.
  
  bhnd_soc is attached under nexus and responsible for all BHND-style calls
  from bhnd(4) bus to parents.
  
  bcma_nexus is bhnd(4) bus, attached to bhnd_soc and implement all
  nexus-style behaviour of BHND.
  
  Submitted by: Michael Zhilin 
  Reviewed by:  Landon Fuller 
  Differential Revision:https://reviews.freebsd.org/D6248

Added:
  head/sys/dev/bhnd/bcma/bcma_nexus.c   (contents, props changed)
  head/sys/dev/bhnd/soc/
  head/sys/dev/bhnd/soc/bhnd_soc.c   (contents, props changed)
  head/sys/dev/bhnd/soc/bhnd_soc.h   (contents, props changed)

Added: head/sys/dev/bhnd/bcma/bcma_nexus.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/bhnd/bcma/bcma_nexus.c Fri May 20 01:02:58 2016
(r300252)
@@ -0,0 +1,111 @@
+/*-
+ * Copyright (c) 2016 Michael Zhilin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *redistribution must be conditioned upon including a substantially
+ *similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "bhnd_bus_if.h"
+#include "bcmavar.h"
+#include "bcma_eromreg.h"
+
+#defineBCMA_NEXUS_EROM_RID 10
+
+static int
+bcma_nexus_probe(device_t dev)
+{
+   const struct bhnd_chipid *cid = 
BHND_BUS_GET_CHIPID(device_get_parent(dev), dev);
+
+   /* Check bus type */
+   if (cid->chip_type != BHND_CHIPTYPE_BCMA)
+   return (ENXIO);
+
+   /* Delegate to default probe implementation */
+   return (bcma_probe(dev));
+}
+
+static int
+bcma_nexus_attach(device_t dev)
+{
+   int  erom_rid;
+   int  error;
+   struct resource *erom_res;
+   const struct bhnd_chipid *cid = 
BHND_BUS_GET_CHIPID(device_get_parent(dev), dev);
+
+   erom_rid = BCMA_NEXUS_EROM_RID;
+   error = bus_set_resource(dev, SYS_RES_MEMORY, erom_rid, cid->enum_addr, 
BCMA_EROM_TABLE_SIZE);
+   if (error != 0) {
+   BHND_ERROR_DEV(dev, "failed to set EROM resource");
+   return (error);
+   }
+
+   /* Map the EROM resource and enumerate our children. */
+   BHND_DEBUG_DEV(dev, "erom enum address: %jx", cid->enum_addr);
+   erom_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, _rid, 
RF_ACTIVE);
+   if (erom_res == NULL) {
+   BHND_ERROR_DEV(dev, "failed to allocate EROM resource");
+   return (ENXIO);
+   }
+
+   BHND_DEBUG_DEV(dev, "erom scanning start address: %p", 
rman_get_virtual(erom_res));
+   error = bcma_add_children(dev, erom_res, BCMA_EROM_TABLE_START);
+
+   /* Clean up */
+   bus_release_resource(dev, SYS_RES_MEMORY, erom_rid, erom_res);
+   if (error)
+   return (error);
+
+   /* Call our superclass' implementation */
+   return (bcma_attach(dev));
+}
+
+static device_method_t bcma_nexus_methods[] = {
+   /* Device interface */
+   DEVMETHOD(device_probe, bcma_nexus_probe),
+   DEVMETHOD(device_attach,bcma_nexus_attach),
+   DEVMETHOD_END
+};
+
+DEFINE_CLASS_1(bhnd, bcma_nexus_driver, bcma_nexus_methods, sizeof(struct 
bcma_softc), bcma_driver);
+EARLY_DRIVER_MODULE(bcma_nexus, bhnd_soc, bcma_nexus_driver, bhnd_devclass,
+ 

svn commit: r300251 - head/sys/dev/bhnd/bhndb

2016-05-19 Thread Adrian Chadd
Author: adrian
Date: Fri May 20 00:49:10 2016
New Revision: 300251
URL: https://svnweb.freebsd.org/changeset/base/300251

Log:
  [bhnd] Add bhnd bridge support for bus_adjust_resource().
  
  Adds support for adjusting active bus resource allocations, limiting the
  range to the constraints of the register window within which the resource
  is mapped.
  
  This is the final set of bhnd changes required to support delegating
  ChipCommon's register space to child devices.
  
  Submitted by: Landon Fuller 
  Differential Revision:https://reviews.freebsd.org/D6470

Modified:
  head/sys/dev/bhnd/bhndb/bhndb.c
  head/sys/dev/bhnd/bhndb/bhndb_private.h
  head/sys/dev/bhnd/bhndb/bhndb_subr.c

Modified: head/sys/dev/bhnd/bhndb/bhndb.c
==
--- head/sys/dev/bhnd/bhndb/bhndb.c Fri May 20 00:45:16 2016
(r300250)
+++ head/sys/dev/bhnd/bhndb/bhndb.c Fri May 20 00:49:10 2016
(r300251)
@@ -1144,11 +1144,16 @@ bhndb_adjust_resource(device_t dev, devi
 {
struct bhndb_softc  *sc;
struct rman *rm;
+   rman_res_t   mstart, mend;
int  error;

sc = device_get_softc(dev);
error = 0;
 
+   /* Verify basic constraints */
+   if (end <= start)
+   return (EINVAL);
+
/* Fetch resource manager */
rm = bhndb_get_rman(sc, child, type);
if (rm == NULL)
@@ -1157,16 +1162,29 @@ bhndb_adjust_resource(device_t dev, devi
if (!rman_is_region_manager(r, rm))
return (ENXIO);
 
-   /* If active, adjustment is limited by the assigned window. */
BHNDB_LOCK(sc);
 
-   // TODO: Currently unsupported
-   error = ENODEV;
+   /* If not active, allow any range permitted by the resource manager */
+   if (!(rman_get_flags(r) & RF_ACTIVE))
+   goto done;
+
+   /* Otherwise, the range is limited to the existing register window
+* mapping */
+   error = bhndb_find_resource_limits(sc->bus_res, r, , );
+   if (error)
+   goto done;
 
-   BHNDB_UNLOCK(sc);
+   if (start < mstart || end > mend) {
+   error = EINVAL;
+   goto done;
+   }
+
+   /* Fall through */
+done:
if (!error)
error = rman_adjust_resource(r, start, end);
 
+   BHNDB_UNLOCK(sc);
return (error);
 }
 
@@ -1536,7 +1554,8 @@ bhndb_activate_bhnd_resource(device_t de
if (bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_BRIDGED) {
bhndb_priority_t r_prio;
 
-   region = bhndb_find_resource_region(sc->bus_res, r_start, 
r_size);
+   region = bhndb_find_resource_region(sc->bus_res, r_start,
+   r_size);
if (region != NULL)
r_prio = region->priority;
else

Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h
==
--- head/sys/dev/bhnd/bhndb/bhndb_private.h Fri May 20 00:45:16 2016
(r300250)
+++ head/sys/dev/bhnd/bhndb/bhndb_private.h Fri May 20 00:49:10 2016
(r300251)
@@ -71,6 +71,11 @@ int   bhndb_add_resource_region(
 bhndb_priority_t priority,
 const struct bhndb_regwin *static_regwin);
 
+int bhndb_find_resource_limits(
+struct bhndb_resources *br,
+struct resource *r, rman_res_t *start,
+rman_res_t *end);
+
 struct bhndb_region*bhndb_find_resource_region(
 struct bhndb_resources *br,
 bhnd_addr_t addr, bhnd_size_t size);
@@ -133,7 +138,7 @@ const struct bhndb_hw_priority  *bhndb_hw
  * Dynamic register window allocation reference.
  */
 struct bhndb_dw_rentry {
-   struct resource *dw_res;/**< child 
resource */
+   struct resource *dw_res;/**< child resource */
LIST_ENTRY(bhndb_dw_rentry)  dw_link;
 };
 

Modified: head/sys/dev/bhnd/bhndb/bhndb_subr.c
==
--- head/sys/dev/bhnd/bhndb/bhndb_subr.cFri May 20 00:45:16 2016
(r300250)
+++ head/sys/dev/bhnd/bhndb/bhndb_subr.cFri May 20 00:49:10 2016
(r300251)
@@ -563,8 +563,52 @@ bhndb_add_resource_region(struct bhndb_r
return (0);
 }
 
+
+/**
+ * Find the maximum start and end limits of the register window mapping
+ * resource @p r.
+ * 
+ * If the memory range is not mapped by an existing dynamic or static register
+ * window, ENOENT will be returned.
+ * 
+ * @param br 

svn commit: r300250 - in head/sys/dev/bhnd: . bhndb nvram tools

2016-05-19 Thread Adrian Chadd
Author: adrian
Date: Fri May 20 00:45:16 2016
New Revision: 300250
URL: https://svnweb.freebsd.org/changeset/base/300250

Log:
  [bhnd] Add remaining bus_(read|write|set)_(1|2|4) APIs
  
  This adds bhnd-compatible implementations of bus_(read|write|set)_(1|2|4) 
APIs,
  and upgrades the SPROM parsing code to use bhnd_bus_read_region_stream_2().
  
  This a precursor to bridge support for resource adjustment and the new
  ChipCommon bus support.
  
  Tested:
  
  * Tested against BCM4331
  * Kernel build verified via tinderbox.
  
  Submitted by: Landon Fuller 
  Differential Revision:https://reviews.freebsd.org/D6469

Modified:
  head/sys/dev/bhnd/bhnd.c
  head/sys/dev/bhnd/bhnd.h
  head/sys/dev/bhnd/bhnd_bus_if.m
  head/sys/dev/bhnd/bhndb/bhndb.c
  head/sys/dev/bhnd/nvram/bhnd_sprom.c
  head/sys/dev/bhnd/tools/bus_macro.sh

Modified: head/sys/dev/bhnd/bhnd.c
==
--- head/sys/dev/bhnd/bhnd.cFri May 20 00:03:22 2016(r300249)
+++ head/sys/dev/bhnd/bhnd.cFri May 20 00:45:16 2016(r300250)
@@ -529,36 +529,36 @@ bhnd_generic_resume_child(device_t dev, 
 /*
  * Delegate all indirect I/O to the parent device. When inherited by
  * non-bridged bus implementations, resources will never be marked as
- * indirect, and these methods should never be called.
+ * indirect, and these methods will never be called.
  */
-#defineBHND_IO_READ(_type, _name, _method) \
-static _type   \
-bhnd_read_ ## _name (device_t dev, device_t child, \
-struct bhnd_resource *r, bus_size_t offset)\
-{  \
-   return (BHND_BUS_READ_ ## _method(  \
-   device_get_parent(dev), child, r, offset)); \
+#defineBHND_IO_READ(_type, _name, _method) 
\
+static _type   \
+bhnd_read_ ## _name (device_t dev, device_t child, \
+struct bhnd_resource *r, bus_size_t offset)
\
+{  \
+   return (BHND_BUS_READ_ ## _method(  \
+   device_get_parent(dev), child, r, offset)); \
 }
 
-#defineBHND_IO_WRITE(_type, _name, _method)\
-static void\
-bhnd_write_ ## _name (device_t dev, device_t child,\
-struct bhnd_resource *r, bus_size_t offset, _type value)   \
-{  \
-   return (BHND_BUS_WRITE_ ## _method( \
-   device_get_parent(dev), child, r, offset,   \
+#defineBHND_IO_WRITE(_type, _name, _method)
\
+static void\
+bhnd_write_ ## _name (device_t dev, device_t child,\
+struct bhnd_resource *r, bus_size_t offset, _type value)   \
+{  \
+   return (BHND_BUS_WRITE_ ## _method( \
+   device_get_parent(dev), child, r, offset,   \
value));\
 }
 
-#defineBHND_IO_MULTI(_type, _rw, _name, _method)   
\
+#defineBHND_IO_MISC(_type, _op, _method)   
\
 static void\
-bhnd_ ## _rw ## _multi_ ## _name (device_t dev, device_t child,\
-struct bhnd_resource *r, bus_size_t offset, _type *datap,  \
+bhnd_ ## _op (device_t dev, device_t child,\
+struct bhnd_resource *r, bus_size_t offset, _type datap,   \
 bus_size_t count)  \
 {  \
BHND_BUS_ ## _method(device_get_parent(dev), child, r,  \
offset, datap, count);  \
-}
+}  
 
 #defineBHND_IO_METHODS(_type, _size)   
\
BHND_IO_READ(_type, _size, _size)   \
@@ -567,13 +567,28 @@ bhnd_ ## _rw ## _multi_ ## _name (device
BHND_IO_READ(_type, stream_ ## _size, STREAM_ ## _size) \
BHND_IO_WRITE(_type, stream_ ## _size, STREAM_ ## _size)\
\
-   BHND_IO_MULTI(_type, read, _size, READ_MULTI_ ## _size) \
-   BHND_IO_MULTI(_type, write, _size, WRITE_MULTI_ ## _size)   \
+   BHND_IO_MISC(_type*, read_multi_ ## _size,  

svn commit: r300249 - in head/sys/dev: acpica pccbb pci

2016-05-19 Thread John Baldwin
Author: jhb
Date: Fri May 20 00:03:22 2016
New Revision: 300249
URL: https://svnweb.freebsd.org/changeset/base/300249

Log:
  Implement a proper detach method for the PCI-PCI bridge driver.
  
  - Add a pcib_detach() function for the PCI-PCI bridge driver.  It
tears down the NEW_PCIB and hotplug state including destroying
resource managers, deleting child devices, and disabling hotplug
events.
  - Add a detach method to the ACPI PCI-PCI bridge driver which calls
pcib_detach() and then frees the copy of the _PRT interrupt routing
table.
  - Add a detach method to the PCI-Cardbus bridge driver which frees
the PCI bus resources in addition to calling cbb_detach().
  - Explicitly clear any pending hotplug events during attach to ensure
future events will generate an interrupt.
  - If a the Command Completed bit is set in the slot status register
when the command completion timeout fires, treat it as if the
command completed and the completion interrupt was just lost rather
than forcing a detach.
  - Don't wait for a Command Completed notification if Command Completion
interrupts are disabled.  The spec explicitly says no interrupt is
enabled when clearing CCIE, and on my T400 no interrupt is generated
when CCIE is changed from cleared to set, either.  In addition, the
T400 doesn't appear to set the Command Completed bit in the cases
where it doesn't generate an interrupt, so don't schedule the timer
either.  (If the CC bit were always set, one could always set the timer
and rely on the logic of treating CC set as a missed interrupt.)
  
  Reviewed by:  imp (older version)
  Differential Revision:https://reviews.freebsd.org/D6424

Modified:
  head/sys/dev/acpica/acpi_pcib_pci.c
  head/sys/dev/pccbb/pccbb_pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcib_private.h

Modified: head/sys/dev/acpica/acpi_pcib_pci.c
==
--- head/sys/dev/acpica/acpi_pcib_pci.c Thu May 19 23:31:00 2016
(r300248)
+++ head/sys/dev/acpica/acpi_pcib_pci.c Fri May 20 00:03:22 2016
(r300249)
@@ -66,6 +66,7 @@ struct acpi_pcib_lookup_info {
 
 static int acpi_pcib_pci_probe(device_t bus);
 static int acpi_pcib_pci_attach(device_t bus);
+static int acpi_pcib_pci_detach(device_t bus);
 static int acpi_pcib_read_ivar(device_t dev, device_t child,
int which, uintptr_t *result);
 static int acpi_pcib_pci_route_interrupt(device_t pcib,
@@ -75,6 +76,7 @@ static device_method_t acpi_pcib_pci_met
 /* Device interface */
 DEVMETHOD(device_probe,acpi_pcib_pci_probe),
 DEVMETHOD(device_attach,   acpi_pcib_pci_attach),
+DEVMETHOD(device_detach,   acpi_pcib_pci_detach),
 
 /* Bus interface */
 DEVMETHOD(bus_read_ivar,   acpi_pcib_read_ivar),
@@ -127,6 +129,21 @@ acpi_pcib_pci_attach(device_t dev)
 }
 
 static int
+acpi_pcib_pci_detach(device_t dev)
+{
+struct acpi_pcib_softc *sc;
+int error;
+
+ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
+
+sc = device_get_softc(dev);
+error = pcib_detach(dev);
+if (error == 0)
+   AcpiOsFree(sc->ap_prt.Pointer);
+return (error);
+}
+
+static int
 acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
 {
 struct acpi_pcib_softc *sc = device_get_softc(dev);

Modified: head/sys/dev/pccbb/pccbb_pci.c
==
--- head/sys/dev/pccbb/pccbb_pci.c  Thu May 19 23:31:00 2016
(r300248)
+++ head/sys/dev/pccbb/pccbb_pci.c  Fri May 20 00:03:22 2016
(r300249)
@@ -435,6 +435,22 @@ err:
return (ENOMEM);
 }
 
+static int
+cbb_pci_detach(device_t brdev)
+{
+#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+   struct cbb_softc *sc = device_get_softc(brdev);
+#endif
+   int error;
+
+   error = cbb_detach(brdev);
+#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+   if (error == 0)
+   pcib_free_secbus(brdev, >bus);
+#endif
+   return (error);
+}
+
 static void
 cbb_chipinit(struct cbb_softc *sc)
 {
@@ -917,7 +933,7 @@ static device_method_t cbb_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, cbb_pci_probe),
DEVMETHOD(device_attach,cbb_pci_attach),
-   DEVMETHOD(device_detach,cbb_detach),
+   DEVMETHOD(device_detach,cbb_pci_detach),
DEVMETHOD(device_shutdown,  cbb_pci_shutdown),
DEVMETHOD(device_suspend,   cbb_pci_suspend),
DEVMETHOD(device_resume,cbb_pci_resume),

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Thu May 19 23:31:00 2016(r300248)
+++ 

Re: svn commit: r300240 - head/sys/netinet

2016-05-19 Thread Don Lewis
On 19 May, Ngie Cooper wrote:
> On Thu, May 19, 2016 at 3:20 PM, Don Lewis  wrote:
>> Author: truckman
>> Date: Thu May 19 22:20:35 2016
>> New Revision: 300240
>> URL: https://svnweb.freebsd.org/changeset/base/300240
>>
>> Log:
>>   Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on
>>   control to a three way setting.
>> 0 - Totally disable ECN. (no change)
>> 1 - Enable ECN if incoming connections request it.  Outgoing
>> connections will request ECN.  (no change from present != 0 setting)
>> 2 - Enable ECN if incoming connections request it.  Outgoing
>> conections will not request ECN.
>>
>>   Change the default value of net.inet.tcp.ecn.enable from 0 to 2.
>>
>>   Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have
>>   similar capabilities.  The actual values above match Linux, and the default
>>   matches the current Linux default.
>>
>>   Reviewed by:  eadler
>>   MFC after:1 month
>>   MFH:  yes
>>   Sponsored by: https://reviews.freebsd.org/D6386
> 
> RelNotes: yes
>
> Also, does it make sense to merge this to head if it fundamentally
> changes behavior from what it was previously on the stable branch(es)?

grrh ... that was supposed to be "Relnotes: yes", not "MFH: yes".

I do think it makes sense to merge this to stable/10.  Linux has had ECN
enabled by default for quite some time, and OS X enabled ECN by default
last September.

The default setting of 2 is fairly safe.  If you receive an incoming
connection request that wants ECN, then that indicates that you are not
behind a broken middlebox that blocks ECN.

Requesting ECN by default on outgoing connections is more problematic.
If you are behind a broken middlebox, the you could have problems making
outgoing connections, though if you don't get a response after sending
net.inet.tcp.ecn.enable SYN packets, ECN will get disabled for that
connection request.

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


svn commit: r300248 - head/sys/dev/iwm

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 23:31:00 2016
New Revision: 300248
URL: https://svnweb.freebsd.org/changeset/base/300248

Log:
  iwm: add 'opt_wlan.h' include into source files.
  
  Include net80211 options file, so IEEE80211_DEBUG_REFCNT option will be
  handled correctly.

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_binding.c
  head/sys/dev/iwm/if_iwm_mac_ctxt.c
  head/sys/dev/iwm/if_iwm_pcie_trans.c
  head/sys/dev/iwm/if_iwm_phy_ctxt.c
  head/sys/dev/iwm/if_iwm_phy_db.c
  head/sys/dev/iwm/if_iwm_power.c
  head/sys/dev/iwm/if_iwm_scan.c
  head/sys/dev/iwm/if_iwm_time_event.c
  head/sys/dev/iwm/if_iwm_util.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Thu May 19 23:03:07 2016(r300247)
+++ head/sys/dev/iwm/if_iwm.c   Thu May 19 23:31:00 2016(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_binding.c
==
--- head/sys/dev/iwm/if_iwm_binding.c   Thu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_binding.c   Thu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c
==
--- head/sys/dev/iwm/if_iwm_mac_ctxt.c  Thu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_mac_ctxt.c  Thu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c
==
--- head/sys/dev/iwm/if_iwm_pcie_trans.cThu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_pcie_trans.cThu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_phy_ctxt.c
==
--- head/sys/dev/iwm/if_iwm_phy_ctxt.c  Thu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_phy_ctxt.c  Thu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_phy_db.c
==
--- head/sys/dev/iwm/if_iwm_phy_db.cThu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_phy_db.cThu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_power.c
==
--- head/sys/dev/iwm/if_iwm_power.c Thu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_power.c Thu May 19 23:31:00 2016
(r300248)
@@ -89,6 +89,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_scan.c
==
--- head/sys/dev/iwm/if_iwm_scan.c  Thu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_scan.c  Thu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_time_event.c
==
--- head/sys/dev/iwm/if_iwm_time_event.cThu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_time_event.cThu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 

Modified: head/sys/dev/iwm/if_iwm_util.c
==
--- head/sys/dev/iwm/if_iwm_util.c  Thu May 19 23:03:07 2016
(r300247)
+++ head/sys/dev/iwm/if_iwm_util.c  Thu May 19 23:31:00 2016
(r300248)
@@ -105,6 +105,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_wlan.h"
+
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300240 - head/sys/netinet

2016-05-19 Thread Ngie Cooper
On Thu, May 19, 2016 at 3:20 PM, Don Lewis  wrote:
> Author: truckman
> Date: Thu May 19 22:20:35 2016
> New Revision: 300240
> URL: https://svnweb.freebsd.org/changeset/base/300240
>
> Log:
>   Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on
>   control to a three way setting.
> 0 - Totally disable ECN. (no change)
> 1 - Enable ECN if incoming connections request it.  Outgoing
> connections will request ECN.  (no change from present != 0 setting)
> 2 - Enable ECN if incoming connections request it.  Outgoing
> conections will not request ECN.
>
>   Change the default value of net.inet.tcp.ecn.enable from 0 to 2.
>
>   Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have
>   similar capabilities.  The actual values above match Linux, and the default
>   matches the current Linux default.
>
>   Reviewed by:  eadler
>   MFC after:1 month
>   MFH:  yes
>   Sponsored by: https://reviews.freebsd.org/D6386

RelNotes: yes

Also, does it make sense to merge this to head if it fundamentally
changes behavior from what it was previously on the stable branch(es)?
Thanks,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300247 - head/share/man/man4

2016-05-19 Thread Don Lewis
Author: truckman
Date: Thu May 19 23:03:07 2016
New Revision: 300247
URL: https://svnweb.freebsd.org/changeset/base/300247

Log:
  Document new net.inet.tcp.ecn.enable sysctl settings.
  
  MFC after:1 month (with r300240)

Modified:
  head/share/man/man4/tcp.4

Modified: head/share/man/man4/tcp.4
==
--- head/share/man/man4/tcp.4   Thu May 19 23:00:30 2016(r300246)
+++ head/share/man/man4/tcp.4   Thu May 19 23:03:07 2016(r300247)
@@ -34,7 +34,7 @@
 .\" From: @(#)tcp.48.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd January 21, 2016
+.Dd May 19, 2016
 .Dt TCP 4
 .Os
 .Sh NAME
@@ -530,6 +530,17 @@ Defaults to 60 seconds.
 Enable support for TCP Explicit Congestion Notification (ECN).
 ECN allows a TCP sender to reduce the transmission rate in order to
 avoid packet drops.
+Settings:
+.Bl -tag -compact
+.It 0
+Disable ECN.
+.It 1
+Allow incoming connections to request ECN.
+Outgoing connections will request ECN.
+.It 2
+Allow incoming connections to request ECN.
+Outgoing connections will not request ECN.
+.El
 .It Va ecn.maxretries
 Number of retries (SYN or SYN/ACK retransmits) before disabling ECN on a
 specific connection.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 23:00:30 2016
New Revision: 300246
URL: https://svnweb.freebsd.org/changeset/base/300246

Log:
  ath: refactor/split getchannels() method.
  
  Split getchannels() method in ath_hal/ah_regdomain.c into a subset
  of functions for better readability.
  
  Note: due to different internal structure, it cannot use
  ieee80211_add_channel*() (however, some parts are done in a
  similar manner).
  
  Differential Revision:https://reviews.freebsd.org/D6139

Modified:
  head/sys/dev/ath/ath_hal/ah_regdomain.c
  head/sys/dev/ath/ath_hal/ah_regdomain.h

Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c
==
--- head/sys/dev/ath/ath_hal/ah_regdomain.c Thu May 19 22:56:00 2016
(r300245)
+++ head/sys/dev/ath/ath_hal/ah_regdomain.c Thu May 19 23:00:30 2016
(r300246)
@@ -35,7 +35,7 @@
  */
 
 /* used throughout this file... */
-#defineN(a)(sizeof (a) / sizeof (a[0]))
+#defineN(a)nitems(a)
 
 #define HAL_MODE_11A_TURBO HAL_MODE_108A
 #define HAL_MODE_11G_TURBO HAL_MODE_108G
@@ -99,30 +99,32 @@
 #include "ah_regdomain/ah_rd_domains.h"
 
 static const struct cmode modes[] = {
-   { HAL_MODE_TURBO,   IEEE80211_CHAN_ST },
-   { HAL_MODE_11A, IEEE80211_CHAN_A },
-   { HAL_MODE_11B, IEEE80211_CHAN_B },
-   { HAL_MODE_11G, IEEE80211_CHAN_G },
-   { HAL_MODE_11G_TURBO,   IEEE80211_CHAN_108G },
-   { HAL_MODE_11A_TURBO,   IEEE80211_CHAN_108A },
+   { HAL_MODE_TURBO,   IEEE80211_CHAN_ST,  [0] 
},
+   { HAL_MODE_11A, IEEE80211_CHAN_A,   [0] },
+   { HAL_MODE_11B, IEEE80211_CHAN_B,   [0] },
+   { HAL_MODE_11G, IEEE80211_CHAN_G,   [0] },
+   { HAL_MODE_11G_TURBO,   IEEE80211_CHAN_108G,
[0] },
+   { HAL_MODE_11A_TURBO,   IEEE80211_CHAN_108A,[0] 
},
{ HAL_MODE_11A_QUARTER_RATE,
- IEEE80211_CHAN_A | IEEE80211_CHAN_QUARTER },
+ IEEE80211_CHAN_A | IEEE80211_CHAN_QUARTER,[0] },
{ HAL_MODE_11A_HALF_RATE,
- IEEE80211_CHAN_A | IEEE80211_CHAN_HALF },
+ IEEE80211_CHAN_A | IEEE80211_CHAN_HALF,   [0] },
{ HAL_MODE_11G_QUARTER_RATE,
- IEEE80211_CHAN_G | IEEE80211_CHAN_QUARTER },
+ IEEE80211_CHAN_G | IEEE80211_CHAN_QUARTER,[0] },
{ HAL_MODE_11G_HALF_RATE,
- IEEE80211_CHAN_G | IEEE80211_CHAN_HALF },
-   { HAL_MODE_11NG_HT20,   IEEE80211_CHAN_G | IEEE80211_CHAN_HT20 },
+ IEEE80211_CHAN_G | IEEE80211_CHAN_HALF,   [0] },
+   { HAL_MODE_11NG_HT20,
+ IEEE80211_CHAN_G | IEEE80211_CHAN_HT20,   [0] },
{ HAL_MODE_11NG_HT40PLUS,
- IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U },
+ IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U,  [0] },
{ HAL_MODE_11NG_HT40MINUS,
- IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D },
-   { HAL_MODE_11NA_HT20,   IEEE80211_CHAN_A | IEEE80211_CHAN_HT20 },
+ IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D,  [0] },
+   { HAL_MODE_11NA_HT20,
+ IEEE80211_CHAN_A | IEEE80211_CHAN_HT20,   [0] },
{ HAL_MODE_11NA_HT40PLUS,
- IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U },
+ IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U,  [0] },
{ HAL_MODE_11NA_HT40MINUS,
- IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D },
+ IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D,  [0] },
 };
 
 static void ath_hal_update_dfsdomain(struct ath_hal *ah);
@@ -358,6 +360,234 @@ getregstate(struct ath_hal *ah, HAL_CTRY
return HAL_OK;
 }
 
+static uint64_t *
+getchannelBM(u_int mode, REG_DOMAIN *rd)
+{
+   switch (mode) {
+   case HAL_MODE_11B:
+   return (rd->chan11b);
+   case HAL_MODE_11G_QUARTER_RATE:
+   return (rd->chan11g_quarter);
+   case HAL_MODE_11G_HALF_RATE:
+   return (rd->chan11g_half);
+   case HAL_MODE_11G:
+   case HAL_MODE_11NG_HT20:
+   case HAL_MODE_11NG_HT40PLUS:
+   case HAL_MODE_11NG_HT40MINUS:
+   return (rd->chan11g);
+   case HAL_MODE_11G_TURBO:
+   return (rd->chan11g_turbo);
+   case HAL_MODE_11A_QUARTER_RATE:
+   return (rd->chan11a_quarter);
+   case HAL_MODE_11A_HALF_RATE:
+   return (rd->chan11a_half);
+   case HAL_MODE_11A:
+   case HAL_MODE_11NA_HT20:
+   case HAL_MODE_11NA_HT40PLUS:
+   case HAL_MODE_11NA_HT40MINUS:
+   return (rd->chan11a);
+   case HAL_MODE_TURBO:
+   return (rd->chan11a_turbo);
+   case HAL_MODE_11A_TURBO:
+   return (rd->chan11a_dyn_turbo);
+   default:
+   return (AH_NULL);
+   }
+}
+
+static void
+setchannelflags(struct ieee80211_channel *c, REG_DMN_FREQ_BAND *fband,
+REG_DOMAIN *rd)
+{
+   if (fband->usePassScan & rd->pscan)
+   c->ic_flags |= IEEE80211_CHAN_PASSIVE;
+   if 

Re: svn commit: r300226 - in head: cddl/contrib/dtracetoolkit cddl/usr.sbin cddl/usr.sbin/dtruss share/dtrace share/dtrace/toolkit

2016-05-19 Thread Ngie Cooper
On Thu, May 19, 2016 at 12:51 PM, George V. Neville-Neil
 wrote:
> Author: gnn
> Date: Thu May 19 19:51:39 2016
> New Revision: 300226
> URL: https://svnweb.freebsd.org/changeset/base/300226
>
> Log:
>   Remove the old version of the DTraceToolkit from the source tree.
>   The DTraceToolkit is part of the Open DTrace effort and is supported
>   on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated
>   to properly track toolkit development upstream.
>
>   Sponsored by: DARPA, AFRL

Add the files to ObsoleteFiles.inc?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300244 - stable/9/share/mk

2016-05-19 Thread Bryan Drewery
Author: bdrewery
Date: Thu May 19 22:54:24 2016
New Revision: 300244
URL: https://svnweb.freebsd.org/changeset/base/300244

Log:
  MFS r300243:
  
Follow-up r300233: Don't override MK_* from env as head does.
  
  PR:   D6271

Modified:
  stable/9/share/mk/bsd.own.mk
Directory Properties:
  stable/9/share/mk/   (props changed)

Modified: stable/9/share/mk/bsd.own.mk
==
--- stable/9/share/mk/bsd.own.mkThu May 19 22:53:44 2016
(r300243)
+++ stable/9/share/mk/bsd.own.mkThu May 19 22:54:24 2016
(r300244)
@@ -504,6 +504,7 @@ __DEFAULT_NO_OPTIONS+=FDT
 # MK_* options which default to "yes".
 #
 .for var in ${__DEFAULT_YES_OPTIONS}
+.if !defined(MK_${var})
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
@@ -512,6 +513,7 @@ MK_${var}:= no
 .else
 MK_${var}:=yes
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_YES_OPTIONS
 
@@ -519,6 +521,7 @@ MK_${var}:= yes
 # MK_* options which default to "no".
 #
 .for var in ${__DEFAULT_NO_OPTIONS}
+.if !defined(MK_${var})
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
@@ -527,6 +530,7 @@ MK_${var}:= yes
 .else
 MK_${var}:=no
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_NO_OPTIONS
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300243 - stable/10/share/mk

2016-05-19 Thread Bryan Drewery
Author: bdrewery
Date: Thu May 19 22:53:44 2016
New Revision: 300243
URL: https://svnweb.freebsd.org/changeset/base/300243

Log:
  Follow-up r300233: Don't override MK_* from env as head does.
  
  PR:   D6271
  Sponsored by: EMC / Isilon Storage Division

Modified:
  stable/10/share/mk/bsd.own.mk

Modified: stable/10/share/mk/bsd.own.mk
==
--- stable/10/share/mk/bsd.own.mk   Thu May 19 22:43:21 2016
(r300242)
+++ stable/10/share/mk/bsd.own.mk   Thu May 19 22:53:44 2016
(r300243)
@@ -480,6 +480,7 @@ __DEFAULT_NO_OPTIONS+=HYPERV
 # MK_* options which default to "yes".
 #
 .for var in ${__DEFAULT_YES_OPTIONS}
+.if !defined(MK_${var})
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
@@ -488,6 +489,7 @@ MK_${var}:= no
 .else
 MK_${var}:=yes
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_YES_OPTIONS
 
@@ -495,6 +497,7 @@ MK_${var}:= yes
 # MK_* options which default to "no".
 #
 .for var in ${__DEFAULT_NO_OPTIONS}
+.if !defined(MK_${var})
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
@@ -503,6 +506,7 @@ MK_${var}:= yes
 .else
 MK_${var}:=no
 .endif
+.endif # !defined(MK_${var})
 .endfor
 .undef __DEFAULT_NO_OPTIONS
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300242 - head/sys/dev/iwm

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 22:43:21 2016
New Revision: 300242
URL: https://svnweb.freebsd.org/changeset/base/300242

Log:
  iwm: restart device after watchdog timeouts.

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Thu May 19 22:28:46 2016(r300241)
+++ head/sys/dev/iwm/if_iwm.c   Thu May 19 22:43:21 2016(r300242)
@@ -3836,6 +3836,7 @@ static void
 iwm_watchdog(void *arg)
 {
struct iwm_softc *sc = arg;
+   struct ieee80211com *ic = >sc_ic;
 
if (sc->sc_tx_timer > 0) {
if (--sc->sc_tx_timer == 0) {
@@ -3843,8 +3844,8 @@ iwm_watchdog(void *arg)
 #ifdef IWM_DEBUG
iwm_nic_error(sc);
 #endif
-   iwm_stop(sc);
-   counter_u64_add(sc->sc_ic.ic_oerrors, 1);
+   ieee80211_restart_all(ic);
+   counter_u64_add(ic->ic_oerrors, 1);
return;
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300241 - head/sys/dev/mwl

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 22:28:46 2016
New Revision: 300241
URL: https://svnweb.freebsd.org/changeset/base/300241

Log:
  mwl: switch to ieee80211_add_channel*().

Modified:
  head/sys/dev/mwl/if_mwl.c

Modified: head/sys/dev/mwl/if_mwl.c
==
--- head/sys/dev/mwl/if_mwl.c   Thu May 19 22:20:35 2016(r300240)
+++ head/sys/dev/mwl/if_mwl.c   Thu May 19 22:28:46 2016(r300241)
@@ -4384,113 +4384,33 @@ mwl_setregdomain(struct ieee80211com *ic
 #defineIEEE80211_CHAN_HTA  (IEEE80211_CHAN_HT|IEEE80211_CHAN_A)
 
 static void
-addchan(struct ieee80211_channel *c, int freq, int flags, int ieee, int txpow)
-{
-   c->ic_freq = freq;
-   c->ic_flags = flags;
-   c->ic_ieee = ieee;
-   c->ic_minpower = 0;
-   c->ic_maxpower = 2*txpow;
-   c->ic_maxregpower = txpow;
-}
-
-static const struct ieee80211_channel *
-findchannel(const struct ieee80211_channel chans[], int nchans,
-   int freq, int flags)
-{
-   const struct ieee80211_channel *c;
-   int i;
-
-   for (i = 0; i < nchans; i++) {
-   c = [i];
-   if (c->ic_freq == freq && c->ic_flags == flags)
-   return c;
-   }
-   return NULL;
-}
-
-static void
 addht40channels(struct ieee80211_channel chans[], int maxchans, int *nchans,
const MWL_HAL_CHANNELINFO *ci, int flags)
 {
-   struct ieee80211_channel *c;
-   const struct ieee80211_channel *extc;
-   const struct mwl_hal_channel *hc;
-   int i;
+   int i, error;
 
-   c = [*nchans];
-
-   flags &= ~IEEE80211_CHAN_HT;
for (i = 0; i < ci->nchannels; i++) {
-   /*
-* Each entry defines an HT40 channel pair; find the
-* extension channel above and the insert the pair.
-*/
-   hc = >channels[i];
-   extc = findchannel(chans, *nchans, hc->freq+20,
-   flags | IEEE80211_CHAN_HT20);
-   if (extc != NULL) {
-   if (*nchans >= maxchans)
-   break;
-   addchan(c, hc->freq, flags | IEEE80211_CHAN_HT40U,
-   hc->ieee, hc->maxTxPow);
-   c->ic_extieee = extc->ic_ieee;
-   c++, (*nchans)++;
-   if (*nchans >= maxchans)
-   break;
-   addchan(c, extc->ic_freq, flags | IEEE80211_CHAN_HT40D,
-   extc->ic_ieee, hc->maxTxPow);
-   c->ic_extieee = hc->ieee;
-   c++, (*nchans)++;
-   }
+   const struct mwl_hal_channel *hc = >channels[i];
+
+   error = ieee80211_add_channel_ht40(chans, maxchans, nchans,
+   hc->ieee, hc->maxTxPow, flags);
+   if (error != 0 && error != ENOENT)
+   break;
}
 }
 
 static void
 addchannels(struct ieee80211_channel chans[], int maxchans, int *nchans,
-   const MWL_HAL_CHANNELINFO *ci, int flags)
+   const MWL_HAL_CHANNELINFO *ci, const uint8_t bands[])
 {
-   struct ieee80211_channel *c;
-   int i;
-
-   c = [*nchans];
+   int i, error;
 
-   for (i = 0; i < ci->nchannels; i++) {
-   const struct mwl_hal_channel *hc;
+   error = 0;
+   for (i = 0; i < ci->nchannels && error == 0; i++) {
+   const struct mwl_hal_channel *hc = >channels[i];
 
-   hc = >channels[i];
-   if (*nchans >= maxchans)
-   break;
-   addchan(c, hc->freq, flags, hc->ieee, hc->maxTxPow);
-   c++, (*nchans)++;
-   if (flags == IEEE80211_CHAN_G || flags == IEEE80211_CHAN_HTG) {
-   /* g channel have a separate b-only entry */
-   if (*nchans >= maxchans)
-   break;
-   c[0] = c[-1];
-   c[-1].ic_flags = IEEE80211_CHAN_B;
-   c++, (*nchans)++;
-   }
-   if (flags == IEEE80211_CHAN_HTG) {
-   /* HT g channel have a separate g-only entry */
-   if (*nchans >= maxchans)
-   break;
-   c[-1].ic_flags = IEEE80211_CHAN_G;
-   c[0] = c[-1];
-   c[0].ic_flags &= ~IEEE80211_CHAN_HT;
-   c[0].ic_flags |= IEEE80211_CHAN_HT20;   /* HT20 */
-   c++, (*nchans)++;
-   }
-   if (flags == IEEE80211_CHAN_HTA) {
-   /* HT a channel have a separate a-only entry */
-   if (*nchans >= maxchans)
-   break;
-   c[-1].ic_flags = IEEE80211_CHAN_A;
-   c[0] = c[-1];
-   

svn commit: r300240 - head/sys/netinet

2016-05-19 Thread Don Lewis
Author: truckman
Date: Thu May 19 22:20:35 2016
New Revision: 300240
URL: https://svnweb.freebsd.org/changeset/base/300240

Log:
  Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on
  control to a three way setting.
0 - Totally disable ECN. (no change)
1 - Enable ECN if incoming connections request it.  Outgoing
connections will request ECN.  (no change from present != 0 setting)
2 - Enable ECN if incoming connections request it.  Outgoing
conections will not request ECN.
  
  Change the default value of net.inet.tcp.ecn.enable from 0 to 2.
  
  Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have
  similar capabilities.  The actual values above match Linux, and the default
  matches the current Linux default.
  
  Reviewed by:  eadler
  MFC after:1 month
  MFH:  yes
  Sponsored by: https://reviews.freebsd.org/D6386

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu May 19 22:19:35 2016
(r300239)
+++ head/sys/netinet/tcp_input.cThu May 19 22:20:35 2016
(r300240)
@@ -185,7 +185,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, abc_
 
 static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN");
 
-VNET_DEFINE(int, tcp_do_ecn) = 0;
+VNET_DEFINE(int, tcp_do_ecn) = 2;
 SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW,
 _NAME(tcp_do_ecn), 0,
 "TCP ECN support");

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu May 19 22:19:35 2016
(r300239)
+++ head/sys/netinet/tcp_output.c   Thu May 19 22:20:35 2016
(r300240)
@@ -1117,7 +1117,7 @@ send:
 * resend those bits a number of times as per
 * RFC 3168.
 */
-   if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn) {
+   if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn == 1) {
if (tp->t_rxtshift >= 1) {
if (tp->t_rxtshift <= V_tcp_ecn_maxretries)
flags |= TH_ECE|TH_CWR;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300239 - head/sys/dev/ipw

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 22:19:35 2016
New Revision: 300239
URL: https://svnweb.freebsd.org/changeset/base/300239

Log:
  ipw: switch to ieee80211_add_channel()
  
  - Convert to ieee80211_add_channel().
  - Add ic_getradiocaps() method.
  
  Differential Revision:https://reviews.freebsd.org/D6236

Modified:
  head/sys/dev/ipw/if_ipw.c
  head/sys/dev/ipw/if_ipwvar.h

Modified: head/sys/dev/ipw/if_ipw.c
==
--- head/sys/dev/ipw/if_ipw.c   Thu May 19 22:14:35 2016(r300238)
+++ head/sys/dev/ipw/if_ipw.c   Thu May 19 22:19:35 2016(r300239)
@@ -116,6 +116,7 @@ static void ipw_release(struct ipw_softc
 static voidipw_media_status(struct ifnet *, struct ifmediareq *);
 static int ipw_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static uint16_tipw_read_prom_word(struct ipw_softc *, uint8_t);
+static uint16_tipw_read_chanmask(struct ipw_softc *);
 static voidipw_rx_cmd_intr(struct ipw_softc *, struct ipw_soft_buf *);
 static voidipw_rx_newstate_intr(struct ipw_softc *, struct ipw_soft_buf *);
 static voidipw_rx_data_intr(struct ipw_softc *, struct ipw_status *,
@@ -164,6 +165,8 @@ static void ipw_write_mem_1(struct ipw_s
 static int ipw_scan(struct ipw_softc *);
 static voidipw_scan_start(struct ieee80211com *);
 static voidipw_scan_end(struct ieee80211com *);
+static voidipw_getradiocaps(struct ieee80211com *, int, int *,
+   struct ieee80211_channel[]);
 static voidipw_set_channel(struct ieee80211com *);
 static voidipw_scan_curchan(struct ieee80211_scan_state *,
unsigned long maxdwell);
@@ -221,7 +224,6 @@ ipw_attach(device_t dev)
 {
struct ipw_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = >sc_ic;
-   struct ieee80211_channel *c;
uint16_t val;
int error, i;
 
@@ -292,18 +294,9 @@ ipw_attach(device_t dev)
ic->ic_macaddr[4] = val >> 8;
ic->ic_macaddr[5] = val & 0xff;
 
-   /* set supported .11b channels (read from EEPROM) */
-   if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0)
-   val = 0x7ff; /* default to channels 1-11 */
-   val <<= 1;
-   for (i = 1; i < 16; i++) {
-   if (val & (1 << i)) {
-   c = >ic_channels[ic->ic_nchans++];
-   c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ);
-   c->ic_flags = IEEE80211_CHAN_B;
-   c->ic_ieee = i;
-   }
-   }
+   sc->chanmask = ipw_read_chanmask(sc);
+   ipw_getradiocaps(ic, IEEE80211_CHAN_MAX, >ic_nchans,
+   ic->ic_channels);
 
/* check support for radio transmitter switch in EEPROM */
if (!(ipw_read_prom_word(sc, IPW_EEPROM_RADIO) & 8))
@@ -312,6 +305,7 @@ ipw_attach(device_t dev)
ieee80211_ifattach(ic);
ic->ic_scan_start = ipw_scan_start;
ic->ic_scan_end = ipw_scan_end;
+   ic->ic_getradiocaps = ipw_getradiocaps;
ic->ic_set_channel = ipw_set_channel;
ic->ic_scan_curchan = ipw_scan_curchan;
ic->ic_scan_mindwell = ipw_scan_mindwell;
@@ -966,6 +960,19 @@ ipw_read_prom_word(struct ipw_softc *sc,
return le16toh(val);
 }
 
+static uint16_t
+ipw_read_chanmask(struct ipw_softc *sc)
+{
+   uint16_t val;
+
+   /* set supported .11b channels (read from EEPROM) */
+   if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0)
+   val = 0x7ff;/* default to channels 1-11 */
+   val <<= 1;
+
+   return (val);
+}
+
 static void
 ipw_rx_cmd_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf)
 {
@@ -2616,6 +2623,26 @@ ipw_scan_start(struct ieee80211com *ic)
 }
 
 static void
+ipw_getradiocaps(struct ieee80211com *ic,
+int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+   struct ipw_softc *sc = ic->ic_softc;
+   uint8_t bands[IEEE80211_MODE_BYTES];
+   int i;
+
+   memset(bands, 0, sizeof(bands));
+   setbit(bands, IEEE80211_MODE_11B);
+
+   for (i = 1; i < 16; i++) {
+   if (sc->chanmask & (1 << i)) {
+   ieee80211_add_channel(chans, maxchans, nchans,
+   i, 0, 0, 0, bands);
+   }
+   }
+
+}
+
+static void
 ipw_set_channel(struct ieee80211com *ic)
 {
struct ipw_softc *sc = ic->ic_softc;

Modified: head/sys/dev/ipw/if_ipwvar.h
==
--- head/sys/dev/ipw/if_ipwvar.hThu May 19 22:14:35 2016
(r300238)
+++ head/sys/dev/ipw/if_ipwvar.hThu May 19 22:19:35 2016
(r300239)
@@ -157,6 +157,8 @@ struct ipw_softc {
uint32_trxcur;
int txfree;
 
+   uint16_tchanmask;
+
struct ipw_rx_radiotap_header   

svn commit: r300238 - head/sys/dev/wi

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 22:14:35 2016
New Revision: 300238
URL: https://svnweb.freebsd.org/changeset/base/300238

Log:
  wi: switch to ieee80211_add_channel()
  
  - Convert to ieee80211_add_channel().
  - Add ic_getradiocaps() method.
  
  Differential Revision:https://reviews.freebsd.org/D6235

Modified:
  head/sys/dev/wi/if_wi.c
  head/sys/dev/wi/if_wivar.h

Modified: head/sys/dev/wi/if_wi.c
==
--- head/sys/dev/wi/if_wi.c Thu May 19 22:02:03 2016(r300237)
+++ head/sys/dev/wi/if_wi.c Thu May 19 22:14:35 2016(r300238)
@@ -155,9 +155,12 @@ static int  wi_mwrite_bap(struct wi_soft
 static int  wi_read_rid(struct wi_softc *, int, void *, int *);
 static int  wi_write_rid(struct wi_softc *, int, const void *, int);
 static int  wi_write_appie(struct wi_softc *, int, const struct 
ieee80211_appie *);
+static u_int16_t wi_read_chanmask(struct wi_softc *);
 
 static void wi_scan_start(struct ieee80211com *);
 static void wi_scan_end(struct ieee80211com *);
+static void wi_getradiocaps(struct ieee80211com *, int, int *,
+   struct ieee80211_channel[]);
 static void wi_set_channel(struct ieee80211com *);

 static __inline int
@@ -335,23 +338,9 @@ wi_attach(device_t dev)
 * Query the card for available channels and setup the
 * channel table.  We assume these are all 11b channels.
 */
-   buflen = sizeof(val);
-   if (wi_read_rid(sc, WI_RID_CHANNEL_LIST, , ) != 0)
-   val = htole16(0x1fff);  /* assume 1-13 */
-   KASSERT(val != 0, ("wi_attach: no available channels listed!"));
-
-   val <<= 1;  /* shift for base 1 indices */
-   for (i = 1; i < 16; i++) {
-   struct ieee80211_channel *c;
-
-   if (!isset((u_int8_t*), i))
-   continue;
-   c = >ic_channels[ic->ic_nchans++];
-   c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_B);
-   c->ic_flags = IEEE80211_CHAN_B;
-   c->ic_ieee = i;
-   /* XXX txpowers? */
-   }
+   sc->sc_chanmask = wi_read_chanmask(sc);
+   wi_getradiocaps(ic, IEEE80211_CHAN_MAX, >ic_nchans,
+   ic->ic_channels);
 
/*
 * Set flags based on firmware version.
@@ -439,6 +428,7 @@ wi_attach(device_t dev)
ic->ic_raw_xmit = wi_raw_xmit;
ic->ic_scan_start = wi_scan_start;
ic->ic_scan_end = wi_scan_end;
+   ic->ic_getradiocaps = wi_getradiocaps;
ic->ic_set_channel = wi_set_channel;
ic->ic_vap_create = wi_vap_create;
ic->ic_vap_delete = wi_vap_delete;
@@ -697,6 +687,26 @@ wi_stop(struct wi_softc *sc, int disable
 }
 
 static void
+wi_getradiocaps(struct ieee80211com *ic,
+int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+   struct wi_softc *sc = ic->ic_softc;
+   u_int8_t bands[IEEE80211_MODE_MAX];
+   int i;
+
+   memset(bands, 0, sizeof(bands));
+   setbit(bands, IEEE80211_MODE_11B);
+
+   for (i = 1; i < 16; i++) {
+   if (sc->sc_chanmask & (1 << i)) {
+   /* XXX txpowers? */
+   ieee80211_add_channel(chans, maxchans, nchans,
+   i, 0, 0, 0, bands);
+   }
+   }
+}
+
+static void
 wi_set_channel(struct ieee80211com *ic)
 {
struct wi_softc *sc = ic->ic_softc;
@@ -1988,6 +1998,22 @@ wi_write_appie(struct wi_softc *sc, int 
return wi_write_rid(sc, rid, buf, ie->ie_len + sizeof(uint16_t));
 }
 
+static u_int16_t
+wi_read_chanmask(struct wi_softc *sc)
+{
+   u_int16_t val;
+   int buflen;
+
+   buflen = sizeof(val);
+   if (wi_read_rid(sc, WI_RID_CHANNEL_LIST, , ) != 0)
+   val = htole16(0x1fff);  /* assume 1-13 */
+   KASSERT(val != 0, ("%s: no available channels listed!", __func__));
+
+   val <<= 1;  /* shift for base 1 indices */
+
+   return (val);
+}
+
 int
 wi_alloc(device_t dev, int rid)
 {

Modified: head/sys/dev/wi/if_wivar.h
==
--- head/sys/dev/wi/if_wivar.h  Thu May 19 22:02:03 2016(r300237)
+++ head/sys/dev/wi/if_wivar.h  Thu May 19 22:14:35 2016(r300238)
@@ -114,6 +114,7 @@ struct wi_softc {
u_int16_t   sc_portnum;
u_int16_t   sc_encryption;
u_int16_t   sc_monitor_port;
+   u_int16_t   sc_chanmask;
 
/* RSSI interpretation */
u_int16_t   sc_min_rssi;/* clamp sc_min_rssi < RSSI */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300237 - head/sys/net80211

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 22:02:03 2016
New Revision: 300237
URL: https://svnweb.freebsd.org/changeset/base/300237

Log:
  net80211: restore interface state check for IEEE80211_IOC_SCAN_REQ ioctl.
  
  Do not try to start a scan when interface is not running.
  
  How-to-reproduce:
  1) ifconfig wlan0 create wlandev urtwn0
  2) wlandebug -i wlan0 state
  3) ifconfig wlan0 scan

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==
--- head/sys/net80211/ieee80211_ioctl.c Thu May 19 21:47:57 2016
(r300236)
+++ head/sys/net80211/ieee80211_ioctl.c Thu May 19 22:02:03 2016
(r300237)
@@ -2486,6 +2486,11 @@ ieee80211_scanreq(struct ieee80211vap *v
 * Otherwise just invoke the scan machinery directly.
 */
IEEE80211_LOCK(ic);
+   if (ic->ic_nrunning == 0) {
+   IEEE80211_UNLOCK(ic);
+   return ENXIO;
+   }
+
if (vap->iv_state == IEEE80211_S_INIT) {
/* NB: clobbers previous settings */
vap->iv_scanreq_flags = sr->sr_flags;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300236 - stable/9/sys/sys

2016-05-19 Thread Bryan Drewery
Author: bdrewery
Date: Thu May 19 21:47:57 2016
New Revision: 300236
URL: https://svnweb.freebsd.org/changeset/base/300236

Log:
  Bump version for r300234

Modified:
  stable/9/sys/sys/param.h

Modified: stable/9/sys/sys/param.h
==
--- stable/9/sys/sys/param.hThu May 19 21:47:32 2016(r300235)
+++ stable/9/sys/sys/param.hThu May 19 21:47:57 2016(r300236)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 903509   /* Master, propagated to newvers */
+#define __FreeBSD_version 903510   /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300235 - stable/10/sys/sys

2016-05-19 Thread Bryan Drewery
Author: bdrewery
Date: Thu May 19 21:47:32 2016
New Revision: 300235
URL: https://svnweb.freebsd.org/changeset/base/300235

Log:
  Bump version for r300233

Modified:
  stable/10/sys/sys/param.h

Modified: stable/10/sys/sys/param.h
==
--- stable/10/sys/sys/param.h   Thu May 19 21:44:33 2016(r300234)
+++ stable/10/sys/sys/param.h   Thu May 19 21:47:32 2016(r300235)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1003502  /* Master, propagated to newvers */
+#define __FreeBSD_version 1003503  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300234 - stable/9/share/mk

2016-05-19 Thread Bryan Drewery
Author: bdrewery
Date: Thu May 19 21:44:33 2016
New Revision: 300234
URL: https://svnweb.freebsd.org/changeset/base/300234

Log:
  MFS r300233:
  
Allow MK_ overrides
  
  PR:   D6271

Modified:
  stable/9/share/mk/bsd.own.mk
Directory Properties:
  stable/9/share/mk/   (props changed)

Modified: stable/9/share/mk/bsd.own.mk
==
--- stable/9/share/mk/bsd.own.mkThu May 19 21:41:35 2016
(r300233)
+++ stable/9/share/mk/bsd.own.mkThu May 19 21:44:33 2016
(r300234)
@@ -507,9 +507,6 @@ __DEFAULT_NO_OPTIONS+=FDT
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
-.if defined(MK_${var})
-.error MK_${var} can't be set by a user.
-.endif
 .if defined(WITHOUT_${var})
 MK_${var}:=no
 .else
@@ -525,9 +522,6 @@ MK_${var}:= yes
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
-.if defined(MK_${var})
-.error MK_${var} can't be set by a user.
-.endif
 .if defined(WITH_${var})
 MK_${var}:=yes
 .else
@@ -645,9 +639,6 @@ MK_CLANG_IS_CC:= no
 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
 .endif
-.if defined(MK_${var}_SUPPORT)
-.error MK_${var}_SUPPORT can't be set by a user.
-.endif
 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
 MK_${var}_SUPPORT:= no
 .else
@@ -664,9 +655,6 @@ MK_${var}_SUPPORT:= yes
 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
 .endif
-.if defined(MK_${vv:H})
-.error MK_${vv:H} can't be set by a user.
-.endif
 .if defined(WITH_${vv:H})
 MK_${vv:H}:=   yes
 .elif defined(WITHOUT_${vv:H})
@@ -685,9 +673,6 @@ MK_${vv:H}:=${MK_${vv:T}}
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
-.if defined(MK_${var})
-.error MK_${var} can't be set by a user.
-.endif
 .if ${COMPILER_FEATURES:Mc++11}
 .if defined(WITHOUT_${var})
 MK_${var}:=no
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300233 - stable/10/share/mk

2016-05-19 Thread Bryan Drewery
Author: bdrewery
Date: Thu May 19 21:41:35 2016
New Revision: 300233
URL: https://svnweb.freebsd.org/changeset/base/300233

Log:
  Allow MK_ overrides.
  
  This is a direct commit to stable.
  
  This was done in head in r264661 and is needed to force certain options off
  for ports.
  
  PR:   D6271
  Sponsored by: EMC / Isilon Storage Division

Modified:
  stable/10/share/mk/bsd.own.mk

Modified: stable/10/share/mk/bsd.own.mk
==
--- stable/10/share/mk/bsd.own.mk   Thu May 19 21:08:33 2016
(r300232)
+++ stable/10/share/mk/bsd.own.mk   Thu May 19 21:41:35 2016
(r300233)
@@ -483,9 +483,6 @@ __DEFAULT_NO_OPTIONS+=HYPERV
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
-.if defined(MK_${var})
-.error MK_${var} can't be set by a user.
-.endif
 .if defined(WITHOUT_${var})
 MK_${var}:=no
 .else
@@ -501,9 +498,6 @@ MK_${var}:= yes
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
-.if defined(MK_${var})
-.error MK_${var} can't be set by a user.
-.endif
 .if defined(WITH_${var})
 MK_${var}:=yes
 .else
@@ -621,9 +615,6 @@ MK_TESTS:= no
 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
 .endif
-.if defined(MK_${var}_SUPPORT)
-.error MK_${var}_SUPPORT can't be set by a user.
-.endif
 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
 MK_${var}_SUPPORT:= no
 .else
@@ -640,9 +631,6 @@ MK_${var}_SUPPORT:= yes
 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
 .endif
-.if defined(MK_${vv:H})
-.error MK_${vv:H} can't be set by a user.
-.endif
 .if defined(WITH_${vv:H})
 MK_${vv:H}:=   yes
 .elif defined(WITHOUT_${vv:H})
@@ -661,9 +649,6 @@ MK_${vv:H}:=${MK_${vv:T}}
 .if defined(WITH_${var}) && defined(WITHOUT_${var})
 .error WITH_${var} and WITHOUT_${var} can't both be set.
 .endif
-.if defined(MK_${var})
-.error MK_${var} can't be set by a user.
-.endif
 .if ${COMPILER_FEATURES:Mc++11}
 .if defined(WITHOUT_${var})
 MK_${var}:=no
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300232 - head/sys/net80211

2016-05-19 Thread Andriy Voskoboinyk
Author: avos
Date: Thu May 19 21:08:33 2016
New Revision: 300232
URL: https://svnweb.freebsd.org/changeset/base/300232

Log:
  net80211: fix more compiler warnings.
  
  ieee80211.c:
add_chanlist(): 'error' variable will be uninitialized if
no channels were passed; return '0' instead.
  ieee80211_action.c:
ieee80211_send_action_register(): drop 'break' after 'return'.
  ieee80211_crypto_none.c:
none_encap(): 'keyid' is not used in non-debug builds; hide it
  behind IEEE80211_DEBUG ifdef.
  ieee80211_freebsd.c:
Staticize global 'ieee80211_debug' variable (used only in this
file).
  ieee80211_hostap.c:
Fix a comment (associatio -> association).
  ieee80211_ht.c:
ieee80211_setup_htrates(): initialize 'maxunequalmcs' to 0 to mute
   compiler warning.
  ieee80211_hwmp.c:
hwmp_recv_preq(): copy 'prep' between conditional blocks to fix
  -Wshadow warning.
  ieee80211_mesh.c:
mesh_newstate(): remove duplicate 'ni' definition.
mesh_recv_group_data(): fix -Wempty-body warning in non-debug
builds.
  ieee80211_phy.c:
ieee80211_compute_duration(): remove 'break' after panic() call.
  ieee80211_scan_sta.c:
Hide some TDMA-specific macros under IEEE80211_SUPPORT_TDMA ifdef
adhoc_pick_bss(): remove 'ic' pointer redefinition.
  ieee80211_sta.c:
sta_beacon_miss(): remove 'ic' pointer redefinition.
  ieee80211_superg.c:
superg_ioctl_set80211(): drop unreachable return.
  
  Tested with clang 3.8.0, gcc 4.6.4 and gcc 5.3.0.

Modified:
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_action.c
  head/sys/net80211/ieee80211_crypto_none.c
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_hwmp.c
  head/sys/net80211/ieee80211_mesh.c
  head/sys/net80211/ieee80211_phy.c
  head/sys/net80211/ieee80211_scan_sta.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_superg.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Thu May 19 21:04:59 2016
(r300231)
+++ head/sys/net80211/ieee80211.c   Thu May 19 21:08:33 2016
(r300232)
@@ -1207,7 +1207,7 @@ add_chanlist(struct ieee80211_channel ch
}
}
 
-   return (error);
+   return (0);
 }
 
 int

Modified: head/sys/net80211/ieee80211_action.c
==
--- head/sys/net80211/ieee80211_action.cThu May 19 21:04:59 2016
(r300231)
+++ head/sys/net80211/ieee80211_action.cThu May 19 21:08:33 2016
(r300232)
@@ -103,7 +103,6 @@ ieee80211_send_action_register(int cat, 
break;
meshaction_send_action[act] = f;
return 0;
-   break;
case IEEE80211_ACTION_CAT_VENDOR:
if (act >= nitems(vendor_send_action))
break;

Modified: head/sys/net80211/ieee80211_crypto_none.c
==
--- head/sys/net80211/ieee80211_crypto_none.c   Thu May 19 21:04:59 2016
(r300231)
+++ head/sys/net80211/ieee80211_crypto_none.c   Thu May 19 21:08:33 2016
(r300232)
@@ -101,7 +101,6 @@ none_encap(struct ieee80211_key *k, stru
struct ieee80211vap *vap = k->wk_private;
 #ifdef IEEE80211_DEBUG
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
-#endif
uint8_t keyid;
 
keyid = ieee80211_crypto_get_keyid(vap, k);
@@ -112,6 +111,7 @@ none_encap(struct ieee80211_key *k, stru
 */
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr1,
"key id %u is not set (encap)", keyid);
+#endif
vap->iv_stats.is_tx_badcipher++;
return 0;
 }

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Thu May 19 21:04:59 2016
(r300231)
+++ head/sys/net80211/ieee80211_freebsd.c   Thu May 19 21:08:33 2016
(r300232)
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
 SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD, 0, "IEEE 80211 parameters");
 
 #ifdef IEEE80211_DEBUG
-intieee80211_debug = 0;
+static int ieee80211_debug = 0;
 SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, _debug,
0, "debugging printfs");
 #endif

Modified: head/sys/net80211/ieee80211_hostap.c
==
--- head/sys/net80211/ieee80211_hostap.cThu May 19 21:04:59 2016
(r300231)
+++ head/sys/net80211/ieee80211_hostap.cThu May 19 21:08:33 2016

svn commit: r300231 - head/sys/sys

2016-05-19 Thread Ed Maste
Author: emaste
Date: Thu May 19 21:04:59 2016
New Revision: 300231
URL: https://svnweb.freebsd.org/changeset/base/300231

Log:
  elf_common.h: add section header flag and dynamic types
  
  SHF_COMPRESSEDsection contains compressed data
  DT_TLSDESC_PLTLocation of PLT entry for TLS descriptor resolver calls
  DT_TLSDESC_GOTLocation of GOT entry used by resolver PLT entry
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Thu May 19 20:51:47 2016(r300230)
+++ head/sys/sys/elf_common.h   Thu May 19 21:04:59 2016(r300231)
@@ -473,6 +473,7 @@ typedef struct {
 #defineSHF_OS_NONCONFORMING0x100   /* OS-specific processing 
required. */
 #defineSHF_GROUP   0x200   /* Member of section group. */
 #defineSHF_TLS 0x400   /* Section contains TLS data. */
+#defineSHF_COMPRESSED  0x800   /* Section contains compressed 
data. */
 #defineSHF_MASKOS  0x0ff0  /* OS-specific semantics. */
 #defineSHF_MASKPROC0xf000  /* Processor-specific 
semantics. */
 
@@ -608,6 +609,8 @@ typedef struct {
  */
 #defineDT_ADDRRNGLO0x6e00
 #defineDT_GNU_HASH 0x6ef5  /* GNU-style hash table */
+#defineDT_TLSDESC_PLT  0x6ef6  /* loc. of PLT for tlsdesc 
resolver */
+#defineDT_TLSDESC_GOT  0x6ef7  /* loc. of GOT for tlsdesc 
resolver */
 #defineDT_GNU_CONFLICT 0x6ef8  /* address of conflict section 
*/
 #defineDT_GNU_LIBLIST  0x6ef9  /* address of library list */
 #defineDT_CONFIG   0x6efa  /* configuration information */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300230 - head/sys/boot/fdt

2016-05-19 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu May 19 20:51:47 2016
New Revision: 300230
URL: https://svnweb.freebsd.org/changeset/base/300230

Log:
  Fixed memory leak in FDT overlay handling code
  
  Free both overlay and new fdt before returning after fdt_open_into error
  PR:   209634
  Submitted by: David Binderman

Modified:
  head/sys/boot/fdt/fdt_loader_cmd.c

Modified: head/sys/boot/fdt/fdt_loader_cmd.c
==
--- head/sys/boot/fdt/fdt_loader_cmd.c  Thu May 19 20:08:16 2016
(r300229)
+++ head/sys/boot/fdt/fdt_loader_cmd.c  Thu May 19 20:51:47 2016
(r300230)
@@ -383,6 +383,8 @@ fdt_apply_overlays()
rv = fdt_open_into(fdtp, new_fdtp, new_fdtp_size);
if (rv != 0) {
printf("failed to open DTB blob for applying overlays\n");
+   free(new_fdtp);
+   free(overlay);
return;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300229 - vendor/elftoolchain/elftoolchain-r3475

2016-05-19 Thread Ed Maste
Author: emaste
Date: Thu May 19 20:08:16 2016
New Revision: 300229
URL: https://svnweb.freebsd.org/changeset/base/300229

Log:
  Tag ELF Tool Chain r3475

Added:
  vendor/elftoolchain/elftoolchain-r3475/
 - copied from r300228, vendor/elftoolchain/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300228 - in vendor/elftoolchain/dist: addr2line brandelf common cxxfilt elfcopy elfdump findtextrel ld libdwarf libelf libelftc libpe nm readelf size strings test/cxxfilt test/cxxfilt/...

2016-05-19 Thread Ed Maste
Author: emaste
Date: Thu May 19 20:06:56 2016
New Revision: 300228
URL: https://svnweb.freebsd.org/changeset/base/300228

Log:
  Import ELF Tool Chain snapshot at revision 3475
  
  From http://svn.code.sf.net/p/elftoolchain/code/

Added:
  vendor/elftoolchain/dist/ld/ld.1   (contents, props changed)
  vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.3   (contents, props 
changed)
  vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c   (contents, props 
changed)
  vendor/elftoolchain/dist/test/cxxfilt/
  vendor/elftoolchain/dist/test/cxxfilt/Makefile   (contents, props changed)
  vendor/elftoolchain/dist/test/cxxfilt/tet_scen
  vendor/elftoolchain/dist/test/cxxfilt/tetexec.cfg
  vendor/elftoolchain/dist/test/cxxfilt/ts/
  vendor/elftoolchain/dist/test/cxxfilt/ts/Makefile   (contents, props changed)
  vendor/elftoolchain/dist/test/cxxfilt/ts/common/
  vendor/elftoolchain/dist/test/cxxfilt/ts/common/func.sh   (contents, props 
changed)
  vendor/elftoolchain/dist/test/cxxfilt/ts/common/gen.awk   (contents, props 
changed)
  vendor/elftoolchain/dist/test/cxxfilt/ts/common/ts.mk   (contents, props 
changed)
  vendor/elftoolchain/dist/test/cxxfilt/ts/misc/
  vendor/elftoolchain/dist/test/cxxfilt/ts/misc/Makefile   (contents, props 
changed)
  vendor/elftoolchain/dist/test/cxxfilt/ts/misc/tclist
Modified:
  vendor/elftoolchain/dist/addr2line/addr2line.c
  vendor/elftoolchain/dist/brandelf/brandelf.c
  vendor/elftoolchain/dist/common/_elftc.h
  vendor/elftoolchain/dist/common/elfdefinitions.h
  vendor/elftoolchain/dist/cxxfilt/cxxfilt.c
  vendor/elftoolchain/dist/elfcopy/ascii.c
  vendor/elftoolchain/dist/elfcopy/binary.c
  vendor/elftoolchain/dist/elfcopy/elfcopy.1
  vendor/elftoolchain/dist/elfcopy/elfcopy.h
  vendor/elftoolchain/dist/elfcopy/main.c
  vendor/elftoolchain/dist/elfcopy/sections.c
  vendor/elftoolchain/dist/elfcopy/segments.c
  vendor/elftoolchain/dist/elfcopy/symbols.c
  vendor/elftoolchain/dist/elfdump/elfdump.c
  vendor/elftoolchain/dist/findtextrel/findtextrel.c
  vendor/elftoolchain/dist/ld/Makefile
  vendor/elftoolchain/dist/ld/amd64.c
  vendor/elftoolchain/dist/ld/i386.c
  vendor/elftoolchain/dist/ld/ld_options.c
  vendor/elftoolchain/dist/ld/ld_options.h
  vendor/elftoolchain/dist/libdwarf/libdwarf_abbrev.c
  vendor/elftoolchain/dist/libdwarf/libdwarf_elf_init.c
  vendor/elftoolchain/dist/libelf/_libelf_config.h
  vendor/elftoolchain/dist/libelf/elf_data.c
  vendor/elftoolchain/dist/libelf/libelf_ar.c
  vendor/elftoolchain/dist/libelf/libelf_convert.m4
  vendor/elftoolchain/dist/libelftc/Makefile
  vendor/elftoolchain/dist/libelftc/libelftc.h
  vendor/elftoolchain/dist/libelftc/libelftc_dem_arm.c
  vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu2.c
  vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu3.c
  vendor/elftoolchain/dist/libelftc/make-toolchain-version
  vendor/elftoolchain/dist/libpe/libpe_section.c
  vendor/elftoolchain/dist/libpe/pe.h
  vendor/elftoolchain/dist/nm/nm.c
  vendor/elftoolchain/dist/readelf/readelf.c
  vendor/elftoolchain/dist/size/size.c
  vendor/elftoolchain/dist/strings/strings.c
  vendor/elftoolchain/dist/test/elfdump/ts/dso1/@S@p%libelf.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso1/@c@p@n%libelf.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso1/@e@p@c%libelf.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso1/@p%libelf.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso1/@p@s%libelf.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso2/@S@p%test.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso2/@c@p@n%test.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso2/@e@p@c%test.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso2/@p%test.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/dso2/@p@s%test.so.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@S@e@p%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@c@p@n%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@e@p%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@e@p@c@d%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@p@e%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@p@n%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec1/@p@s%ls.out
  vendor/elftoolchain/dist/test/elfdump/ts/exec2/@S@n%cp.out

Modified: vendor/elftoolchain/dist/addr2line/addr2line.c
==
--- vendor/elftoolchain/dist/addr2line/addr2line.c  Thu May 19 20:03:01 
2016(r300227)
+++ vendor/elftoolchain/dist/addr2line/addr2line.c  Thu May 19 20:06:56 
2016(r300228)
@@ -40,7 +40,7 @@
 #include "uthash.h"
 #include "_elftc.h"
 
-ELFTC_VCSID("$Id: addr2line.c 3273 2015-12-11 21:38:57Z kaiwang27 $");
+ELFTC_VCSID("$Id: addr2line.c 3446 2016-05-03 01:31:17Z emaste $");
 
 struct Func {
char *name;
@@ -284,7 +284,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die 
) == DW_DLV_OK)
goto add_func;
 
-   /* Skip if no 

svn commit: r300227 - head/usr.bin/ar

2016-05-19 Thread Ed Schouten
Author: ed
Date: Thu May 19 20:03:01 2016
New Revision: 300227
URL: https://svnweb.freebsd.org/changeset/base/300227

Log:
  Make code compile when basename() is POSIX compliant.
  
  If basename() uses "char *", we shouldn't do the intermediate
  assignment, as that field is of type "const char *". Simply call
  basename() on the command line argument directly.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D6463

Modified:
  head/usr.bin/ar/ar.c

Modified: head/usr.bin/ar/ar.c
==
--- head/usr.bin/ar/ar.cThu May 19 19:51:39 2016(r300226)
+++ head/usr.bin/ar/ar.cThu May 19 20:03:01 2016(r300227)
@@ -272,10 +272,10 @@ main(int argc, char **argv)
"only one of -s and -S options allowed");
 
if (bsdar->options & (AR_A | AR_B)) {
-   if ((bsdar->posarg = *argv) == NULL)
+   if (*argv == NULL)
bsdar_errc(bsdar, EX_USAGE, 0,
"no position operand specified");
-   if ((bsdar->posarg = basename(bsdar->posarg)) == NULL)
+   if ((bsdar->posarg = basename(*argv)) == NULL)
bsdar_errc(bsdar, EX_SOFTWARE, errno,
"basename failed");
argc--;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300226 - in head: cddl/contrib/dtracetoolkit cddl/usr.sbin cddl/usr.sbin/dtruss share/dtrace share/dtrace/toolkit

2016-05-19 Thread George V. Neville-Neil
Author: gnn
Date: Thu May 19 19:51:39 2016
New Revision: 300226
URL: https://svnweb.freebsd.org/changeset/base/300226

Log:
  Remove the old version of the DTraceToolkit from the source tree.
  The DTraceToolkit is part of the Open DTrace effort and is supported
  on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated
  to properly track toolkit development upstream.
  
  Sponsored by: DARPA, AFRL

Deleted:
  head/cddl/contrib/dtracetoolkit/
  head/cddl/usr.sbin/dtruss/
  head/share/dtrace/toolkit/
Modified:
  head/cddl/usr.sbin/Makefile
  head/share/dtrace/Makefile
  head/share/dtrace/README

Modified: head/cddl/usr.sbin/Makefile
==
--- head/cddl/usr.sbin/Makefile Thu May 19 19:27:33 2016(r300225)
+++ head/cddl/usr.sbin/Makefile Thu May 19 19:51:39 2016(r300226)
@@ -3,7 +3,6 @@
 .include 
 
 SUBDIR=${_dtrace} \
-   ${_dtruss} \
${_lockstat} \
${_plockstat} \
${_tests} \
@@ -23,14 +22,12 @@ _zhack= zhack
 
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _dtrace=   dtrace
-_dtruss=   dtruss
 _lockstat= lockstat
 _plockstat=plockstat
 .endif
 
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
 _dtrace=   dtrace
-_dtruss=   dtruss
 _lockstat= lockstat
 .endif
 
@@ -40,7 +37,6 @@ _dtrace=  dtrace
 
 .if ${MACHINE_CPUARCH} == "powerpc"
 _dtrace=   dtrace
-_dtruss=   dtruss
 _lockstat= lockstat
 .endif
 

Modified: head/share/dtrace/Makefile
==
--- head/share/dtrace/Makefile  Thu May 19 19:27:33 2016(r300225)
+++ head/share/dtrace/Makefile  Thu May 19 19:51:39 2016(r300226)
@@ -6,12 +6,6 @@
 
 .include 
 
-SUBDIR= ${_toolkit}
-
-.if ${MK_CDDL} != "no"
-_toolkit=  toolkit
-.endif
-
 SCRIPTS=   blocking \
disklatency \
disklatencycmd \

Modified: head/share/dtrace/README
==
--- head/share/dtrace/READMEThu May 19 19:27:33 2016(r300225)
+++ head/share/dtrace/READMEThu May 19 19:51:39 2016(r300226)
@@ -1,11 +1,5 @@
 $FreeBSD$
 
-This directory contains scripts for use with the DTrace system.  The
-toolkit/ directory installs the latest vendor import of Brendan
-Gregg's DTraceToolkit while the other files and directories
-contain code generated by the FreeBSD Project for use with DTrace on
-FreeBSD.
-
-NOTE: Do not add new scripts to the toolkit directory. New DTraceToolkit
-scripts should be send to the maintainer of the toolkit and then brought
-back into FreeBSD via future vendor imports.
+This directory contains scripts for use with the DTrace system.
+These files and directories contain code generated by the FreeBSD
+Project for use with DTrace on FreeBSD.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300225 - head/sys/vm

2016-05-19 Thread Alan Cox
Author: alc
Date: Thu May 19 19:27:33 2016
New Revision: 300225
URL: https://svnweb.freebsd.org/changeset/base/300225

Log:
  Clean up the handling of errors from vm_pager_get_pages().  Mostly, this
  cleanup consists of fixes to comments.  However, there is one change to
  code: Remove special-case handling of errors involving the kernel map.
  We do not perform I/O on the kernel map, so there is no need for this
  special case.
  
  Reviewed by:  kib (an earlier version)

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Thu May 19 19:13:43 2016(r300224)
+++ head/sys/vm/vm_fault.c  Thu May 19 19:27:33 2016(r300225)
@@ -657,48 +657,40 @@ vnode_locked:
hardfault++;
break; /* break to PAGE HAS BEEN FOUND */
}
-   /*
-* Remove the bogus page (which does not exist at this
-* object/offset); before doing so, we must get back
-* our object lock to preserve our invariant.
-*
-* Also wake up any other process that may want to bring
-* in this page.
-*
-* If this is the top-level object, we must leave the
-* busy page to prevent another process from rushing
-* past us, and inserting the page in that object at
-* the same time that we are.
-*/
if (rv == VM_PAGER_ERROR)
printf("vm_fault: pager read error, pid %d 
(%s)\n",
curproc->p_pid, curproc->p_comm);
+
/*
-* Data outside the range of the pager or an I/O error
-*/
-   /*
-* XXX - the check for kernel_map is a kludge to work
-* around having the machine panic on a kernel space
-* fault w/ I/O error.
+* If an I/O error occurred or the requested page was
+* outside the range of the pager, clean up and return
+* an error.
 */
-   if (((fs.map != kernel_map) && (rv == VM_PAGER_ERROR)) 
||
-   (rv == VM_PAGER_BAD)) {
+   if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) {
vm_page_lock(fs.m);
vm_page_free(fs.m);
vm_page_unlock(fs.m);
fs.m = NULL;
unlock_and_deallocate();
-   return ((rv == VM_PAGER_ERROR) ? KERN_FAILURE : 
KERN_PROTECTION_FAILURE);
+   return (rv == VM_PAGER_ERROR ? KERN_FAILURE :
+   KERN_PROTECTION_FAILURE);
}
+
+   /*
+* The requested page does not exist at this object/
+* offset.  Remove the invalid page from the object,
+* waking up anyone waiting for it, and continue on to
+* the next object.  However, if this is the top-level
+* object, we must leave the busy page in place to
+* prevent another process from rushing past us, and
+* inserting the page in that object at the same time
+* that we are.
+*/
if (fs.object != fs.first_object) {
vm_page_lock(fs.m);
vm_page_free(fs.m);
vm_page_unlock(fs.m);
fs.m = NULL;
-   /*
-* XXX - we cannot just fall out at this
-* point, m has been freed and is invalid!
-*/
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300224 - head/usr.sbin/camdd

2016-05-19 Thread Kenneth D. Merry
Author: ken
Date: Thu May 19 19:13:43 2016
New Revision: 300224
URL: https://svnweb.freebsd.org/changeset/base/300224

Log:
  Adjust a couple of error cases in camdd(8).
  
  usr.sbin/camdd/camdd.c:
In camdd_probe_file(), fix an error case after fstat where
we were bailing out and leaving two lines of cleanup code
unexecuted.  Instead, just goto bailout_error.
  
In camdd_probe_pass(), fail if the sector size is 0.
  
  Sponsored by: Spectra Logic
  MFC after:3 days

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

Modified: head/usr.sbin/camdd/camdd.c
==
--- head/usr.sbin/camdd/camdd.c Thu May 19 17:54:14 2016(r300223)
+++ head/usr.sbin/camdd/camdd.c Thu May 19 19:13:43 2016(r300224)
@@ -1079,9 +1079,7 @@ camdd_probe_file(int fd, struct camdd_io
retval = fstat(fd, _dev->sb);
if (retval != 0) {
warn("Cannot stat %s", dev->device_name);
-   goto bailout;
-   camdd_free_dev(dev);
-   dev = NULL;
+   goto bailout_error;
}
if (S_ISREG(file_dev->sb.st_mode)) {
file_dev->file_type = CAMDD_FILE_REG;
@@ -1383,6 +1381,11 @@ camdd_probe_pass(struct cam_device *cam_
block_len = scsi_4btoul(rcaplong.length);
 
 rcap_done:
+   if (block_len == 0) {
+   warnx("Sector size for %s%u is 0, cannot continue",
+   cam_dev->device_name, cam_dev->dev_unit_num);
+   goto bailout_error;
+   }
 
bzero(&(>ccb_h)[1],
  sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300219 - in head/sys: kern sys

2016-05-19 Thread Steven Hartland
I thought it was considered better to use if (var == NULL) instead of
if (!var) for pointers as they aren't bools?

> On 19 May 2016, at 18:14, Scott Long  wrote:
>
> Author: scottl
> Date: Thu May 19 17:14:24 2016
> New Revision: 300219
> URL: https://svnweb.freebsd.org/changeset/base/300219
>
> Log:
>  Adjust the creation of tq_name so it can be freed correctly
>
>  Reviewed by:jhb, allanjude
>  Differential Revision:D6454
>
> Modified:
>  head/sys/kern/subr_taskqueue.c
>  head/sys/sys/taskqueue.h
>
> Modified: head/sys/kern/subr_taskqueue.c
> ==
> --- head/sys/kern/subr_taskqueue.cThu May 19 17:02:33 2016(r300218)
> +++ head/sys/kern/subr_taskqueue.cThu May 19 17:14:24 2016(r300219)
> @@ -128,16 +128,17 @@ _taskqueue_create(const char *name, int
> int mtxflags, const char *mtxname __unused)
> {
>struct taskqueue *queue;
> -char *tq_name = NULL;
> +char *tq_name;
>
> -if (name != NULL)
> -tq_name = strndup(name, 32, M_TASKQUEUE);
> -if (tq_name == NULL)
> -tq_name = "taskqueue";
> +tq_name = malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | M_ZERO);
> +if (!tq_name)
> +return (NULL);
> +
> +snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue");
>
>queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO);
>if (!queue)
> -return NULL;
> +return (NULL);
>
>STAILQ_INIT(>tq_queue);
>TAILQ_INIT(>tq_active);
> @@ -153,7 +154,7 @@ _taskqueue_create(const char *name, int
>queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE;
>mtx_init(>tq_mutex, tq_name, NULL, mtxflags);
>
> -return queue;
> +return (queue);
> }
>
> struct taskqueue *
>
> Modified: head/sys/sys/taskqueue.h
> ==
> --- head/sys/sys/taskqueue.hThu May 19 17:02:33 2016(r300218)
> +++ head/sys/sys/taskqueue.hThu May 19 17:14:24 2016(r300219)
> @@ -56,6 +56,7 @@ enum taskqueue_callback_type {
> #defineTASKQUEUE_CALLBACK_TYPE_MINTASKQUEUE_CALLBACK_TYPE_INIT
> #defineTASKQUEUE_CALLBACK_TYPE_MAXTASKQUEUE_CALLBACK_TYPE_SHUTDOWN
> #defineTASKQUEUE_NUM_CALLBACKSTASKQUEUE_CALLBACK_TYPE_MAX + 1
> +#defineTASKQUEUE_NAMELEN32
>
> typedef void (*taskqueue_callback_fn)(void *context);
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300223 - head/sys/vm

2016-05-19 Thread Conrad E. Meyer
Author: cem
Date: Thu May 19 17:54:14 2016
New Revision: 300223
URL: https://svnweb.freebsd.org/changeset/base/300223

Log:
  vm/vm_page.h: Fix trivial '-Wpointer-sign' warning
  
  pq_vcnt, as a count of real things, has no business being negative.  It is 
only
  ever initialized by a u_int counter.
  
  The warning came from the atomic_add_int() in vm_pagequeue_cnt_add().
  
  Rectify the warning by changing the variable to u_int.  No functional change.
  
  Suggested by: Clang 3.3
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu May 19 17:48:56 2016(r300222)
+++ head/sys/vm/vm_page.c   Thu May 19 17:54:14 2016(r300223)
@@ -384,11 +384,11 @@ vm_page_domain_init(struct vm_domain *vm
 
*__DECONST(char **, >vmd_pagequeues[PQ_INACTIVE].pq_name) =
"vm inactive pagequeue";
-   *__DECONST(int **, >vmd_pagequeues[PQ_INACTIVE].pq_vcnt) =
+   *__DECONST(u_int **, >vmd_pagequeues[PQ_INACTIVE].pq_vcnt) =
_cnt.v_inactive_count;
*__DECONST(char **, >vmd_pagequeues[PQ_ACTIVE].pq_name) =
"vm active pagequeue";
-   *__DECONST(int **, >vmd_pagequeues[PQ_ACTIVE].pq_vcnt) =
+   *__DECONST(u_int **, >vmd_pagequeues[PQ_ACTIVE].pq_vcnt) =
_cnt.v_active_count;
vmd->vmd_page_count = 0;
vmd->vmd_free_count = 0;

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Thu May 19 17:48:56 2016(r300222)
+++ head/sys/vm/vm_page.h   Thu May 19 17:54:14 2016(r300223)
@@ -215,7 +215,7 @@ struct vm_pagequeue {
struct mtx  pq_mutex;
struct pglist   pq_pl;
int pq_cnt;
-   int * const pq_vcnt;
+   u_int   * const pq_vcnt;
const char  * const pq_name;
 } __aligned(CACHE_LINE_SIZE);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300222 - head/sys/dev/isp

2016-05-19 Thread Alexander Motin
Author: mav
Date: Thu May 19 17:48:56 2016
New Revision: 300222
URL: https://svnweb.freebsd.org/changeset/base/300222

Log:
  Fix delaying requests to unknown virtual ports 2s after init.
  
  This code was originally implemented 7 years ago, but never really worked
  due to trivial error.  I think this functionality may be not required.
  Initiators supporting optional periodic command status checks detected
  those terminated commands and retried them 3 seconds later.  But thinking
  about less featured initiators and the fact that it is our race makes
  virtual ports "unknown" it may be good to have this feature.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Thu May 19 17:40:00 2016(r300221)
+++ head/sys/dev/isp/isp.c  Thu May 19 17:48:56 2016(r300222)
@@ -2431,6 +2431,7 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch
__func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status);
return (EIO);
}
+   GET_NANOTIME(>isp_init_time);
return (0);
 }
 
@@ -5865,6 +5866,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
 * These are broadcast events that have to be sent across
 * all active channels.
 */
+   GET_NANOTIME(>isp_init_time);
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcp = FCPARAM(isp, chan);
int topo = fcp->isp_topo;
@@ -5921,6 +5923,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
 * This is a broadcast event that has to be sent across
 * all active channels.
 */
+   GET_NANOTIME(>isp_init_time);
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcp = FCPARAM(isp, chan);
if (fcp->role == ISP_ROLE_NONE)
@@ -5964,6 +5967,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
 * This is a broadcast event that has to be sent across
 * all active channels.
 */
+   GET_NANOTIME(>isp_init_time);
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcp = FCPARAM(isp, chan);
if (fcp->role == ISP_ROLE_NONE)
@@ -6162,6 +6166,7 @@ isp_handle_other_response(ispsoftc_t *is
portid = (uint32_t)rid.ridacq_vp_port_hi << 16 |
rid.ridacq_vp_port_lo;
if (rid.ridacq_format == 0) {
+   GET_NANOTIME(>isp_init_time);
for (chan = 0; chan < isp->isp_nchan; chan++) {
fcparam *fcp = FCPARAM(isp, chan);
if (fcp->role == ISP_ROLE_NONE)

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Thu May 19 17:40:00 2016
(r300221)
+++ head/sys/dev/isp/isp_freebsd.c  Thu May 19 17:48:56 2016
(r300222)
@@ -2055,7 +2055,7 @@ isp_handle_platform_atio7(ispsoftc_t *is
 * It's a bit tricky here as we need to stash this 
command *somewhere*.
 */
GET_NANOTIME();
-   if (NANOTIME_SUB(>isp_init_time, ) > 
20ULL) {
+   if (NANOTIME_SUB(, >isp_init_time) > 
20ULL) {
isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] 
D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did);
isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, 
ECMD_TERMINATE, 0);
return;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300221 - in head/lib: libc/sys libthr

2016-05-19 Thread Konstantin Belousov
Author: kib
Date: Thu May 19 17:40:00 2016
New Revision: 300221
URL: https://svnweb.freebsd.org/changeset/base/300221

Log:
  Document _umtx_op(2) interface for the implementation of robust mutexes.
  In libthr(3), list added knobs.
  
  Reviewed by:  emaste
  Sponsored by: The FreeBSD Foundation
  Differential revision:https://reviews.freebsd.org/D6427

Modified:
  head/lib/libc/sys/_umtx_op.2
  head/lib/libthr/libthr.3

Modified: head/lib/libc/sys/_umtx_op.2
==
--- head/lib/libc/sys/_umtx_op.2Thu May 19 17:21:24 2016
(r300220)
+++ head/lib/libc/sys/_umtx_op.2Thu May 19 17:40:00 2016
(r300221)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2016
+.Dd May 17, 2016
 .Dt _UMTX_OP 2
 .Os
 .Sh NAME
@@ -85,6 +85,7 @@ struct umutex {
volatile lwpid_t m_owner;
uint32_t m_flags;
uint32_t m_ceilings[2];
+   uintptr_tm_rb_lnk;
 };
 .Ed
 .Pp
@@ -95,18 +96,24 @@ It contains either the thread identifier
 locked state, or zero when the lock is unowned.
 The highest bit set indicates that there is contention on the lock.
 The constants are defined for special values:
-.Bl -tag -width "Dv UMUTEX_CONTESTED"
+.Bl -tag -width "Dv UMUTEX_RB_OWNERDEAD"
 .It Dv UMUTEX_UNOWNED
 Zero, the value stored in the unowned lock.
 .It Dv UMUTEX_CONTESTED
 The contenion indicator.
+.It Dv UMUTEX_RB_OWNERDEAD
+A thread owning the robust mutex terminated.
+The mutex is in unlocked state.
+.It Dv UMUTEX_RB_NOTRECOV
+The robust mutex is in a non-recoverable state.
+It cannot be locked until reinitialized.
 .El
 .Pp
 The
 .Dv m_flags
 field may contain the following umutex-specific flags, in addition to
 the common flags:
-.Bl -tag -width "Dv UMUTEX_PRIO_INHERIT"
+.Bl -tag -width "Dv UMUTEX_NONCONSISTENT"
 .It Dv UMUTEX_PRIO_INHERIT
 Mutex implements
 .Em Priority Inheritance
@@ -115,6 +122,13 @@ protocol.
 Mutex implements
 .Em Priority Protection
 protocol.
+.It Dv UMUTEX_ROBUST
+Mutex is robust, as described in the
+.Sx ROBUST UMUTEXES
+section below.
+.It Dv UMUTEX_NONCONSISTENT
+Robust mutex is in a transient non-consistent state.
+Not used by kernel.
 .El
 .Pp
 In the manual page, mutexes not having
@@ -417,6 +431,75 @@ primitives, even when the physical addre
 When waking up a limited number of threads from a given sleep queue,
 the highest priority threads that have been blocked for the longest on
 the queue are selected.
+.Ss ROBUST UMUTEXES
+The
+.Em robust umutexes
+are provided as a substrate for a userspace library to implement
+POSIX robust mutexes.
+A robust umutex must have the
+.Dv UMUTEX_ROBUST
+flag set.
+.Pp
+On thread termination, the kernel walks two lists of mutexes.
+The two lists head addresses must be provided by a prior call to
+.Dv UMTX_OP_ROBUST_LISTS
+request.
+The lists are singly-linked.
+The link to next element is provided by the
+.Dv m_rb_lnk
+member of the
+.Vt struct umutex .
+.Pp
+Robust list processing is aborted if the kernel finds a mutex
+with any of the following conditions:
+.Bl -dash -offset indent -compact
+.It
+the
+.Dv UMUTEX_ROBUST
+flag is not set
+.It
+not owned by the current thread, except when the mutex is pointed to
+by the
+.Dv robust_inactive
+member of the
+.Vt struct umtx_robust_lists_params ,
+registered for the current thread
+.It
+the combination of mutex flags is invalid
+.It
+read of the umutex memory faults
+.It
+the list length limit described in
+.Xr libthr 3
+ is reached.
+.El
+.Pp
+Every mutex in both lists is unlocked as if the
+.Dv UMTX_OP_MUTEX_UNLOCK
+request is performed on it, but instead of the
+.Dv UMUTEX_UNOWNED
+value, the
+.Dv m_owner
+field is written with the
+.Dv UMUTEX_RB_OWNERDEAD
+value.
+When a mutex in the
+.Dv UMUTEX_RB_OWNERDEAD
+state is locked by kernel due to the
+.Dv UMTX_OP_MUTEX_TRYLOCK
+and
+.Dv UMTX_OP_MUTEX_LOCK
+requests, the lock is granted and
+.Er EOWNERDEAD
+error is returned.
+.Pp
+Also, the kernel handles the
+.Dv UMUTEX_RB_NOTRECOV
+value of
+.Dv the m_owner
+field specially, always returning the
+.Er ENOTRECOVERABLE
+error for lock attempts, without granting the lock.
 .Ss OPERATIONS
 The following operations, requested by the
 .Fa op
@@ -582,12 +665,12 @@ The arguments to the request are:
 Pointer to the umutex.
 .It Fa val
 New ceiling value.
-.It Fa uaddr1
+.It Fa uaddr
 Address of a variable of type
 .Vt uint32_t .
 If not NULL, after the successful update the previous ceiling value is
 written to the location pointed to by
-.Fa uaddr1 .
+.Fa uaddr .
 .El
 .Pp
 The request locks the umutex pointed to by the
@@ -614,7 +697,7 @@ Pointer to the
 .Vt struct ucond .
 .It Fa val
 Request flags, see below.
-.It Fa uaddr1
+.It Fa uaddr
 Pointer to the umutex.
 .It Fa uaddr2
 Optional pointer to a
@@ -624,7 +707,7 @@ for timeout specification.
 .Pp
 The request must be issued by the thread owning the mutex pointed to
 by the
-.Fa uaddr1
+.Fa uaddr
 argument.
 The
 .Dv 

svn commit: r300220 - head/sys/sys

2016-05-19 Thread Conrad E. Meyer
Author: cem
Date: Thu May 19 17:21:24 2016
New Revision: 300220
URL: https://svnweb.freebsd.org/changeset/base/300220

Log:
  sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header
  
  Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative
  value (it is only ever set to a fraction of v_free_min, which is unsigned and
  also obviously non-negative).  But I'm not going to try and convert every
  non-negative scalar in the VM to unsigned today, so just cast it for the
  comparison.
  
  Submitted by: Clang 3.3
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/sys/vmmeter.h

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Thu May 19 17:14:24 2016(r300219)
+++ head/sys/sys/vmmeter.h  Thu May 19 17:21:24 2016(r300220)
@@ -186,7 +186,7 @@ int
 vm_paging_needed(void)
 {
 return (vm_cnt.v_free_count + vm_cnt.v_cache_count <
-vm_pageout_wakeup_thresh);
+(u_int)vm_pageout_wakeup_thresh);
 }
 
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-05-19 Thread Scott Long
Author: scottl
Date: Thu May 19 17:14:24 2016
New Revision: 300219
URL: https://svnweb.freebsd.org/changeset/base/300219

Log:
  Adjust the creation of tq_name so it can be freed correctly
  
  Reviewed by:  jhb, allanjude
  Differential Revision:D6454

Modified:
  head/sys/kern/subr_taskqueue.c
  head/sys/sys/taskqueue.h

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Thu May 19 17:02:33 2016
(r300218)
+++ head/sys/kern/subr_taskqueue.c  Thu May 19 17:14:24 2016
(r300219)
@@ -128,16 +128,17 @@ _taskqueue_create(const char *name, int 
 int mtxflags, const char *mtxname __unused)
 {
struct taskqueue *queue;
-   char *tq_name = NULL;
+   char *tq_name;
 
-   if (name != NULL)
-   tq_name = strndup(name, 32, M_TASKQUEUE);
-   if (tq_name == NULL)
-   tq_name = "taskqueue";
+   tq_name = malloc(TASKQUEUE_NAMELEN, M_TASKQUEUE, mflags | M_ZERO);
+   if (!tq_name)
+   return (NULL);
+
+   snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue");
 
queue = malloc(sizeof(struct taskqueue), M_TASKQUEUE, mflags | M_ZERO);
if (!queue)
-   return NULL;
+   return (NULL);
 
STAILQ_INIT(>tq_queue);
TAILQ_INIT(>tq_active);
@@ -153,7 +154,7 @@ _taskqueue_create(const char *name, int 
queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE;
mtx_init(>tq_mutex, tq_name, NULL, mtxflags);
 
-   return queue;
+   return (queue);
 }
 
 struct taskqueue *

Modified: head/sys/sys/taskqueue.h
==
--- head/sys/sys/taskqueue.hThu May 19 17:02:33 2016(r300218)
+++ head/sys/sys/taskqueue.hThu May 19 17:14:24 2016(r300219)
@@ -56,6 +56,7 @@ enum taskqueue_callback_type {
 #defineTASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT
 #defineTASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN
 #defineTASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1
+#defineTASKQUEUE_NAMELEN   32
 
 typedef void (*taskqueue_callback_fn)(void *context);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-19 Thread Pedro Giffuni



On 05/19/16 08:33, Alexey Dokuchaev wrote:

On Tue, May 17, 2016 at 11:29:01AM -0500, Pedro Giffuni wrote:

Hello;

On 05/17/16 10:36, George V. Neville-Neil wrote:

Author: gnn
Date: Tue May 17 15:36:40 2016
New Revision: 300062
URL: https://svnweb.freebsd.org/changeset/base/300062

Log:
  Kill off ReiserFS as it is no longer supported, for obvious reasons.


It's not so obvious since the fs worked and could've been useful for
people migrating from ancient linux.


And not just that.  Simply having ability to boot off Live CD and read
some exotic filesystem is cool.  What was wrong with ReiserFS, was it
broken or something?  (NTFS support is another great loss of ours.)



Well, I recall it was the only GPL'd filesystem that survived SMP but
apart from that, the fs format is not really used anymore, it didn't 
have much sense to keep it.


As pointed out by Conrad, sysutils/fusefs-lkl is the way to go.

And then ... IANAL, but given the situation in other camps it seems
sane to keep away from anything involving the words "GPL" and 
"filesystems" in the same sentence.


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


svn commit: r300218 - head/sys/dev/isp

2016-05-19 Thread Alexander Motin
Author: mav
Date: Thu May 19 17:02:33 2016
New Revision: 300218
URL: https://svnweb.freebsd.org/changeset/base/300218

Log:
  Add proper reporting for early task management errors.
  
  This covers unknown requests and requests to unknown virtual ports.
  Previously it "worked" only because of timeout handling on initiator.

Modified:
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_target.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Thu May 19 16:53:53 2016
(r300217)
+++ head/sys/dev/isp/isp_freebsd.c  Thu May 19 17:02:33 2016
(r300218)
@@ -2103,7 +2103,7 @@ isp_handle_platform_atio7(ispsoftc_t *is
"%s: [0x%x] no state pointer for lun %jx or 
wildcard",
__func__, aep->at_rxid, (uintmax_t)lun);
if (lun == 0) {
-   isp_endcmd(isp, aep, nphdl, SCSI_STATUS_BUSY, 
0);
+   isp_endcmd(isp, aep, nphdl, chan, 
SCSI_STATUS_BUSY, 0);
} else {
isp_endcmd(isp, aep, nphdl, chan, 
SCSI_STATUS_CHECK_COND | ECMD_SVALID | (0x5 << 12) | (0x25 << 16), 0);
}

Modified: head/sys/dev/isp/isp_target.c
==
--- head/sys/dev/isp/isp_target.c   Thu May 19 16:53:53 2016
(r300217)
+++ head/sys/dev/isp/isp_target.c   Thu May 19 17:02:33 2016
(r300218)
@@ -539,13 +539,22 @@ isp_endcmd(ispsoftc_t *isp, ...)
} else if (code & ECMD_SVALID) {
cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS;
cto->ct_scsi_status |= (FCP_SNSLEN_VALID << 8);
-   cto->rsp.m1.ct_resplen = cto->ct_senselen = min(16, 
MAXRESPLEN_24XX);
+   cto->ct_senselen = min(16, MAXRESPLEN_24XX);
ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof 
(cto->rsp.m1.ct_resp));
cto->rsp.m1.ct_resp[0] = 0xf0;
cto->rsp.m1.ct_resp[2] = (code >> 12) & 0xf;
cto->rsp.m1.ct_resp[7] = 8;
cto->rsp.m1.ct_resp[12] = (code >> 16) & 0xff;
cto->rsp.m1.ct_resp[13] = (code >> 24) & 0xff;
+   } else if (code & ECMD_RVALID) {
+   cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS;
+   cto->ct_scsi_status |= (FCP_RSPLEN_VALID << 8);
+   cto->rsp.m1.ct_resplen = 4;
+   ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof 
(cto->rsp.m1.ct_resp));
+   cto->rsp.m1.ct_resp[0] = (code >> 12) & 0xf;
+   cto->rsp.m1.ct_resp[1] = (code >> 16) & 0xff;
+   cto->rsp.m1.ct_resp[2] = (code >> 24) & 0xff;
+   cto->rsp.m1.ct_resp[3] = 0;
} else {
cto->ct_flags |= CT7_FLAG_MODE1 | CT7_SENDSTATUS;
}
@@ -764,6 +773,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en
isp_notify_t notify;
static const char f1[] = "%s from PortID 0x%06x lun %x seq 0x%08x";
static const char f2[] = "unknown Task Flag 0x%x lun %x PortID 0x%x tag 
0x%08x";
+   fcportdb_t *lp;
uint16_t chan;
uint32_t sid, did;
 
@@ -774,20 +784,23 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en
notify.nt_tagval = aep->at_rxid;
notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
notify.nt_lreserved = aep;
-   sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] <<  8) | 
(aep->at_hdr.s_id[2]);
+   sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | 
aep->at_hdr.s_id[2];
did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | 
aep->at_hdr.d_id[2];
if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) {
/* Channel has to be derived from D_ID */
isp_find_chan_by_did(isp, did, );
if (chan == ISP_NOCHAN) {
isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on 
any channel", __func__, did);
-   /* just drop on the floor */
+   isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, 
ECMD_TERMINATE, 0);
return;
}
} else {
chan = 0;
}
-   notify.nt_nphdl = NIL_HANDLE; /* unknown here */
+   if (isp_find_pdb_by_portid(isp, chan, sid, ))
+   notify.nt_nphdl = lp->handle;
+   else
+   notify.nt_nphdl = NIL_HANDLE;
notify.nt_sid = sid;
notify.nt_did = did;
notify.nt_channel = chan;
@@ -815,6 +828,7 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en
} else {
isp_prt(isp, ISP_LOGWARN, f2, 

svn commit: r300217 - head/sys/dev/isp

2016-05-19 Thread Alexander Motin
Author: mav
Date: Thu May 19 16:53:53 2016
New Revision: 300217
URL: https://svnweb.freebsd.org/changeset/base/300217

Log:
  Add IOCB debugging for ISPCTL_RESET_DEV and ISPCTL_ABORT_CMD.

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

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Thu May 19 16:36:06 2016(r300216)
+++ head/sys/dev/isp/isp.c  Thu May 19 16:53:53 2016(r300217)
@@ -4699,6 +4699,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
tmf->tmf_tidhi = lp->portid >> 16;
tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan);
isp_put_24xx_tmf(isp, tmf, isp->isp_iocb);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "TMF IOCB request", 
QENTRY_LEN, isp->isp_iocb);
MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan);
fcp->sendmarker = 1;
 
@@ -4715,6 +4717,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
break;
 
MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, 
QENTRY_LEN, chan);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "TMF IOCB response", 
QENTRY_LEN, &((isp24xx_statusreq_t *)isp->isp_iocb)[1]);
sp = (isp24xx_statusreq_t *) local;
isp_get_24xx_response(isp, &((isp24xx_statusreq_t 
*)isp->isp_iocb)[1], sp);
if (sp->req_completion_status == 0) {
@@ -4781,6 +4785,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
ab->abrt_tidhi = lp->portid >> 16;
ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan);
isp_put_24xx_abrt(isp, ab, isp->isp_iocb);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "AB IOCB quest", 
QENTRY_LEN, isp->isp_iocb);
MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, 
chan);
 
ISP_MEMZERO(, sizeof (mbs));
@@ -4796,6 +4802,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
break;
 
MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, 
QENTRY_LEN, chan);
+   if (isp->isp_dblev & ISP_LOGDEBUG1)
+   isp_print_bytes(isp, "AB IOCB response", 
QENTRY_LEN, &((isp24xx_abrt_t *)isp->isp_iocb)[1]);
isp_get_24xx_abrt(isp, &((isp24xx_abrt_t 
*)isp->isp_iocb)[1], ab);
if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) {
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300201 - head/sys/sys

2016-05-19 Thread Scott Long via svn-src-all
Thanks!

Scott

> On May 19, 2016, at 5:19 AM, Alexander Motin  wrote:
> 
> Author: mav
> Date: Thu May 19 11:19:37 2016
> New Revision: 300201
> URL: https://svnweb.freebsd.org/changeset/base/300201
> 
> Log:
>  Add ta_flags initialization in old macros missed in 300113.
> 
>  Depending on uninitialized memory content it could cause loss of wakeup()
>  call in taskqueue_run_locked().
> 
> Modified:
>  head/sys/sys/taskqueue.h
> 
> Modified: head/sys/sys/taskqueue.h
> ==
> --- head/sys/sys/taskqueue.h  Thu May 19 11:02:39 2016(r300200)
> +++ head/sys/sys/taskqueue.h  Thu May 19 11:19:37 2016(r300201)
> @@ -97,6 +97,7 @@ voidtaskqueue_set_callback(struct taskq
> 
> #define TASK_INITIALIZER(priority, func, context) \
>   { .ta_pending = 0,  \
> +   .ta_flags = 0,\
> .ta_priority = (priority),\
> .ta_func = (func),\
> .ta_context = (context) }
> @@ -112,6 +113,7 @@ void  taskqueue_thread_enqueue(void *cont
>  */
> #define TASK_INIT(task, priority, func, context) do { \
>   (task)->ta_pending = 0; \
> + (task)->ta_flags = 0;   \
>   (task)->ta_priority = (priority);   \
>   (task)->ta_func = (func);   \
>   (task)->ta_context = (context); \
> 

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


svn commit: r300216 - head/sys/boot/efi/loader

2016-05-19 Thread Warner Losh
Author: imp
Date: Thu May 19 16:36:06 2016
New Revision: 300216
URL: https://svnweb.freebsd.org/changeset/base/300216

Log:
  Fix logic error so UEFI variables are reported correctly
  without error at the end.

Modified:
  head/sys/boot/efi/loader/main.c

Modified: head/sys/boot/efi/loader/main.c
==
--- head/sys/boot/efi/loader/main.c Thu May 19 16:28:05 2016
(r300215)
+++ head/sys/boot/efi/loader/main.c Thu May 19 16:36:06 2016
(r300216)
@@ -891,24 +891,26 @@ command_efi_printenv(int argc, char *arg
 */
varsz = nitems(varname);
varname[0] = 0;
-   status = RS->GetNextVariableName(, varname, );
-   while (status != EFI_NOT_FOUND) {
-   status = RS->GetNextVariableName(, varname,
-   );
+   while ((status = RS->GetNextVariableName(, varname, )) !=
+   EFI_NOT_FOUND) {
if (aflag) {
if (efi_print_var(varname, , lflag) != CMD_OK)
break;
continue;
}
if (vflag) {
-   if (wcscmp(varnamearg, varname) == 0)
+   if (wcscmp(varnamearg, varname) == 0) {
if (efi_print_var(varname, , lflag) != 
CMD_OK)
break;
+   continue;
+   }
}
if (gflag) {
-   if (memcmp(, , sizeof(varguid)) == 0)
+   if (memcmp(, , sizeof(varguid)) == 0) 
{
if (efi_print_var(varname, , lflag) != 
CMD_OK)
break;
+   continue;
+   }
}
}
pager_close();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300215 - head/sys/net

2016-05-19 Thread Pedro F. Giffuni
Author: pfg
Date: Thu May 19 16:28:05 2016
New Revision: 300215
URL: https://svnweb.freebsd.org/changeset/base/300215

Log:
  sys/net: more spelling.

Modified:
  head/sys/net/mp_ring.c

Modified: head/sys/net/mp_ring.c
==
--- head/sys/net/mp_ring.c  Thu May 19 16:04:20 2016(r300214)
+++ head/sys/net/mp_ring.c  Thu May 19 16:28:05 2016(r300215)
@@ -358,7 +358,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, v
/*
 * Wait for other producers who got in ahead of us to enqueue their
 * items, one producer at a time.  It is our turn when the ring's
-* pidx_tail reaches the begining of our reservation (pidx_start).
+* pidx_tail reaches the beginning of our reservation (pidx_start).
 */
while (ns.pidx_tail != pidx_start) {
cpu_spinwait();
@@ -432,7 +432,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, v
/*
 * Wait for other producers who got in ahead of us to enqueue their
 * items, one producer at a time.  It is our turn when the ring's
-* pidx_tail reaches the begining of our reservation (pidx_start).
+* pidx_tail reaches the beginning of our reservation (pidx_start).
 */
while (ns.pidx_tail != pidx_start) {
cpu_spinwait();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300214 - in stable/10: sbin/devd sys/geom

2016-05-19 Thread Alan Somers
Author: asomers
Date: Thu May 19 16:04:20 2016
New Revision: 300214
URL: https://svnweb.freebsd.org/changeset/base/300214

Log:
  MFC r298420, r298439, r298644
  
  r298420 | asomers | 2016-04-21 10:43:15 -0600 (Thu, 21 Apr 2016) | 10 lines
  
  Notify userspace listeners when geom disk attributes have changed
  
  sys/geom/geom_disk.c:
  disk_attr_changed(): Generate a devctl event of type GEOM: for
  every call.
  
  r298439 | asomers | 2016-04-21 15:13:41 -0600 (Thu, 21 Apr 2016) | 10 lines
  
  DRY on buffer sizes.  Update to r298420.
  
  sys/geom/geom_disk.c:
  In disk_attr_changed, don't repeat a buffer size.
  
  r298644 | asomers | 2016-04-26 08:48:58 -0600 (Tue, 26 Apr 2016) | 8 lines
  
  Add GEOM::physpath documentation to devd.conf(5)

Modified:
  stable/10/sbin/devd/devd.conf.5
  stable/10/sys/geom/geom_disk.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/devd/devd.conf.5
==
--- stable/10/sbin/devd/devd.conf.5 Thu May 19 16:02:02 2016
(r300213)
+++ stable/10/sbin/devd/devd.conf.5 Thu May 19 16:04:20 2016
(r300214)
@@ -424,6 +424,8 @@ device node is created.
 A
 .Xr geom 4
 device node is destroyed.
+.It Li GEOM::physpath
+The physical path of a device has changed.
 .It Li MEDIACHANGE
 Physical media has changed.
 .El

Modified: stable/10/sys/geom/geom_disk.c
==
--- stable/10/sys/geom/geom_disk.c  Thu May 19 16:02:02 2016
(r300213)
+++ stable/10/sys/geom/geom_disk.c  Thu May 19 16:04:20 2016
(r300214)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -861,11 +862,15 @@ disk_attr_changed(struct disk *dp, const
 {
struct g_geom *gp;
struct g_provider *pp;
+   char devnamebuf[128];
 
gp = dp->d_geom;
if (gp != NULL)
LIST_FOREACH(pp, >provider, provider)
(void)g_attr_changed(pp, attr, flag);
+   snprintf(devnamebuf, sizeof(devnamebuf), "devname=%s%d", dp->d_name,
+   dp->d_unit);
+   devctl_notify("GEOM", "disk", attr, devnamebuf);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300213 - head/sys/sys

2016-05-19 Thread Pedro F. Giffuni
Author: pfg
Date: Thu May 19 16:02:02 2016
New Revision: 300213
URL: https://svnweb.freebsd.org/changeset/base/300213

Log:
  sys/vmmeter.h: "desperate" spelling fix.

Modified:
  head/sys/sys/vmmeter.h

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Thu May 19 14:59:21 2016(r300212)
+++ head/sys/sys/vmmeter.h  Thu May 19 16:02:02 2016(r300213)
@@ -141,7 +141,7 @@ vm_page_count_severe(void)
  * we can execute potentially very expensive code in terms of memory.  It
  * is also used by the pageout daemon to calculate when to sleep, when
  * to wake waiters up, and when (after making a pass) to become more
- * desparate.
+ * desperate.
  */
 
 static __inline 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl

2016-05-19 Thread Alan Somers
On Thu, May 19, 2016 at 9:54 AM, Adrian Chadd 
wrote:

> On 19 May 2016 at 07:50, Kenneth D. Merry  wrote:
> > On Thu, May 19, 2016 at 15:30:37 +0100, Bruce Simpson wrote:
> >> Right On Commander!
> >>
> >> Now here is hoping the random-write issues with OpenZFS are solved...
> >
> > Well, this is of course only the underlying infrastructure for SMR
> drives.
> >
> > As for the random write issues with ZFS (or rather sequential I/O going
> out
> > in random order), we (Spectra) are working on that in general.
> >
> > The original plan was to do full SMR support for ZFS, but it looks like
> we
> > may get good enough write performance with Drive Managed drives by just
> > making writes from ZFS to drives more sequential rather than going for
> full
> > Host Aware and Host Managed support.  If that turns out that performance
> > isn't good enough after all, then we'll have to put in the effort to put
> > Host Aware support at least into ZFS.
> >
> > That's why I said (in the commit message) that I don't know of anyone
> > working on using the SMR infrastructure for UFS or ZFS.  Now that the
> > plumbing is in place in CAM and GEOM, it is possible at the filesystem
> > level if someone wants to do the work.
>
> Is it possible to use this from userland for now? Ie, probe whatever
> we need to in order to understand the transaction geometries (ie, the
> optimal sizes for reading/writing, etc) and then issue IOs that are in
> line with this?
>
>
>
> -adrian
>
>
Sure.  You can do all that with zonectl or its ioctls, if you have a
userland program that writes to raw block devices.  Reset Write Pointer is
supported, too.

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


Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl

2016-05-19 Thread Adrian Chadd
On 19 May 2016 at 07:50, Kenneth D. Merry  wrote:
> On Thu, May 19, 2016 at 15:30:37 +0100, Bruce Simpson wrote:
>> Right On Commander!
>>
>> Now here is hoping the random-write issues with OpenZFS are solved...
>
> Well, this is of course only the underlying infrastructure for SMR drives.
>
> As for the random write issues with ZFS (or rather sequential I/O going out
> in random order), we (Spectra) are working on that in general.
>
> The original plan was to do full SMR support for ZFS, but it looks like we
> may get good enough write performance with Drive Managed drives by just
> making writes from ZFS to drives more sequential rather than going for full
> Host Aware and Host Managed support.  If that turns out that performance
> isn't good enough after all, then we'll have to put in the effort to put
> Host Aware support at least into ZFS.
>
> That's why I said (in the commit message) that I don't know of anyone
> working on using the SMR infrastructure for UFS or ZFS.  Now that the
> plumbing is in place in CAM and GEOM, it is possible at the filesystem
> level if someone wants to do the work.

Is it possible to use this from userland for now? Ie, probe whatever
we need to in order to understand the transaction geometries (ie, the
optimal sizes for reading/writing, etc) and then issue IOs that are in
line with this?



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


svn commit: r300212 - head/usr.sbin/iscsid

2016-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 19 14:59:21 2016
New Revision: 300212
URL: https://svnweb.freebsd.org/changeset/base/300212

Log:
  When iscsid(8) is running in ICL proxy mode, don't try to send Logout PDUs.
  The kernel already does this for us when we ask it to terminate the session.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/discovery.c

Modified: head/usr.sbin/iscsid/discovery.c
==
--- head/usr.sbin/iscsid/discovery.cThu May 19 14:57:37 2016
(r300211)
+++ head/usr.sbin/iscsid/discovery.cThu May 19 14:59:21 2016
(r300212)
@@ -206,6 +206,18 @@ discovery(struct connection *conn)
log_debugx("removing temporary discovery session");
kernel_remove(conn);
 
+#ifdef ICL_KERNEL_PROXY
+   if (conn->conn_conf.isc_iser == 1) {
+   /*
+* If we're going through the proxy, the kernel already
+* sent Logout PDU for us and destroyed the session,
+* so we can't send anything anymore.
+*/
+   log_debugx("discovery session done");
+   return;
+   }
+#endif
+
log_debugx("discovery done; logging out");
request = logout_new_request(conn);
pdu_send(request);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300211 - head/sys/dev/iscsi

2016-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 19 14:57:37 2016
New Revision: 300211
URL: https://svnweb.freebsd.org/changeset/base/300211

Log:
  Make ICL proxy use kernel code for handling iSCSI sequence numbers
  for PDUs to/from iscsid(8).  This fixes StatSN for Logout PDUs sent
  by iscsi_session_logout().
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Thu May 19 14:45:34 2016(r300210)
+++ head/sys/dev/iscsi/iscsi.c  Thu May 19 14:57:37 2016(r300211)
@@ -713,6 +713,8 @@ iscsi_receive_callback(struct icl_pdu *r
 
ISCSI_SESSION_LOCK(is);
 
+   iscsi_pdu_update_statsn(response);
+
 #ifdef ICL_KERNEL_PROXY
if (is->is_login_phase) {
if (is->is_login_pdu == NULL)
@@ -725,8 +727,6 @@ iscsi_receive_callback(struct icl_pdu *r
}
 #endif
 
-   iscsi_pdu_update_statsn(response);
-   
/*
 * The handling routine is responsible for freeing the PDU
 * when it's no longer needed.
@@ -1620,9 +1620,7 @@ iscsi_ioctl_daemon_send(struct iscsi_sof
KASSERT(error == 0, ("icl_pdu_append_data(..., M_WAITOK) 
failed"));
free(data, M_ISCSI);
}
-   ISCSI_SESSION_LOCK(is);
-   icl_pdu_queue(ip);
-   ISCSI_SESSION_UNLOCK(is);
+   iscsi_pdu_queue(ip);
 
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl

2016-05-19 Thread Kenneth D. Merry
On Thu, May 19, 2016 at 15:30:37 +0100, Bruce Simpson wrote:
> Right On Commander!
> 
> Now here is hoping the random-write issues with OpenZFS are solved...

Well, this is of course only the underlying infrastructure for SMR drives.

As for the random write issues with ZFS (or rather sequential I/O going out
in random order), we (Spectra) are working on that in general.

The original plan was to do full SMR support for ZFS, but it looks like we
may get good enough write performance with Drive Managed drives by just
making writes from ZFS to drives more sequential rather than going for full
Host Aware and Host Managed support.  If that turns out that performance
isn't good enough after all, then we'll have to put in the effort to put
Host Aware support at least into ZFS.

That's why I said (in the commit message) that I don't know of anyone
working on using the SMR infrastructure for UFS or ZFS.  Now that the
plumbing is in place in CAM and GEOM, it is possible at the filesystem
level if someone wants to do the work.

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


Re: svn commit: r300206 - head/sys/arm64/include

2016-05-19 Thread Andrew Turner
On Thu, 19 May 2016 07:22:51 -0700
John Baldwin  wrote:

> On Thursday, May 19, 2016 02:00:18 PM Andrew Turner wrote:
> > Author: andrew
> > Date: Thu May 19 14:00:18 2016
> > New Revision: 300206
> > URL: https://svnweb.freebsd.org/changeset/base/300206
> > 
> > Log:
> >   Define PCI_RES_BUS for NEW_PCIB
> >   
> >   Obtained from:ABT Systems Ltd
> >   Sponsored by: The FreeBSD Foundation  
> 
> Does it work? :)  You'd need to handle it explicitly in non-ACPI
> Host-PCI bridge drivers.
> 

See https://reviews.freebsd.org/D6453 for the review.

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


svn commit: r300210 - head/usr.sbin/ctld

2016-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 19 14:45:34 2016
New Revision: 300210
URL: https://svnweb.freebsd.org/changeset/base/300210

Log:
  Fix error message.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/discovery.c

Modified: head/usr.sbin/ctld/discovery.c
==
--- head/usr.sbin/ctld/discovery.c  Thu May 19 14:37:24 2016
(r300209)
+++ head/usr.sbin/ctld/discovery.c  Thu May 19 14:45:34 2016
(r300210)
@@ -69,7 +69,7 @@ text_receive(struct connection *conn)
"was %u, is %u", conn->conn_cmdsn, 
ntohl(bhstr->bhstr_cmdsn));
}
if (ntohl(bhstr->bhstr_expstatsn) != conn->conn_statsn) {
-   log_errx(1, "received Text PDU with wrong StatSN: "
+   log_errx(1, "received Text PDU with wrong ExpStatSN: "
"is %u, should be %u", ntohl(bhstr->bhstr_expstatsn),
conn->conn_statsn);
}
@@ -127,7 +127,7 @@ logout_receive(struct connection *conn)
ntohl(bhslr->bhslr_cmdsn));
}
if (ntohl(bhslr->bhslr_expstatsn) != conn->conn_statsn) {
-   log_errx(1, "received Logout PDU with wrong StatSN: "
+   log_errx(1, "received Logout PDU with wrong ExpStatSN: "
"is %u, should be %u", ntohl(bhslr->bhslr_expstatsn),
conn->conn_statsn);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300209 - head/sys/dev/iscsi

2016-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 19 14:37:24 2016
New Revision: 300209
URL: https://svnweb.freebsd.org/changeset/base/300209

Log:
  Make it possible to interrupt proxy-mode iscsid receive.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Thu May 19 14:19:01 2016(r300208)
+++ head/sys/dev/iscsi/iscsi.c  Thu May 19 14:37:24 2016(r300209)
@@ -1634,6 +1634,7 @@ iscsi_ioctl_daemon_receive(struct iscsi_
struct iscsi_session *is;
struct icl_pdu *ip;
void *data;
+   int error;
 
sx_slock(>sc_lock);
TAILQ_FOREACH(is, >sc_sessions, is_next) {
@@ -1652,8 +1653,13 @@ iscsi_ioctl_daemon_receive(struct iscsi_
ISCSI_SESSION_LOCK(is);
while (is->is_login_pdu == NULL &&
is->is_terminating == false &&
-   is->is_reconnecting == false)
-   cv_wait(>is_login_cv, >is_lock);
+   is->is_reconnecting == false) {
+   error = cv_wait_sig(>is_login_cv, >is_lock);
+   if (error != 0) {
+   ISCSI_SESSION_UNLOCK(is);
+   return (error);
+   }
+   }
if (is->is_terminating || is->is_reconnecting) {
ISCSI_SESSION_UNLOCK(is);
return (EIO);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl

2016-05-19 Thread Bruce Simpson

Right On Commander!

Now here is hoping the random-write issues with OpenZFS are solved...
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300206 - head/sys/arm64/include

2016-05-19 Thread John Baldwin
On Thursday, May 19, 2016 02:00:18 PM Andrew Turner wrote:
> Author: andrew
> Date: Thu May 19 14:00:18 2016
> New Revision: 300206
> URL: https://svnweb.freebsd.org/changeset/base/300206
> 
> Log:
>   Define PCI_RES_BUS for NEW_PCIB
>   
>   Obtained from:  ABT Systems Ltd
>   Sponsored by:   The FreeBSD Foundation

Does it work? :)  You'd need to handle it explicitly in non-ACPI
Host-PCI bridge drivers.

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


svn commit: r300208 - head/sys/mips/conf

2016-05-19 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 19 14:19:01 2016
New Revision: 300208
URL: https://svnweb.freebsd.org/changeset/base/300208

Log:
  Exclude BCM from universe build until it compiles again.

Modified:
  head/sys/mips/conf/BCM

Modified: head/sys/mips/conf/BCM
==
--- head/sys/mips/conf/BCM  Thu May 19 14:08:36 2016(r300207)
+++ head/sys/mips/conf/BCM  Thu May 19 14:19:01 2016(r300208)
@@ -5,6 +5,8 @@
 # used in COTS hardware including the ASUS RT-N12, RT-N16, RT-N53.
 #
 
+#NO_UNIVERSE
+
 ident  BCM
 
 hints  "BCM.hints"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300113 - in head/sys: conf kern net sys

2016-05-19 Thread Bjoern A. Zeeb

> On 18 May 2016, at 04:35 , Scott Long  wrote:
> 
> Author: scottl
> Date: Wed May 18 04:35:58 2016
> New Revision: 300113
> URL: https://svnweb.freebsd.org/changeset/base/300113
> 
> Log:
>  Import the 'iflib' API library for network drivers.  From the author:
> 
>  "iflib is a library to eliminate the need for frequently duplicated device
>  independent logic propagated (poorly) across many network drivers."
> 
>  Participation is purely optional.  The IFLIB kernel config option is
>  provided for drivers that want to transition between legacy and iflib
>  modes of operation.  ixl and ixgbe driver conversions will be committed
>  shortly.  We hope to see participation from the Broadcom and maybe
>  Chelsio drivers in the near future.
> 
>  Submitted by:   mm...@nextbsd.org
>  Reviewed by:gallatin
>  Differential Revision:  D5211


Can someone explain to me why I am seeing this now and what it means?

taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0


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


svn commit: r300207 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/dev/ahci sys/geom sys/geom/eli sys/kern sys/sys usr.sbin usr.sbin/diskinfo usr.sbin/zonectl

2016-05-19 Thread Kenneth D. Merry
Author: ken
Date: Thu May 19 14:08:36 2016
New Revision: 300207
URL: https://svnweb.freebsd.org/changeset/base/300207

Log:
  Add support for managing Shingled Magnetic Recording (SMR) drives.
  
  This change includes support for SCSI SMR drives (which conform to the
  Zoned Block Commands or ZBC spec) and ATA SMR drives (which conform to
  the Zoned ATA Command Set or ZAC spec) behind SAS expanders.
  
  This includes full management support through the GEOM BIO interface, and
  through a new userland utility, zonectl(8), and through camcontrol(8).
  
  This is now ready for filesystems to use to detect and manage zoned drives.
  (There is no work in progress that I know of to use this for ZFS or UFS, if
  anyone is interested, let me know and I may have some suggestions.)
  
  Also, improve ATA command passthrough and dispatch support, both via ATA
  and ATA passthrough over SCSI.
  
  Also, add support to camcontrol(8) for the ATA Extended Power Conditions
  feature set.  You can now manage ATA device power states, and set various
  idle time thresholds for a drive to enter lower power states.
  
  Note that this change cannot be MFCed in full, because it depends on
  changes to the struct bio API that break compatilibity.  In order to
  avoid breaking the stable API, only changes that don't touch or depend on
  the struct bio changes can be merged.  For example, the camcontrol(8)
  changes don't depend on the new bio API, but zonectl(8) and the probe
  changes to the da(4) and ada(4) drivers do depend on it.
  
  Also note that the SMR changes have not yet been tested with an actual
  SCSI ZBC device, or a SCSI to ATA translation layer (SAT) that supports
  ZBC to ZAC translation.  I have not yet gotten a suitable drive or SAT
  layer, so any testing help would be appreciated.  These changes have been
  tested with Seagate Host Aware SATA drives attached to both SAS and SATA
  controllers.  Also, I do not have any SATA Host Managed devices, and I
  suspect that it may take additional (hopefully minor) changes to support
  them.
  
  Thanks to Seagate for supplying the test hardware and answering questions.
  
  sbin/camcontrol/Makefile:
Add epc.c and zone.c.
  
  sbin/camcontrol/camcontrol.8:
Document the zone and epc subcommands.
  
  sbin/camcontrol/camcontrol.c:
Add the zone and epc subcommands.
  
Add auxiliary register support to build_ata_cmd().  Make sure to
set the CAM_ATAIO_NEEDRESULT, CAM_ATAIO_DMA, and CAM_ATAIO_FPDMA
flags as appropriate for ATA commands.
  
Add a new get_ata_status() function to parse ATA result from SCSI
sense descriptors (for ATA passthrough over SCSI) and ATA I/O
requests.
  
  sbin/camcontrol/camcontrol.h:
Update the build_ata_cmd() prototype
  
Add get_ata_status(), zone(), and epc().
  
  sbin/camcontrol/epc.c:
Support for ATA Extended Power Conditions features.  This includes
support for all features documented in the ACS-4 Revision 12
specification from t13.org (dated February 18, 2016).
  
The EPC feature set allows putting a drive into a power power mode
immediately, or setting timeouts so that the drive will
automatically enter progressively lower power states after various
idle times.
  
  sbin/camcontrol/fwdownload.c:
Update the firmware download code for the new build_ata_cmd()
arguments.
  
  sbin/camcontrol/zone.c:
Implement support for Shingled Magnetic Recording (SMR) drives
via SCSI Zoned Block Commands (ZBC) and ATA Zoned Device ATA
Command Set (ZAC).
  
These specs were developed in concert, and are functionally
identical.  The primary differences are due to SCSI and ATA
differences.  (SCSI is big endian, ATA is little endian, for
example.)
  
This includes support for all commands defined in the ZBC and
ZAC specs.
  
  sys/cam/ata/ata_all.c:
Decode a number of additional ATA command names in ata_op_string().
  
Add a new CCB building function, ata_read_log().
  
Add ata_zac_mgmt_in() and ata_zac_mgmt_out() CCB building
functions.  These support both DMA and NCQ encapsulation.
  
  sys/cam/ata/ata_all.h:
Add prototypes for ata_read_log(), ata_zac_mgmt_out(), and
ata_zac_mgmt_in().
  
  sys/cam/ata/ata_da.c:
Revamp the ada(4) driver to support zoned devices.
  
Add four new probe states to gather information needed for zone
support.
  
Add a new adasetflags() function to avoid duplication of large
blocks of flag setting between the async handler and register
functions.
  
Add new sysctl variables that describe zone support and paramters.
  
Add support for the new BIO_ZONE bio, and all of its subcommands:
DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP,
DISK_ZONE_REPORT_ZONES, and 

svn commit: r300206 - head/sys/arm64/include

2016-05-19 Thread Andrew Turner
Author: andrew
Date: Thu May 19 14:00:18 2016
New Revision: 300206
URL: https://svnweb.freebsd.org/changeset/base/300206

Log:
  Define PCI_RES_BUS for NEW_PCIB
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/include/resource.h

Modified: head/sys/arm64/include/resource.h
==
--- head/sys/arm64/include/resource.h   Thu May 19 13:52:12 2016
(r300205)
+++ head/sys/arm64/include/resource.h   Thu May 19 14:00:18 2016
(r300206)
@@ -42,5 +42,8 @@
 #defineSYS_RES_MEMORY  3   /* i/o memory */
 #defineSYS_RES_IOPORT  4   /* i/o ports */
 #defineSYS_RES_GPIO5   /* general purpose i/o */
+#ifdef NEW_PCIB
+#definePCI_RES_BUS 6   /* PCI bus numbers */
+#endif
 
 #endif /* !_MACHINE_RESOURCE_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300205 - head/sys/net

2016-05-19 Thread Michael Tuexen
Author: tuexen
Date: Thu May 19 13:52:12 2016
New Revision: 300205
URL: https://svnweb.freebsd.org/changeset/base/300205

Log:
  Allow writing IP packets of length TUNMRU no matter if TUNSIFHEAD is set
  or not.

Modified:
  head/sys/net/if_tun.c

Modified: head/sys/net/if_tun.c
==
--- head/sys/net/if_tun.c   Thu May 19 13:32:44 2016(r300204)
+++ head/sys/net/if_tun.c   Thu May 19 13:52:12 2016(r300205)
@@ -848,7 +848,7 @@ tunwrite(struct cdev *dev, struct uio *u
struct tun_softc *tp = dev->si_drv1;
struct ifnet*ifp = TUN2IFP(tp);
struct mbuf *m;
-   uint32_tfamily;
+   uint32_tfamily, mru;
int isr;
 
TUNDEBUG(ifp, "tunwrite\n");
@@ -860,7 +860,10 @@ tunwrite(struct cdev *dev, struct uio *u
if (uio->uio_resid == 0)
return (0);
 
-   if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
+   mru = TUNMRU;
+   if (tp->tun_flags & TUN_IFHEAD)
+   mru += sizeof(family);
+   if (uio->uio_resid < 0 || uio->uio_resid > mru) {
TUNDEBUG(ifp, "len=%zd!\n", uio->uio_resid);
return (EIO);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-19 Thread Alexey Dokuchaev
On Tue, May 17, 2016 at 11:29:01AM -0500, Pedro Giffuni wrote:
> Hello;
> 
> On 05/17/16 10:36, George V. Neville-Neil wrote:
> > Author: gnn
> > Date: Tue May 17 15:36:40 2016
> > New Revision: 300062
> > URL: https://svnweb.freebsd.org/changeset/base/300062
> >
> > Log:
> >   Kill off ReiserFS as it is no longer supported, for obvious reasons.
> 
> It's not so obvious since the fs worked and could've been useful for
> people migrating from ancient linux.

And not just that.  Simply having ability to boot off Live CD and read
some exotic filesystem is cool.  What was wrong with ReiserFS, was it
broken or something?  (NTFS support is another great loss of ours.)

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


svn commit: r300202 - head/sys/netinet6

2016-05-19 Thread Andrey V. Elsukov
Author: ae
Date: Thu May 19 12:45:20 2016
New Revision: 300202
URL: https://svnweb.freebsd.org/changeset/base/300202

Log:
  Since PFIL can change destination address, use its always actual value
  from mbuf when calculating path mtu. Remove now unused finaldst variable.
  Also constify dst argument in ip6_getpmtu() and ip6_getpmtu_ctl().
  
  Reviewed by:  melifaro
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Thu May 19 11:19:37 2016
(r300201)
+++ head/sys/netinet6/ip6_output.c  Thu May 19 12:45:20 2016
(r300202)
@@ -149,10 +149,10 @@ static int ip6_insertfraghdr(struct mbuf
 static int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t);
 static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *);
 static int ip6_getpmtu(struct route_in6 *, int,
-   struct ifnet *, struct in6_addr *, u_long *, int *, u_int);
+   struct ifnet *, const struct in6_addr *, u_long *, int *, u_int);
 static int ip6_calcmtu(struct ifnet *, const struct in6_addr *, u_long,
u_long *, int *);
-static int ip6_getpmtu_ctl(u_int, struct in6_addr *, u_long *);
+static int ip6_getpmtu_ctl(u_int, const struct in6_addr *, u_long *);
 static int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int);
 
 
@@ -313,7 +313,7 @@ ip6_output(struct mbuf *m0, struct ip6_p
int alwaysfrag, dontfrag;
u_int32_t optlen = 0, plen = 0, unfragpartlen = 0;
struct ip6_exthdrs exthdrs;
-   struct in6_addr finaldst, src0, dst0;
+   struct in6_addr src0, dst0;
u_int32_t zone;
struct route_in6 *ro_pmtu = NULL;
int hdrsplit = 0;
@@ -338,7 +338,6 @@ ip6_output(struct mbuf *m0, struct ip6_p
}
}
 
-   finaldst = ip6->ip6_dst;
bzero(, sizeof(exthdrs));
if (opt) {
/* Hop-by-Hop options header */
@@ -727,8 +726,8 @@ again:
*ifpp = ifp;
 
/* Determine path MTU. */
-   if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, , ,
-   , fibnum)) != 0)
+   if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, >ip6_dst,
+   , , fibnum)) != 0)
goto bad;
 
/*
@@ -1239,7 +1238,7 @@ ip6_insertfraghdr(struct mbuf *m0, struc
  * Returns 0 on success.
  */
 static int
-ip6_getpmtu_ctl(u_int fibnum, struct in6_addr *dst, u_long *mtup)
+ip6_getpmtu_ctl(u_int fibnum, const struct in6_addr *dst, u_long *mtup)
 {
struct nhop6_extended nh6;
struct in6_addr kdst;
@@ -1273,7 +1272,7 @@ ip6_getpmtu_ctl(u_int fibnum, struct in6
  */
 static int
 ip6_getpmtu(struct route_in6 *ro_pmtu, int do_lookup,
-struct ifnet *ifp, struct in6_addr *dst, u_long *mtup,
+struct ifnet *ifp, const struct in6_addr *dst, u_long *mtup,
 int *alwaysfragp, u_int fibnum)
 {
struct nhop6_basic nh6;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r300113 - in head/sys: conf kern net sys

2016-05-19 Thread Kristof Provost



On 19 May 2016, at 17:36, Andriy Gapon wrote:


On 19/05/2016 14:37, Kristof Provost wrote:



On 18 May 2016, at 10:05, Scott Long wrote:


Author: scottl
Date: Wed May 18 04:35:58 2016
New Revision: 300113
URL: https://svnweb.freebsd.org/changeset/base/300113

Log:
  Import the 'iflib' API library for network drivers.  From the 
author:


For reasons I don’t understand right now this appears to break boot 
on my T61.
It’s got an em NIC (82566MM) and is running root-on-zfs, if that 
matters.


It mounts the rootfs and then just freezes. I’m investigating, but 
would

appreciate any hints or thoughts.


Alexander has just committed r300201.  It should help.

Indeed, I’ve just updated to include that fix, and now the system 
boots.


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

Re: svn commit: r299753 - head/sys/fs/fuse

2016-05-19 Thread Alexey Dokuchaev
On Mon, May 16, 2016 at 06:56:35PM -0400, Rick Macklem wrote:
> Alexey Dokuchaev wrote:
> > On Sat, May 14, 2016 at 08:03:22PM +, Rick Macklem wrote:
> > > New Revision: 299753
> > > URL: https://svnweb.freebsd.org/changeset/base/299753
> > > 
> > > Log:
> > >   Fix fuse to use DIRECT_IO when required.
> > >   
> > >   When a file is opened write-only and a partial block was written,
> > >   buffered I/O would try and read the whole block in. This would
> > >   result in a hung thread, since there was no open (fuse filehandle)
> > >   that allowed reading. This patch avoids the problem by forcing
> > >   DIRECT_IO for this case.
> > >   It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO
> > >   flag in its reply to the open.
> > 
> > Since you're at fuse now, perhaps you could also have a look at PR 195000?
> > 
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195000
> 
> I was able to test the patch and it stops the crash.
> I took out the MPASS() call because I didn't see why it should panic
> for VFIFO instead of returning EINVAL like the rest.
> 
> If you'd like to commit it, email soon. Otherwise I will commit it.

Rick, if I could've committed it, I would've done it long time ago. ;-)
I'm lucky to finaly drag competent src committer's attention to this PR.

Please go ahead of course, no waiting required.

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


Re: svn commit: r300113 - in head/sys: conf kern net sys

2016-05-19 Thread Andriy Gapon
On 19/05/2016 14:37, Kristof Provost wrote:
> 
> 
> On 18 May 2016, at 10:05, Scott Long wrote:
> 
>> Author: scottl
>> Date: Wed May 18 04:35:58 2016
>> New Revision: 300113
>> URL: https://svnweb.freebsd.org/changeset/base/300113
>>
>> Log:
>>   Import the 'iflib' API library for network drivers.  From the author:
> 
> For reasons I don’t understand right now this appears to break boot on my T61.
> It’s got an em NIC (82566MM) and is running root-on-zfs, if that matters.
> 
> It mounts the rootfs and then just freezes. I’m investigating, but would
> appreciate any hints or thoughts.

Alexander has just committed r300201.  It should help.

> 
>> Modified: head/sys/kern/subr_taskqueue.c
>> ==
>> --- head/sys/kern/subr_taskqueue.cWed May 18 04:04:14 2016(r300112)
>> +++ head/sys/kern/subr_taskqueue.cWed May 18 04:35:58 2016(r300113)
>> @@ -119,11 +123,17 @@ TQ_SLEEP(struct taskqueue *tq, void *p,
>>  }
>>
>>  static struct taskqueue *
>> -_taskqueue_create(const char *name __unused, int mflags,
>> +_taskqueue_create(const char *name, int mflags,
>>   taskqueue_enqueue_fn enqueue, void *context,
>> - int mtxflags, const char *mtxname)
>> + int mtxflags, const char *mtxname __unused)
>>  {
>>  struct taskqueue *queue;
>> +char *tq_name = NULL;
>> +
>> +if (name != NULL)
>> +tq_name = strndup(name, 32, M_TASKQUEUE);
>> +if (tq_name == NULL)
>> +tq_name = "taskqueue";
> 
> This looks wrong. It’s later free()ed.
> 
>>
>> @@ -194,6 +206,7 @@ taskqueue_free(struct taskqueue *queue)
>>  KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks"));
>>  mtx_destroy(>tq_mutex);
>>  free(queue->tq_threads, M_TASKQUEUE);
>> +free(queue->tq_name, M_TASKQUEUE);
> 
> This potentially frees a constant pointer.
> 
> Regards,
> Kristof
> 


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

Re: svn commit: r300113 - in head/sys: conf kern net sys

2016-05-19 Thread Kristof Provost



On 18 May 2016, at 10:05, Scott Long wrote:


Author: scottl
Date: Wed May 18 04:35:58 2016
New Revision: 300113
URL: https://svnweb.freebsd.org/changeset/base/300113

Log:
  Import the 'iflib' API library for network drivers.  From the 
author:


For reasons I don’t understand right now this appears to break boot on 
my T61.
It’s got an em NIC (82566MM) and is running root-on-zfs, if that 
matters.


It mounts the rootfs and then just freezes. I’m investigating, but 
would appreciate any hints or thoughts.




Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Wed May 18 04:04:14 2016
(r300112)
+++ head/sys/kern/subr_taskqueue.c  Wed May 18 04:35:58 2016
(r300113)
@@ -119,11 +123,17 @@ TQ_SLEEP(struct taskqueue *tq, void *p,
 }

 static struct taskqueue *
-_taskqueue_create(const char *name __unused, int mflags,
+_taskqueue_create(const char *name, int mflags,
 taskqueue_enqueue_fn enqueue, void *context,
-int mtxflags, const char *mtxname)
+int mtxflags, const char *mtxname __unused)
 {
struct taskqueue *queue;
+   char *tq_name = NULL;
+
+   if (name != NULL)
+   tq_name = strndup(name, 32, M_TASKQUEUE);
+   if (tq_name == NULL)
+   tq_name = "taskqueue";


This looks wrong. It’s later free()ed.



@@ -194,6 +206,7 @@ taskqueue_free(struct taskqueue *queue)
KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks"));
mtx_destroy(>tq_mutex);
free(queue->tq_threads, M_TASKQUEUE);
+   free(queue->tq_name, M_TASKQUEUE);


This potentially frees a constant pointer.

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

svn commit: r300201 - head/sys/sys

2016-05-19 Thread Alexander Motin
Author: mav
Date: Thu May 19 11:19:37 2016
New Revision: 300201
URL: https://svnweb.freebsd.org/changeset/base/300201

Log:
  Add ta_flags initialization in old macros missed in 300113.
  
  Depending on uninitialized memory content it could cause loss of wakeup()
  call in taskqueue_run_locked().

Modified:
  head/sys/sys/taskqueue.h

Modified: head/sys/sys/taskqueue.h
==
--- head/sys/sys/taskqueue.hThu May 19 11:02:39 2016(r300200)
+++ head/sys/sys/taskqueue.hThu May 19 11:19:37 2016(r300201)
@@ -97,6 +97,7 @@ void  taskqueue_set_callback(struct taskq
 
 #define TASK_INITIALIZER(priority, func, context)  \
{ .ta_pending = 0,  \
+ .ta_flags = 0,\
  .ta_priority = (priority),\
  .ta_func = (func),\
  .ta_context = (context) }
@@ -112,6 +113,7 @@ voidtaskqueue_thread_enqueue(void *cont
  */
 #define TASK_INIT(task, priority, func, context) do {  \
(task)->ta_pending = 0; \
+   (task)->ta_flags = 0;   \
(task)->ta_priority = (priority);   \
(task)->ta_func = (func);   \
(task)->ta_context = (context); \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300200 - head/sys/dev/usb/controller

2016-05-19 Thread Hans Petter Selasky
Author: hselasky
Date: Thu May 19 11:02:39 2016
New Revision: 300200
URL: https://svnweb.freebsd.org/changeset/base/300200

Log:
  Fix bad sizeof().
  
  Submitted by: David Binderman 
  PR:   209636

Modified:
  head/sys/dev/usb/controller/generic_ohci.c

Modified: head/sys/dev/usb/controller/generic_ohci.c
==
--- head/sys/dev/usb/controller/generic_ohci.c  Thu May 19 10:56:55 2016
(r300199)
+++ head/sys/dev/usb/controller/generic_ohci.c  Thu May 19 11:02:39 2016
(r300200)
@@ -166,7 +166,7 @@ generic_ohci_attach(device_t dev)
clk_get_name(clk));
goto error;
}
-   clkp = malloc(sizeof(clkp), M_DEVBUF, M_WAITOK | M_ZERO);
+   clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO);
clkp->clk = clk;
TAILQ_INSERT_TAIL(>clk_list, clkp, next);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300199 - head/share/man/man8

2016-05-19 Thread Maxim Konovalov
Author: maxim
Date: Thu May 19 10:56:55 2016
New Revision: 300199
URL: https://svnweb.freebsd.org/changeset/base/300199

Log:
  o -f, -i, -K, -q, -v, -X flags documented.

Modified:
  head/share/man/man8/nanobsd.8

Modified: head/share/man/man8/nanobsd.8
==
--- head/share/man/man8/nanobsd.8   Thu May 19 10:39:04 2016
(r300198)
+++ head/share/man/man8/nanobsd.8   Thu May 19 10:56:55 2016
(r300199)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 20, 2010
+.Dd May 19, 2016
 .Dt NANOBSD 8
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 applications
 .Sh SYNOPSIS
 .Nm
-.Op Fl bhknw
+.Op Fl bfhiKknqvwX
 .Op Fl c Ar config-file
 .Sh DESCRIPTION
 The
@@ -53,8 +53,16 @@ The following options are available:
 Skip the build stages (both for kernel and world).
 .It Fl c Ar config-file
 Specify the configuration file to use.
+.It Fl f
+Skip the code slice extraction.
 .It Fl h
 Display usage information.
+.It Fl i
+Skip the disk image build stage.
+.It Fl K
+Skip the
+.Cm installkernel
+stage of the build.
 .It Fl k
 Skip the
 .Cm buildkernel
@@ -65,10 +73,17 @@ This suppresses the normal cleanup work 
 .Cm buildworld
 stage and adds -DNO_CLEAN to the make command line
 used for each build stage (world and kernel).
+.It Fl q
+Make output more quiet.
+.It Fl v
+Make output more verbose.
 .It Fl w
 Skip the
 .Cm buildworld
 stage of the build.
+.It Fl X
+Make
+.Cm native-xtools.
 .El
 .Pp
 The features of
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300198 - head/tools/tools/nanobsd

2016-05-19 Thread Maxim Konovalov
Author: maxim
Date: Thu May 19 10:39:04 2016
New Revision: 300198
URL: https://svnweb.freebsd.org/changeset/base/300198

Log:
  o Remove EoL whitespaces.

Modified:
  head/tools/tools/nanobsd/defaults.sh
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shThu May 19 10:37:44 2016
(r300197)
+++ head/tools/tools/nanobsd/defaults.shThu May 19 10:39:04 2016
(r300198)
@@ -195,7 +195,7 @@ NANO_DATADIR=""
 # in case they are stray in the build environment
 SRCCONF=/dev/null
 SRC_ENV_CONF=/dev/null
- 
+
 ###
 #
 # The functions which do the real work.
@@ -319,7 +319,7 @@ make_conf_build ( ) (
# in addition to the user's global settings
(
nano_global_make_env
-   echo "${CONF_WORLD}" 
+   echo "${CONF_WORLD}"
echo "${CONF_BUILD}"
) > ${NANO_MAKE_CONF_BUILD}
 )
@@ -429,7 +429,7 @@ install_kernel ( ) (
(
 
nano_make_install_env
-   nano_make_kernel_env
+   nano_make_kernel_env
 
if [ "${NANO_MODULES}" != "default" ]; then
MODULES_OVERRIDE="${NANO_MODULES}"
@@ -465,7 +465,7 @@ run_early_customize() {
 
pprint 2 "run early customize scripts"
for c in $NANO_EARLY_CUSTOMIZE
-   do  
+   do
pprint 2 "early customize \"$c\""
pprint 3 "log: ${NANO_LOG}/_.early_cust.$c"
pprint 4 "`type $c`"
@@ -529,7 +529,7 @@ fixup_before_diskimage ( ) (
echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" > 
${NANO_METALOG}
cat ${NANO_METALOG}.pre | ${NANO_TOOLS}/mtree-dedup.awk | \
sed -e 's/ size=[0-9][0-9]*//' | sort >> ${NANO_METALOG}
-   fi  
+   fi
 )
 
 setup_nanobsd ( ) (
@@ -603,11 +603,11 @@ setup_nanobsd_etc ( ) (
 
 prune_usr ( ) (
 
-   # Remove all empty directories in /usr 
+   # Remove all empty directories in /usr
find "${NANO_WORLDDIR}"/usr -type d -depth -print |
while read d
do
-   rmdir $d > /dev/null 2>&1 || true 
+   rmdir $d > /dev/null 2>&1 || true
done
 )
 
@@ -676,7 +676,7 @@ create_diskimage ( ) (
else
print "g c" 1023 " h" $4 " s" $3
 
-   if ($7 > 0) { 
+   if ($7 > 0) {
# size of data partition in full cylinders
dsl = int (($7 + cs - 1) / cs)
} else {
@@ -697,7 +697,7 @@ create_diskimage ( ) (
print "p 1 165 " $3, isl * cs - $3
c = isl * cs;
 
-   # Second image partition (if any) also starts offset one 
+   # Second image partition (if any) also starts offset one
# track to keep them identical.
if ($2 > 1) {
print "p 2 165 " $3 + c, isl * cs - $3
@@ -780,7 +780,7 @@ create_diskimage ( ) (
tunefs -L ${NANO_LABEL}"${NANO_ALTROOT}" 
/dev/${MD}${NANO_ALTROOT}
fi
fi
-   
+
# Create Config slice
populate_cfg_slice /dev/${MD}${NANO_SLICE_CFG} "${NANO_CFGDIR}" ${MNT} 
"${NANO_SLICE_CFG}"
 

Modified: head/tools/tools/nanobsd/nanobsd.sh
==
--- head/tools/tools/nanobsd/nanobsd.sh Thu May 19 10:37:44 2016
(r300197)
+++ head/tools/tools/nanobsd/nanobsd.sh Thu May 19 10:39:04 2016
(r300198)
@@ -55,7 +55,7 @@ set -e
 set -- $args
 for i
 do
-   case "$i" 
+   case "$i"
in
-K)
do_installkernel=false
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300197 - head/tools/tools/nanobsd

2016-05-19 Thread Maxim Konovalov
Author: maxim
Date: Thu May 19 10:37:44 2016
New Revision: 300197
URL: https://svnweb.freebsd.org/changeset/base/300197

Log:
  o usage() updated for -h and -X flags.

Modified:
  head/tools/tools/nanobsd/defaults.sh

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shThu May 19 06:29:43 2016
(r300196)
+++ head/tools/tools/nanobsd/defaults.shThu May 19 10:37:44 2016
(r300197)
@@ -1018,10 +1018,11 @@ pprint ( ) (
 
 usage ( ) {
(
-   echo "Usage: $0 [-bfiKknqvw] [-c config_file]"
+   echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]"
echo "  -b  suppress builds (both kernel and world)"
echo "  -c  specify config file"
echo "  -f  suppress code slice extraction"
+   echo "  -h  print this help summary page"
echo "  -i  suppress disk image build"
echo "  -K  suppress installkernel"
echo "  -k  suppress buildkernel"
@@ -1029,6 +1030,7 @@ usage ( ) {
echo "  -q  make output more quiet"
echo "  -v  make output more verbose"
echo "  -w  suppress buildworld"
+   echo "  -X  make native-xtools"
) 1>&2
exit 2
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300196 - head/sys/mips/mediatek

2016-05-19 Thread Stanislav Galabov
Author: sgalabov
Date: Thu May 19 06:29:43 2016
New Revision: 300196
URL: https://svnweb.freebsd.org/changeset/base/300196

Log:
  Ralink: Add more SoC compatible strings
  
  Add more 'compatible' strings found in various LEDE DTS files.
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  Sponsored by: Smartcom - Bulgaria AD
  Differential Revision:https://reviews.freebsd.org/D6432

Modified:
  head/sys/mips/mediatek/mtk_soc.c

Modified: head/sys/mips/mediatek/mtk_soc.c
==
--- head/sys/mips/mediatek/mtk_soc.cThu May 19 05:09:20 2016
(r300195)
+++ head/sys/mips/mediatek/mtk_soc.cThu May 19 06:29:43 2016
(r300196)
@@ -61,9 +61,12 @@ static const struct ofw_compat_data comp
{ "ralink,rt3883-soc",  MTK_SOC_RT3883 },
{ "ralink,rt5350-soc",  MTK_SOC_RT5350 },
{ "ralink,mtk7620a-soc",MTK_SOC_MT7620A },
+   { "ralink,mt7620a-soc", MTK_SOC_MT7620A },
{ "ralink,mtk7620n-soc",MTK_SOC_MT7620N },
+   { "ralink,mt7620n-soc", MTK_SOC_MT7620N },
{ "mediatek,mtk7621-soc",   MTK_SOC_MT7621 },
{ "mediatek,mt7621-soc",MTK_SOC_MT7621 },
+   { "ralink,mt7621-soc",  MTK_SOC_MT7621 },
{ "ralink,mtk7621-soc", MTK_SOC_MT7621 },
{ "ralink,mtk7628an-soc",   MTK_SOC_MT7628 },
{ "mediatek,mt7628an-soc",  MTK_SOC_MT7628 },
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"