svn commit: r271610 - in head: etc/rc.d sys/netinet

2014-09-15 Thread Hiroki Sato
Author: hrs
Date: Mon Sep 15 07:20:40 2014
New Revision: 271610
URL: http://svnweb.freebsd.org/changeset/base/271610

Log:
  Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and
  net.inet.ip.process_options vnet-aware.  Revert changes in r271545.
  
  Suggested by: bz

Modified:
  head/etc/rc.d/routing
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_options.c
  head/sys/netinet/ip_options.h

Modified: head/etc/rc.d/routing
==
--- head/etc/rc.d/routing   Mon Sep 15 06:21:28 2014(r271609)
+++ head/etc/rc.d/routing   Mon Sep 15 07:20:40 2014(r271610)
@@ -326,22 +326,20 @@ options_inet()
${SYSCTL} net.inet.ip.forwarding=0 > /dev/null
fi
 
-   if ! check_jail vnet; then
-   if checkyesno forward_sourceroute; then
-   ropts_init inet
-   echo -n ' do source routing=YES'
-   ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null
-   else
-   ${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null
-   fi
-
-   if checkyesno accept_sourceroute; then
-   ropts_init inet
-   echo -n ' accept source routing=YES'
-   ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null
-   else
-   ${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null
-   fi
+   if checkyesno forward_sourceroute; then
+   ropts_init inet
+   echo -n ' do source routing=YES'
+   ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null
+   else
+   ${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null
+   fi
+
+   if checkyesno accept_sourceroute; then
+   ropts_init inet
+   echo -n ' accept source routing=YES'
+   ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null
+   else
+   ${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null
fi
 
if checkyesno arpproxy_all; then

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Mon Sep 15 06:21:28 2014
(r271609)
+++ head/sys/netinet/ip_fastfwd.c   Mon Sep 15 07:20:40 2014
(r271610)
@@ -296,9 +296,9 @@ ip_fastforward(struct mbuf *m)
 * Only IP packets without options
 */
if (ip->ip_hl != (sizeof(struct ip) >> 2)) {
-   if (ip_doopts == 1)
+   if (V_ip_doopts == 1)
return m;
-   else if (ip_doopts == 2) {
+   else if (V_ip_doopts == 2) {
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_FILTER_PROHIB,
0, 0);
return NULL;/* mbuf already free'd */

Modified: head/sys/netinet/ip_options.c
==
--- head/sys/netinet/ip_options.c   Mon Sep 15 06:21:28 2014
(r271609)
+++ head/sys/netinet/ip_options.c   Mon Sep 15 07:20:40 2014
(r271610)
@@ -65,18 +65,21 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-static int ip_dosourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
-&ip_dosourceroute, 0, "Enable forwarding source routed IP packets");
-
-static int ip_acceptsourceroute = 0;
-SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 
-CTLFLAG_RW, &ip_acceptsourceroute, 0, 
+static VNET_DEFINE(int, ip_dosourceroute);
+SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
+&VNET_NAME(ip_dosourceroute), 0,
+"Enable forwarding source routed IP packets");
+#defineV_ip_dosourceroute  VNET(ip_dosourceroute)
+
+static VNET_DEFINE(int,ip_acceptsourceroute);
+SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 
+CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, 
 "Enable accepting source routed IP packets");
+#defineV_ip_acceptsourceroute  VNET(ip_acceptsourceroute)
 
-intip_doopts = 1;  /* 0 = ignore, 1 = process, 2 = reject */
-SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
-&ip_doopts, 0, "Enable IP options processing ([LS]SRR, RR, TS)");
+VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */
+SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
+&VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, 
TS)");
 
 static voidsave_rte(struct mbuf *m, u_char *, struct in_addr);
 
@@ -104,9 +107,9 @@ ip_dooptions(struct mbuf *m, int pass)
struct  sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
 
/* Ignore or reject packets with IP options. */
-   if (ip_doopts == 0)
+   if (V_ip_doopts == 0)
   

Re: svn commit: r271601 - in head/sys/arm: arm include

2014-09-15 Thread Andrew Turner
On Sun, 14 Sep 2014 21:21:04 + (UTC)
Ian Lepore  wrote:

...

> Modified: head/sys/arm/arm/gic.c
> ==
> --- head/sys/arm/arm/gic.cSun Sep 14 20:13:07 2014
> (r271600) +++ head/sys/arm/arm/gic.c  Sun Sep 14 21:21:03
> 2014  (r271601) @@ -185,6 +185,51 @@ gic_init_secondary(void)
>   gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F)));
>  }
>  
> +int
> +gic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt,
> +int *trig, int *pol)
> +{
> + static u_int num_intr_cells;
> +
> + if (num_intr_cells == 0) {
> + if (OF_searchencprop(OF_node_from_xref(iparent), 
> + "#interrupt-cells", &num_intr_cells, 
> + sizeof(num_intr_cells)) == -1) {
> + num_intr_cells = 1;
> + }
> + }
> +
> + if (num_intr_cells == 1) {
> + *interrupt = fdt32_to_cpu(intr[0]);
> + *trig = INTR_TRIGGER_CONFORM;
> + *pol = INTR_POLARITY_CONFORM;
> + } else {
> + if (intr[0] == 0)
> + *interrupt = fdt32_to_cpu(intr[1]) + 32;
> + else
> + *interrupt = fdt32_to_cpu(intr[1]);

Shouldn't the PPI case have a +16? The PPI interrupts start from 16
with 0-15 being used for software-generated interrupts. My copy of the
binding document state the values for the PPI interrupts should be in
the range 0 to 15 meaning they will be assigned an SGI value here.

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


Re: svn commit: r271604 - head/sys/kern

2014-09-15 Thread Konstantin Belousov
On Sun, Sep 14, 2014 at 10:13:19PM +, Alexander Motin wrote:
> Author: mav
> Date: Sun Sep 14 22:13:19 2014
> New Revision: 271604
> URL: http://svnweb.freebsd.org/changeset/base/271604
> 
> Log:
>   Add couple memory barries to serialize tdq_cpu_idle and tdq_load accesses.
Serialize what against what ?

It seems what you do is just ensuring that the write to tdq_cpu_idle in
sched_idletd() become visible faster than it was before your patch.
Memory barrier after the assignment of dq->tdq_cpu_idle = 1 flushes
write buffers, which makes the tdq_notify() to see the write immediately.
Am I right ?

If true, this must be commented to explain the stray barriers appearing
in the code.

>   
>   This change fixes transient performance drops in some of my benchmarks,
>   vanishing as soon as I am trying to collect any stats from the scheduler.
>   It looks like reordered access to those variables sometimes caused loss of
>   IPI_PREEMPT, that delayed thread execution until some later interrupt.
>   
>   MFC after:  3 days
> 
> Modified:
>   head/sys/kern/sched_ule.c
> 
> Modified: head/sys/kern/sched_ule.c
> ==
> --- head/sys/kern/sched_ule.c Sun Sep 14 22:10:35 2014(r271603)
> +++ head/sys/kern/sched_ule.c Sun Sep 14 22:13:19 2014(r271604)
> @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa
>   ctd = pcpu_find(cpu)->pc_curthread;
>   if (!sched_shouldpreempt(pri, ctd->td_priority, 1))
>   return;
> + mb();
>   if (TD_IS_IDLETHREAD(ctd)) {
>   /*
>* If the MD code has an idle wakeup routine try that before
> @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy)
>  
>   /* Run main MD idle handler. */
>   tdq->tdq_cpu_idle = 1;
> + mb();
>   cpu_idle(switchcnt * 4 > sched_idlespinthresh);
>   tdq->tdq_cpu_idle = 0;
>  
I suspect that what you are trying to do could be achieved by using
the FreeBSD API, instead of compat shims, in the following way.

diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 0a63c01..1ffac22 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1042,7 +1042,8 @@ tdq_notify(struct tdq *tdq, struct thread *td)
 * If the MD code has an idle wakeup routine try that before
 * falling back to IPI.
 */
-   if (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu))
+   if (!atomic_load_acq_int(&tdq->tdq_cpu_idle) ||
+   cpu_idle_wakeup(cpu))
return;
}
tdq->tdq_ipipending = 1;
@@ -2639,7 +2640,7 @@ sched_idletd(void *dummy)
continue;
 
/* Run main MD idle handler. */
-   tdq->tdq_cpu_idle = 1;
+   atomic_add_rel_int(&tdq->tdq_cpu_idle, 1);
cpu_idle(switchcnt * 4 > sched_idlespinthresh);
tdq->tdq_cpu_idle = 0;
 


pgpX7BcwB_8v0.pgp
Description: PGP signature


Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-09-15 Thread Andriy Gapon
On 11/09/2014 19:21, Steven Hartland wrote:
> Author: smh
> Date: Thu Sep 11 16:21:51 2014
> New Revision: 271429
> URL: http://svnweb.freebsd.org/changeset/base/271429
> 
> Log:
>   Persist vdev_resilver_txg changes to avoid panic caused by validation
>   vs a vdev_resilver_txg value from a previous resilver.

Looks that this change is a prime candidate for a discussion with OpenZFS folks.
 I know that it is a pain to go through all hoops for submitting a change to
illumos, but at the very least we should let them know of the problem.

>   MFC after:  1 week
> 
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
> ==
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.cThu Sep 
> 11 15:36:36 2014(r271428)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.cThu Sep 
> 11 16:21:51 2014(r271429)
> @@ -1951,12 +1951,15 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t
>  
>   /*
>* If the vdev was resilvering and no longer has any
> -  * DTLs then reset its resilvering flag.
> +  * DTLs then reset its resilvering flag and dirty
> +  * the top level so that we persist the change.
>*/
>   if (vd->vdev_resilver_txg != 0 &&
>   range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0 &&
> - range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0)
> + range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) {
>   vd->vdev_resilver_txg = 0;
> + vdev_config_dirty(vd->vdev_top);
> + }
>  
>   mutex_exit(&vd->vdev_dtl_lock);
>  
> 


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


Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-09-15 Thread Steven Hartland
- Original Message - 
From: "Andriy Gapon" 




On 11/09/2014 19:21, Steven Hartland wrote:

Author: smh
Date: Thu Sep 11 16:21:51 2014
New Revision: 271429
URL: http://svnweb.freebsd.org/changeset/base/271429

Log:
  Persist vdev_resilver_txg changes to avoid panic caused by validation
  vs a vdev_resilver_txg value from a previous resilver.


Looks that this change is a prime candidate for a discussion with OpenZFS folks.
I know that it is a pain to go through all hoops for submitting a change to
illumos, but at the very least we should let them know of the problem.


Yep I already raised the bug: https://www.illumos.org/issues/5154 ;-)

If I could actually send emails to their mailing list I would have discused but 
the
OpenZFS list has been broken for weeks. I've raised it with Matt, who directed
me at Luke but had no response from him :(

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


Re: svn commit: r271604 - head/sys/kern

2014-09-15 Thread Alexander Motin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 15.09.2014 11:51, Konstantin Belousov wrote:
> On Sun, Sep 14, 2014 at 10:13:19PM +, Alexander Motin wrote:
>> Author: mav Date: Sun Sep 14 22:13:19 2014 New Revision: 271604 
>> URL: http://svnweb.freebsd.org/changeset/base/271604
>> 
>> Log: Add couple memory barries to serialize tdq_cpu_idle and
>> tdq_load accesses.
> Serialize what against what ?
> 
> It seems what you do is just ensuring that the write to
> tdq_cpu_idle in sched_idletd() become visible faster than it was
> before your patch. Memory barrier after the assignment of
> dq->tdq_cpu_idle = 1 flushes write buffers, which makes the
> tdq_notify() to see the write immediately. Am I right ?

Right. My understanding of the problem is that tdq_notify() does not
see updated tdq_cpu_idle in time, while cpu_idle() does not see
updated tdq_load in time. From my experiments any one of those two
barriers appear enough to fix the problem, but I tried to be safe.

> If true, this must be commented to explain the stray barriers
> appearing in the code.
> 
>> 
>> This change fixes transient performance drops in some of my
>> benchmarks, vanishing as soon as I am trying to collect any stats
>> from the scheduler. It looks like reordered access to those
>> variables sometimes caused loss of IPI_PREEMPT, that delayed
>> thread execution until some later interrupt.
>> 
>> MFC after:   3 days
>> 
>> Modified: head/sys/kern/sched_ule.c
>> 
>> Modified: head/sys/kern/sched_ule.c 
>> ==
>>
>> 
- --- head/sys/kern/sched_ule.c Sun Sep 14 22:10:35 2014(r271603)
>> +++ head/sys/kern/sched_ule.cSun Sep 14 22:13:19 2014
>> (r271604) 
>> @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa 
>> ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri,
>> ctd->td_priority, 1)) return; +  mb(); if (TD_IS_IDLETHREAD(ctd))
>> { /* * If the MD code has an idle wakeup routine try that before 
>> @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy)
>> 
>> /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + mb(); 
>> cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle
>> = 0;
>> 
> I suspect that what you are trying to do could be achieved by
> using the FreeBSD API, instead of compat shims, in the following
> way.

I was really trying to do it native way originally, but haven't found
how. If I understand semantics right, I would need atomic_load_rel()
and atomic_store_acq(), but there is no such ones. Second one you
successfully replaced by atomic_add_rel(). But I am not sure about the
first -- on x86 your idea should work since uses LOCK CMPXCHG, but on
other platforms barrier is provided after the load, not before.

> diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index
> 0a63c01..1ffac22 100644 --- a/sys/kern/sched_ule.c +++
> b/sys/kern/sched_ule.c @@ -1042,7 +1042,8 @@ tdq_notify(struct tdq
> *tdq, struct thread *td) * If the MD code has an idle wakeup
> routine try that before * falling back to IPI. */ -   if
> (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) +if
> (!atomic_load_acq_int(&tdq->tdq_cpu_idle) || +
> cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending = 1; @@ -2639,7
> +2640,7 @@ sched_idletd(void *dummy) continue;
> 
> /* Run main MD idle handler. */ - tdq->tdq_cpu_idle = 1; +
> atomic_add_rel_int(&tdq->tdq_cpu_idle, 1); cpu_idle(switchcnt * 4 >
> sched_idlespinthresh); tdq->tdq_cpu_idle = 0;
> 
> 


- -- 
Alexander Motin
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQF8BAEBCgBmBQJUFquzXxSAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFOThDRjNDNEU2OUNDM0NEMEU1NzlENTU4
MzE4QzM5NTVCQUIyMjdGAAoJEIMYw5VbqyJ/3LUIAMizmXrjgfoQBLhD25fKhP0w
XulDxS4L0xGE17xDW0MTL7BJ8A/xz/nolY8SQFbHe5/7jlueqqG2PoSokrQMHpYw
IZ0aYy5rQw+ZgR40zRFbTY1iNdZ7K9QsB6qweWQztSnBvLvlQ0Nx+/YgeDNuHNe1
jWfJjmJLp3gz+/VQOUnHIBdslPS6YplOc5vQmc4NqFGhMplnhzWARJbLqxmYu7JK
HmeIP1uVxDEiG82TU+x4n21HehUi2POXAnygLrv0B4xqN4n8pYNyEtknesJiQO0t
lyrcXE2vWsDrLMrqCsaZc6pZEXqk8PJ4Og/v6S/XztV/FtrI5Ilqjz/i6e45b8Y=
=tfah
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-09-15 Thread Andriy Gapon
On 15/09/2014 12:04, Steven Hartland wrote:
> - Original Message - From: "Andriy Gapon" 
> 
> 
>> On 11/09/2014 19:21, Steven Hartland wrote:
>>> Author: smh
>>> Date: Thu Sep 11 16:21:51 2014
>>> New Revision: 271429
>>> URL: http://svnweb.freebsd.org/changeset/base/271429
>>>
>>> Log:
>>>   Persist vdev_resilver_txg changes to avoid panic caused by validation
>>>   vs a vdev_resilver_txg value from a previous resilver.
>>
>> Looks that this change is a prime candidate for a discussion with OpenZFS 
>> folks.
>> I know that it is a pain to go through all hoops for submitting a change to
>> illumos, but at the very least we should let them know of the problem.
> 
> Yep I already raised the bug: https://www.illumos.org/issues/5154 ;-)

Cool!

> If I could actually send emails to their mailing list I would have discused 
> but the
> OpenZFS list has been broken for weeks. I've raised it with Matt, who directed
> me at Luke but had no response from him :(

I haven't try to post to the list for quite a while but I occasionally see posts
on it.

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


Re: svn commit: r271604 - head/sys/kern

2014-09-15 Thread Konstantin Belousov
On Mon, Sep 15, 2014 at 12:04:51PM +0300, Alexander Motin wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> On 15.09.2014 11:51, Konstantin Belousov wrote:
> > On Sun, Sep 14, 2014 at 10:13:19PM +, Alexander Motin wrote:
> >> Author: mav Date: Sun Sep 14 22:13:19 2014 New Revision: 271604 
> >> URL: http://svnweb.freebsd.org/changeset/base/271604
> >> 
> >> Log: Add couple memory barries to serialize tdq_cpu_idle and
> >> tdq_load accesses.
> > Serialize what against what ?
> > 
> > It seems what you do is just ensuring that the write to
> > tdq_cpu_idle in sched_idletd() become visible faster than it was
> > before your patch. Memory barrier after the assignment of
> > dq->tdq_cpu_idle = 1 flushes write buffers, which makes the
> > tdq_notify() to see the write immediately. Am I right ?
> 
> Right. My understanding of the problem is that tdq_notify() does not
> see updated tdq_cpu_idle in time, while cpu_idle() does not see
> updated tdq_load in time. From my experiments any one of those two
> barriers appear enough to fix the problem, but I tried to be safe.
> 
> > If true, this must be commented to explain the stray barriers
> > appearing in the code.
> > 
> >> 
> >> This change fixes transient performance drops in some of my
> >> benchmarks, vanishing as soon as I am trying to collect any stats
> >> from the scheduler. It looks like reordered access to those
> >> variables sometimes caused loss of IPI_PREEMPT, that delayed
> >> thread execution until some later interrupt.
> >> 
> >> MFC after: 3 days
> >> 
> >> Modified: head/sys/kern/sched_ule.c
> >> 
> >> Modified: head/sys/kern/sched_ule.c 
> >> ==
> >>
> >> 
> - --- head/sys/kern/sched_ule.c   Sun Sep 14 22:10:35 2014
> (r271603)
> >> +++ head/sys/kern/sched_ule.c  Sun Sep 14 22:13:19 2014
> >> (r271604) 
> >> @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa 
> >> ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri,
> >> ctd->td_priority, 1)) return; +mb(); if (TD_IS_IDLETHREAD(ctd))
> >> { /* * If the MD code has an idle wakeup routine try that before 
> >> @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy)
> >> 
> >> /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; +   mb(); 
> >> cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle
> >> = 0;
> >> 
> > I suspect that what you are trying to do could be achieved by
> > using the FreeBSD API, instead of compat shims, in the following
> > way.
> 
> I was really trying to do it native way originally, but haven't found
> how. If I understand semantics right, I would need atomic_load_rel()
> and atomic_store_acq(), but there is no such ones. Second one you
> successfully replaced by atomic_add_rel(). But I am not sure about the
> first -- on x86 your idea should work since uses LOCK CMPXCHG, but on
> other platforms barrier is provided after the load, not before.
No, neither _acq/_rel, nor mb() do not provide formal semantic that
you want.  The write buffers (on x86), or read/write buffers on
other arches are the implementation detail.  The API of barriers
guarantees the visibility ordering of operations on other cores,
and is completely silent about visibility timing.

I.e., either your use of mb(), or store_rel() (it uses add_rel()
since store_rel() is without lock prefix due to TSO+ on x86) rely on
implementation details for x86.

This is why I do not see an advantage of using alien API of mb(),
and why I said that comment is required to explain what is going on.

> 
> > diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index
> > 0a63c01..1ffac22 100644 --- a/sys/kern/sched_ule.c +++
> > b/sys/kern/sched_ule.c @@ -1042,7 +1042,8 @@ tdq_notify(struct tdq
> > *tdq, struct thread *td) * If the MD code has an idle wakeup
> > routine try that before * falling back to IPI. */ - if
> > (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) +  if
> > (!atomic_load_acq_int(&tdq->tdq_cpu_idle) || +
> > cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending = 1; @@ -2639,7
> > +2640,7 @@ sched_idletd(void *dummy) continue;
> > 
> > /* Run main MD idle handler. */ -   tdq->tdq_cpu_idle = 1; +
> > atomic_add_rel_int(&tdq->tdq_cpu_idle, 1); cpu_idle(switchcnt * 4 >
> > sched_idlespinthresh); tdq->tdq_cpu_idle = 0;
> > 
> > 
> 
> 
> - -- 
> Alexander Motin
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iQF8BAEBCgBmBQJUFquzXxSAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
> ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFOThDRjNDNEU2OUNDM0NEMEU1NzlENTU4
> MzE4QzM5NTVCQUIyMjdGAAoJEIMYw5VbqyJ/3LUIAMizmXrjgfoQBLhD25fKhP0w
> XulDxS4L0xGE17xDW0MTL7BJ8A/xz/nolY8SQFbHe5/7jlueqqG2PoSokrQMHpYw
> IZ0aYy5rQw+ZgR40zRFbTY1iNdZ7K9QsB6qweWQztSnBvLvlQ0Nx+/YgeDNuHNe1
> jWfJjmJLp3gz+/VQOUnHIBdslPS6YplOc5vQmc4NqFGhMplnhzWARJbLqxmYu7JK
> HmeIP1uVxDEiG82TU+x4n21HehUi2POXAnygLrv0B4xqN4n8pYNy

svn commit: r271614 - in head/contrib/openpam: . bin bin/su doc doc/man include include/security misc modules modules/pam_deny modules/pam_permit modules/pam_unix

2014-09-15 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Sep 15 09:45:10 2014
New Revision: 271614
URL: http://svnweb.freebsd.org/changeset/base/271614

Log:
  Remove incorrect props

Modified:
Directory Properties:
  head/contrib/openpam/CREDITS   (props changed)
  head/contrib/openpam/HISTORY   (props changed)
  head/contrib/openpam/INSTALL   (props changed)
  head/contrib/openpam/LICENSE   (props changed)
  head/contrib/openpam/Makefile.am   (props changed)
  head/contrib/openpam/Makefile.in   (props changed)
  head/contrib/openpam/README   (props changed)
  head/contrib/openpam/RELNOTES   (props changed)
  head/contrib/openpam/aclocal.m4   (props changed)
  head/contrib/openpam/autogen.sh   (props changed)
  head/contrib/openpam/bin/Makefile.am   (props changed)
  head/contrib/openpam/bin/Makefile.in   (props changed)
  head/contrib/openpam/bin/su/Makefile.am   (props changed)
  head/contrib/openpam/bin/su/Makefile.in   (props changed)
  head/contrib/openpam/bin/su/su.c   (props changed)
  head/contrib/openpam/compile   (props changed)
  head/contrib/openpam/config.guess   (props changed)
  head/contrib/openpam/config.h.in   (props changed)
  head/contrib/openpam/config.sub   (props changed)
  head/contrib/openpam/configure   (props changed)
  head/contrib/openpam/configure.ac   (props changed)
  head/contrib/openpam/depcomp   (props changed)
  head/contrib/openpam/doc/Makefile.am   (props changed)
  head/contrib/openpam/doc/Makefile.in   (props changed)
  head/contrib/openpam/doc/man/Makefile.am   (props changed)
  head/contrib/openpam/doc/man/Makefile.in   (props changed)
  head/contrib/openpam/doc/man/openpam.3   (props changed)
  head/contrib/openpam/doc/man/openpam.man   (props changed)
  head/contrib/openpam/doc/man/openpam_borrow_cred.3   (props changed)
  head/contrib/openpam/doc/man/openpam_free_data.3   (props changed)
  head/contrib/openpam/doc/man/openpam_free_envlist.3   (props changed)
  head/contrib/openpam/doc/man/openpam_get_option.3   (props changed)
  head/contrib/openpam/doc/man/openpam_log.3   (props changed)
  head/contrib/openpam/doc/man/openpam_nullconv.3   (props changed)
  head/contrib/openpam/doc/man/openpam_readline.3   (props changed)
  head/contrib/openpam/doc/man/openpam_restore_cred.3   (props changed)
  head/contrib/openpam/doc/man/openpam_set_option.3   (props changed)
  head/contrib/openpam/doc/man/openpam_ttyconv.3   (props changed)
  head/contrib/openpam/doc/man/pam.3   (props changed)
  head/contrib/openpam/doc/man/pam.conf.5   (props changed)
  head/contrib/openpam/doc/man/pam.man   (props changed)
  head/contrib/openpam/doc/man/pam_acct_mgmt.3   (props changed)
  head/contrib/openpam/doc/man/pam_authenticate.3   (props changed)
  head/contrib/openpam/doc/man/pam_chauthtok.3   (props changed)
  head/contrib/openpam/doc/man/pam_close_session.3   (props changed)
  head/contrib/openpam/doc/man/pam_conv.3   (props changed)
  head/contrib/openpam/doc/man/pam_end.3   (props changed)
  head/contrib/openpam/doc/man/pam_error.3   (props changed)
  head/contrib/openpam/doc/man/pam_get_authtok.3   (props changed)
  head/contrib/openpam/doc/man/pam_get_data.3   (props changed)
  head/contrib/openpam/doc/man/pam_get_item.3   (props changed)
  head/contrib/openpam/doc/man/pam_get_user.3   (props changed)
  head/contrib/openpam/doc/man/pam_getenv.3   (props changed)
  head/contrib/openpam/doc/man/pam_getenvlist.3   (props changed)
  head/contrib/openpam/doc/man/pam_info.3   (props changed)
  head/contrib/openpam/doc/man/pam_open_session.3   (props changed)
  head/contrib/openpam/doc/man/pam_prompt.3   (props changed)
  head/contrib/openpam/doc/man/pam_putenv.3   (props changed)
  head/contrib/openpam/doc/man/pam_set_data.3   (props changed)
  head/contrib/openpam/doc/man/pam_set_item.3   (props changed)
  head/contrib/openpam/doc/man/pam_setcred.3   (props changed)
  head/contrib/openpam/doc/man/pam_setenv.3   (props changed)
  head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3   (props changed)
  head/contrib/openpam/doc/man/pam_sm_authenticate.3   (props changed)
  head/contrib/openpam/doc/man/pam_sm_chauthtok.3   (props changed)
  head/contrib/openpam/doc/man/pam_sm_close_session.3   (props changed)
  head/contrib/openpam/doc/man/pam_sm_open_session.3   (props changed)
  head/contrib/openpam/doc/man/pam_sm_setcred.3   (props changed)
  head/contrib/openpam/doc/man/pam_start.3   (props changed)
  head/contrib/openpam/doc/man/pam_strerror.3   (props changed)
  head/contrib/openpam/doc/man/pam_verror.3   (props changed)
  head/contrib/openpam/doc/man/pam_vinfo.3   (props changed)
  head/contrib/openpam/doc/man/pam_vprompt.3   (props changed)
  head/contrib/openpam/include/Makefile.am   (props changed)
  head/contrib/openpam/include/Makefile.in   (props changed)
  head/contrib/openpam/include/security/Makefile.am   (props changed)
  head/contrib/openpam/include/security/Makefile.in   (props changed)
  head/contrib/openpam/include/security/openpam.h   (props changed)
  head/contrib/openpam/include/security/openpam_att

Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4

2014-09-15 Thread Gleb Smirnoff
  Hans,

  I second on Adrians suggestions.

Also, this chunk:

H> Modified: head/sys/netinet/tcp_output.c
H> 
==
H> --- head/sys/netinet/tcp_output.cSat Sep 13 07:45:03 2014
(r271503)
H> +++ head/sys/netinet/tcp_output.cSat Sep 13 08:26:09 2014
(r271504)
H> @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
H>  #include 
H>  
H>  #include 
H> +#include 
H>  #include 
H>  #include 

Is it possible to avoid this inclusion? I'd even suggest to push
all TSO (or all TCP hardware assistance stuff) into a separate
header, that is shared between TCP and drivers, w/o polluting
TCP with all ifnet knowledge.

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


Re: svn commit: r271538 - head/sys/net

2014-09-15 Thread Gleb Smirnoff
On Sat, Sep 13, 2014 at 06:13:08PM +, Alexander V. Chernikov wrote:
A> @@ -1099,15 +1117,39 @@ vlan_transmit(struct ifnet *ifp, struct 
A>   * Send it, precisely as ether_output() would have.
A>   */
A>  error = (p->if_transmit)(p, m);
A> -if (!error) {
A> -ifp->if_opackets++;
A> -ifp->if_omcasts += mcast;
A> -ifp->if_obytes += len;
A> +if (error == 0) {
A> +counter_u64_add(ifv->ifv_opackets, 1);
A> +counter_u64_add(ifv->ifv_obytes, len);
A> +counter_u64_add(ifv->ifv_omcasts, 1);
A>  } else
A>  ifp->if_oerrors++;
A>  return (error);
A>  }

This looks like counting all packets as multicasts. Strange that compiler
didn't warn you about write only variable.

P.S. Why did you decide to keep if_oerrors old style?

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


Re: svn commit: r271610 - in head: etc/rc.d sys/netinet

2014-09-15 Thread Gleb Smirnoff
  Hiroki,

On Mon, Sep 15, 2014 at 07:20:40AM +, Hiroki Sato wrote:
H> Modified: head/sys/netinet/ip_options.c
H> 
==
H> --- head/sys/netinet/ip_options.cMon Sep 15 06:21:28 2014
(r271609)
H> +++ head/sys/netinet/ip_options.cMon Sep 15 07:20:40 2014
(r271610)
H> @@ -65,18 +65,21 @@ __FBSDID("$FreeBSD$");
H>  
H>  #include 
H>  
H> -static int  ip_dosourceroute = 0;
H> -SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
H> -&ip_dosourceroute, 0, "Enable forwarding source routed IP packets");
H> -
H> -static int  ip_acceptsourceroute = 0;
H> -SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 
H> -CTLFLAG_RW, &ip_acceptsourceroute, 0, 
H> +static VNET_DEFINE(int, ip_dosourceroute);
H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
H> +&VNET_NAME(ip_dosourceroute), 0,
H> +"Enable forwarding source routed IP packets");
H> +#define V_ip_dosourceroute  VNET(ip_dosourceroute)
H> +
H> +static VNET_DEFINE(int, ip_acceptsourceroute);
H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 
H> +CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, 
H>  "Enable accepting source routed IP packets");
H> +#define V_ip_acceptsourceroute  VNET(ip_acceptsourceroute)
H>  
H> -int ip_doopts = 1;  /* 0 = ignore, 1 = process, 2 = reject */
H> -SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
H> -&ip_doopts, 0, "Enable IP options processing ([LS]SRR, RR, TS)");
H> +VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */
H> +SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
H> +&VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, 
TS)");

Since r261590 one doesn't need SYSCTL_VNET_* macros. You can simply add
CTLFLAG_VNET to the generic SYSCTL_* macro.

I kept old macros due to big amount of code using it, and I was lazy
to convert it. But new code shouldn't be added.

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


svn commit: r271615 - head/share/man/man9

2014-09-15 Thread Gleb Smirnoff
Author: glebius
Date: Mon Sep 15 11:14:23 2014
New Revision: 271615
URL: http://svnweb.freebsd.org/changeset/base/271615

Log:
  Add a brief description of CTLFLAG_VNET flag. Since the VIMAGE is
  absolutely not documented, I see no reason in long descriptions
  here.

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

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Mon Sep 15 09:45:10 2014
(r271614)
+++ head/share/man/man9/sysctl.9Mon Sep 15 11:14:23 2014
(r271615)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 31, 2014
+.Dd September 15, 2014
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -504,6 +504,8 @@ The initial sysctl value is tried fetche
 enviroment early during module load or system boot.
 .It Dv CTLFLAG_DYN
 Dynamically created OIDs automatically get this flag set.
+.It Dv CTLFLAG_VNET
+OID references a VIMAGE-enabled variable.
 .El
 .Sh EXAMPLES
 Sample use of
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271616 - head/sys/kern

2014-09-15 Thread Alexander Motin
Author: mav
Date: Mon Sep 15 11:17:36 2014
New Revision: 271616
URL: http://svnweb.freebsd.org/changeset/base/271616

Log:
  Add comments describing r271604 change.
  
  MFC after:3 days

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Mon Sep 15 11:14:23 2014(r271615)
+++ head/sys/kern/sched_ule.c   Mon Sep 15 11:17:36 2014(r271616)
@@ -1037,7 +1037,14 @@ tdq_notify(struct tdq *tdq, struct threa
ctd = pcpu_find(cpu)->pc_curthread;
if (!sched_shouldpreempt(pri, ctd->td_priority, 1))
return;
+
+   /*
+* Make sure that tdq_load updated before calling this function
+* is globally visible before we read tdq_cpu_idle.  Idle thread
+* accesses both of them without locks, and the order is important.
+*/
mb();
+
if (TD_IS_IDLETHREAD(ctd)) {
/*
 * If the MD code has an idle wakeup routine try that before
@@ -2641,6 +2648,11 @@ sched_idletd(void *dummy)
 
/* Run main MD idle handler. */
tdq->tdq_cpu_idle = 1;
+   /*
+* Make sure that tdq_cpu_idle update is globally visible
+* before cpu_idle() read tdq_load.  The order is important
+* to avoid race with tdq_notify.
+*/
mb();
cpu_idle(switchcnt * 4 > sched_idlespinthresh);
tdq->tdq_cpu_idle = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271617 - head/lib/libpam/modules/pam_login_access

2014-09-15 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Sep 15 11:32:08 2014
New Revision: 271617
URL: http://svnweb.freebsd.org/changeset/base/271617

Log:
  r271256 fixed one segfault condition but introduced another due to the
  wrong operator being used in the tty check.
  
  Reported by:  avg@
  MFH:  3 days

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

Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c
==
--- head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 15 
11:17:36 2014(r271616)
+++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 15 
11:32:08 2014(r271617)
@@ -86,7 +86,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s",
user, rhost);
-   } else if (tty != NULL || *(const char *)tty != '\0') {
+   } else if (tty != NULL && *(const char *)tty != '\0') {
PAM_LOG("Checking login.access for user %s on tty %s",
(const char *)user, (const char *)tty);
if (login_access(user, tty) != 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271619 - in head/sys: fs/ext2fs ufs/ffs vm

2014-09-15 Thread Konstantin Belousov
Author: kib
Date: Mon Sep 15 12:28:29 2014
New Revision: 271619
URL: http://svnweb.freebsd.org/changeset/base/271619

Log:
  Provide the unique implementation for the VOP_GETPAGES() method used
  by ffs and ext2fs.  Remove duplicated call to vm_page_zero_invalid(),
  done by VOP and by vm_pager_getpages().  Use vm_pager_free_nonreq().
  
  Reviewed by:  alc (previous version)
  Sponsored by: The FreeBSD Foundation
  MFC after:6 weeks (after r271596)

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/ufs/ffs/ffs_vnops.c
  head/sys/vm/vnode_pager.c
  head/sys/vm/vnode_pager.h

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==
--- head/sys/fs/ext2fs/ext2_vnops.c Mon Sep 15 11:35:14 2014
(r271618)
+++ head/sys/fs/ext2fs/ext2_vnops.c Mon Sep 15 12:28:29 2014
(r271619)
@@ -97,7 +97,6 @@ static int ext2_chown(struct vnode *, ui
 static vop_close_t ext2_close;
 static vop_create_text2_create;
 static vop_fsync_t ext2_fsync;
-static vop_getpages_t  ext2_getpages;
 static vop_getattr_t   ext2_getattr;
 static vop_ioctl_t ext2_ioctl;
 static vop_link_t  ext2_link;
@@ -128,7 +127,7 @@ struct vop_vector ext2_vnodeops = {
.vop_close =ext2_close,
.vop_create =   ext2_create,
.vop_fsync =ext2_fsync,
-   .vop_getpages = ext2_getpages,
+   .vop_getpages = vnode_pager_local_getpages,
.vop_getattr =  ext2_getattr,
.vop_inactive = ext2_inactive,
.vop_ioctl =ext2_ioctl,
@@ -2063,48 +2062,3 @@ ext2_write(struct vop_write_args *ap)
}
return (error);
 }
-
-/*
- * get page routine
- */
-static int
-ext2_getpages(struct vop_getpages_args *ap)
-{
-   int i;
-   vm_page_t mreq;
-   int pcount;
-
-   mreq = ap->a_m[ap->a_reqpage];
-
-   /*
-* Since the caller has busied the requested page, that page's valid
-* field will not be changed by other threads.
-*/
-   vm_page_assert_xbusied(mreq);
-
-   /*
-* if ANY DEV_BSIZE blocks are valid on a large filesystem block,
-* then the entire page is valid.  Since the page may be mapped,
-* user programs might reference data beyond the actual end of file
-* occuring within the page.  We have to zero that data.
-*/
-   if (mreq->valid) {
-   VM_OBJECT_WLOCK(mreq->object);
-   if (mreq->valid != VM_PAGE_BITS_ALL)
-   vm_page_zero_invalid(mreq, TRUE);
-   pcount = round_page(ap->a_count) / PAGE_SIZE;
-   for (i = 0; i < pcount; i++) {
-   if (i != ap->a_reqpage) {
-   vm_page_lock(ap->a_m[i]);
-   vm_page_free(ap->a_m[i]);
-   vm_page_unlock(ap->a_m[i]);
-   }
-   }
-   VM_OBJECT_WUNLOCK(mreq->object);
-   return VM_PAGER_OK;
-   }
-
-   return vnode_pager_generic_getpages(ap->a_vp, ap->a_m,
-   ap->a_count,
-   ap->a_reqpage);
-}

Modified: head/sys/ufs/ffs/ffs_vnops.c
==
--- head/sys/ufs/ffs/ffs_vnops.cMon Sep 15 11:35:14 2014
(r271618)
+++ head/sys/ufs/ffs/ffs_vnops.cMon Sep 15 12:28:29 2014
(r271619)
@@ -104,7 +104,6 @@ extern int  ffs_rawread(struct vnode *vp,
 #endif
 static vop_fsync_t ffs_fsync;
 static vop_lock1_t ffs_lock;
-static vop_getpages_t  ffs_getpages;
 static vop_read_t  ffs_read;
 static vop_write_t ffs_write;
 static int ffs_extread(struct vnode *vp, struct uio *uio, int ioflag);
@@ -124,7 +123,7 @@ static vop_vptofh_t ffs_vptofh;
 struct vop_vector ffs_vnodeops1 = {
.vop_default =  &ufs_vnodeops,
.vop_fsync =ffs_fsync,
-   .vop_getpages = ffs_getpages,
+   .vop_getpages = vnode_pager_local_getpages,
.vop_lock1 =ffs_lock,
.vop_read = ffs_read,
.vop_reallocblks =  ffs_reallocblks,
@@ -143,7 +142,7 @@ struct vop_vector ffs_fifoops1 = {
 struct vop_vector ffs_vnodeops2 = {
.vop_default =  &ufs_vnodeops,
.vop_fsync =ffs_fsync,
-   .vop_getpages = ffs_getpages,
+   .vop_getpages = vnode_pager_local_getpages,
.vop_lock1 =ffs_lock,
.vop_read = ffs_read,
.vop_reallocblks =  ffs_reallocblks,
@@ -847,53 +846,6 @@ ffs_write(ap)
 }
 
 /*
- * get page routine
- */
-static int
-ffs_getpages(ap)
-   struct vop_getpages_args *ap;
-{
-   int i;
-   vm_page_t mreq;
-   int pcount;
-
-   mreq = ap->a_m[ap->a_reqpage];
-
-   /*
-* Since the caller ha

svn commit: r271624 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc contrib/openpam/doc...

2014-09-15 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Sep 15 13:40:09 2014
New Revision: 271624
URL: http://svnweb.freebsd.org/changeset/base/271624

Log:
  Upgrade to OpenPAM Ourouparia.

Added:
  head/contrib/openpam/lib/libpam/openpam_strlset.c
 - copied unchanged from r271612, 
vendor/openpam/dist/lib/libpam/openpam_strlset.c
  head/contrib/openpam/lib/libpam/openpam_strlset.h
 - copied unchanged from r271612, 
vendor/openpam/dist/lib/libpam/openpam_strlset.h
Deleted:
  head/contrib/openpam/m4/
Modified:
  head/contrib/openpam/CREDITS
  head/contrib/openpam/HISTORY
  head/contrib/openpam/INSTALL
  head/contrib/openpam/LICENSE
  head/contrib/openpam/Makefile.am
  head/contrib/openpam/Makefile.in
  head/contrib/openpam/README
  head/contrib/openpam/RELNOTES
  head/contrib/openpam/TODO
  head/contrib/openpam/aclocal.m4
  head/contrib/openpam/autogen.sh
  head/contrib/openpam/bin/Makefile.in
  head/contrib/openpam/bin/openpam_dump_policy/Makefile.in
  head/contrib/openpam/bin/openpam_dump_policy/openpam_dump_policy.c
  head/contrib/openpam/bin/pamtest/Makefile.in
  head/contrib/openpam/bin/pamtest/pamtest.1
  head/contrib/openpam/bin/su/Makefile.in
  head/contrib/openpam/bin/su/su.1
  head/contrib/openpam/config.h.in
  head/contrib/openpam/configure
  head/contrib/openpam/configure.ac
  head/contrib/openpam/doc/Makefile.in
  head/contrib/openpam/doc/man/Makefile.in
  head/contrib/openpam/doc/man/openpam.3
  head/contrib/openpam/doc/man/openpam_borrow_cred.3
  head/contrib/openpam/doc/man/openpam_free_data.3
  head/contrib/openpam/doc/man/openpam_free_envlist.3
  head/contrib/openpam/doc/man/openpam_get_feature.3
  head/contrib/openpam/doc/man/openpam_get_option.3
  head/contrib/openpam/doc/man/openpam_log.3
  head/contrib/openpam/doc/man/openpam_nullconv.3
  head/contrib/openpam/doc/man/openpam_readline.3
  head/contrib/openpam/doc/man/openpam_readlinev.3
  head/contrib/openpam/doc/man/openpam_readword.3
  head/contrib/openpam/doc/man/openpam_restore_cred.3
  head/contrib/openpam/doc/man/openpam_set_feature.3
  head/contrib/openpam/doc/man/openpam_set_option.3
  head/contrib/openpam/doc/man/openpam_straddch.3
  head/contrib/openpam/doc/man/openpam_subst.3
  head/contrib/openpam/doc/man/openpam_ttyconv.3
  head/contrib/openpam/doc/man/pam.3
  head/contrib/openpam/doc/man/pam.conf.5
  head/contrib/openpam/doc/man/pam_acct_mgmt.3
  head/contrib/openpam/doc/man/pam_authenticate.3
  head/contrib/openpam/doc/man/pam_chauthtok.3
  head/contrib/openpam/doc/man/pam_close_session.3
  head/contrib/openpam/doc/man/pam_conv.3
  head/contrib/openpam/doc/man/pam_end.3
  head/contrib/openpam/doc/man/pam_error.3
  head/contrib/openpam/doc/man/pam_get_authtok.3
  head/contrib/openpam/doc/man/pam_get_data.3
  head/contrib/openpam/doc/man/pam_get_item.3
  head/contrib/openpam/doc/man/pam_get_user.3
  head/contrib/openpam/doc/man/pam_getenv.3
  head/contrib/openpam/doc/man/pam_getenvlist.3
  head/contrib/openpam/doc/man/pam_info.3
  head/contrib/openpam/doc/man/pam_open_session.3
  head/contrib/openpam/doc/man/pam_prompt.3
  head/contrib/openpam/doc/man/pam_putenv.3
  head/contrib/openpam/doc/man/pam_set_data.3
  head/contrib/openpam/doc/man/pam_set_item.3
  head/contrib/openpam/doc/man/pam_setcred.3
  head/contrib/openpam/doc/man/pam_setenv.3
  head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3
  head/contrib/openpam/doc/man/pam_sm_authenticate.3
  head/contrib/openpam/doc/man/pam_sm_chauthtok.3
  head/contrib/openpam/doc/man/pam_sm_close_session.3
  head/contrib/openpam/doc/man/pam_sm_open_session.3
  head/contrib/openpam/doc/man/pam_sm_setcred.3
  head/contrib/openpam/doc/man/pam_start.3
  head/contrib/openpam/doc/man/pam_strerror.3
  head/contrib/openpam/doc/man/pam_verror.3
  head/contrib/openpam/doc/man/pam_vinfo.3
  head/contrib/openpam/doc/man/pam_vprompt.3
  head/contrib/openpam/include/Makefile.in
  head/contrib/openpam/include/security/Makefile.in
  head/contrib/openpam/include/security/openpam_version.h
  head/contrib/openpam/lib/Makefile.am
  head/contrib/openpam/lib/Makefile.in
  head/contrib/openpam/lib/libpam/Makefile.am
  head/contrib/openpam/lib/libpam/Makefile.in
  head/contrib/openpam/lib/libpam/openpam_configure.c
  head/contrib/openpam/lib/libpam/openpam_ctype.h
  head/contrib/openpam/lib/libpam/openpam_dispatch.c
  head/contrib/openpam/lib/libpam/openpam_ttyconv.c
  head/contrib/openpam/lib/libpam/pam_get_authtok.c
  head/contrib/openpam/ltmain.sh
  head/contrib/openpam/mkpkgng.in
  head/contrib/openpam/modules/Makefile.in
  head/contrib/openpam/modules/pam_deny/Makefile.in
  head/contrib/openpam/modules/pam_permit/Makefile.in
  head/contrib/openpam/modules/pam_unix/Makefile.in
  head/contrib/openpam/pamgdb.in
  head/contrib/openpam/t/Makefile.am
  head/contrib/openpam/t/Makefile.in
  head/lib/libpam/libpam/Makefile
Directory Properties:
  head/contrib/openpam/   (props changed)

Modified: head/contrib/openpam/CREDITS
==
--- head/contrib/openpam/CREDITS   

svn commit: r271628 - head/sys/netinet

2014-09-15 Thread Hiroki Sato
Author: hrs
Date: Mon Sep 15 14:43:58 2014
New Revision: 271628
URL: http://svnweb.freebsd.org/changeset/base/271628

Log:
  Use generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*.
  
  Suggested by: glebius

Modified:
  head/sys/netinet/ip_options.c

Modified: head/sys/netinet/ip_options.c
==
--- head/sys/netinet/ip_options.c   Mon Sep 15 14:21:57 2014
(r271627)
+++ head/sys/netinet/ip_options.c   Mon Sep 15 14:43:58 2014
(r271628)
@@ -66,19 +66,19 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static VNET_DEFINE(int, ip_dosourceroute);
-SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
-&VNET_NAME(ip_dosourceroute), 0,
+SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute,
+CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_dosourceroute), 0,
 "Enable forwarding source routed IP packets");
 #defineV_ip_dosourceroute  VNET(ip_dosourceroute)
 
 static VNET_DEFINE(int,ip_acceptsourceroute);
-SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 
-CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, 
+SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 
+CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, 
 "Enable accepting source routed IP packets");
 #defineV_ip_acceptsourceroute  VNET(ip_acceptsourceroute)
 
 VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */
-SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
+SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_VNET | CTLFLAG_RW,
 &VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, 
TS)");
 
 static voidsave_rte(struct mbuf *m, u_char *, struct in_addr);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r271610 - in head: etc/rc.d sys/netinet

2014-09-15 Thread Hiroki Sato
Gleb Smirnoff  wrote
  in <2014091502.gs60...@freebsd.org>:

gl>   Hiroki,
gl>
gl> On Mon, Sep 15, 2014 at 07:20:40AM +, Hiroki Sato wrote:
gl> H> Modified: head/sys/netinet/ip_options.c
gl> H> 
==
gl> H> --- head/sys/netinet/ip_options.cMon Sep 15 06:21:28 2014
(r271609)
gl> H> +++ head/sys/netinet/ip_options.cMon Sep 15 07:20:40 2014
(r271610)
gl> H> @@ -65,18 +65,21 @@ __FBSDID("$FreeBSD$");
gl> H>
gl> H>  #include 
gl> H>
gl> H> -static int  ip_dosourceroute = 0;
gl> H> -SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW,
gl> H> -&ip_dosourceroute, 0, "Enable forwarding source routed IP packets");
gl> H> -
gl> H> -static int  ip_acceptsourceroute = 0;
gl> H> -SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute,
gl> H> -CTLFLAG_RW, &ip_acceptsourceroute, 0,
gl> H> +static VNET_DEFINE(int, ip_dosourceroute);
gl> H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, 
CTLFLAG_RW,
gl> H> +&VNET_NAME(ip_dosourceroute), 0,
gl> H> +"Enable forwarding source routed IP packets");
gl> H> +#define V_ip_dosourceroute  VNET(ip_dosourceroute)
gl> H> +
gl> H> +static VNET_DEFINE(int, ip_acceptsourceroute);
gl> H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, 
accept_sourceroute,
gl> H> +CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0,
gl> H>  "Enable accepting source routed IP packets");
gl> H> +#define V_ip_acceptsourceroute  VNET(ip_acceptsourceroute)
gl> H>
gl> H> -int ip_doopts = 1;  /* 0 = ignore, 1 = process, 2 = reject 
*/
gl> H> -SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
gl> H> -&ip_doopts, 0, "Enable IP options processing ([LS]SRR, RR, TS)");
gl> H> +VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject 
*/
gl> H> +SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW,
gl> H> +&VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, 
RR, TS)");
gl>
gl> Since r261590 one doesn't need SYSCTL_VNET_* macros. You can simply add
gl> CTLFLAG_VNET to the generic SYSCTL_* macro.
gl>
gl> I kept old macros due to big amount of code using it, and I was lazy
gl> to convert it. But new code shouldn't be added.

 Ah, okay, thank you for pointing out it.  Fixed in r271628.

-- Hiroki


pgpsqQVWWv3Q0.pgp
Description: PGP signature


svn commit: r271629 - head/sys/x86/xen

2014-09-15 Thread Roger Pau Monné
Author: royger
Date: Mon Sep 15 15:15:52 2014
New Revision: 271629
URL: http://svnweb.freebsd.org/changeset/base/271629

Log:
  xen: don't set suspend/resume methods for the PIRQ PIC
  
  The suspend/resume of event channels is already handled by the xen_intr_pic.
  If those methods are set on the PIRQ PIC they are just called twice, which
  breaks proper resume. This fix restores migration of FreeBSD guests to a
  working state.
  
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/x86/xen/xen_intr.c

Modified: head/sys/x86/xen/xen_intr.c
==
--- head/sys/x86/xen/xen_intr.c Mon Sep 15 14:43:58 2014(r271628)
+++ head/sys/x86/xen/xen_intr.c Mon Sep 15 15:15:52 2014(r271629)
@@ -179,8 +179,6 @@ struct pic xen_intr_pirq_pic = {
.pic_disable_intr   = xen_intr_pirq_disable_intr,
.pic_vector = xen_intr_vector,
.pic_source_pending = xen_intr_source_pending,
-   .pic_suspend= xen_intr_suspend,
-   .pic_resume = xen_intr_resume,
.pic_config_intr= xen_intr_pirq_config_intr,
.pic_assign_cpu = xen_intr_assign_cpu
 };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-09-15 Thread Matthew Ahrens
On Mon, Sep 15, 2014 at 2:04 AM, Steven Hartland  wrote:

> - Original Message - From: "Andriy Gapon" 
>
>
>  On 11/09/2014 19:21, Steven Hartland wrote:
>>
>>> Author: smh
>>> Date: Thu Sep 11 16:21:51 2014
>>> New Revision: 271429
>>> URL: http://svnweb.freebsd.org/changeset/base/271429
>>>
>>> Log:
>>>   Persist vdev_resilver_txg changes to avoid panic caused by validation
>>>   vs a vdev_resilver_txg value from a previous resilver.
>>>
>>
>> Looks that this change is a prime candidate for a discussion with OpenZFS
>> folks.
>> I know that it is a pain to go through all hoops for submitting a change
>> to
>> illumos, but at the very least we should let them know of the problem.
>>
>
> Yep I already raised the bug: https://www.illumos.org/issues/5154 ;-)
>
>
I don't know that anyone reads illumos bug submissions (I don't).



> If I could actually send emails to their mailing list I would have
> discused but the
> OpenZFS list has been broken for weeks. I've raised it with Matt, who
> directed
> me at Luke but had no response from him :(
>
>
The list works fine for me.  Keep bugging Luke.  You can also bug Martin (
m...@freebsd.org).

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


svn commit: r271630 - head/sys/arm/arm

2014-09-15 Thread Ian Lepore
Author: ian
Date: Mon Sep 15 15:36:00 2014
New Revision: 271630
URL: http://svnweb.freebsd.org/changeset/base/271630

Log:
  The private peripheral interrupts start at offset 16, not 0.  Also, use
  names rather than inline mystery constants for these offsets.
  
  Pointed out by:   andrew

Modified:
  head/sys/arm/arm/gic.c

Modified: head/sys/arm/arm/gic.c
==
--- head/sys/arm/arm/gic.c  Mon Sep 15 15:15:52 2014(r271629)
+++ head/sys/arm/arm/gic.c  Mon Sep 15 15:36:00 2014(r271630)
@@ -83,7 +83,11 @@ __FBSDID("$FreeBSD$");
 #define GICC_ABPR  0x001C  /* v1 ICCABPR */
 #define GICC_IIDR  0x00FC  /* v1 ICCIIDR*/
 
-#defineGIC_LAST_IPI15  /* Irqs 0-15 are IPIs. */
+#defineGIC_FIRST_IPI0  /* Irqs 0-15 are SGIs/IPIs. */
+#defineGIC_LAST_IPI15
+#defineGIC_FIRST_PPI   16  /* Irqs 16-31 are private (per 
*/
+#defineGIC_LAST_PPI31  /* core) peripheral interrupts. 
*/
+#defineGIC_FIRST_SPI   32  /* Irqs 32+ are shared 
peripherals. */
 
 /* First bit is a polarity bit (0 - low, 1 - high) */
 #define GICD_ICFGR_POL_LOW (0 << 0)
@@ -205,9 +209,9 @@ gic_decode_fdt(uint32_t iparent, uint32_
*pol = INTR_POLARITY_CONFORM;
} else {
if (intr[0] == 0)
-   *interrupt = fdt32_to_cpu(intr[1]) + 32;
+   *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_SPI;
else
-   *interrupt = fdt32_to_cpu(intr[1]);
+   *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_PPI;
/*
 * In intr[2], bits[3:0] are trigger type and level flags.
 *   1 = low-to-high edge triggered
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271631 - head/sys/vm

2014-09-15 Thread Gleb Smirnoff
Author: glebius
Date: Mon Sep 15 15:49:29 2014
New Revision: 271631
URL: http://svnweb.freebsd.org/changeset/base/271631

Log:
  Remove redundant declaration. vnode.h should be included before vnode_pager.h.

Modified:
  head/sys/vm/vnode_pager.h

Modified: head/sys/vm/vnode_pager.h
==
--- head/sys/vm/vnode_pager.h   Mon Sep 15 15:36:00 2014(r271630)
+++ head/sys/vm/vnode_pager.h   Mon Sep 15 15:49:29 2014(r271631)
@@ -45,7 +45,6 @@ int vnode_pager_generic_getpages(struct 
 int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *m,
  int count, boolean_t sync,
  int *rtvals);
-struct vop_getpages_args;
 int vnode_pager_local_getpages(struct vop_getpages_args *ap);
 
 void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce

2014-09-15 Thread David Somayajulu
Hi Andrey,
When I didn't have the clean override,  "make clean" was not cleaning properly 
when I built a standalone loadable driver. Perhaps we can change "clean" in 
bxe/Makefile and bce/Makefile to "dclean".

Thanks
David S.
-Original Message-
From: Andrey V. Elsukov [mailto:a...@freebsd.org]
Sent: Sunday, September 14, 2014 10:00 PM
To: David C Somayajulu; src-committ...@freebsd.org; svn-src-...@freebsd.org; 
svn-src-head@freebsd.org
Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce 
sys/dev/bxe sys/modules/bce

On 08.05.2014 23:40, David C Somayajulu wrote:
> Author: davidcs
> Date: Thu May  8 19:40:37 2014
> New Revision: 265703
> URL: http://svnweb.freebsd.org/changeset/base/265703

> Modified: head/sys/modules/bce/Makefile
> ==
> --- head/sys/modules/bce/Makefile Thu May  8 19:35:29 2014
> (r265702)
> +++ head/sys/modules/bce/Makefile Thu May  8 19:40:37 2014
> (r265703)
> @@ -5,4 +5,9 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii
>
>  #CFLAGS += -DBCE_DEBUG=0
>
> +clean:
> + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms
> + rm -f *.o *.kld *.ko
> + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h
> +
>  .include 

Hi,

why did you override 'clean' target?
It works well by default, but now some files don't deleted, e.g. when you build 
modules with DEBUG_FLAGS. Also the same problem with if_bxe(4) module.

--
WBR, Andrey V. Elsukov



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271634 - head/sys/vm

2014-09-15 Thread Alan Cox
Author: alc
Date: Mon Sep 15 17:14:09 2014
New Revision: 271634
URL: http://svnweb.freebsd.org/changeset/base/271634

Log:
  Three improvements to vnode_pager_generic_getpages():
  
  Eliminate an exclusive object lock acquisition and release on the expected
  execution path.
  
  Do page zeroing before the object lock is acquired rather than during the
  time that the object lock is held.
  
  Use vm_pager_free_nonreq() to eliminate duplicated code.
  
  Reviewed by:  kib
  MFC after:6 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Mon Sep 15 16:47:04 2014(r271633)
+++ head/sys/vm/vnode_pager.c   Mon Sep 15 17:14:09 2014(r271634)
@@ -772,24 +772,24 @@ vnode_pager_generic_getpages(struct vnod
}
 
/*
+* Since the caller has busied the requested page, that page's valid
+* field will not be changed by other threads.
+*/
+   vm_page_assert_xbusied(m[reqpage]);
+
+   /*
 * If we have a completely valid page available to us, we can
 * clean up and return.  Otherwise we have to re-read the
 * media.
 */
-   VM_OBJECT_WLOCK(object);
if (m[reqpage]->valid == VM_PAGE_BITS_ALL) {
-   for (i = 0; i < count; i++)
-   if (i != reqpage) {
-   vm_page_lock(m[i]);
-   vm_page_free(m[i]);
-   vm_page_unlock(m[i]);
-   }
-   VM_OBJECT_WUNLOCK(object);
-   return VM_PAGER_OK;
+   vm_pager_free_nonreq(object, m, reqpage, count);
+   return (VM_PAGER_OK);
} else if (reqblock == -1) {
pmap_zero_page(m[reqpage]);
KASSERT(m[reqpage]->dirty == 0,
("vnode_pager_generic_getpages: page %p is dirty", m));
+   VM_OBJECT_WLOCK(object);
m[reqpage]->valid = VM_PAGE_BITS_ALL;
for (i = 0; i < count; i++)
if (i != reqpage) {
@@ -799,9 +799,11 @@ vnode_pager_generic_getpages(struct vnod
}
VM_OBJECT_WUNLOCK(object);
return (VM_PAGER_OK);
+   } else if (m[reqpage]->valid != 0) {
+   VM_OBJECT_WLOCK(object);
+   m[reqpage]->valid = 0;
+   VM_OBJECT_WUNLOCK(object);
}
-   m[reqpage]->valid = 0;
-   VM_OBJECT_WUNLOCK(object);
 
/*
 * here on direct device I/O
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271635 - in head: lib/libc/sys sys/vm

2014-09-15 Thread John Baldwin
Author: jhb
Date: Mon Sep 15 17:20:13 2014
New Revision: 271635
URL: http://svnweb.freebsd.org/changeset/base/271635

Log:
  Add stricter checking of some mmap() arguments:
  - Fail with EINVAL if an invalid protection mask is passed to mmap().
  - Fail with EINVAL if an unknown flag is passed to mmap().
  - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap().
  - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
mappings.
  
  Reviewed by:  alc, kib
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D698

Modified:
  head/lib/libc/sys/mmap.2
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/sys/mmap.2
==
--- head/lib/libc/sys/mmap.2Mon Sep 15 17:14:09 2014(r271634)
+++ head/lib/libc/sys/mmap.2Mon Sep 15 17:20:13 2014(r271635)
@@ -28,7 +28,7 @@
 .\"@(#)mmap.2  8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd June 19, 2014
+.Dd September 15, 2014
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -372,6 +372,29 @@ The
 argument
 is not a valid open file descriptor.
 .It Bq Er EINVAL
+An invalid value was passed in the
+.Fa prot
+argument.
+.It Bq Er EINVAL
+An undefined option was set in the
+.Fa flags
+argument.
+.It Bq Er EINVAL
+Both
+.Dv MAP_PRIVATE
+and
+.Dv MAP_SHARED
+were specified.
+.It Bq Er EINVAL
+None of
+.Dv MAP_ANON ,
+.Dv MAP_PRIVATE ,
+.Dv MAP_SHARED ,
+or
+.Dv MAP_STACK
+was specified.
+At least one of these flags must be included.
+.It Bq Er EINVAL
 .Dv MAP_FIXED
 was specified and the
 .Fa addr

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Mon Sep 15 17:14:09 2014(r271634)
+++ head/sys/vm/vm_mmap.c   Mon Sep 15 17:20:13 2014(r271635)
@@ -203,17 +203,17 @@ sys_mmap(td, uap)
struct vnode *vp;
vm_offset_t addr;
vm_size_t size, pageoff;
-   vm_prot_t cap_maxprot, prot, maxprot;
+   vm_prot_t cap_maxprot, maxprot;
void *handle;
objtype_t handle_type;
-   int align, error, flags;
+   int align, error, flags, prot;
off_t pos;
struct vmspace *vms = td->td_proc->p_vmspace;
cap_rights_t rights;
 
addr = (vm_offset_t) uap->addr;
size = uap->len;
-   prot = uap->prot & VM_PROT_ALL;
+   prot = uap->prot;
flags = uap->flags;
pos = uap->pos;
 
@@ -244,8 +244,23 @@ sys_mmap(td, uap)
flags |= MAP_ANON;
pos = 0;
}
+   /* XXX: MAP_RENAME, MAP_NORESERVE */
+   if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_HASSEMAPHORE |
+   MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE |
+   MAP_PREFAULT_READ |
+#ifdef MAP_32BIT
+   MAP_32BIT |
+#endif
+   MAP_ALIGNMENT_MASK)) != 0)
+   return (EINVAL);
if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL)
return (EINVAL);
+   if ((flags & (MAP_ANON | MAP_SHARED | MAP_PRIVATE)) == 0 ||
+   (flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE))
+   return (EINVAL);
+   if (prot != PROT_NONE &&
+   (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0)
+   return (EINVAL);
 
/*
 * Align the file position to a page boundary,
@@ -415,6 +430,8 @@ sys_mmap(td, uap)
 map:
td->td_fpop = fp;
maxprot &= cap_maxprot;
+
+   /* This relies on VM_PROT_* matching PROT_*. */
error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot,
flags, handle_type, handle, pos);
td->td_fpop = NULL;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce

2014-09-15 Thread Garrett Cooper

> On Sep 15, 2014, at 9:31, David Somayajulu  
> wrote:
> 
> Hi Andrey,
> When I didn't have the clean override,  "make clean" was not cleaning 
> properly when I built a standalone loadable driver. Perhaps we can change 
> "clean" in bxe/Makefile and bce/Makefile to "dclean".

Hi David,
Does make depend work from a clean obj tree? You added some files to your 
make clean target that aren't in SRCS.
Cheers,
-Garrett
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce

2014-09-15 Thread David Somayajulu
Hi Garrett,
Please see below.
Cheers
-david S.

-Original Message-
From: Garrett Cooper [mailto:yaneurab...@gmail.com]
Sent: Monday, September 15, 2014 10:22 AM
To: David Somayajulu
Cc: Andrey V. Elsukov; David C Somayajulu; src-committ...@freebsd.org; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce 
sys/dev/bxe sys/modules/bce


> On Sep 15, 2014, at 9:31, David Somayajulu  
> wrote:
>
> Hi Andrey,
> When I didn't have the clean override,  "make clean" was not cleaning 
> properly when I built a standalone loadable driver. Perhaps we can change 
> "clean" in bxe/Makefile and bce/Makefile to "dclean".

Hi David,
Does make depend work from a clean obj tree? You added some files to your 
make clean target that aren't in SRCS.
Cheers,
-Garrett
[David S.] Not sure. I haven't tried it.



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271643 - head/sys/netinet

2014-09-15 Thread Michael Tuexen
Author: tuexen
Date: Mon Sep 15 19:38:34 2014
New Revision: 271643
URL: http://svnweb.freebsd.org/changeset/base/271643

Log:
  Chunk IDs are 8 bit entities, not 16 bit.
  Thanks to Peter Kasting from Google for drawing
  my attention to it.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_structs.h

Modified: head/sys/netinet/sctp_structs.h
==
--- head/sys/netinet/sctp_structs.h Mon Sep 15 19:07:24 2014
(r271642)
+++ head/sys/netinet/sctp_structs.h Mon Sep 15 19:38:34 2014
(r271643)
@@ -418,8 +418,8 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit
 #define CHUNK_FLAGS_FRAGMENT_OK0x0100
 
 struct chk_id {
-   uint16_t id;
-   uint16_t can_take_data;
+   uint8_t id;
+   uint8_t can_take_data;
 };
 
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271644 - head/sys/cam/scsi

2014-09-15 Thread Alexander Motin
Author: mav
Date: Mon Sep 15 19:48:27 2014
New Revision: 271644
URL: http://svnweb.freebsd.org/changeset/base/271644

Log:
  Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives.
  
  Submitted by: Sean Fagan 
  MFC after:3 days

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Mon Sep 15 19:38:34 2014(r271643)
+++ head/sys/cam/scsi/scsi_da.c Mon Sep 15 19:48:27 2014(r271644)
@@ -547,6 +547,13 @@ static struct da_quirk_entry da_quirk_ta
},
{
/*
+* PNY USB 3.0 Flash Drives
+   */
+   {T_DIRECT, SIP_MEDIA_REMOVABLE, "PNY", "USB 3.0 FD*",
+   "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_RC16
+   },
+   {
+   /*
 * PNY USB Flash keys
 * PR: usb/75578, usb/72344, usb/65436 
 */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271645 - head/sys/dev/e1000

2014-09-15 Thread Adrian Chadd
Author: adrian
Date: Mon Sep 15 19:53:49 2014
New Revision: 271645
URL: http://svnweb.freebsd.org/changeset/base/271645

Log:
  Set DROP_EN on each RX queue if transmit flow-control is disabled.
  
  This allows the NIC to drop frames on the receive queue and not
  cause the MAC to block on receiving to _any_ queue.
  
  Tested:
  
  igb0@pci0:5:0:0:class=0x02 card=0x152115d9 chip=0x15218086 
rev=0x01 hdr=0x00
  vendor = 'Intel Corporation'
  device = 'I350 Gigabit Network Connection'
  class  = network
  subclass   = ethernet
  
  Discussed with: Eric Joyner 
  
  MFC after:1 week
  Sponsored by: Norse Corp, Inc.

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Mon Sep 15 19:48:27 2014(r271644)
+++ head/sys/dev/e1000/if_igb.c Mon Sep 15 19:53:49 2014(r271645)
@@ -4712,6 +4712,18 @@ igb_initialize_receive_units(struct adap
rctl |= E1000_RCTL_SZ_2048;
}
 
+   /*
+* If TX flow control is disabled and there's >1 queue defined,
+* enable DROP.
+*
+* This drops frames rather than hanging the RX MAC for all queues.
+*/
+   if ((adapter->num_queues > 1) &&
+   (adapter->fc == e1000_fc_none ||
+adapter->fc == e1000_fc_rx_pause)) {
+   srrctl |= E1000_SRRCTL_DROP_EN;
+   }
+
/* Setup the Base and Length of the Rx Descriptor Rings */
for (int i = 0; i < adapter->num_queues; i++, rxr++) {
u64 bus_addr = rxr->rxdma.dma_paddr;
@@ -6255,6 +6267,7 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS)
 
adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode;
e1000_force_mac_fc(&adapter->hw);
+   /* XXX TODO: update DROP_EN on each RX queue if appropriate */
return (error);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271647 - head/sys/dev/ixgbe

2014-09-15 Thread Adrian Chadd
Author: adrian
Date: Mon Sep 15 20:50:26 2014
New Revision: 271647
URL: http://svnweb.freebsd.org/changeset/base/271647

Log:
  Fix a double-free of mbufs in rx_ixgbe_discard().
  
  fmp->buf at the free point is already part of the chain being freed,
  so double-freeing is counter-productive.
  
  Submitted by: Marc De La Gueronniere 
  MFC after:1 week
  Sponsored by: Verisign, Inc.

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

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Mon Sep 15 20:08:07 2014(r271646)
+++ head/sys/dev/ixgbe/ixgbe.c  Mon Sep 15 20:50:26 2014(r271647)
@@ -4523,11 +4523,6 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
 
rbuf = &rxr->rx_buffers[i];
 
-if (rbuf->fmp != NULL) {/* Partial chain ? */
-   rbuf->fmp->m_flags |= M_PKTHDR;
-m_freem(rbuf->fmp);
-rbuf->fmp = NULL;
-   }
 
/*
** With advanced descriptors the writeback
@@ -4536,7 +4531,13 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
** the normal refresh path to get new buffers
** and mapping.
*/
-   if (rbuf->buf) {
+
+   if (rbuf->fmp != NULL) {/* Partial chain ? */
+   rbuf->fmp->m_flags |= M_PKTHDR;
+   m_freem(rbuf->fmp);
+   rbuf->fmp = NULL;
+   rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */
+   } else if (rbuf->buf) {
m_free(rbuf->buf);
rbuf->buf = NULL;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271648 - head/sys/dev/ixgbe

2014-09-15 Thread Adrian Chadd
Author: adrian
Date: Mon Sep 15 20:54:12 2014
New Revision: 271648
URL: http://svnweb.freebsd.org/changeset/base/271648

Log:
  The error bits are not valid with EOP=0; so intermediary fragments should
  not be discarded.
  
  Submitted by: Marc De La Gueronniere 
  MFC after:1 week
  Sponsored by: Verisign, Inc.

Modified:
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/ixgbe/ixgbe.h

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Mon Sep 15 20:50:26 2014(r271647)
+++ head/sys/dev/ixgbe/ixgbe.c  Mon Sep 15 20:54:12 2014(r271648)
@@ -4142,7 +4142,6 @@ ixgbe_setup_receive_ring(struct rx_ring 
rxr->lro_enabled = FALSE;
rxr->rx_copies = 0;
rxr->rx_bytes = 0;
-   rxr->discard = FALSE;
rxr->vtag_strip = FALSE;
 
bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
@@ -4618,13 +4617,8 @@ ixgbe_rxeof(struct ix_queue *que)
eop = ((staterr & IXGBE_RXD_STAT_EOP) != 0);
 
/* Make sure bad packets are discarded */
-   if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) ||
-   (rxr->discard)) {
+   if (eop && (staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) {
rxr->rx_discarded++;
-   if (eop)
-   rxr->discard = FALSE;
-   else
-   rxr->discard = TRUE;
ixgbe_rx_discard(rxr, i);
goto next_desc;
}

Modified: head/sys/dev/ixgbe/ixgbe.h
==
--- head/sys/dev/ixgbe/ixgbe.h  Mon Sep 15 20:50:26 2014(r271647)
+++ head/sys/dev/ixgbe/ixgbe.h  Mon Sep 15 20:54:12 2014(r271648)
@@ -331,7 +331,6 @@ struct rx_ring {
struct lro_ctrl lro;
boollro_enabled;
boolhw_rsc;
-   booldiscard;
boolvtag_strip;
 u16next_to_refresh;
 u16next_to_check;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271649 - in head/sys: conf modules/ixgbe

2014-09-15 Thread Adrian Chadd
Author: adrian
Date: Mon Sep 15 21:09:19 2014
New Revision: 271649
URL: http://svnweb.freebsd.org/changeset/base/271649

Log:
  Disable flow-director support until it's been debugged and verified.
  
  The flowdirector feature shares on-chip memory with other things
  such as the RX buffers.  In theory it should be configured in a way
  that doesn't interfere with the rest of operation.  In practice,
  the RX buffer calculation didn't take the flow-director allocation
  into account and there'd be overlap.  This lead to various garbage
  frames being received containing what looks like internal NIC state.
  
  What _I_ saw was traffic ending up in the wrong RX queues.
  If I was doing a UDP traffic test with only one NIC ring receiving
  traffic, everything is fine.  If I fired up a second UDP stream
  which came in on another ring, there'd be a few percent of traffic
  from both rings ending up in the wrong ring.  Ie, the RSS hash would
  indicate it was supposed to come in ring X, but it'd come in ring Y.
  
  However, when the allocation was fixed up, the developers at Verisign
  still saw traffic stalls.
  
  The flowdirector feature ends up fiddling with the NIC to do various
  attempts at load balancing connections by populating flow table rules
  based on sampled traffic.  It's likely that all of that has to be
  carefully reviewed and made less "magic".
  
  So for now the flow director feature is disabled (which fixes both
  what I was seeing and what they were seeing) until it's all much
  more debugged and verified.
  
  Tested:
  
  * (me) 82599EB 2x10G NIC, RSS UDP testing.
  * (verisign) not sure on the NIC (but likely 82599), 100k-200k/sec TCP
transaction tests.
  
  Submitted by: Marc De La Gueronniere 
  MFC after:1 week
  Sponsored by: Verisign, Inc.

Modified:
  head/sys/conf/files
  head/sys/modules/ixgbe/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Sep 15 20:54:12 2014(r271648)
+++ head/sys/conf/files Mon Sep 15 21:09:19 2014(r271649)
@@ -1779,7 +1779,7 @@ dev/ixgb/if_ixgb.coptional ixgb
 dev/ixgb/ixgb_ee.c optional ixgb
 dev/ixgb/ixgb_hw.c optional ixgb
 dev/ixgbe/ixgbe.c  optional ixgbe inet \
-   compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP -DIXGBE_FDIR"
+   compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP"
 dev/ixgbe/ixv.coptional ixgbe inet \
compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_phy.c  optional ixgbe inet \

Modified: head/sys/modules/ixgbe/Makefile
==
--- head/sys/modules/ixgbe/Makefile Mon Sep 15 20:54:12 2014
(r271648)
+++ head/sys/modules/ixgbe/Makefile Mon Sep 15 21:09:19 2014
(r271649)
@@ -10,6 +10,6 @@ SRCS+= ixgbe.c ixv.c
 SRCS+= ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c
 SRCS+= ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c
 SRCS+= ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c
-CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR
+CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP
 
 .include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271650 - head/lib/libc/sys

2014-09-15 Thread John-Mark Gurney
Author: jmg
Date: Mon Sep 15 22:32:35 2014
New Revision: 271650
URL: http://svnweb.freebsd.org/changeset/base/271650

Log:
  document mqueuefs is required for mq_open...

Modified:
  head/lib/libc/sys/mq_open.2

Modified: head/lib/libc/sys/mq_open.2
==
--- head/lib/libc/sys/mq_open.2 Mon Sep 15 21:09:19 2014(r271649)
+++ head/lib/libc/sys/mq_open.2 Mon Sep 15 22:32:35 2014(r271650)
@@ -37,7 +37,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 29, 2005
+.Dd September 15, 2014
 .Dt MQ_OPEN 2
 .Os
 .Sh NAME
@@ -223,6 +223,11 @@ The
 and
 .Xr kevent 2
 system calls are supported for message queue descriptor.
+.Pp
+Please see the
+.Xr mqueuefs 5
+man page for instructions on loading the module or compiling the service into
+the kernel.
 .Sh RETURN VALUES
 Upon successful completion, the function returns a message queue
 descriptor; otherwise, the function returns
@@ -294,7 +299,8 @@ There is insufficient space for the crea
 .Xr mq_setattr 2 ,
 .Xr mq_timedreceive 3 ,
 .Xr mq_timedsend 3 ,
-.Xr mq_unlink 3
+.Xr mq_unlink 3 ,
+.Xr mqueuefs 5
 .Sh STANDARDS
 The
 .Fn mq_open
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271651 - in head/lib/msun: . ld128 ld80 man src

2014-09-15 Thread Steve Kargl
Author: kargl
Date: Mon Sep 15 23:21:57 2014
New Revision: 271651
URL: http://svnweb.freebsd.org/changeset/base/271651

Log:
  * Makefile:
. Hook e_lgammal[_r].c to the build.
. Create man page links for lgammal[-r].3.
  
  * Symbol.map:
. Sort lgammal to its rightful place.
. Add FBSD_1.4 section for the new lgamal_r symbol.
  
  * ld128/e_lgammal_r.c:
. 128-bit implementataion of lgammal_r().
  
  * ld80/e_lgammal_r.c:
. Intel 80-bit format implementation of lgammal_r().
  
  * src/e_lgamma.c:
. Expose lgammal as a weak reference to lgamma for platforms
  where long double is mapped to double.
  
  * src/e_lgamma_r.c:
. Use integer literal constants instead of real literal constants.
  Let compiler(s) do the job of conversion to the appropriate type.
. Expose lgammal_r as a weak reference to lgamma_r for platforms
  where long double is mapped to double.
  
  * src/e_lgammaf_r.c:
. Fixed the Cygnus Support conversion of e_lgamma_r.c to float.
  This includes the generation of new polynomial and rational
  approximations with fewer terms.  For each approximation, include
  a comment on an estimate of the accuracy over the relevant domain.
. Use integer literal constants instead of real literal constants.
  Let compiler(s) do the job of conversion to the appropriate type.
  This allows the removal of several explicit casts of double values
  to float.
  
  * src/e_lgammal.c:
. Wrapper for lgammal() about lgammal_r().
  
  * src/imprecise.c:
. Remove the lgamma.
  
  * src/math.h:
. Add a prototype for lgammal_r().
  
  * man/lgamma.3:
. Document the new functions.
  
  Reviewed by:  bde

Added:
  head/lib/msun/ld128/e_lgammal_r.c   (contents, props changed)
  head/lib/msun/ld80/e_lgammal_r.c   (contents, props changed)
  head/lib/msun/src/e_lgammal.c   (contents, props changed)
Modified:
  head/lib/msun/Makefile
  head/lib/msun/Symbol.map
  head/lib/msun/man/lgamma.3
  head/lib/msun/src/e_lgamma.c
  head/lib/msun/src/e_lgamma_r.c
  head/lib/msun/src/e_lgammaf_r.c
  head/lib/msun/src/imprecise.c
  head/lib/msun/src/math.h

Modified: head/lib/msun/Makefile
==
--- head/lib/msun/Makefile  Mon Sep 15 22:32:35 2014(r271650)
+++ head/lib/msun/Makefile  Mon Sep 15 23:21:57 2014(r271651)
@@ -98,6 +98,7 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_
 # If long double != double use these; otherwise, we alias the double versions.
 COMMON_SRCS+=  e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \
e_coshl.c e_fmodl.c e_hypotl.c \
+   e_lgammal.c e_lgammal_r.c \
e_remainderl.c e_sinhl.c e_sqrtl.c \
invtrig.c k_cosl.c k_sinl.c k_tanl.c \
s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \
@@ -188,7 +189,8 @@ MLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl.
ilogb.3 logb.3 ilogb.3 logbf.3 ilogb.3 logbl.3
 MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3
 MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3
-MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \
+MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 \
+   lgamma.3 lgammaf.3 lgamma.3 lgammal.3 \
lgamma.3 tgamma.3 lgamma.3 tgammaf.3
 MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log10l.3 \
log.3 log1p.3 log.3 log1pf.3 log.3 log1pl.3 \

Modified: head/lib/msun/Symbol.map
==
--- head/lib/msun/Symbol.mapMon Sep 15 22:32:35 2014(r271650)
+++ head/lib/msun/Symbol.mapMon Sep 15 23:21:57 2014(r271651)
@@ -269,6 +269,7 @@ FBSD_1.3 {
erfl;
expl;
expm1l;
+   lgammal;
log10l;
log1pl;
log2l;
@@ -276,7 +277,11 @@ FBSD_1.3 {
sinhl;
tanhl;
/* Implemented as weak aliases for imprecise versions */
-   lgammal;
powl;
tgammal;
 };
+
+/* First added in 11.0-CURRENT */
+FBSD_1.4 {
+   lgammal_r;
+};

Added: head/lib/msun/ld128/e_lgammal_r.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/msun/ld128/e_lgammal_r.c   Mon Sep 15 23:21:57 2014
(r271651)
@@ -0,0 +1,329 @@
+/* @(#)e_lgamma_r.c 1.3 95/01/18 */
+/*
+ * 
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * 
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * See e_lgamma_r.c for complete comments.
+ *
+ * Converted to long double by Steven G. Kargl.
+ */
+
+#include "fpmath.h"
+#include "math.h"
+#include "ma

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

2014-09-15 Thread Rui Paulo
On Sep 8, 2014, at 20:10, Adrian Chadd  wrote:
> 
>  The IPv6 part of this is missing - I'm going to do some re-juggling of
>  where various parts of the RSS framework live before I add the IPv6
>  code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch],
>  rather than living here.)

Any thoughts on how are you going to handle the IPv6 part?  I would probably 
avoid parsing any special IPv6 header type and provide RSS iff the packet is 
IPv6 header + next header = (TCP|UDP).

--
Rui Paulo



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


svn commit: r271655 - in head: lib/libc/sys sys/kern

2014-09-15 Thread Garrett Cooper
Author: ngie
Date: Tue Sep 16 00:56:47 2014
New Revision: 271655
URL: http://svnweb.freebsd.org/changeset/base/271655

Log:
  Validate the mode argument in access, eaccess, and faccessat for optional
  POSIX compliance and to improve compatibility with Linux and NetBSD
  
  The issue was identified with lib/libc/sys/t_access:access_inval from
  NetBSD
  
  Update the manpage accordingly
  
  PR: 181155
  Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code)
  MFC after: 4 weeks
  Phabric: D678 (code), D786 (manpage)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/sys/access.2
  head/sys/kern/vfs_syscalls.c

Modified: head/lib/libc/sys/access.2
==
--- head/lib/libc/sys/access.2  Tue Sep 16 00:11:01 2014(r271654)
+++ head/lib/libc/sys/access.2  Tue Sep 16 00:56:47 2014(r271655)
@@ -133,8 +133,16 @@ and
 .Sh RETURN VALUES
 .Rv -std
 .Sh ERRORS
-Access to the file is denied if:
+.Fn access ,
+.Fn eaccess ,
+or
+.Fn faccessat 
+will fail if:
 .Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa mode
+argument is invalid.
 .It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 .It Bq Er ENAMETOOLONG

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Sep 16 00:11:01 2014
(r271654)
+++ head/sys/kern/vfs_syscalls.cTue Sep 16 00:56:47 2014
(r271655)
@@ -2055,6 +2055,9 @@ kern_accessat(struct thread *td, int fd,
cap_rights_t rights;
int error;
 
+   if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0)
+   return (EINVAL);
+
/*
 * Create and modify a temporary credential instead of one that
 * is potentially shared.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271656 - head/lib/libc/sys

2014-09-15 Thread Garrett Cooper
Author: ngie
Date: Tue Sep 16 00:59:08 2014
New Revision: 271656
URL: http://svnweb.freebsd.org/changeset/base/271656

Log:
  Bump .Dd for the content change done to access(2) in r271655
  
  PR: 181155
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/sys/access.2

Modified: head/lib/libc/sys/access.2
==
--- head/lib/libc/sys/access.2  Tue Sep 16 00:56:47 2014(r271655)
+++ head/lib/libc/sys/access.2  Tue Sep 16 00:59:08 2014(r271656)
@@ -28,7 +28,7 @@
 .\" @(#)access.2   8.2 (Berkeley) 4/1/94
 .\" $FreeBSD$
 .\"
-.Dd April 10, 2008
+.Dd September 15, 2014
 .Dt ACCESS 2
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271657 - head/sys/sys

2014-09-15 Thread Garrett Cooper
Author: ngie
Date: Tue Sep 16 00:59:56 2014
New Revision: 271657
URL: http://svnweb.freebsd.org/changeset/base/271657

Log:
  Bump __FreeBSD_version for the change made in r271655
  
  PR: 181155
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Sep 16 00:59:08 2014(r271656)
+++ head/sys/sys/param.hTue Sep 16 00:59:56 2014(r271657)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100032  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100033  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-09-15 Thread Adrian Chadd
Author: adrian
Date: Tue Sep 16 01:21:47 2014
New Revision: 271658
URL: http://svnweb.freebsd.org/changeset/base/271658

Log:
  Modify cpuset_setithread() to take a CPU ID as an integer, not a char.
  
  We're going to end up having > 254 CPUs at some point.

Modified:
  head/sys/kern/kern_cpuset.c
  head/sys/sys/cpuset.h

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Tue Sep 16 00:59:56 2014(r271657)
+++ head/sys/kern/kern_cpuset.c Tue Sep 16 01:21:47 2014(r271658)
@@ -719,7 +719,7 @@ out:
  * Apply new cpumask to the ithread.
  */
 int
-cpuset_setithread(lwpid_t id, u_char cpu)
+cpuset_setithread(lwpid_t id, int cpu)
 {
struct cpuset *nset, *rset;
struct cpuset *parent, *old_set;

Modified: head/sys/sys/cpuset.h
==
--- head/sys/sys/cpuset.h   Tue Sep 16 00:59:56 2014(r271657)
+++ head/sys/sys/cpuset.h   Tue Sep 16 01:21:47 2014(r271658)
@@ -118,7 +118,7 @@ struct cpuset *cpuset_thread0(void);
 struct cpuset *cpuset_ref(struct cpuset *);
 void   cpuset_rel(struct cpuset *);
 intcpuset_setthread(lwpid_t id, cpuset_t *);
-intcpuset_setithread(lwpid_t id, u_char cpu);
+intcpuset_setithread(lwpid_t id, int cpu);
 intcpuset_create_root(struct prison *, struct cpuset **);
 intcpuset_setproc_update_set(struct proc *, struct cpuset *);
 char   *cpusetobj_strprint(char *, const cpuset_t *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-09-15 Thread Adrian Chadd
On 15 September 2014 17:00, Rui Paulo  wrote:
> On Sep 8, 2014, at 20:10, Adrian Chadd  wrote:
>>
>>  The IPv6 part of this is missing - I'm going to do some re-juggling of
>>  where various parts of the RSS framework live before I add the IPv6
>>  code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch],
>>  rather than living here.)
>
> Any thoughts on how are you going to handle the IPv6 part?  I would probably 
> avoid parsing any special IPv6 header type and provide RSS iff the packet is 
> IPv6 header + next header = (TCP|UDP).

I'm likely going to do exactly that for now and only support those
bits in the RSS config. The IPV6 _EXT bits can come later.


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


svn commit: r271660 - head/sys/netinet

2014-09-15 Thread Adrian Chadd
Author: adrian
Date: Tue Sep 16 03:26:42 2014
New Revision: 271660
URL: http://svnweb.freebsd.org/changeset/base/271660

Log:
  Ensure the correct software IPv4 hash is done based on the configured
  RSS parameters, rather than assuming we're hashing IPv4+UDP and IPv4+TCP.

Modified:
  head/sys/netinet/in_rss.c

Modified: head/sys/netinet/in_rss.c
==
--- head/sys/netinet/in_rss.c   Tue Sep 16 01:59:19 2014(r271659)
+++ head/sys/netinet/in_rss.c   Tue Sep 16 03:26:42 2014(r271660)
@@ -671,7 +671,9 @@ rss_mbuf_software_hash_v4(const struct m
 * XXX TODO: does the hardware hash on 4-tuple if IP
 *options are present?
 */
-   if (proto == IPPROTO_TCP && is_frag == 0) {
+   if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_TCP_IPV4) &&
+   (proto == IPPROTO_TCP) &&
+   (is_frag == 0)) {
if (m->m_len < iphlen + sizeof(struct tcphdr)) {
printf("%s: short TCP frame?\n", __func__);
return (-1);
@@ -683,7 +685,9 @@ rss_mbuf_software_hash_v4(const struct m
proto,
hashval,
hashtype);
-   } else if (proto == IPPROTO_UDP && is_frag == 0) {
+   } else if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4) &&
+   (proto == IPPROTO_UDP) &&
+   (is_frag == 0)) {
uh = (struct udphdr *)((caddr_t)ip + iphlen);
if (m->m_len < iphlen + sizeof(struct udphdr)) {
printf("%s: short UDP frame?\n", __func__);
@@ -695,7 +699,7 @@ rss_mbuf_software_hash_v4(const struct m
proto,
hashval,
hashtype);
-   } else {
+   } else if (rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) {
/* Default to 2-tuple hash */
return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst,
0,  /* source port */
@@ -703,6 +707,9 @@ rss_mbuf_software_hash_v4(const struct m
0,  /* IPPROTO_IP */
hashval,
hashtype);
+   } else {
+   printf("%s: no available hashtypes!\n", __func__);
+   return (-1);
}
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r271663 - in head/etc: defaults rc.d

2014-09-15 Thread Hiroki Sato
Author: hrs
Date: Tue Sep 16 05:45:38 2014
New Revision: 271663
URL: http://svnweb.freebsd.org/changeset/base/271663

Log:
  Fix a typo; master server for iprop service should be singular.

Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/ipropd_slave

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Tue Sep 16 04:01:55 2014(r271662)
+++ head/etc/defaults/rc.conf   Tue Sep 16 05:45:38 2014(r271663)
@@ -293,7 +293,7 @@ ipropd_slave_enable="NO"# Run Heimdal i
 ipropd_slave_program="/usr/libexec/ipropd-slave"
 ipropd_slave_flags=""  # Flags to ipropd-slave.
 ipropd_slave_keytab="/etc/krb5.keytab" # keytab for ipropd-slave.
-ipropd_slave_masters=""# master node names.
+ipropd_slave_master="" # master node name.
 
 gssd_enable="NO"   # Run the gssd daemon (or NO).
 gssd_program="/usr/sbin/gssd"  # Path to gssd.

Modified: head/etc/rc.d/ipropd_slave
==
--- head/etc/rc.d/ipropd_slave  Tue Sep 16 04:01:55 2014(r271662)
+++ head/etc/rc.d/ipropd_slave  Tue Sep 16 05:45:38 2014(r271663)
@@ -17,15 +17,15 @@ start_precmd=${name}_start_precmd
 ipropd_slave_start_precmd()
 {
 
-   if [ -z "$ipropd_slave_masters" ]; then
-   warn "\$ipropd_slave_masters is empty."
+   if [ -z "$ipropd_slave_master" ]; then
+   warn "\$ipropd_slave_master is empty."
return 1
fi
command_args=" \
$command_args \
--keytab=\"$ipropd_slave_keytab\" \
--detach \
-   $ipropd_slave_masters"
+   $ipropd_slave_master"
 }
 
 load_rc_config $name
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"