svn commit: r312793 - head/share/misc

2017-01-25 Thread Matthew Rezny
Author: rezny (ports committer)
Date: Thu Jan 26 07:07:09 2017
New Revision: 312793
URL: https://svnweb.freebsd.org/changeset/base/312793

Log:
  Update the mentor/mentee relationships to add myself.
  
  Reviewed by:  swills
  Approved by:  swills (mentor)
  Differential Revision:https://reviews.freebsd.org/D9343

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Jan 26 05:23:33 2017
(r312792)
+++ head/share/misc/committers-ports.dotThu Jan 26 07:07:09 2017
(r312793)
@@ -195,6 +195,7 @@ philip [label="Philip Paeps\nphilip@Free
 rafan [label="Rong-En Fan\nra...@freebsd.org\n2006/06/23"]
 rakuco [label="Raphael Kubo da Costa\nrak...@freebsd.org\n2011/08/22"]
 rene [label="Rene Ladan\nr...@freebsd.org\n2010/04/11"]
+rezny [label="Matthew Rezny\nre...@freebsd.org\n2017/01/09"]
 riggs [label="Thomas Zander\nri...@freebsd.org\n2014/01/09"]
 rm [label="Ruslan Makhmatkhanov\n...@freebsd.org\n2011/11/06"]
 rnoland [label="Robert Noland\nrnol...@freebsd.org\n2008/07/21"]
@@ -370,6 +371,7 @@ erwin -> simon
 
 feld -> brnrd
 feld -> junovitch
+feld -> rezny
 
 fjoe -> danfe
 fjoe -> flo
@@ -595,6 +597,7 @@ swills -> feld
 swills -> jrm
 swills -> milki
 swills -> pclin
+swills -> rezny
 swills -> robak
 swills -> rpaulo
 swills -> tz
___
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: r312765 - in head/contrib/llvm: include/llvm/Analysis lib/Analysis

2017-01-25 Thread Antoine Brodin
On Wed, Jan 25, 2017 at 6:59 PM, Dimitry Andric  wrote:
> Author: dim
> Date: Wed Jan 25 17:59:22 2017
> New Revision: 312765
> URL: https://svnweb.freebsd.org/changeset/base/312765
>
> Log:
>   Pull in r276136 from upstream llvm trunk (by Wei Mi):
>
> Use ValueOffsetPair to enhance value reuse during SCEV expansion.
>
> In D12090, the ExprValueMap was added to reuse existing value during
> SCEV expansion. However, const folding and sext/zext distribution can
> make the reuse still difficult.
>
> A simplified case is: suppose we know S1 expands to V1 in
> ExprValueMap, and
>   S1 = S2 + C_a
>   S3 = S2 + C_b
> where C_a and C_b are different SCEVConstants. Then we'd like to
> expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
> helpful when S2 is a complex SCEV expr and S2 has no entry in
> ExprValueMap, which is usually caused by the fact that S3 is
> generated from S1 after const folding.
>
> In order to do that, we represent ExprValueMap as a mapping from SCEV
> to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
> into the ExprValueMap when we create SCEV for V1. When S3 is
> expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
> C_a} in the map, then expand S3 to V1 - C_a + C_b.
>
> Differential Revision: https://reviews.llvm.org/D21313
>
>   This should fix assertion failures when building OpenCV >= 3.1.
>
>   PR:   215649
>   MFC after:3 days

Hi,

I don't know if it's this commit,  but there is now an assertion
failure when trying to build lang/spidermonkey24  (It was building
fine with base/head@312672)

http://beefy12.nyi.freebsd.org/data/head-amd64-default/p432463_s312786/logs/errors/spidermonkey24-24.2.0_4.log

Cheers,

Antoine
___
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: r312792 - in head/sys/arm: arm include

2017-01-25 Thread Jason Harmening
On Wed, Jan 25, 2017 at 9:23 PM, Jason A. Harmening  wrote:

> Author: jah
> Date: Thu Jan 26 05:23:33 2017
> New Revision: 312792
> URL: https://svnweb.freebsd.org/changeset/base/312792
>
> Log:
>   Further cleanup of per-CPU armv6 pmap data:
>
>   - Replace pcpu_find(curcpu) with get_pcpu(), which is much
> more direct.
>
>   - Remove armv4 pcpu fields which I added in r286296 but never
> needed to use.
>
>   - armv6 pc_qmap_addr was leftover from the old armv6 pmap
> implementation.  Rename it and put it to use in the new one.
>

pc_qmap_addr -> pc_qmap_pte
___
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: r312687 - in head/sys: net sys

2017-01-25 Thread Dexuan Cui via svn-src-all
> From: Dexuan Cui [mailto:de...@microsoft.com]
> Sent: Wednesday, January 25, 2017 06:21
> To: Gleb Smirnoff ; Dexuan Cui 
> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-
> h...@freebsd.org
> Subject: RE: svn commit: r312687 - in head/sys: net sys
> 
> > From: Gleb Smirnoff [mailto:gleb...@freebsd.org]
> >   Dexuan,
> >
> > On Tue, Jan 24, 2017 at 09:19:47AM +, Dexuan Cui wrote:
> > D> --- head/sys/sys/eventhandler.h  Tue Jan 24 09:15:36 2017
> > (r312686)
> > D> +++ head/sys/sys/eventhandler.h  Tue Jan 24 09:19:46 2017
> > (r312687)
> > D> @@ -284,4 +284,11 @@ typedef void (*swapoff_fn)(void *, struc
> > D>  EVENTHANDLER_DECLARE(swapon, swapon_fn);
> > D>  EVENTHANDLER_DECLARE(swapoff, swapoff_fn);
> > D>
> > D> +/* ifup/ifdown events */
> > D> +#define IFNET_EVENT_UP  0
> > D> +#define IFNET_EVENT_DOWN1
> > D> +struct ifnet;
> > D> +typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event);
> > D> +EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn);
> > D> +
> > D>  #endif /* _SYS_EVENTHANDLER_H_ */
> >
> > The network stuff shall not be added to sys/eventhandler.h.
> >
> > All these declarations should go to net/if_var.h. There is already
> > a block of event(9) defines there. Please move it there.
> >
> > --
> > Totus tuus, Glebius.
> 
> Hi Gleb,
> Sorry, I didn't realize this... I'll move it as you suggested.
> 
> Thank you for the reminder!
> 
> -- Dexuan

I posted https://reviews.freebsd.org/D9345 for this.

Please review it.

Thanks,
-- Dexuan

___
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: r312792 - in head/sys/arm: arm include

2017-01-25 Thread Jason A. Harmening
Author: jah
Date: Thu Jan 26 05:23:33 2017
New Revision: 312792
URL: https://svnweb.freebsd.org/changeset/base/312792

Log:
  Further cleanup of per-CPU armv6 pmap data:
  
  - Replace pcpu_find(curcpu) with get_pcpu(), which is much
more direct.
  
  - Remove armv4 pcpu fields which I added in r286296 but never
needed to use.
  
  - armv6 pc_qmap_addr was leftover from the old armv6 pmap
implementation.  Rename it and put it to use in the new one.
  
  Noted by: skra
  Reviewed by:  skra
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9312

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/include/pcpu.h

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Thu Jan 26 04:51:48 2017(r312791)
+++ head/sys/arm/arm/pmap-v6.c  Thu Jan 26 05:23:33 2017(r312792)
@@ -1160,11 +1160,11 @@ pmap_bootstrap(vm_offset_t firstaddr)
 * Local CMAP1/CMAP2 are used for zeroing and copying pages.
 * Local CMAP2 is also used for data cache cleaning.
 */
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
mtx_init(>pc_cmap_lock, "SYSMAPS", NULL, MTX_DEF);
SYSMAP(caddr_t, pc->pc_cmap1_pte2p, pc->pc_cmap1_addr, 1);
SYSMAP(caddr_t, pc->pc_cmap2_pte2p, pc->pc_cmap2_addr, 1);
-   SYSMAP(vm_offset_t, unused, pc->pc_qmap_addr, 1);
+   SYSMAP(vm_offset_t, pc->pc_qmap_pte2p, pc->pc_qmap_addr, 1);
 
/*
 * Crashdump maps.
@@ -1217,6 +1217,7 @@ pmap_init_reserved_pages(void)
panic("%s: unable to allocate KVA", __func__);
pc->pc_cmap1_pte2p = pt2map_entry(pages);
pc->pc_cmap2_pte2p = pt2map_entry(pages + PAGE_SIZE);
+   pc->pc_qmap_pte2p = pt2map_entry(pages + (PAGE_SIZE * 2));
pc->pc_cmap1_addr = (caddr_t)pages;
pc->pc_cmap2_addr = (caddr_t)(pages + PAGE_SIZE);
pc->pc_qmap_addr = pages + (PAGE_SIZE * 2);
@@ -1584,7 +1585,7 @@ pmap_pt2pg_zero(vm_page_t m)
 *  to sync it even if the sync is only DSB.
 */
sched_pin();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
cmap2_pte2p = pc->pc_cmap2_pte2p;
mtx_lock(>pc_cmap_lock);
if (pte2_load(cmap2_pte2p) != 0)
@@ -5661,7 +5662,7 @@ pmap_page_set_memattr(vm_page_t m, vm_me
if (ma != oma) {
pa = VM_PAGE_TO_PHYS(m);
sched_pin();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
cmap2_pte2p = pc->pc_cmap2_pte2p;
mtx_lock(>pc_cmap_lock);
if (pte2_load(cmap2_pte2p) != 0)
@@ -5754,7 +5755,7 @@ pmap_zero_page(vm_page_t m)
struct pcpu *pc;
 
sched_pin();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
cmap2_pte2p = pc->pc_cmap2_pte2p;
mtx_lock(>pc_cmap_lock);
if (pte2_load(cmap2_pte2p) != 0)
@@ -5781,7 +5782,7 @@ pmap_zero_page_area(vm_page_t m, int off
struct pcpu *pc;
 
sched_pin();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
cmap2_pte2p = pc->pc_cmap2_pte2p;
mtx_lock(>pc_cmap_lock);
if (pte2_load(cmap2_pte2p) != 0)
@@ -5811,7 +5812,7 @@ pmap_copy_page(vm_page_t src, vm_page_t 
struct pcpu *pc;
 
sched_pin();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
cmap1_pte2p = pc->pc_cmap1_pte2p;
cmap2_pte2p = pc->pc_cmap2_pte2p;
mtx_lock(>pc_cmap_lock);
@@ -5846,7 +5847,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
int cnt;
 
sched_pin();
-   pc = pcpu_find(curcpu);
+   pc = get_pcpu();
cmap1_pte2p = pc->pc_cmap1_pte2p;
cmap2_pte2p = pc->pc_cmap2_pte2p;
mtx_lock(>pc_cmap_lock);
@@ -5885,34 +5886,34 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
 vm_offset_t
 pmap_quick_enter_page(vm_page_t m)
 {
+   struct pcpu *pc;
pt2_entry_t *pte2p;
-   vm_offset_t qmap_addr;
 
critical_enter();
-   qmap_addr = PCPU_GET(qmap_addr);
-   pte2p = pt2map_entry(qmap_addr);
+   pc = get_pcpu();
+   pte2p = pc->pc_qmap_pte2p;
 
KASSERT(pte2_load(pte2p) == 0, ("%s: PTE2 busy", __func__));
 
pte2_store(pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
vm_page_pte2_attr(m)));
-   return (qmap_addr);
+   return (pc->pc_qmap_addr);
 }
 
 void
 pmap_quick_remove_page(vm_offset_t addr)
 {
+   struct pcpu *pc;
pt2_entry_t *pte2p;
-   vm_offset_t qmap_addr;
 
-   qmap_addr = PCPU_GET(qmap_addr);
-   pte2p = pt2map_entry(qmap_addr);
+   pc = get_pcpu();
+   pte2p = pc->pc_qmap_pte2p;
 
-   KASSERT(addr == qmap_addr, ("%s: invalid address", __func__));
+   KASSERT(addr == pc->pc_qmap_addr, ("%s: invalid address", __func__));
KASSERT(pte2_load(pte2p) != 0, ("%s: PTE2 not in use", __func__));
 

svn commit: r312791 - head/contrib/ipfilter/tools

2017-01-25 Thread Cy Schubert
Author: cy
Date: Thu Jan 26 04:51:48 2017
New Revision: 312791
URL: https://svnweb.freebsd.org/changeset/base/312791

Log:
  Use normal KNF cuddling of elses.
  
  Reported by:  bde
  MFC after:2 weeks
  X-MFC with:   r312777

Modified:
  head/contrib/ipfilter/tools/ipf.c

Modified: head/contrib/ipfilter/tools/ipf.c
==
--- head/contrib/ipfilter/tools/ipf.c   Thu Jan 26 04:44:18 2017
(r312790)
+++ head/contrib/ipfilter/tools/ipf.c   Thu Jan 26 04:51:48 2017
(r312791)
@@ -408,8 +408,7 @@ static void flushfilter(arg, filter)
}
closedevice();
return;
-   }
-   else if (strchr(arg, 'i') || strchr(arg, 'I'))
+   } else if (strchr(arg, 'i') || strchr(arg, 'I'))
fl = FR_INQUE;
else if (strchr(arg, 'o') || strchr(arg, 'O'))
fl = FR_OUTQUE;
___
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: r312790 - stable/11/release/tools

2017-01-25 Thread Colin Percival
Author: cperciva
Date: Thu Jan 26 04:44:18 2017
New Revision: 312790
URL: https://svnweb.freebsd.org/changeset/base/312790

Log:
  MFC r312214: Enable IPv6 on EC2 AMIs.

Modified:
  stable/11/release/tools/ec2.conf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/release/tools/ec2.conf
==
--- stable/11/release/tools/ec2.confThu Jan 26 03:05:27 2017
(r312789)
+++ stable/11/release/tools/ec2.confThu Jan 26 04:44:18 2017
(r312790)
@@ -6,7 +6,7 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs 
dual-dhclient"
 
 # Set to a list of third-party software to enable in rc.conf(5).
 export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap 
ec2_loghostkey firstboot_freebsd_update firstboot_pkgs"
@@ -39,8 +39,9 @@ vm_extra_pre_umount() {
# time; expand our filesystem to fill the disk.
echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
 
-   # EC2 instances use DHCP to get their network configuration.
-   echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
+   # EC2 instances use DHCP to get their network configuration.  IPv6
+   # requires accept_rtadv.
+   echo 'ifconfig_DEFAULT="SYNCDHCP accept_rtadv"' >> 
${DESTDIR}/etc/rc.conf
 
# Unless the system has been configured via EC2 user-data, the user
# will need to SSH in to do anything.
@@ -51,6 +52,10 @@ vm_extra_pre_umount() {
# via EC2 user-data.
echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf
 
+   # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6.
+   echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf
+   echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> 
${DESTDIR}/etc/rc.conf
+
# The EC2 console is output-only, so while printing a backtrace can
# be useful, there's no point dropping into a debugger or waiting
# for a keypress.
___
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: r312780 - head/contrib/ipfilter/tools

2017-01-25 Thread Cy Schubert
In message <20170126144726.u1...@besplex.bde.org>, Bruce Evans writes:
> On Wed, 25 Jan 2017, Cy Schubert wrote:
> 
> > Log:
> >  Remove extraneous blank line.
> >
> >  MFC after: 2 weeks
> >  X-MFC with:r312777
> >
> > Modified:
> >  head/contrib/ipfilter/tools/ipf.c
> >
> > Modified: head/contrib/ipfilter/tools/ipf.c
> > ===
> ===
> > --- head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:59:06 2017
>   (r312779)
> > +++ head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:59:23 2017
>   (r312780)
> > @@ -409,7 +409,6 @@ static void flushfilter(arg, filter)
> > closedevice();
> > return;
> > }
> > -
> > else if (strchr(arg, 'i') || strchr(arg, 'I'))
> > fl = FR_INQUE;
> > else if (strchr(arg, 'o') || strchr(arg, 'O'))
> 
> Now it has 1 extra instead of 2 extra.
> 
> Most code in ipfilter, and all in the old version of this file, uses the
> normal KNF style of cuddling elses.

I suppose I should compress it one more. I'll do that after the change 
window I'm working on tonight (if it's not too late and I'm not too tired).

Thanks for your input Bruce.


-- 
Cheers,
Cy Schubert 
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"


Re: svn commit: r312780 - head/contrib/ipfilter/tools

2017-01-25 Thread Bruce Evans

On Wed, 25 Jan 2017, Cy Schubert wrote:


Log:
 Remove extraneous blank line.

 MFC after: 2 weeks
 X-MFC with:r312777

Modified:
 head/contrib/ipfilter/tools/ipf.c

Modified: head/contrib/ipfilter/tools/ipf.c
==
--- head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:59:06 2017
(r312779)
+++ head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:59:23 2017
(r312780)
@@ -409,7 +409,6 @@ static void flushfilter(arg, filter)
closedevice();
return;
}
-
else if (strchr(arg, 'i') || strchr(arg, 'I'))
fl = FR_INQUE;
else if (strchr(arg, 'o') || strchr(arg, 'O'))


Now it has 1 extra instead of 2 extra.

Most code in ipfilter, and all in the old version of this file, uses the
normal KNF style of cuddling elses.

Bruce
___
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: r312789 - stable/11/libexec/rtld-elf/amd64

2017-01-25 Thread Ed Maste
Author: emaste
Date: Thu Jan 26 03:05:27 2017
New Revision: 312789
URL: https://svnweb.freebsd.org/changeset/base/312789

Log:
  MFC r312288: rtld: do not rely on a populated GOT on amd64
  
  On rela architectures GNU BFD ld and gold store the relocation addend
  in GOT entries (in addition to the relocation's r_addend field).
  rtld previously relied on this to access its own _DYNAMIC symbol in
  order to apply its own relocations.
  
  However, recording addends in the GOT is not specified by the ABI,
  and some versions of LLVM's LLD linker leave the GOT uninitialized on
  rela architectures.
  
  BFD ld does not populate the GOT on sparc64, and sparc64 rtld has a
  machine-dependent rtld_dynamic_addr() function that returns the
  _DYNAMIC address. Use the same approach on amd64, obtaining the %rip-
  relative _DYNAMIC address following a suggestion from Rafael EspĂ­ndola.
  
  Architectures other than amd64 should be addressed in future work.

Modified:
  stable/11/libexec/rtld-elf/amd64/rtld_machdep.h
  stable/11/libexec/rtld-elf/amd64/rtld_start.S
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rtld-elf/amd64/rtld_machdep.h
==
--- stable/11/libexec/rtld-elf/amd64/rtld_machdep.h Thu Jan 26 02:22:23 
2017(r312788)
+++ stable/11/libexec/rtld-elf/amd64/rtld_machdep.h Thu Jan 26 03:05:27 
2017(r312789)
@@ -35,8 +35,8 @@
 struct Struct_Obj_Entry;
 
 /* Return the address of the .dynamic section in the dynamic linker. */
-#define rtld_dynamic(obj) \
-((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC))
+Elf_Dyn *rtld_dynamic_addr(void);
+#definertld_dynamic(obj)   rtld_dynamic_addr()
 
 /* Fixup the jump slot at "where" to transfer control to "target". */
 static inline Elf_Addr

Modified: stable/11/libexec/rtld-elf/amd64/rtld_start.S
==
--- stable/11/libexec/rtld-elf/amd64/rtld_start.S   Thu Jan 26 02:22:23 
2017(r312788)
+++ stable/11/libexec/rtld-elf/amd64/rtld_start.S   Thu Jan 26 03:05:27 
2017(r312789)
@@ -156,4 +156,16 @@ _rtld_bind_start:
.cfi_endproc
.size   _rtld_bind_start, . - _rtld_bind_start
 
+   .align  4
+   .globl  rtld_dynamic_addr
+   .type   rtld_dynamic_addr,@function
+rtld_dynamic_addr:
+   .cfi_startproc
+   .weak _DYNAMIC
+   .hidden _DYNAMIC
+   lea _DYNAMIC(%rip),%rax
+   ret
+   .cfi_endproc
+   .size   rtld_dynamic_addr, . - rtld_dynamic_addr
+
.section .note.GNU-stack,"",%progbits
___
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: r312770 - in head/sys: net netinet netinet6

2017-01-25 Thread Bruce Evans

On Thu, 26 Jan 2017, Konstantin Belousov wrote:


On Wed, Jan 25, 2017 at 02:20:06PM -0800, Gleb Smirnoff wrote:

  Thanks, Luiz!

  One stylistic nit that I missed in review:

L>  static int
L> -in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td)
L> +in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread 
*td)
L>  {
L>   const struct ifreq *ifr = (struct ifreq *)data;
L>   const struct sockaddr_in *addr = (const struct sockaddr_in *)
L> @@ -618,7 +618,8 @@ in_difaddr_ioctl(caddr_t data, struct if
L>   in_ifadown(>ia_ifa, 1);
L>
L>   if (ia->ia_ifa.ifa_carp)
L> - (*carp_detach_p)(>ia_ifa);
L> + (*carp_detach_p)(>ia_ifa,
L> + (cmd == SIOCDIFADDR) ? false : true);

Can we change the very last line to:

(cmd == SIOCAIFADDR) ? true : false);


That is not stylistic, but invert the result.  Perhaps you meant to
reverse the test to avoid negative logic for the result.


This is just 'cmd == SIOCAIFADDR'.


Not quite.  The result of a relational operator is 1 or 0 (and thus has
type int), not true or false (and thus would have type bool).

Unfortunately, carp has a bool infestation (the declaration of
carp_attach_p() is 1 of 21 lines in netinet with bool), so int is the
wrong type.  It is automatically converted to bool by the prototype.

12 of the 21 lines with bools are actually mispelling of 'boolean'
for IP options in in.h.  'bool' is a C type.  IP options are never
bools.  Some of them are booleans represented as ints (never as bool
since get/setsockopt() only uses int).  A meta-comment in in.h
describes this "bool is stored as int".

Fixing the style bugs on 1 line gives another style bug -- line splitting
which was to make space for the verbose spelling of a logical value.

The inversion could also be written less verbosely and more clearly using
the ! operator

!(cmd == SIOCAIFADDR)

but since the expression is so simple the ! operator can be distributed in
it almost as clearly, giving !=.  Then remove the parentheses.

Bruce
___
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: r312747 - head/sys/arm/mv

2017-01-25 Thread Ed Maste
On 25 January 2017 at 05:31, Wojciech Macek  wrote:
> Author: wma
> Date: Wed Jan 25 10:31:16 2017
> New Revision: 312747
> URL: https://svnweb.freebsd.org/changeset/base/312747
>
> Log:
>   Setup decoding windows for ARMADA38X
>
>   It is necesarry to open memory windows on internal bus for
>   AHCI driver to work correctly.

Build broken with:

/scratch/tmp/emaste/freebsd/sys/arm/mv/mv_common.c:2019:3: error:
implicit declaration of function 'win_sata_sz_write' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
win_sata_sz_write(base, i, 0);
^
/scratch/tmp/emaste/freebsd/sys/arm/mv/mv_common.c:2024:25: error: use
of undeclared identifier 'IO_WIN_ATTR_SHIFT'
cr = (ddr_attr(i) << IO_WIN_ATTR_SHIFT) |
 ^
...
___
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: r312787 - in head: contrib/ipfilter/lib sys/contrib/ipfilter/netinet

2017-01-25 Thread Cy Schubert
Author: cy
Date: Thu Jan 26 01:24:05 2017
New Revision: 312787
URL: https://svnweb.freebsd.org/changeset/base/312787

Log:
  Currently the fragment info is placed at the top of the linked list
  under a shared read lock. This patch attempts to upgrade the lock to
  an exclusive write lock. If the exclusive write lock fails to be
  obtained, the current fragment is not placed at the head of the list.
  
  This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which
  effectively removed the section of code that performed the reordering).
  
  The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the
  MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c.
  
  The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch
  by emulating the mutex in userspace when exercised by ipftest(1).
  
  Inspired by:  NetBSD ip_frag.c r1.4
  MFC after:1 month

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

Modified: head/contrib/ipfilter/lib/rwlock_emul.c
==
--- head/contrib/ipfilter/lib/rwlock_emul.c Wed Jan 25 23:12:03 2017
(r312786)
+++ head/contrib/ipfilter/lib/rwlock_emul.c Thu Jan 26 01:24:05 2017
(r312787)
@@ -56,6 +56,27 @@ void eMrwlock_write_enter(rw, file, line
 }
 
 
+void eMrwlock_try_upgrade(rw, file, line)
+   eMrwlock_t *rw;
+   char *file;
+   int line;
+{
+   if (rw->eMrw_magic != EMM_MAGIC) {
+   fprintf(stderr, "%s:eMrwlock_write_enter(%p): bad magic: %#x\n",
+   rw->eMrw_owner, rw, rw->eMrw_magic);
+   abort();
+   }
+   if (rw->eMrw_read != 0 || rw->eMrw_write != 0) {
+   fprintf(stderr,
+   "%s:eMrwlock_try_upgrade(%p): already locked: %d/%d\n",
+   rw->eMrw_owner, rw, rw->eMrw_read, rw->eMrw_write);
+   abort();
+   }
+   rw->eMrw_write++;
+   rw->eMrw_heldin = file;
+   rw->eMrw_heldat = line;
+}
+
 void eMrwlock_downgrade(rw, file, line)
eMrwlock_t *rw;
char *file;

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Wed Jan 25 23:12:03 
2017(r312786)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Thu Jan 26 01:24:05 
2017(r312787)
@@ -165,6 +165,7 @@ struct  ether_addr {
 #defineREAD_ENTER(x)   rw_rlock(&(x)->ipf_lk)
 #defineWRITE_ENTER(x)  rw_wlock(&(x)->ipf_lk)
 #defineMUTEX_DOWNGRADE(x)  rw_downgrade(&(x)->ipf_lk)
+#defineMUTEX_TRY_UPGRADE(x)rw_try_upgrade(&(x)->ipf_lk)
 #defineRWLOCK_INIT(x,y)rw_init(&(x)->ipf_lk, (y))
 #defineRW_DESTROY(x)   rw_destroy(&(x)->ipf_lk)
 #defineRWLOCK_EXIT(x)  do { \
@@ -421,6 +422,8 @@ extern  voidfreembt __P((mb_t *));
 
 # define   MUTEX_DOWNGRADE(x)  eMrwlock_downgrade(&(x)->ipf_emu, \
   __FILE__, __LINE__)
+# define   MUTEX_TRY_UPGRADE(x)eMrwlock_try_upgrade(&(x)->ipf_emu, \
+  __FILE__, __LINE__)
 # define   READ_ENTER(x)   eMrwlock_read_enter(&(x)->ipf_emu, \
__FILE__, __LINE__)
 # define   RWLOCK_INIT(x, y)   eMrwlock_init(&(x)->ipf_emu, y)
@@ -671,6 +674,7 @@ extern  char*ipf_getifname __P((struct i
 # define   READ_ENTER(x)   ;
 # define   WRITE_ENTER(x)  ;
 # define   MUTEX_DOWNGRADE(x)  ;
+# define   MUTEX_TRY_UPGRADE(x);
 # define   RWLOCK_INIT(x, y)   ;
 # define   RWLOCK_EXIT(x)  ;
 # define   RW_DESTROY(x)   ;

Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c
==
--- head/sys/contrib/ipfilter/netinet/ip_frag.c Wed Jan 25 23:12:03 2017
(r312786)
+++ head/sys/contrib/ipfilter/netinet/ip_frag.c Thu Jan 26 01:24:05 2017
(r312787)
@@ -745,7 +745,7 @@ ipf_frag_lookup(softc, softf, fin, table
} else if (off == 0)
f->ipfr_seen0 = 1;
 
-   if (f != table[idx]) {
+   if (f != table[idx] && MUTEX_TRY_UPGRADE(lock)) {
ipfr_t **fp;
 
/*
@@ -763,6 +763,7 @@ ipf_frag_lookup(softc, softf, fin, table
table[idx]->ipfr_hprev = >ipfr_hnext;
f->ipfr_hprev = table + idx;
table[idx] = f;
+   MUTEX_DOWNGRADE(lock);
}
 
   

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

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 23:12:03 2017
New Revision: 312786
URL: https://svnweb.freebsd.org/changeset/base/312786

Log:
  Implement RSS queue tagging for em(4) class devices from a copy and massage
  of functions from igb(4).  This enables 2 queue routing on 82574L class
  devices again.

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

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cWed Jan 25 22:52:57 2017
(r312785)
+++ head/sys/dev/e1000/em_txrx.cWed Jan 25 23:12:03 2017
(r312786)
@@ -62,6 +62,7 @@ static int lem_isc_rxd_pkt_get(void *arg
 
 static void lem_receive_checksum(int status, int errors, if_rxd_info_t ri);
 static void em_receive_checksum(uint32_t status, if_rxd_info_t ri);
+static int em_determine_rsstype(u32 pkt_info);
 extern int em_intr(void *arg);
 
 struct if_txrx em_txrx  = {
@@ -645,6 +646,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_inf
union e1000_rx_desc_extended *rxd;
 
u16  len; 
+   u32  pkt_info;
u32  staterr = 0;
bool eop;
int  i, cidx, vtag;
@@ -655,6 +657,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_inf
do {
rxd = >rx_base[cidx];
staterr = le32toh(rxd->wb.upper.status_error);  
+   pkt_info = le32toh(rxd->wb.lower.mrq);

/* Error Checking then decrement count */
MPASS ((staterr & E1000_RXD_STAT_DD) != 0);
@@ -690,10 +693,14 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_inf
} 

ri->iri_vtag = vtag;
-   ri->iri_nfrags = i;
if (vtag)
ri->iri_flags |= M_VLANTAG;

+ri->iri_flowid =
+le32toh(rxd->wb.lower.hi_dword.rss);
+ri->iri_rsstype = em_determine_rsstype(pkt_info);
+
+   ri->iri_nfrags = i;
return (0);
 }
 
@@ -721,6 +728,31 @@ lem_receive_checksum(int status, int err
}
 }
 
+/
+ *
+ *  Parse the packet type to determine the appropriate hash
+ *
+ **/
+static int
+em_determine_rsstype(u32 pkt_info)
+{
+switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) {
+case E1000_RXDADV_RSSTYPE_IPV4_TCP:
+return M_HASHTYPE_RSS_TCP_IPV4;
+case E1000_RXDADV_RSSTYPE_IPV4:
+return M_HASHTYPE_RSS_IPV4;
+case E1000_RXDADV_RSSTYPE_IPV6_TCP:
+return M_HASHTYPE_RSS_TCP_IPV6;
+case E1000_RXDADV_RSSTYPE_IPV6_EX: 
+return M_HASHTYPE_RSS_IPV6_EX;
+case E1000_RXDADV_RSSTYPE_IPV6:
+return M_HASHTYPE_RSS_IPV6;
+case E1000_RXDADV_RSSTYPE_IPV6_TCP_EX:
+return M_HASHTYPE_RSS_TCP_IPV6_EX;
+default:
+return M_HASHTYPE_OPAQUE;
+}
+}
 static void
 em_receive_checksum(uint32_t status, if_rxd_info_t ri)
 {
___
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: r312785 - head/sys/cam/ctl

2017-01-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jan 25 22:52:57 2017
New Revision: 312785
URL: https://svnweb.freebsd.org/changeset/base/312785

Log:
  Bring the ctl headers a bit closer to style(9).  No functional changes.

Modified:
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_ioctl.h
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.h
==
--- head/sys/cam/ctl/ctl.h  Wed Jan 25 22:26:45 2017(r312784)
+++ head/sys/cam/ctl/ctl.h  Wed Jan 25 22:52:57 2017(r312785)
@@ -73,10 +73,10 @@ struct ctl_port_entry {
 };
 
 struct ctl_modepage_header {
-   uint8_t page_code;
-   uint8_t subpage;
-   uint16_t len_used;
-   uint16_t len_left;
+   uint8_t page_code;
+   uint8_t subpage;
+   uint16_tlen_used;
+   uint16_tlen_left;
 };
 
 union ctl_modepage_info {

Modified: head/sys/cam/ctl/ctl_io.h
==
--- head/sys/cam/ctl/ctl_io.h   Wed Jan 25 22:26:45 2017(r312784)
+++ head/sys/cam/ctl/ctl_io.h   Wed Jan 25 22:52:57 2017(r312785)
@@ -137,9 +137,9 @@ struct ctl_lba_len_flags {
 };
 
 struct ctl_ptr_len_flags {
-   uint8_t *ptr;
-   uint32_t len;
-   uint32_t flags;
+   uint8_t *ptr;
+   uint32_tlen;
+   uint32_tflags;
 };
 
 union ctl_priv {
@@ -405,10 +405,10 @@ typedef enum {
  * structure.
  */
 struct ctl_pr_info {
-   ctl_pr_actionaction;
-   uint8_t  sa_res_key[8];
-   uint8_t  res_type;
-   uint32_t residx;
+   ctl_pr_action   action;
+   uint8_t sa_res_key[8];
+   uint8_t res_type;
+   uint32_tresidx;
 };
 
 struct ctl_ha_msg_hdr {
@@ -569,15 +569,15 @@ union ctl_ha_msg {
 };
 
 struct ctl_prio {
-   struct ctl_io_hdr  io_hdr;
-   struct ctl_ha_msg_pr pr_msg;
+   struct ctl_io_hdr   io_hdr;
+   struct ctl_ha_msg_prpr_msg;
 };
 
 union ctl_io {
-   struct ctl_io_hdr io_hdr;   /* common to all I/O types */
-   struct ctl_scsiio scsiio;   /* Normal SCSI commands */
-   struct ctl_taskio taskio;   /* SCSI task management/reset */
-   struct ctl_prio   presio;   /* update per. res info on other SC */
+   struct ctl_io_hdr   io_hdr; /* common to all I/O types */
+   struct ctl_scsiio   scsiio; /* Normal SCSI commands */
+   struct ctl_taskio   taskio; /* SCSI task management/reset */
+   struct ctl_prio presio; /* update per. res info on other SC */
 };
 
 #ifdef _KERNEL

Modified: head/sys/cam/ctl/ctl_ioctl.h
==
--- head/sys/cam/ctl/ctl_ioctl.hWed Jan 25 22:26:45 2017
(r312784)
+++ head/sys/cam/ctl/ctl_ioctl.hWed Jan 25 22:52:57 2017
(r312785)
@@ -358,8 +358,8 @@ struct ctl_be_arg {
unsigned intvallen;
void*value;
 
-   char*kname;
-   void*kvalue;
+   char*kname;
+   void*kvalue;
 };
 
 typedef enum {
@@ -591,7 +591,7 @@ typedef enum {
 struct ctl_lun_list {
charbackend[CTL_BE_NAME_LEN]; /* passed to kernel*/
uint32_talloc_len;  /* passed to kernel */
-   char   *lun_xml;/* filled in kernel */
+   char*lun_xml;   /* filled in kernel */
uint32_tfill_len;   /* passed to userland */
ctl_lun_list_status status; /* passed to userland */
charerror_str[CTL_ERROR_STR_LEN];
@@ -753,42 +753,42 @@ struct ctl_iscsi_limits_params {
 
 #ifdef ICL_KERNEL_PROXY
 struct ctl_iscsi_listen_params {
-   int iser;
-   int domain;
-   int socktype;
-   int protocol;
-   struct sockaddr *addr;
-   socklen_t   addrlen;
-   int portal_id;
-   int spare[4];
+   int iser;
+   int domain;
+   int socktype;
+   int protocol;
+   struct sockaddr *addr;
+   socklen_t   addrlen;
+   int portal_id;
+   int spare[4];
 };
 
 struct ctl_iscsi_accept_params {
-   int connection_id;
-   int portal_id;
-   struct sockaddr *initiator_addr;
-   socklen_t   initiator_addrlen;
-   int   

Re: svn commit: r312770 - in head/sys: net netinet netinet6

2017-01-25 Thread Gleb Smirnoff
On Thu, Jan 26, 2017 at 12:26:32AM +0200, Konstantin Belousov wrote:
K> On Wed, Jan 25, 2017 at 02:20:06PM -0800, Gleb Smirnoff wrote:
K> >   Thanks, Luiz!
K> > 
K> >   One stylistic nit that I missed in review:
K> > 
K> > L>  static int
K> > L> -in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td)
K> > L> +in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct 
thread *td)
K> > L>  {
K> > L> const struct ifreq *ifr = (struct ifreq *)data;
K> > L> const struct sockaddr_in *addr = (const struct sockaddr_in *)
K> > L> @@ -618,7 +618,8 @@ in_difaddr_ioctl(caddr_t data, struct if
K> > L> in_ifadown(>ia_ifa, 1);
K> > L>  
K> > L> if (ia->ia_ifa.ifa_carp)
K> > L> -   (*carp_detach_p)(>ia_ifa);
K> > L> +   (*carp_detach_p)(>ia_ifa,
K> > L> +   (cmd == SIOCDIFADDR) ? false : true);
K> > 
K> > Can we change the very last line to:
K> > 
K> >(cmd == SIOCAIFADDR) ? true : false);
K> This is just 'cmd == SIOCAIFADDR'.

Right. Would be even better :)

-- 
Totus tuus, Glebius.
___
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: r312784 - head/sys/kern

2017-01-25 Thread Gleb Smirnoff
Author: glebius
Date: Wed Jan 25 22:26:45 2017
New Revision: 312784
URL: https://svnweb.freebsd.org/changeset/base/312784

Log:
  For non-listening AF_UNIX sockets return error code EOPNOTSUPP to match
  documentation and SUS.

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==
--- head/sys/kern/uipc_usrreq.c Wed Jan 25 21:35:15 2017(r312783)
+++ head/sys/kern/uipc_usrreq.c Wed Jan 25 22:26:45 2017(r312784)
@@ -743,6 +743,9 @@ uipc_listen(struct socket *so, int backl
struct unpcb *unp;
int error;
 
+   if (so->so_type != SOCK_STREAM && so->so_type != SOCK_SEQPACKET)
+   return (EOPNOTSUPP);
+
unp = sotounpcb(so);
KASSERT(unp != NULL, ("uipc_listen: unp == NULL"));
 
___
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: r312770 - in head/sys: net netinet netinet6

2017-01-25 Thread Konstantin Belousov
On Wed, Jan 25, 2017 at 02:20:06PM -0800, Gleb Smirnoff wrote:
>   Thanks, Luiz!
> 
>   One stylistic nit that I missed in review:
> 
> L>  static int
> L> -in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td)
> L> +in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct 
> thread *td)
> L>  {
> L>const struct ifreq *ifr = (struct ifreq *)data;
> L>const struct sockaddr_in *addr = (const struct sockaddr_in *)
> L> @@ -618,7 +618,8 @@ in_difaddr_ioctl(caddr_t data, struct if
> L>in_ifadown(>ia_ifa, 1);
> L>  
> L>if (ia->ia_ifa.ifa_carp)
> L> -  (*carp_detach_p)(>ia_ifa);
> L> +  (*carp_detach_p)(>ia_ifa,
> L> +  (cmd == SIOCDIFADDR) ? false : true);
> 
> Can we change the very last line to:
> 
>   (cmd == SIOCAIFADDR) ? true : false);
This is just 'cmd == SIOCAIFADDR'.

> 
> I think that would be more straightforward. Do you agree? Sorry for not
> noticing that before.
> 
> -- 
> Totus tuus, Glebius.
___
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: r312770 - in head/sys: net netinet netinet6

2017-01-25 Thread Gleb Smirnoff
  Thanks, Luiz!

  One stylistic nit that I missed in review:

L>  static int
L> -in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td)
L> +in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread 
*td)
L>  {
L>  const struct ifreq *ifr = (struct ifreq *)data;
L>  const struct sockaddr_in *addr = (const struct sockaddr_in *)
L> @@ -618,7 +618,8 @@ in_difaddr_ioctl(caddr_t data, struct if
L>  in_ifadown(>ia_ifa, 1);
L>  
L>  if (ia->ia_ifa.ifa_carp)
L> -(*carp_detach_p)(>ia_ifa);
L> +(*carp_detach_p)(>ia_ifa,
L> +(cmd == SIOCDIFADDR) ? false : true);

Can we change the very last line to:

(cmd == SIOCAIFADDR) ? true : false);

I think that would be more straightforward. Do you agree? Sorry for not
noticing that before.

-- 
Totus tuus, Glebius.
___
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: r312783 - stable/11/sys/dev/netmap

2017-01-25 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Jan 25 21:35:15 2017
New Revision: 312783
URL: https://svnweb.freebsd.org/changeset/base/312783

Log:
  Fix a crash in netmap when using the emulated mode.
  
  This is a direct commit to stable/11 as the -head version was already fixed
  by a recent import of a new netmap version.
  
  Submitted by: Vincenzo Maffione 
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/dev/netmap/netmap_freebsd.c
  stable/11/sys/dev/netmap/netmap_generic.c
  stable/11/sys/dev/netmap/netmap_kern.h

Modified: stable/11/sys/dev/netmap/netmap_freebsd.c
==
--- stable/11/sys/dev/netmap/netmap_freebsd.c   Wed Jan 25 21:25:26 2017
(r312782)
+++ stable/11/sys/dev/netmap/netmap_freebsd.c   Wed Jan 25 21:35:15 2017
(r312783)
@@ -218,30 +218,16 @@ generic_xmit_frame(struct ifnet *ifp, st
 {
int ret;
 
-   /*
-* The mbuf should be a cluster from our special pool,
-* so we do not need to do an m_copyback but just copy
-* (and eventually, just reference the netmap buffer)
-*/
+   /* Link the external storage to the netmap buffer, so that
+* no copy is necessary. */
+   m->m_ext.ext_buf = m->m_data = addr;
+   m->m_ext.ext_size = len;
 
-   if (GET_MBUF_REFCNT(m) != 1) {
-   D("invalid refcnt %d for %p",
-   GET_MBUF_REFCNT(m), m);
-   panic("in generic_xmit_frame");
-   }
-   // XXX the ext_size check is unnecessary if we link the netmap buf
-   if (m->m_ext.ext_size < len) {
-   RD(5, "size %d < len %d", m->m_ext.ext_size, len);
-   len = m->m_ext.ext_size;
-   }
-   if (0) { /* XXX seems to have negligible benefits */
-   m->m_ext.ext_buf = m->m_data = addr;
-   } else {
-   bcopy(addr, m->m_data, len);
-   }
m->m_len = m->m_pkthdr.len = len;
-   // inc refcount. All ours, we could skip the atomic
-   atomic_fetchadd_int(PNT_MBUF_REFCNT(m), 1);
+
+   /* mbuf refcnt is not contended, no need to use atomic
+* (a memory barrier is enough). */
+   SET_MBUF_REFCNT(m, 2);
M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
m->m_pkthdr.flowid = ring_nr;
m->m_pkthdr.rcvif = ifp; /* used for tx notification */

Modified: stable/11/sys/dev/netmap/netmap_generic.c
==
--- stable/11/sys/dev/netmap/netmap_generic.c   Wed Jan 25 21:25:26 2017
(r312782)
+++ stable/11/sys/dev/netmap/netmap_generic.c   Wed Jan 25 21:35:15 2017
(r312783)
@@ -90,53 +90,40 @@ __FBSDID("$FreeBSD$");
 /*
  * FreeBSD mbuf allocator/deallocator in emulation mode:
  *
- * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE
- * so that the destructor, if invoked, will not free the packet.
- *In principle we should set the destructor only on demand,
- * but since there might be a race we better do it on allocation.
- * As a consequence, we also need to set the destructor or we
- * would leak buffers.
- */
-
-/*
- * mbuf wrappers
+ * We allocate mbufs with m_gethdr(), since the mbuf header is needed
+ * by the driver. We also attach a customly-provided external storage,
+ * which in this case is a netmap buffer. When calling m_extadd(), however
+ * we pass a NULL address, since the real address (and length) will be
+ * filled in by nm_os_generic_xmit_frame() right before calling
+ * if_transmit().
+ *
+ * The dtor function does nothing, however we need it since mb_free_ext()
+ * has a KASSERT(), checking that the mbuf dtor function is not NULL.
  */
 
-/* mbuf destructor, also need to change the type to EXT_EXTREF,
- * add an M_NOFREE flag, and then clear the flag and
- * chain into uma_zfree(zone_pack, mf)
- * (or reinstall the buffer ?)
- */
-#define SET_MBUF_DESTRUCTOR(m, fn) do {\
-   (m)->m_ext.ext_free = (void *)fn;   \
-   (m)->m_ext.ext_type = EXT_EXTREF;   \
-} while (0)
+static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { }
 
-static void
-netmap_default_mbuf_destructor(struct mbuf *m)
+static inline void
+SET_MBUF_DESTRUCTOR(struct mbuf *m, void *fn)
 {
-   /* restore original mbuf */
-   m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1;
-   m->m_ext.ext_arg1 = NULL;
-   m->m_ext.ext_type = EXT_PACKET;
-   m->m_ext.ext_free = NULL;
-   if (GET_MBUF_REFCNT(m) == 0)
-   SET_MBUF_REFCNT(m, 1);
-   uma_zfree(zone_pack, m);
+   m->m_ext.ext_free = fn ? fn : (void *)void_mbuf_dtor;
 }
 
 static inline struct mbuf *
 netmap_get_mbuf(int len)
 {
struct mbuf *m;
-   m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
-   if (m) {
-   m->m_flags |= M_NOFREE; /* XXXNP: Almost certainly incorrect. */
-   m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save
-

svn commit: r312782 - head/sys/net

2017-01-25 Thread Kristof Provost
Author: kp
Date: Wed Jan 25 21:25:26 2017
New Revision: 312782
URL: https://svnweb.freebsd.org/changeset/base/312782

Log:
  bridge: Release the bridge lock when calling bridge_set_ifcap()
  
  This calls ioctl() handlers for the different interfaces in the bridge.
  These handlers expect to get called in an ioctl context where it's safe
  for them to sleep. We may not sleep with the bridge lock held.
  
  However, we still need to protect the interface list, to ensure it
  doesn't get changed while we iterate over it.
  Use BRIDGE_XLOCK(), which prevents bridge members from being removed.
  Adding bridge members is safe, because it uses LIST_INSERT_HEAD().
  
  This caused panics when adding xen interfaces to a bridge.
  
  PR:   216304
  Reviewed by:  ae
  MFC after:1 week
  Sponsored by: RootBSD
  Differential Revision:https://reviews.freebsd.org/D9290

Modified:
  head/sys/net/if_bridge.c
  head/sys/net/if_bridgevar.h

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cWed Jan 25 21:05:48 2017(r312781)
+++ head/sys/net/if_bridge.cWed Jan 25 21:25:26 2017(r312782)
@@ -909,14 +909,18 @@ bridge_mutecaps(struct bridge_softc *sc)
mask &= bif->bif_savedcaps;
}
 
+   BRIDGE_XLOCK(sc);
LIST_FOREACH(bif, >sc_iflist, bif_next) {
enabled = bif->bif_ifp->if_capenable;
enabled &= ~BRIDGE_IFCAPS_STRIP;
/* strip off mask bits and enable them again if allowed */
enabled &= ~BRIDGE_IFCAPS_MASK;
enabled |= mask;
+   BRIDGE_UNLOCK(sc);
bridge_set_ifcap(sc, bif, enabled);
+   BRIDGE_LOCK(sc);
}
+   BRIDGE_XDROP(sc);
 
 }
 
@@ -927,6 +931,8 @@ bridge_set_ifcap(struct bridge_softc *sc
struct ifreq ifr;
int error;
 
+   BRIDGE_UNLOCK_ASSERT(sc);
+
bzero(, sizeof(ifr));
ifr.ifr_reqcap = set;
 

Modified: head/sys/net/if_bridgevar.h
==
--- head/sys/net/if_bridgevar.h Wed Jan 25 21:05:48 2017(r312781)
+++ head/sys/net/if_bridgevar.h Wed Jan 25 21:25:26 2017(r312782)
@@ -280,6 +280,7 @@ struct ifbpstpconf {
 #define BRIDGE_LOCK(_sc)   mtx_lock(&(_sc)->sc_mtx)
 #define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
 #define BRIDGE_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->sc_mtx, 
MA_OWNED)
+#define BRIDGE_UNLOCK_ASSERT(_sc)  mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED)
 #defineBRIDGE_LOCK2REF(_sc, _err)  do {\
mtx_assert(&(_sc)->sc_mtx, MA_OWNED);   \
if ((_sc)->sc_iflist_xcnt > 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: r312780 - head/contrib/ipfilter/tools

2017-01-25 Thread Cy Schubert
Author: cy
Date: Wed Jan 25 20:59:23 2017
New Revision: 312780
URL: https://svnweb.freebsd.org/changeset/base/312780

Log:
  Remove extraneous blank line.
  
  MFC after:2 weeks
  X-MFC with:   r312777

Modified:
  head/contrib/ipfilter/tools/ipf.c

Modified: head/contrib/ipfilter/tools/ipf.c
==
--- head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:59:06 2017
(r312779)
+++ head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:59:23 2017
(r312780)
@@ -409,7 +409,6 @@ static void flushfilter(arg, filter)
closedevice();
return;
}
-
else if (strchr(arg, 'i') || strchr(arg, 'I'))
fl = FR_INQUE;
else if (strchr(arg, 'o') || strchr(arg, 'O'))
___
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: r312779 - head/contrib/elftoolchain/strings

2017-01-25 Thread Ed Maste
Author: emaste
Date: Wed Jan 25 20:59:06 2017
New Revision: 312779
URL: https://svnweb.freebsd.org/changeset/base/312779

Log:
  strings: avoid unnecessary trip through handle_file for stdin
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/elftoolchain/strings/strings.c

Modified: head/contrib/elftoolchain/strings/strings.c
==
--- head/contrib/elftoolchain/strings/strings.c Wed Jan 25 20:44:57 2017
(r312778)
+++ head/contrib/elftoolchain/strings/strings.c Wed Jan 25 20:59:06 2017
(r312779)
@@ -189,7 +189,7 @@ main(int argc, char **argv)
if (!min_len)
min_len = 4;
if (!*argv)
-   rc = handle_file("{standard input}");
+   rc = find_strings("{standard input}", 0, 0);
else while (*argv) {
if (handle_file(*argv) != 0)
rc = 1;
@@ -205,13 +205,9 @@ handle_file(const char *name)
 
if (name == NULL)
return (1);
-   if (strcmp("{standard input}", name) != 0) {
-   if (freopen(name, "rb", stdin) == NULL) {
-   warnx("'%s': %s", name, strerror(errno));
-   return (1);
-   }
-   } else {
-   return (find_strings(name, (off_t)0, (off_t)0));
+   if (freopen(name, "rb", stdin) == NULL) {
+   warnx("'%s': %s", name, strerror(errno));
+   return (1);
}
 
fd = fileno(stdin);
___
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: r312778 - stable/11/sbin/ifconfig

2017-01-25 Thread Andriy Voskoboinyk
Author: avos
Date: Wed Jan 25 20:44:57 2017
New Revision: 312778
URL: https://svnweb.freebsd.org/changeset/base/312778

Log:
  MFC r312560:
  ifconfig(8): fix '-stbc' parameter name.

Modified:
  stable/11/sbin/ifconfig/ifieee80211.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ifconfig/ifieee80211.c
==
--- stable/11/sbin/ifconfig/ifieee80211.c   Wed Jan 25 20:41:16 2017
(r312777)
+++ stable/11/sbin/ifconfig/ifieee80211.c   Wed Jan 25 20:44:57 2017
(r312778)
@@ -5405,7 +5405,7 @@ static struct cmd ieee80211_cmds[] = {
DEF_CMD("stbctx",   1,  set80211stbc),
DEF_CMD("-stbctx",  -1, set80211stbc),
DEF_CMD("stbc", 3,  set80211stbc),  /* NB: tx+rx */
-   DEF_CMD("-ampdu",   -3, set80211stbc),
+   DEF_CMD("-stbc",-3, set80211stbc),
DEF_CMD("puren",1,  set80211puren),
DEF_CMD("-puren",   0,  set80211puren),
DEF_CMD("doth", 1,  set80211doth),
___
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: r312777 - head/contrib/ipfilter/tools

2017-01-25 Thread Cy Schubert
Author: cy
Date: Wed Jan 25 20:41:16 2017
New Revision: 312777
URL: https://svnweb.freebsd.org/changeset/base/312777

Log:
  Issue an error message when an incorrect flush argument is
  encountered.`
  
  MFC after:2 weeks

Modified:
  head/contrib/ipfilter/tools/ipf.c

Modified: head/contrib/ipfilter/tools/ipf.c
==
--- head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:33:31 2017
(r312776)
+++ head/contrib/ipfilter/tools/ipf.c   Wed Jan 25 20:41:16 2017
(r312777)
@@ -410,12 +410,16 @@ static void flushfilter(arg, filter)
return;
}
 
-   if (strchr(arg, 'i') || strchr(arg, 'I'))
+   else if (strchr(arg, 'i') || strchr(arg, 'I'))
fl = FR_INQUE;
-   if (strchr(arg, 'o') || strchr(arg, 'O'))
+   else if (strchr(arg, 'o') || strchr(arg, 'O'))
fl = FR_OUTQUE;
-   if (strchr(arg, 'a') || strchr(arg, 'A'))
+   else if (strchr(arg, 'a') || strchr(arg, 'A'))
fl = FR_OUTQUE|FR_INQUE;
+   else {
+   fprintf(stderr, "Incorrect flush argument: %s\n", arg);
+   usage();
+   }
if (opts & OPT_INACTIVE)
fl |= FR_INACTIVE;
rem = fl;
___
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: r312775 - head/sys/kern

2017-01-25 Thread Ed Maste
Author: emaste
Date: Wed Jan 25 20:22:32 2017
New Revision: 312775
URL: https://svnweb.freebsd.org/changeset/base/312775

Log:
  ANSIfy kern_ntptime.c

Modified:
  head/sys/kern/kern_ntptime.c

Modified: head/sys/kern/kern_ntptime.c
==
--- head/sys/kern/kern_ntptime.cWed Jan 25 20:19:48 2017
(r312774)
+++ head/sys/kern/kern_ntptime.cWed Jan 25 20:22:32 2017
(r312775)
@@ -750,11 +750,12 @@ hardupdate(offset)
  * Therefore, the variables used are distinct from the hardclock()
  * variables, except for the actual time and frequency variables, which
  * are determined by this routine and updated atomically.
+ *
+ * tsp  - time at PPS
+ * nsec - hardware counter at PPS
  */
 void
-hardpps(tsp, nsec)
-   struct timespec *tsp;   /* time at PPS */
-   long nsec;  /* hardware counter at PPS */
+hardpps(struct timespec *tsp, long nsec)
 {
long u_sec, u_nsec, v_nsec; /* temps */
l_fp ftemp;
___
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: r312774 - head/lib/libthr/thread

2017-01-25 Thread Ed Maste
Author: emaste
Date: Wed Jan 25 20:19:48 2017
New Revision: 312774
URL: https://svnweb.freebsd.org/changeset/base/312774

Log:
  libthr: coalesce repeated #if blocks

Modified:
  head/lib/libthr/thread/thr_exit.c

Modified: head/lib/libthr/thread/thr_exit.c
==
--- head/lib/libthr/thread/thr_exit.c   Wed Jan 25 20:12:07 2017
(r312773)
+++ head/lib/libthr/thread/thr_exit.c   Wed Jan 25 20:19:48 2017
(r312774)
@@ -240,9 +240,6 @@ _pthread_exit_mask(void *status, sigset_
 
 #ifdef PIC
thread_uw_init();
-#endif /* PIC */
-
-#ifdef PIC
if (uwl_forcedunwind != NULL) {
 #else
if (_Unwind_ForcedUnwind != NULL) {
___
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: r312773 - stable/10/sys/boot/efi/boot1

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 20:12:07 2017
New Revision: 312773
URL: https://svnweb.freebsd.org/changeset/base/312773

Log:
  MFC r311933:
  
  Use proper prototypes in struct boot_module_t
  
  With clang 4.0.0, we are getting the following warnings about struct
  boot_module_t in efi's boot_module.h:
  
  In file included from sys/boot/efi/boot1/ufs_module.c:41:
  sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is 
not a prototype [-Werror,-Wstrict-prototypes]
  void (*init)();
  ^
   void
  sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is 
not a prototype [-Werror,-Wstrict-prototypes]
  void (*status)();
^
 void
  sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is 
not a prototype [-Werror,-Wstrict-prototypes]
  dev_info_t *(*devices)();
^
 void
  3 errors generated.
  
  Fix this by adding 'void' to the parameter lists.  No functional change.
  
  Reviewed by:  emaste, imp, smh
  Differential Revision:https://reviews.freebsd.org/D9144

Modified:
  stable/10/sys/boot/efi/boot1/boot_module.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/boot/efi/boot1/boot_module.h
==
--- stable/10/sys/boot/efi/boot1/boot_module.h  Wed Jan 25 19:55:35 2017
(r312772)
+++ stable/10/sys/boot/efi/boot1/boot_module.h  Wed Jan 25 20:12:07 2017
(r312773)
@@ -64,7 +64,7 @@ typedef struct boot_module_t
const char *name;
 
/* init is the optional initialiser for the module. */
-   void (*init)();
+   void (*init)(void);
 
/*
 * probe checks to see if the module can handle dev.
@@ -89,10 +89,10 @@ typedef struct boot_module_t
void **buf, size_t *bufsize);
 
/* status outputs information about the probed devices. */
-   void (*status)();
+   void (*status)(void);
 
/* valid devices as found by probe. */
-   dev_info_t *(*devices)();
+   dev_info_t *(*devices)(void);
 } boot_module_t;
 
 /* Standard boot modules. */
___
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: r312772 - in stable: 10/sys/boot/efi/include 11/sys/boot/efi/include

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 19:55:35 2017
New Revision: 312772
URL: https://svnweb.freebsd.org/changeset/base/312772

Log:
  MFC r311932:
  
  Make EFI_RESERVED_SERVICE a proper prototype
  
  With clang 4.0.0, the EFI API header causes the following warning:
  
  In file included from sys/boot/efi/loader/bootinfo.c:43:
  In file included from sys/boot/efi/loader/../include/efi.h:52:
  sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not 
a prototype [-Werror,-Wstrict-prototypes]
  (EFIAPI *EFI_RESERVED_SERVICE) (
 ^
  
  Add VOID to make it into a real prototype.
  
  Reviewed by:  imp, emaste, tsoome
  Differential Revision:https://reviews.freebsd.org/D9132

Modified:
  stable/10/sys/boot/efi/include/efiapi.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/boot/efi/include/efiapi.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/boot/efi/include/efiapi.h
==
--- stable/10/sys/boot/efi/include/efiapi.h Wed Jan 25 19:16:24 2017
(r312771)
+++ stable/10/sys/boot/efi/include/efiapi.h Wed Jan 25 19:55:35 2017
(r312772)
@@ -536,6 +536,7 @@ EFI_STATUS
 typedef
 EFI_STATUS
 (EFIAPI *EFI_RESERVED_SERVICE) (
+VOID
 );
 
 typedef
___
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: r312772 - in stable: 10/sys/boot/efi/include 11/sys/boot/efi/include

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 19:55:35 2017
New Revision: 312772
URL: https://svnweb.freebsd.org/changeset/base/312772

Log:
  MFC r311932:
  
  Make EFI_RESERVED_SERVICE a proper prototype
  
  With clang 4.0.0, the EFI API header causes the following warning:
  
  In file included from sys/boot/efi/loader/bootinfo.c:43:
  In file included from sys/boot/efi/loader/../include/efi.h:52:
  sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not 
a prototype [-Werror,-Wstrict-prototypes]
  (EFIAPI *EFI_RESERVED_SERVICE) (
 ^
  
  Add VOID to make it into a real prototype.
  
  Reviewed by:  imp, emaste, tsoome
  Differential Revision:https://reviews.freebsd.org/D9132

Modified:
  stable/11/sys/boot/efi/include/efiapi.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/boot/efi/include/efiapi.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/boot/efi/include/efiapi.h
==
--- stable/11/sys/boot/efi/include/efiapi.h Wed Jan 25 19:16:24 2017
(r312771)
+++ stable/11/sys/boot/efi/include/efiapi.h Wed Jan 25 19:55:35 2017
(r312772)
@@ -532,6 +532,7 @@ EFI_STATUS
 typedef
 EFI_STATUS
 (EFIAPI *EFI_RESERVED_SERVICE) (
+VOID
 );
 
 typedef
___
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: r312771 - in stable: 10/sys/boot/common 11/sys/boot/common

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 19:16:24 2017
New Revision: 312771
URL: https://svnweb.freebsd.org/changeset/base/312771

Log:
  MFC r311929:
  
  Don't include  in reloc_elf.c, as it includes  just
  after it, which has a conflicting definition of errno.  This leads to
  the following warning with clang 4.0.0:
  
  In file included from sys/boot/common/reloc_elf32.c:6:
  In file included from sys/boot/common/reloc_elf.c:37:
  /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function 
declaration is not a prototype [-Werror,-Wstrict-prototypes]
  extern int errno;
 ^
  sys/sys/errno.h:46:26: note: expanded from macro 'errno'
  #define errno   (* __error())
^

Modified:
  stable/10/sys/boot/common/reloc_elf.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/boot/common/reloc_elf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/boot/common/reloc_elf.c
==
--- stable/10/sys/boot/common/reloc_elf.c   Wed Jan 25 19:04:08 2017
(r312770)
+++ stable/10/sys/boot/common/reloc_elf.c   Wed Jan 25 19:16:24 2017
(r312771)
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #define FREEBSD_ELF
___
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: r312771 - in stable: 10/sys/boot/common 11/sys/boot/common

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 19:16:24 2017
New Revision: 312771
URL: https://svnweb.freebsd.org/changeset/base/312771

Log:
  MFC r311929:
  
  Don't include  in reloc_elf.c, as it includes  just
  after it, which has a conflicting definition of errno.  This leads to
  the following warning with clang 4.0.0:
  
  In file included from sys/boot/common/reloc_elf32.c:6:
  In file included from sys/boot/common/reloc_elf.c:37:
  /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function 
declaration is not a prototype [-Werror,-Wstrict-prototypes]
  extern int errno;
 ^
  sys/sys/errno.h:46:26: note: expanded from macro 'errno'
  #define errno   (* __error())
^

Modified:
  stable/11/sys/boot/common/reloc_elf.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/boot/common/reloc_elf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/boot/common/reloc_elf.c
==
--- stable/11/sys/boot/common/reloc_elf.c   Wed Jan 25 19:04:08 2017
(r312770)
+++ stable/11/sys/boot/common/reloc_elf.c   Wed Jan 25 19:16:24 2017
(r312771)
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
 #include 
 
 #define FREEBSD_ELF
___
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: r312770 - in head/sys: net netinet netinet6

2017-01-25 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Jan 25 19:04:08 2017
New Revision: 312770
URL: https://svnweb.freebsd.org/changeset/base/312770

Log:
  After the in_control() changes in r257692, an existing address is
  (intentionally) deleted first and then completely added again (so all the
  events, announces and hooks are given a chance to run).
  
  This cause an issue with CARP where the existing CARP data structure is
  removed together with the last address for a given VHID, which will cause
  a subsequent fail when the address is later re-added.
  
  This change fixes this issue by adding a new flag to keep the CARP data
  structure when an address is not being removed.
  
  There was an additional issue with IPv6 CARP addresses, where the CARP data
  structure would never be removed after a change and lead to VHIDs which
  cannot be destroyed.
  
  Reviewed by:  glebius
  Obtained from:pfSense
  MFC after:2 weeks
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/sys/net/if.c
  head/sys/netinet/in.c
  head/sys/netinet/ip_carp.c
  head/sys/netinet/ip_carp.h
  head/sys/netinet6/in6.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Wed Jan 25 18:31:51 2017(r312769)
+++ head/sys/net/if.c   Wed Jan 25 19:04:08 2017(r312770)
@@ -145,7 +145,7 @@ int (*carp_output_p)(struct ifnet *ifp, 
 const struct sockaddr *sa);
 int(*carp_ioctl_p)(struct ifreq *, u_long, struct thread *);   
 int(*carp_attach_p)(struct ifaddr *, int);
-void   (*carp_detach_p)(struct ifaddr *);
+void   (*carp_detach_p)(struct ifaddr *, bool);
 #endif
 #ifdef INET
 int(*carp_iamatch_p)(struct ifaddr *, uint8_t **);

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Wed Jan 25 18:31:51 2017(r312769)
+++ head/sys/netinet/in.c   Wed Jan 25 19:04:08 2017(r312770)
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *);
-static int in_difaddr_ioctl(caddr_t, struct ifnet *, struct thread *);
+static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *);
 
 static voidin_socktrim(struct sockaddr_in *);
 static voidin_purgemaddrs(struct ifnet *);
@@ -245,7 +245,7 @@ in_control(struct socket *so, u_long cmd
break;
case SIOCDIFADDR:
sx_xlock(_control_sx);
-   error = in_difaddr_ioctl(data, ifp, td);
+   error = in_difaddr_ioctl(cmd, data, ifp, td);
sx_xunlock(_control_sx);
return (error);
case OSIOCAIFADDR:  /* 9.x compat */
@@ -390,7 +390,7 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
IF_ADDR_RUNLOCK(ifp);
 
if (ia != NULL)
-   (void )in_difaddr_ioctl(data, ifp, td);
+   (void )in_difaddr_ioctl(cmd, data, ifp, td);
 
ifa = ifa_alloc(sizeof(struct in_ifaddr), M_WAITOK);
ia = (struct in_ifaddr *)ifa;
@@ -528,7 +528,7 @@ fail2:
 
 fail1:
if (ia->ia_ifa.ifa_carp)
-   (*carp_detach_p)(>ia_ifa);
+   (*carp_detach_p)(>ia_ifa, false);
 
IF_ADDR_WLOCK(ifp);
TAILQ_REMOVE(>if_addrhead, >ia_ifa, ifa_link);
@@ -545,7 +545,7 @@ fail1:
 }
 
 static int
-in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td)
+in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread 
*td)
 {
const struct ifreq *ifr = (struct ifreq *)data;
const struct sockaddr_in *addr = (const struct sockaddr_in *)
@@ -618,7 +618,8 @@ in_difaddr_ioctl(caddr_t data, struct if
in_ifadown(>ia_ifa, 1);
 
if (ia->ia_ifa.ifa_carp)
-   (*carp_detach_p)(>ia_ifa);
+   (*carp_detach_p)(>ia_ifa,
+   (cmd == SIOCDIFADDR) ? false : true);
 
/*
 * If this is the last IPv4 address configured on this

Modified: head/sys/netinet/ip_carp.c
==
--- head/sys/netinet/ip_carp.c  Wed Jan 25 18:31:51 2017(r312769)
+++ head/sys/netinet/ip_carp.c  Wed Jan 25 19:04:08 2017(r312770)
@@ -1969,7 +1969,7 @@ carp_attach(struct ifaddr *ifa, int vhid
 }
 
 void
-carp_detach(struct ifaddr *ifa)
+carp_detach(struct ifaddr *ifa, bool keep_cif)
 {
struct ifnet *ifp = ifa->ifa_ifp;
struct carp_if *cif = ifp->if_carp;
@@ -2015,12 +2015,13 @@ carp_detach(struct ifaddr *ifa)
carp_hmac_prepare(sc);
carp_sc_state(sc);
 
-   if (sc->sc_naddrs == 0 && sc->sc_naddrs6 == 0)
+   if (!keep_cif && sc->sc_naddrs == 0 && sc->sc_naddrs6 == 0)
carp_destroy(sc);
else
CARP_UNLOCK(sc);
 
-   CIF_FREE(cif);
+   if (!keep_cif)
+   CIF_FREE(cif);
 
sx_xunlock(_sx);
 }

Modified: 

svn commit: r312769 - stable/11/sys/boot/efi/boot1

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 18:31:51 2017
New Revision: 312769
URL: https://svnweb.freebsd.org/changeset/base/312769

Log:
  MFC r311933:
  
  Use proper prototypes in struct boot_module_t
  
  With clang 4.0.0, we are getting the following warnings about struct
  boot_module_t in efi's boot_module.h:
  
  In file included from sys/boot/efi/boot1/ufs_module.c:41:
  sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is 
not a prototype [-Werror,-Wstrict-prototypes]
  void (*init)();
  ^
   void
  sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is 
not a prototype [-Werror,-Wstrict-prototypes]
  void (*status)();
^
 void
  sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is 
not a prototype [-Werror,-Wstrict-prototypes]
  dev_info_t *(*devices)();
^
 void
  3 errors generated.
  
  Fix this by adding 'void' to the parameter lists.  No functional change.
  
  Reviewed by:  emaste, imp, smh
  Differential Revision:https://reviews.freebsd.org/D9144

Modified:
  stable/11/sys/boot/efi/boot1/boot_module.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/boot/efi/boot1/boot_module.h
==
--- stable/11/sys/boot/efi/boot1/boot_module.h  Wed Jan 25 18:21:49 2017
(r312768)
+++ stable/11/sys/boot/efi/boot1/boot_module.h  Wed Jan 25 18:31:51 2017
(r312769)
@@ -64,7 +64,7 @@ typedef struct boot_module_t
const char *name;
 
/* init is the optional initialiser for the module. */
-   void (*init)();
+   void (*init)(void);
 
/*
 * probe checks to see if the module can handle dev.
@@ -89,10 +89,10 @@ typedef struct boot_module_t
void **buf, size_t *bufsize);
 
/* status outputs information about the probed devices. */
-   void (*status)();
+   void (*status)(void);
 
/* valid devices as found by probe. */
-   dev_info_t *(*devices)();
+   dev_info_t *(*devices)(void);
 } boot_module_t;
 
 /* Standard boot modules. */
___
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: r312768 - stable/11/usr.sbin/mfiutil

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 18:21:49 2017
New Revision: 312768
URL: https://svnweb.freebsd.org/changeset/base/312768

Log:
  MFC r311811:
  
  Avoid taking the address of a packed struct member in mfiutil
  
  Fix a clang 4.0.0 warning about taking the address of a packed member of
  struct mfi_evt in mfiutil:
  
  usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
  member 'members' of class or structure 'mfi_evt' may result in an
  unaligned pointer value [-Werror,-Waddress-of-packed-member]
  if (parse_locale(optarg, ) 
< 0) {
^
  
  Use a local variable instead, and copy that into the struct.
  
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D9069

Modified:
  stable/11/usr.sbin/mfiutil/mfi_evt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/mfiutil/mfi_evt.c
==
--- stable/11/usr.sbin/mfiutil/mfi_evt.cWed Jan 25 18:16:17 2017
(r312767)
+++ stable/11/usr.sbin/mfiutil/mfi_evt.cWed Jan 25 18:21:49 2017
(r312768)
@@ -540,6 +540,7 @@ show_events(int ac, char **av)
char *cp;
ssize_t size;
uint32_t seq, start, stop;
+   uint16_t locale;
uint8_t status;
int ch, error, fd, num_events, verbose;
u_int i;
@@ -580,12 +581,13 @@ show_events(int ac, char **av)
}
break;
case 'l':
-   if (parse_locale(optarg, ) < 0) {
+   if (parse_locale(optarg, ) < 0) {
error = errno;
warn("Error parsing event locale");
close(fd);
return (error);
}
+   filter.members.locale = locale;
break;
case 'n':
val = strtol(optarg, , 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: r312767 - head/sys/dev/ahci

2017-01-25 Thread Alexander Motin
Author: mav
Date: Wed Jan 25 18:16:17 2017
New Revision: 312767
URL: https://svnweb.freebsd.org/changeset/base/312767

Log:
  Partially workaround ASMedia HBA error recovery.
  
  Taking closer look on my ASM1062 I found that it has bunch of issues around
  error recovery: reported wrong CCS, failed commands reported as completed,
  READ LOG EXT times out after NCQ error.  This patch workarounds first two
  problems, that were making ATAPI devices close to unusable on these HBAs.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h
  head/sys/dev/ahci/ahci_pci.c

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cWed Jan 25 18:07:27 2017(r312766)
+++ head/sys/dev/ahci/ahci.cWed Jan 25 18:16:17 2017(r312767)
@@ -758,7 +758,7 @@ ahci_ch_attach(device_t dev)
/* Construct SIM entry */
ch->sim = cam_sim_alloc(ahciaction, ahcipoll, "ahcich", ch,
device_get_unit(dev), (struct mtx *)>mtx,
-   min(2, ch->numslots),
+   (ch->quirks & AHCI_Q_NOCCS) ? 1 : min(2, ch->numslots),
(ch->caps & AHCI_CAP_SNCQ) ? ch->numslots : 0,
devq);
if (ch->sim == NULL) {
@@ -1271,8 +1271,19 @@ ahci_ch_intr_main(struct ahci_channel *c
/* Process command errors */
if (istatus & (AHCI_P_IX_OF | AHCI_P_IX_IF |
AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) {
-   ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK)
-   >> AHCI_P_CMD_CCS_SHIFT;
+   if (ch->quirks & AHCI_Q_NOCCS) {
+   /*
+* ASMedia chips sometimes report failed commands as
+* completed.  Count all running commands as failed.
+*/
+   cstatus |= ch->rslots;
+
+   /* They also report wrong CCS, so try to guess one. */
+   ccs = powerof2(cstatus) ? ffs(cstatus) - 1 : -1;
+   } else {
+   ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) &
+   AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT;
+   }
 //device_printf(dev, "%s ERROR is %08x cs %08x ss %08x rs %08x tfd %02x serr 
%08x fbs %08x ccs %d\n",
 //__func__, istatus, cstatus, sstatus, ch->rslots, ATA_INL(ch->r_mem, 
AHCI_P_TFD),
 //serr, ATA_INL(ch->r_mem, AHCI_P_FBS), ccs);

Modified: head/sys/dev/ahci/ahci.h
==
--- head/sys/dev/ahci/ahci.hWed Jan 25 18:07:27 2017(r312766)
+++ head/sys/dev/ahci/ahci.hWed Jan 25 18:16:17 2017(r312767)
@@ -599,6 +599,7 @@ enum ahci_err_type {
 #define AHCI_Q_RESTORE_CAP 0x0008
 #define AHCI_Q_NOMSIX  0x0010
 #define AHCI_Q_MRVL_SR_DEL 0x0020
+#define AHCI_Q_NOCCS   0x0040
 
 #define AHCI_Q_BIT_STRING  \
"\020"  \
@@ -623,7 +624,8 @@ enum ahci_err_type {
"\023FORCE_PI"  \
"\024RESTORE_CAP"   \
"\025NOMSIX"\
-   "\026MRVL_SR_DEL"
+   "\026MRVL_SR_DEL"   \
+   "\027NOCCS"
 
 int ahci_attach(device_t dev);
 int ahci_detach(device_t dev);

Modified: head/sys/dev/ahci/ahci_pci.c
==
--- head/sys/dev/ahci/ahci_pci.cWed Jan 25 18:07:27 2017
(r312766)
+++ head/sys/dev/ahci/ahci_pci.cWed Jan 25 18:16:17 2017
(r312767)
@@ -73,15 +73,15 @@ static const struct {
{0x78021022, 0x00, "AMD Hudson-2",  0},
{0x78031022, 0x00, "AMD Hudson-2",  0},
{0x78041022, 0x00, "AMD Hudson-2",  0},
-   {0x06011b21, 0x00, "ASMedia ASM1060",   0},
-   {0x06021b21, 0x00, "ASMedia ASM1060",   0},
-   {0x06111b21, 0x00, "ASMedia ASM1061",   0},
-   {0x06121b21, 0x00, "ASMedia ASM1062",   0},
-   {0x06201b21, 0x00, "ASMedia ASM106x",   0},
-   {0x06211b21, 0x00, "ASMedia ASM106x",   0},
-   {0x06221b21, 0x00, "ASMedia ASM106x",   0},
-   {0x06241b21, 0x00, "ASMedia ASM106x",   0},
-   {0x06251b21, 0x00, "ASMedia ASM106x",   0},
+   {0x06011b21, 0x00, "ASMedia ASM1060",   AHCI_Q_NOCCS},
+   {0x06021b21, 0x00, "ASMedia ASM1060",   AHCI_Q_NOCCS},
+   {0x06111b21, 0x00, "ASMedia ASM1061",   AHCI_Q_NOCCS},
+   {0x06121b21, 0x00, "ASMedia ASM1062",   AHCI_Q_NOCCS},
+   {0x06201b21, 0x00, "ASMedia ASM106x",   AHCI_Q_NOCCS},
+   {0x06211b21, 0x00, "ASMedia ASM106x",   AHCI_Q_NOCCS},
+   {0x06221b21, 0x00, "ASMedia ASM106x",   AHCI_Q_NOCCS},
+   {0x06241b21, 0x00, "ASMedia ASM106x",   AHCI_Q_NOCCS},
+   {0x06251b21, 0x00, "ASMedia ASM106x",   AHCI_Q_NOCCS},
{0x26528086, 0x00, "Intel ICH6",AHCI_Q_NOFORCE},
{0x26538086, 0x00, "Intel ICH6M",   AHCI_Q_NOFORCE},
   

svn commit: r312766 - stable/11/tools/build/mk

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 18:07:27 2017
New Revision: 312766
URL: https://svnweb.freebsd.org/changeset/base/312766

Log:
  MFC r311807:
  
  Add recently added libc++ headers to OptionalObsoleteFiles.inc.

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Wed Jan 25 17:59:22 
2017(r312765)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Wed Jan 25 18:07:27 
2017(r312766)
@@ -4390,6 +4390,8 @@ OLD_FILES+=usr/lib/libcxxrt.a
 OLD_FILES+=usr/lib/libcxxrt.so
 OLD_FILES+=usr/lib/libcxxrt_p.a
 OLD_FILES+=usr/include/c++/v1/__bit_reference
+OLD_FILES+=usr/include/c++/v1/__bsd_locale_defaults.h
+OLD_FILES+=usr/include/c++/v1/__bsd_locale_fallbacks.h
 OLD_FILES+=usr/include/c++/v1/__config
 OLD_FILES+=usr/include/c++/v1/__debug
 OLD_FILES+=usr/include/c++/v1/__functional_03
@@ -4398,10 +4400,12 @@ OLD_FILES+=usr/include/c++/v1/__function
 OLD_FILES+=usr/include/c++/v1/__hash_table
 OLD_FILES+=usr/include/c++/v1/__locale
 OLD_FILES+=usr/include/c++/v1/__mutex_base
+OLD_FILES+=usr/include/c++/v1/__nullptr
 OLD_FILES+=usr/include/c++/v1/__refstring
 OLD_FILES+=usr/include/c++/v1/__split_buffer
 OLD_FILES+=usr/include/c++/v1/__sso_allocator
 OLD_FILES+=usr/include/c++/v1/__std_stream
+OLD_FILES+=usr/include/c++/v1/__threading_support
 OLD_FILES+=usr/include/c++/v1/__tree
 OLD_FILES+=usr/include/c++/v1/__tuple
 OLD_FILES+=usr/include/c++/v1/__undef___deallocate
@@ -4437,30 +4441,51 @@ OLD_FILES+=usr/include/c++/v1/cstdlib
 OLD_FILES+=usr/include/c++/v1/cstring
 OLD_FILES+=usr/include/c++/v1/ctgmath
 OLD_FILES+=usr/include/c++/v1/ctime
+OLD_FILES+=usr/include/c++/v1/ctype.h
 OLD_FILES+=usr/include/c++/v1/cwchar
 OLD_FILES+=usr/include/c++/v1/cwctype
 OLD_FILES+=usr/include/c++/v1/cxxabi.h
 OLD_FILES+=usr/include/c++/v1/deque
+OLD_FILES+=usr/include/c++/v1/errno.h
 OLD_FILES+=usr/include/c++/v1/exception
 OLD_FILES+=usr/include/c++/v1/experimental/__config
+OLD_FILES+=usr/include/c++/v1/experimental/__memory
+OLD_FILES+=usr/include/c++/v1/experimental/algorithm
+OLD_FILES+=usr/include/c++/v1/experimental/any
 OLD_FILES+=usr/include/c++/v1/experimental/chrono
+OLD_FILES+=usr/include/c++/v1/experimental/deque
 OLD_FILES+=usr/include/c++/v1/experimental/dynarray
-OLD_FILES+=usr/include/c++/v1/experimental/dynarray
+OLD_FILES+=usr/include/c++/v1/experimental/filesystem
+OLD_FILES+=usr/include/c++/v1/experimental/forward_list
+OLD_FILES+=usr/include/c++/v1/experimental/functional
+OLD_FILES+=usr/include/c++/v1/experimental/iterator
+OLD_FILES+=usr/include/c++/v1/experimental/list
+OLD_FILES+=usr/include/c++/v1/experimental/map
+OLD_FILES+=usr/include/c++/v1/experimental/memory_resource
 OLD_FILES+=usr/include/c++/v1/experimental/optional
+OLD_FILES+=usr/include/c++/v1/experimental/propagate_const
 OLD_FILES+=usr/include/c++/v1/experimental/ratio
+OLD_FILES+=usr/include/c++/v1/experimental/regex
+OLD_FILES+=usr/include/c++/v1/experimental/set
+OLD_FILES+=usr/include/c++/v1/experimental/string
 OLD_FILES+=usr/include/c++/v1/experimental/string_view
 OLD_FILES+=usr/include/c++/v1/experimental/system_error
 OLD_FILES+=usr/include/c++/v1/experimental/tuple
 OLD_FILES+=usr/include/c++/v1/experimental/type_traits
+OLD_FILES+=usr/include/c++/v1/experimental/unordered_map
+OLD_FILES+=usr/include/c++/v1/experimental/unordered_set
 OLD_FILES+=usr/include/c++/v1/experimental/utility
+OLD_FILES+=usr/include/c++/v1/experimental/vector
 OLD_FILES+=usr/include/c++/v1/ext/__hash
 OLD_FILES+=usr/include/c++/v1/ext/hash_map
 OLD_FILES+=usr/include/c++/v1/ext/hash_set
+OLD_FILES+=usr/include/c++/v1/float.h
 OLD_FILES+=usr/include/c++/v1/forward_list
 OLD_FILES+=usr/include/c++/v1/fstream
 OLD_FILES+=usr/include/c++/v1/functional
 OLD_FILES+=usr/include/c++/v1/future
 OLD_FILES+=usr/include/c++/v1/initializer_list
+OLD_FILES+=usr/include/c++/v1/inttypes.h
 OLD_FILES+=usr/include/c++/v1/iomanip
 OLD_FILES+=usr/include/c++/v1/ios
 OLD_FILES+=usr/include/c++/v1/iosfwd
@@ -4471,6 +4496,7 @@ OLD_FILES+=usr/include/c++/v1/limits
 OLD_FILES+=usr/include/c++/v1/list
 OLD_FILES+=usr/include/c++/v1/locale
 OLD_FILES+=usr/include/c++/v1/map
+OLD_FILES+=usr/include/c++/v1/math.h
 OLD_FILES+=usr/include/c++/v1/memory
 OLD_FILES+=usr/include/c++/v1/mutex
 OLD_FILES+=usr/include/c++/v1/new
@@ -4482,17 +4508,25 @@ OLD_FILES+=usr/include/c++/v1/ratio
 OLD_FILES+=usr/include/c++/v1/regex
 OLD_FILES+=usr/include/c++/v1/scoped_allocator
 OLD_FILES+=usr/include/c++/v1/set
+OLD_FILES+=usr/include/c++/v1/setjmp.h
 OLD_FILES+=usr/include/c++/v1/shared_mutex
 OLD_FILES+=usr/include/c++/v1/sstream
 OLD_FILES+=usr/include/c++/v1/stack
+OLD_FILES+=usr/include/c++/v1/stdbool.h
+OLD_FILES+=usr/include/c++/v1/stddef.h
 OLD_FILES+=usr/include/c++/v1/stdexcept

svn commit: r312765 - in head/contrib/llvm: include/llvm/Analysis lib/Analysis

2017-01-25 Thread Dimitry Andric
Author: dim
Date: Wed Jan 25 17:59:22 2017
New Revision: 312765
URL: https://svnweb.freebsd.org/changeset/base/312765

Log:
  Pull in r276136 from upstream llvm trunk (by Wei Mi):
  
Use ValueOffsetPair to enhance value reuse during SCEV expansion.
  
In D12090, the ExprValueMap was added to reuse existing value during
SCEV expansion. However, const folding and sext/zext distribution can
make the reuse still difficult.
  
A simplified case is: suppose we know S1 expands to V1 in
ExprValueMap, and
  S1 = S2 + C_a
  S3 = S2 + C_b
where C_a and C_b are different SCEVConstants. Then we'd like to
expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
helpful when S2 is a complex SCEV expr and S2 has no entry in
ExprValueMap, which is usually caused by the fact that S3 is
generated from S1 after const folding.
  
In order to do that, we represent ExprValueMap as a mapping from SCEV
to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
into the ExprValueMap when we create SCEV for V1. When S3 is
expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
C_a} in the map, then expand S3 to V1 - C_a + C_b.
  
Differential Revision: https://reviews.llvm.org/D21313
  
  This should fix assertion failures when building OpenCV >= 3.1.
  
  PR:   215649
  MFC after:3 days

Modified:
  head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h
  head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
  head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp
  head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp

Modified: head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h
==
--- head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h   Wed Jan 25 
17:35:11 2017(r312764)
+++ head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h   Wed Jan 25 
17:59:22 2017(r312765)
@@ -495,10 +495,29 @@ namespace llvm {
 
 /// The typedef for ExprValueMap.
 ///
-typedef DenseMap> ExprValueMapType;
+typedef std::pair ValueOffsetPair;
+typedef DenseMap> 
ExprValueMapType;
 
 /// ExprValueMap -- This map records the original values from which
 /// the SCEV expr is generated from.
+///
+/// We want to represent the mapping as SCEV -> ValueOffsetPair instead
+/// of SCEV -> Value:
+/// Suppose we know S1 expands to V1, and
+///  S1 = S2 + C_a
+///  S3 = S2 + C_b
+/// where C_a and C_b are different SCEVConstants. Then we'd like to
+/// expand S3 as V1 - C_a + C_b instead of expanding S2 literally.
+/// It is helpful when S2 is a complex SCEV expr.
+///
+/// In order to do that, we represent ExprValueMap as a mapping from
+/// SCEV to ValueOffsetPair. We will save both S1->{V1, 0} and
+/// S2->{V1, C_a} into the map when we create SCEV for V1. When S3
+/// is expanded, it will first expand S2 to V1 - C_a because of
+/// S2->{V1, C_a} in the map, then expand S3 to V1 - C_a + C_b.
+///
+/// Note: S->{V, Offset} in the ExprValueMap means S can be expanded
+/// to V - Offset.
 ExprValueMapType ExprValueMap;
 
 /// The typedef for ValueExprMap.
@@ -1181,7 +1200,7 @@ namespace llvm {
 bool containsAddRecurrence(const SCEV *S);
 
 /// Return the Value set from which the SCEV expr is generated.
-SetVector *getSCEVValues(const SCEV *S);
+SetVector *getSCEVValues(const SCEV *S);
 
 /// Erase Value from ValueExprMap and ExprValueMap.
 void eraseValueFromMap(Value *V);

Modified: head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
==
--- head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h   Wed Jan 
25 17:35:11 2017(r312764)
+++ head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h   Wed Jan 
25 17:59:22 2017(r312765)
@@ -325,7 +325,8 @@ namespace llvm {
   PointerType *PTy, Type *Ty, Value *V);
 
 /// \brief Find a previous Value in ExprValueMap for expand.
-Value *FindValueInExprValueMap(const SCEV *S, const Instruction *InsertPt);
+ScalarEvolution::ValueOffsetPair
+FindValueInExprValueMap(const SCEV *S, const Instruction *InsertPt);
 
 Value *expand(const SCEV *S);
 

Modified: head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp
==
--- head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp  Wed Jan 25 17:35:11 
2017(r312764)
+++ head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp  Wed Jan 25 17:59:22 
2017(r312765)
@@ -3378,8 +3378,28 @@ bool ScalarEvolution::containsAddRecurre
   return F.FoundOne;
 }
 
-/// Return the Value set from S.
-SetVector *ScalarEvolution::getSCEVValues(const SCEV *S) {
+/// Try to split a SCEVAddExpr into a 

Re: svn commit: r312764 - head/libexec/rtld-elf/aarch64

2017-01-25 Thread Andrew Turner
On Wed, 25 Jan 2017 17:35:11 + (UTC)
Andrew Turner  wrote:

> Author: andrew
> Date: Wed Jan 25 17:35:11 2017
> New Revision: 312764
> URL: https://svnweb.freebsd.org/changeset/base/312764
> 
> Log:
>   Pull the R_AARCH64_TLSDESC code out into a common function and use
> them in both the plt and non-plt case.
>   
>   This fixes an issue where libraries built with LLD can fail with
>   "Unhandled relocation 1031"
>   
>   PR: 214971
>   Obtained from:  1 week

Should be "MFC after: 1 week"

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: r312764 - head/libexec/rtld-elf/aarch64

2017-01-25 Thread Andrew Turner
Author: andrew
Date: Wed Jan 25 17:35:11 2017
New Revision: 312764
URL: https://svnweb.freebsd.org/changeset/base/312764

Log:
  Pull the R_AARCH64_TLSDESC code out into a common function and use them in
  both the plt and non-plt case.
  
  This fixes an issue where libraries built with LLD can fail with
  "Unhandled relocation 1031"
  
  PR:   214971
  Obtained from:1 week
  Sponsored by: DARPA, AFRL

Modified:
  head/libexec/rtld-elf/aarch64/reloc.c

Modified: head/libexec/rtld-elf/aarch64/reloc.c
==
--- head/libexec/rtld-elf/aarch64/reloc.c   Wed Jan 25 16:35:57 2017
(r312763)
+++ head/libexec/rtld-elf/aarch64/reloc.c   Wed Jan 25 17:35:11 2017
(r312764)
@@ -184,6 +184,18 @@ rtld_tlsdesc_handle(struct tls_data *tls
return (tlsdesc->index);
 }
 
+static void
+reloc_tlsdesc(Obj_Entry *obj, const Elf_Rela *rela, Elf_Addr *where)
+{
+   if (ELF_R_SYM(rela->r_info) == 0) {
+   where[0] = (Elf_Addr)_rtld_tlsdesc;
+   where[1] = obj->tlsoffset + rela->r_addend;
+   } else {
+   where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic;
+   where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj, rela);
+   }
+}
+
 /*
  * Process the PLT relocations.
  */
@@ -204,14 +216,7 @@ reloc_plt(Obj_Entry *obj)
*where += (Elf_Addr)obj->relocbase;
break;
case R_AARCH64_TLSDESC:
-   if (ELF_R_SYM(rela->r_info) == 0) {
-   where[0] = (Elf_Addr)_rtld_tlsdesc;
-   where[1] = obj->tlsoffset + rela->r_addend;
-   } else {
-   where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic;
-   where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj,
-   rela);
-   }
+   reloc_tlsdesc(obj, rela, where);
break;
default:
_rtld_error("Unknown relocation type %u in PLT",
@@ -362,6 +367,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
return (-1);
}
break;
+   case R_AARCH64_TLSDESC:
+   reloc_tlsdesc(obj, rela, where);
+   break;
case R_AARCH64_TLS_TPREL64:
def = find_symdef(symnum, obj, , flags, cache,
lockstate);
___
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: r312763 - head/sys/cddl/dev/dtrace

2017-01-25 Thread Mark Johnston
Author: markj
Date: Wed Jan 25 16:35:57 2017
New Revision: 312763
URL: https://svnweb.freebsd.org/changeset/base/312763

Log:
  Fix initialization of "p" after r312658.
  
  CID:  1369410

Modified:
  head/sys/cddl/dev/dtrace/dtrace_ioctl.c

Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c
==
--- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Wed Jan 25 16:18:40 2017
(r312762)
+++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Wed Jan 25 16:35:57 2017
(r312763)
@@ -44,8 +44,8 @@ dtrace_ioctl_helper(struct cdev *dev, u_
case DTRACEHIOC_ADDDOF:
dhp = (dof_helper_t *)addr;
addr = (caddr_t)(uintptr_t)dhp->dofhp_dof;
+   p = curproc;
if (p->p_pid == dhp->dofhp_pid) {
-   p = curproc;
dof = dtrace_dof_copyin((uintptr_t)addr, );
} else {
p = pfind(dhp->dofhp_pid);
___
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: r312762 - stable/11/sys/arm/ti/cpsw

2017-01-25 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Jan 25 16:18:40 2017
New Revision: 312762
URL: https://svnweb.freebsd.org/changeset/base/312762

Log:
  MFC r312604 and r312605:
  
  Simplify the handling of small packets padding in cpsw:
   - Pad small packets to 60 bytes and not 64 (exclude the CRC bytes);
   - Pad the packet using m_append(9), if the packet has enough space for
 padding, which is usually true, it will not be necessary append a newly
 allocated mbuf to the chain.
  
  Suggested by: yongari
  
  MFC r312608:
  
  Handle the rx queue stall while reading the packets from NIC (when the
  descriptor state will not change anymore).  This seems to eliminate the
  race where we can miss a stalled queue under high load.
  
  While here remove the unnecessary curly brackets.
  
  Reported by:  Konstantin Kormashev 
  
  MFC r312636:
  
  Properly assemble an mbuf chain out of received fragments.
  
  Remove the rx_batch hack, it makes no difference now that most of bugs have
  been sorted out.
  
  MFC r312637:
  
  Be a little more pedantic here, the TRM says the hardware is supposed to
  only clean the OWNER bit on SOP descriptors.
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/arm/ti/cpsw/if_cpsw.c
  stable/11/sys/arm/ti/cpsw/if_cpswvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c
==
--- stable/11/sys/arm/ti/cpsw/if_cpsw.c Wed Jan 25 16:10:35 2017
(r312761)
+++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Wed Jan 25 16:18:40 2017
(r312762)
@@ -784,8 +784,7 @@ cpsw_get_fdt_data(struct cpsw_softc *sc,
 static int
 cpsw_attach(device_t dev)
 {
-   bus_dma_segment_t segs[1];
-   int error, i, nsegs;
+   int error, i;
struct cpsw_softc *sc;
uint32_t reg;
 
@@ -860,15 +859,8 @@ cpsw_attach(device_t dev)
return (error);
}
 
-   /* Allocate the null mbuf and pre-sync it. */
-   sc->null_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
-   memset(sc->null_mbuf->m_data, 0, sc->null_mbuf->m_ext.ext_size);
-   bus_dmamap_create(sc->mbuf_dtag, 0, >null_mbuf_dmamap);
-   bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, sc->null_mbuf_dmamap,
-   sc->null_mbuf, segs, , BUS_DMA_NOWAIT);
-   bus_dmamap_sync(sc->mbuf_dtag, sc->null_mbuf_dmamap,
-   BUS_DMASYNC_PREWRITE);
-   sc->null_mbuf_paddr = segs[0].ds_addr;
+   /* Allocate a NULL buffer for padding. */
+   sc->nullpad = malloc(ETHER_MIN_LEN, M_DEVBUF, M_WAITOK | M_ZERO);
 
cpsw_init_slots(sc);
 
@@ -947,13 +939,9 @@ cpsw_detach(device_t dev)
for (i = 0; i < nitems(sc->_slots); ++i)
cpsw_free_slot(sc, >_slots[i]);
 
-   /* Free null mbuf. */
-   if (sc->null_mbuf_dmamap) {
-   bus_dmamap_unload(sc->mbuf_dtag, sc->null_mbuf_dmamap);
-   error = bus_dmamap_destroy(sc->mbuf_dtag, sc->null_mbuf_dmamap);
-   KASSERT(error == 0, ("Mapping still active"));
-   m_freem(sc->null_mbuf);
-   }
+   /* Free null padding buffer. */
+   if (sc->nullpad)
+   free(sc->nullpad, M_DEVBUF);
 
/* Free DMA tag */
if (sc->mbuf_dtag) {
@@ -1595,14 +1583,19 @@ cpsw_intr_rx(void *arg)
 static struct mbuf *
 cpsw_rx_dequeue(struct cpsw_softc *sc)
 {
+   int nsegs, port, removed;
struct cpsw_cpdma_bd bd;
struct cpsw_slot *last, *slot;
struct cpswp_softc *psc;
-   struct mbuf *mb_head, *mb_tail;
-   int port, removed = 0;
+   struct mbuf *m, *m0, *mb_head, *mb_tail;
+   uint16_t m0_flags;
 
+   nsegs = 0;
+   m0 = NULL;
last = NULL;
-   mb_head = mb_tail = NULL;
+   mb_head = NULL;
+   mb_tail = NULL;
+   removed = 0;
 
/* Pull completed packets off hardware RX queue. */
while ((slot = STAILQ_FIRST(>rx.active)) != NULL) {
@@ -1625,10 +1618,12 @@ cpsw_rx_dequeue(struct cpsw_softc *sc)
bus_dmamap_sync(sc->mbuf_dtag, slot->dmamap, 
BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap);
 
+   m = slot->mbuf;
+   slot->mbuf = NULL;
+
if (bd.flags & CPDMA_BD_TDOWNCMPLT) {
CPSW_DEBUGF(sc, ("RX teardown is complete"));
-   m_freem(slot->mbuf);
-   slot->mbuf = NULL;
+   m_freem(m);
sc->rx.running = 0;
sc->rx.teardown = 0;
break;
@@ -1640,41 +1635,63 @@ cpsw_rx_dequeue(struct cpsw_softc *sc)
psc = device_get_softc(sc->port[port].dev);
 
/* Set up mbuf */
-   /* TODO: track SOP/EOP bits to assemble a full mbuf
-  out of received fragments. */
-   slot->mbuf->m_data += bd.bufoff;
-   

svn commit: r312761 - stable/11/sys/arm/ti/cpsw

2017-01-25 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Jan 25 16:10:35 2017
New Revision: 312761
URL: https://svnweb.freebsd.org/changeset/base/312761

Log:
  MFC r312411:
  
  Handle the set capabilities ioctl, letting the hardware checksum be
  disabled (Hi netmap!).
  
  Only remove the CRC bytes from packets when the hardware tell us to do so.
  
  Fixes the 'discard frame w/o leading ethernet header' issues.
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/arm/ti/cpsw/if_cpsw.c
  stable/11/sys/arm/ti/cpsw/if_cpswreg.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c
==
--- stable/11/sys/arm/ti/cpsw/if_cpsw.c Wed Jan 25 15:54:44 2017
(r312760)
+++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Wed Jan 25 16:10:35 2017
(r312761)
@@ -1396,6 +1396,16 @@ cpswp_ioctl(struct ifnet *ifp, u_long co
ifr = (struct ifreq *)data;
 
switch (command) {
+   case SIOCSIFCAP:
+   changed = ifp->if_capenable ^ ifr->ifr_reqcap;
+   if (changed & IFCAP_HWCSUM) {
+   if ((ifr->ifr_reqcap & changed) & IFCAP_HWCSUM)
+   ifp->if_capenable |= IFCAP_HWCSUM;
+   else
+   ifp->if_capenable &= ~IFCAP_HWCSUM;
+   }
+   error = 0;
+   break;
case SIOCSIFFLAGS:
CPSW_PORT_LOCK(sc);
if (ifp->if_flags & IFF_UP) {
@@ -1633,15 +1643,22 @@ cpsw_rx_dequeue(struct cpsw_softc *sc)
/* TODO: track SOP/EOP bits to assemble a full mbuf
   out of received fragments. */
slot->mbuf->m_data += bd.bufoff;
-   slot->mbuf->m_len = bd.pktlen - 4;
-   slot->mbuf->m_pkthdr.len = bd.pktlen - 4;
-   slot->mbuf->m_flags |= M_PKTHDR;
-   slot->mbuf->m_pkthdr.rcvif = psc->ifp;
+   slot->mbuf->m_len = bd.buflen;
+   if (bd.flags & CPDMA_BD_SOP) {
+   slot->mbuf->m_pkthdr.len = bd.pktlen;
+   slot->mbuf->m_pkthdr.rcvif = psc->ifp;
+   slot->mbuf->m_flags |= M_PKTHDR;
+   }
+   slot->mbuf->m_next = NULL;
slot->mbuf->m_nextpkt = NULL;
+   if (bd.flags & CPDMA_BD_PASS_CRC)
+   m_adj(slot->mbuf, -ETHER_CRC_LEN);
 
if ((psc->ifp->if_capenable & IFCAP_RXCSUM) != 0) {
/* check for valid CRC by looking into pkt_err[5:4] */
-   if ((bd.flags & CPDMA_BD_PKT_ERR_MASK) == 0) {
+   if ((bd.flags &
+   (CPDMA_BD_SOP | CPDMA_BD_PKT_ERR_MASK)) ==
+   CPDMA_BD_SOP) {
slot->mbuf->m_pkthdr.csum_flags |= 
CSUM_IP_CHECKED;
slot->mbuf->m_pkthdr.csum_flags |= 
CSUM_IP_VALID;
slot->mbuf->m_pkthdr.csum_data = 0x;

Modified: stable/11/sys/arm/ti/cpsw/if_cpswreg.h
==
--- stable/11/sys/arm/ti/cpsw/if_cpswreg.h  Wed Jan 25 15:54:44 2017
(r312760)
+++ stable/11/sys/arm/ti/cpsw/if_cpswreg.h  Wed Jan 25 16:10:35 2017
(r312761)
@@ -191,6 +191,7 @@
 #define CPDMA_BD_OWNER (1 << 13)
 #define CPDMA_BD_EOQ   (1 << 12)
 #define CPDMA_BD_TDOWNCMPLT(1 << 11)
+#define CPDMA_BD_PASS_CRC  (1 << 10)
 #define CPDMA_BD_PKT_ERR_MASK  (3 << 4)
 #define CPDMA_BD_TO_PORT   (1 << 4)
 #define CPDMA_BD_PORT_MASK 3
___
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: r312760 - head/sys/kern

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 15:54:44 2017
New Revision: 312760
URL: https://svnweb.freebsd.org/changeset/base/312760

Log:
  Replace overlooked smp_started checks and variable use in a print
  with the now used tqg_smp_started.
  
  Submitted by: bde

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Wed Jan 25 15:52:03 2017
(r312759)
+++ head/sys/kern/subr_gtaskqueue.c Wed Jan 25 15:54:44 2017
(r312760)
@@ -740,7 +740,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 
CPU_ZERO();
CPU_SET(cpu, );
-   if (irq != -1 && (smp_started || mp_ncpus == 1))
+   if (irq != -1 && tqg_smp_started)
intr_setaffinity(irq, );
return (0);
 }
@@ -849,8 +849,8 @@ _taskqgroup_adjust(struct taskqgroup *qg
 
if (cnt < 1 || cnt * stride > mp_ncpus || !tqg_smp_started) {
printf("%s: failed cnt: %d stride: %d "
-  "mp_ncpus: %d smp_started: %d\n",
-   __func__, cnt, stride, mp_ncpus, smp_started);
+   "mp_ncpus: %d tqg_smp_started: %d\n",
+   __func__, cnt, stride, mp_ncpus, tqg_smp_started);
return (EINVAL);
}
if (qgroup->tqg_adjusting) {
___
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: r312759 - head/sys/sys

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 15:52:03 2017
New Revision: 312759
URL: https://svnweb.freebsd.org/changeset/base/312759

Log:
  Resolve a non-fatal syntax warning left in by a trailing ;
  
  Submitted by: bde

Modified:
  head/sys/sys/gtaskqueue.h

Modified: head/sys/sys/gtaskqueue.h
==
--- head/sys/sys/gtaskqueue.h   Wed Jan 25 15:42:29 2017(r312758)
+++ head/sys/sys/gtaskqueue.h   Wed Jan 25 15:52:03 2017(r312759)
@@ -94,7 +94,7 @@ taskqgroup_define_##name(void *arg)   

 }  \
\
 SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
-   taskqgroup_define_##name, NULL)
+   taskqgroup_define_##name, NULL) \
 
 #else /* !EARLY_AP_STARTUP */
 #define TASKQGROUP_DEFINE(name, cnt, stride)   \
@@ -117,7 +117,7 @@ taskqgroup_adjust_##name(void *arg) 

 }  \
\
 SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY,   \
-   taskqgroup_adjust_##name, NULL);\
+   taskqgroup_adjust_##name, NULL) \
 
 #endif /* EARLY_AP_STARTUP */
 
___
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: r312758 - head/sys/sys

2017-01-25 Thread Ed Maste
Author: emaste
Date: Wed Jan 25 15:42:29 2017
New Revision: 312758
URL: https://svnweb.freebsd.org/changeset/base/312758

Log:
  Add sys/capability.h deprecation warning
  
  In r263232 sys/capability.h was renamed to sys/capsicum.h, to avoid
  conflicts with a capability.h header found on other operating systems.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/capability.h

Modified: head/sys/sys/capability.h
==
--- head/sys/sys/capability.h   Wed Jan 25 15:27:05 2017(r312757)
+++ head/sys/sys/capability.h   Wed Jan 25 15:42:29 2017(r312758)
@@ -38,6 +38,7 @@
 #ifndef _SYS_CAPABILITY_H_
 #define_SYS_CAPABILITY_H_
 
+#warning this file includes  which is deprecated
 #include 
 
 #endif /* !_SYS_CAPABILITY_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: r312757 - stable/11/sys/arm/ti/cpsw

2017-01-25 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Jan 25 15:27:05 2017
New Revision: 312757
URL: https://svnweb.freebsd.org/changeset/base/312757

Log:
  MFC r312408:
  
  The port number and the to_port_en flag are valid only on SOP descriptor.
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/arm/ti/cpsw/if_cpsw.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c
==
--- stable/11/sys/arm/ti/cpsw/if_cpsw.c Wed Jan 25 14:49:42 2017
(r312756)
+++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Wed Jan 25 15:27:05 2017
(r312757)
@@ -1801,13 +1801,8 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
struct cpsw_cpdma_bd bd;
struct cpsw_slot *first_new_slot, *last, *last_old_slot, *next, *slot;
struct mbuf *m0;
-   int error, flags, nsegs, seg, added = 0, padlen;
+   int error, nsegs, seg, added = 0, padlen;
 
-   flags = 0;
-   if (sc->swsc->dualemac) {
-   flags = CPDMA_BD_TO_PORT |
-   ((sc->unit + 1) & CPDMA_BD_PORT_MASK);
-   }
/* Pull pending packets from IF queue and prep them for DMA. */
last = NULL;
first_new_slot = NULL;
@@ -1885,7 +1880,11 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = segs[0].ds_len;
bd.pktlen = m_length(slot->mbuf, NULL) + padlen;
-   bd.flags =  CPDMA_BD_SOP | CPDMA_BD_OWNER | flags;
+   bd.flags =  CPDMA_BD_SOP | CPDMA_BD_OWNER;
+   if (sc->swsc->dualemac) {
+   bd.flags |= CPDMA_BD_TO_PORT;
+   bd.flags |= ((sc->unit + 1) & CPDMA_BD_PORT_MASK);
+   }
for (seg = 1; seg < nsegs; ++seg) {
/* Save the previous buffer (which isn't EOP) */
cpsw_cpdma_write_bd(sc->swsc, slot, );
@@ -1903,7 +1902,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = segs[seg].ds_len;
bd.pktlen = 0;
-   bd.flags = CPDMA_BD_OWNER | flags;
+   bd.flags = CPDMA_BD_OWNER;
}
/* Save the final buffer. */
if (padlen <= 0)
@@ -1925,7 +1924,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = padlen;
bd.pktlen = 0;
-   bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER | flags;
+   bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER;
cpsw_cpdma_write_bd(sc->swsc, slot, );
++nsegs;
 
___
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: r312756 - in stable/11/sys: boot/fdt/dts/arm modules/dtb/am335x

2017-01-25 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Jan 25 14:49:42 2017
New Revision: 312756
URL: https://svnweb.freebsd.org/changeset/base/312756

Log:
  MFC r308458, r311157 and r312347:
  
  Add the DTS for the Netgate SG-1000 (micro-Firewall).
  
  Remove a GPL licensed DTS.
  
  The micro-Firewall DTS is now a single BSD licensed file.
  
  The write-protect is not wired on uFW, disable it to allow writes to SD
  card.
  
  Obtained from:pfSense
  Sponsored by: Rubicon Communications, LLC (Netgate)

Added:
  stable/11/sys/boot/fdt/dts/arm/ufw.dts
 - copied, changed from r308458, head/sys/boot/fdt/dts/arm/ufw.dts
Modified:
  stable/11/sys/modules/dtb/am335x/Makefile
Directory Properties:
  stable/11/   (props changed)

Copied and modified: stable/11/sys/boot/fdt/dts/arm/ufw.dts (from r308458, 
head/sys/boot/fdt/dts/arm/ufw.dts)
==
--- head/sys/boot/fdt/dts/arm/ufw.dts   Wed Nov  9 04:07:15 2016
(r308458, copy source)
+++ stable/11/sys/boot/fdt/dts/arm/ufw.dts  Wed Jan 25 14:49:42 2017
(r312756)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Rubicon Communications, LLC (Netgate)
+ * Copyright (c) 2016, 2017 Rubicon Communications, LLC (Netgate)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,11 +29,247 @@
 /dts-v1/;
 
 #include "am33xx.dtsi"
-#include "ubmc.dtsi"
 
 / {
model = "AM335x uFW";
compatible = "ti,am335x-ufw", "ti,am335x-ubmc", "ti,am33xx";
+
+   memory {
+   device_type = "memory";
+   reg = <0x8000 0x1000>; /* 256 MB */
+   };
+
+   vmmcsd_fixed: fixedregulator@0 {
+   compatible = "regulator-fixed";
+   regulator-name = "vmmcsd_fixed";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   };
+};
+
+_pinmux {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin>;
+
+   i2c0_pins: pinmux_i2c0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)   
/* i2c0_sda.i2c0_sda */
+   AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)   
/* i2c0_scl.i2c0_scl */
+   >;
+   };
+
+   i2c1_pins: pinmux_i2c1_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3)   
/* uart0_ctsn.i2c1_sda */
+   AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3)   
/* uart0_rtsn.i2c1_scl */
+   >;
+   };
+
+   uart0_pins: pinmux_uart0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)   
/* uart0_rxd.uart0_rxd */
+   AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
/* uart0_txd.uart0_txd */
+   >;
+   };
+
+   clkout2_pin: pinmux_clkout2_pin {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* xdma_event_intr1.clkout2 */
+   >;
+   };
+
+   cpsw_default: cpsw_default {
+   pinctrl-single,pins = <
+   /* Slave 1 */
+   AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txen.rgmii_1_txen */
+   AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxdv.rgmii_1_rxdv */
+   AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd3.rgmii_1_txd3 */
+   AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd2.rgmii_1_txd2 */
+   AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd1.rgmii_1_txd1 */
+   AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txd0.rgmii_1_txd0 */
+   AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* mii1_txclk.rgmii_1_txclk */
+   AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxclk.rgmii_1_rxclk */
+   AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxd3.rgmii_1_rxd3 */
+   AM33XX_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxd2.rgmii_1_rxd2 */
+   AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxd1.rgmii_1_rxd1 */
+   AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE2)   
/* mii1_rxd0.rgmii_1_rxd0 */
+
+   /* Slave 2 */
+   AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* gmpc_a0.rgmii_2_txen */
+   AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE2)   
/* gmpc_a1.rgmii_2_rxdv */
+   AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2)
/* gmpc_a2.rgmii_2_txd3 */
+ 

svn commit: r312755 - head/sys/net

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 14:37:05 2017
New Revision: 312755
URL: https://svnweb.freebsd.org/changeset/base/312755

Log:
  Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns
  success and a good value.  Only then try to use it and set the MSIX_ENABLE
  bit.
  
  With the current em(4) driver we have observed failures in this case in a
  specific environment when pci_find_cap() would not return the assumed
  value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID)
  which is read-only.
  
  PR:   216456
  Submitted by: bz

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Jan 25 13:42:38 2017(r312754)
+++ head/sys/net/iflib.cWed Jan 25 14:37:05 2017(r312755)
@@ -3733,6 +3733,10 @@ iflib_device_register(device_t dev, void
if (sctx->isc_flags & IFLIB_SKIP_MSIX) {
msix = scctx->isc_vectors;
} else if (scctx->isc_msix_bar != 0)
+  /*
+   * The simple fact that isc_msix_bar is not 0 does not mean we
+   * we have a good value there that is known to work.
+   */
msix = iflib_msix_init(ctx);
else {
scctx->isc_vectors = 1;
@@ -4779,15 +4783,20 @@ iflib_msix_init(if_ctx_t ctx)
uint16_t pci_cmd_word;
int msix_ctrl, rid;
 
-   rid = 0;
pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2);
pci_cmd_word |= PCIM_CMD_BUSMASTEREN;
pci_write_config(dev, PCIR_COMMAND, pci_cmd_word, 2);
-   pci_find_cap(dev, PCIY_MSIX, );
-   rid += PCIR_MSIX_CTRL;
-   msix_ctrl = pci_read_config(dev, rid, 2);
-   msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE;
-   pci_write_config(dev, rid, msix_ctrl, 2);
+   rid = 0;
+   if (pci_find_cap(dev, PCIY_MSIX, ) == 0 && rid != 0) {
+   rid += PCIR_MSIX_CTRL;
+   msix_ctrl = pci_read_config(dev, rid, 2);
+   msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE;
+   pci_write_config(dev, rid, msix_ctrl, 2);
+   } else {
+   device_printf(dev, "PCIY_MSIX capability not found; "
+  "or rid %d == 0.\n", rid);
+   goto msi;
+   }
}
 
/*
___
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: r312751 - head/sys/dev/ahci

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 12:18:21 2017
New Revision: 312751
URL: https://svnweb.freebsd.org/changeset/base/312751

Log:
  Extend AHCI_Q_BIT_STRING after adding new quirk for soft
   reset delay
  
  Adding new quirk (AHCI_Q_MRVL_SR_DEL) requires according extention
  of AHCI_Q_BIT_STRING.
  
  Submitted by:  Marcin Wojtas 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   wma

Modified:
  head/sys/dev/ahci/ahci.h

Modified: head/sys/dev/ahci/ahci.h
==
--- head/sys/dev/ahci/ahci.hWed Jan 25 11:47:16 2017(r312750)
+++ head/sys/dev/ahci/ahci.hWed Jan 25 12:18:21 2017(r312751)
@@ -622,7 +622,8 @@ enum ahci_err_type {
"\0221MSI"  \
"\023FORCE_PI"  \
"\024RESTORE_CAP"   \
-   "\025NOMSIX"
+   "\025NOMSIX"\
+   "\026MRVL_SR_DEL"
 
 int ahci_attach(device_t dev);
 int ahci_detach(device_t dev);
___
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: r312750 - head/share/misc

2017-01-25 Thread Alexander Motin
Author: mav
Date: Wed Jan 25 11:47:16 2017
New Revision: 312750
URL: https://svnweb.freebsd.org/changeset/base/312750

Log:
  Add Timeout and Protect mode page description from MMC-6.
  
  MFC after:2 weeks

Modified:
  head/share/misc/scsi_modes

Modified: head/share/misc/scsi_modes
==
--- head/share/misc/scsi_modes  Wed Jan 25 10:34:37 2017(r312749)
+++ head/share/misc/scsi_modes  Wed Jan 25 11:47:16 2017(r312750)
@@ -478,4 +478,17 @@
{Current Write Speed Supported (kBps)} i2
 };
 
+0x1d "Timeout and Protect" {
+   {Reserved} *i2
+   {Reserved} *t4
+   {G3Enable} t1
+   {TMOE} t1
+   {DISP} t1
+   {SWPP} t1
+   {Reserved} *i1
+   {Group 1 Minimum Timeout} i2
+   {Group 2 Minimum Timeout} i2
+   {Group 3 Timeout} i2
+};
+
 0x00 "Vendor-Specific";
___
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: r312749 - in head/sys: arm/conf arm/mv dev/ahci

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:34:37 2017
New Revision: 312749
URL: https://svnweb.freebsd.org/changeset/base/312749

Log:
  Add support for AHCI on ARMADA38X
  
  This file provides support for AHCI mode on Armada38x
  and adds new optional AHCI device to arm/mv/files.mv.
  
  Submitted by:  Konrad Adamczyk 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   zbb
  Differential revision: https://reviews.freebsd.org/D9222

Added:
  head/sys/dev/ahci/ahci_mv_fdt.c   (contents, props changed)
Modified:
  head/sys/arm/conf/ARMADA38X
  head/sys/arm/mv/files.mv

Modified: head/sys/arm/conf/ARMADA38X
==
--- head/sys/arm/conf/ARMADA38X Wed Jan 25 10:32:57 2017(r312748)
+++ head/sys/arm/conf/ARMADA38X Wed Jan 25 10:34:37 2017(r312749)
@@ -60,6 +60,9 @@ devicescbus
 device pass
 device da
 
+# SATA
+device ahci
+
 # I2C
 device iic
 device iicbus

Modified: head/sys/arm/mv/files.mv
==
--- head/sys/arm/mv/files.mvWed Jan 25 10:32:57 2017(r312748)
+++ head/sys/arm/mv/files.mvWed Jan 25 10:34:37 2017(r312749)
@@ -29,5 +29,6 @@ dev/uart/uart_dev_ns8250.coptionaluart
 dev/uart/uart_dev_snps.c   optionaluart
 dev/usb/controller/ehci_mv.c   optionalehci
 dev/usb/controller/xhci_mv.c   optionalxhci
+dev/ahci/ahci_mv_fdt.c optionalahci
 
 kern/kern_clocksource.cstandard

Added: head/sys/dev/ahci/ahci_mv_fdt.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ahci/ahci_mv_fdt.c Wed Jan 25 10:34:37 2017
(r312749)
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2017 Semihalf.
+ * Copyright (c) 2017 Stormshield.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#defineAHCI_VENDOR_SPECIFIC_0_ADDR 0xa0
+#defineAHCI_VENDOR_SPECIFIC_0_DATA 0xa4
+
+#defineAHCI_HC_DEVSTR  "Marvell AHCI Controller"
+#defineAHCI_HC_VENDOR  "Marvell"
+
+static device_attach_t ahci_mv_fdt_attach;
+
+static struct ofw_compat_data compatible_data[] = {
+   {"marvell,armada-380-ahci", true},
+   {NULL,  false}
+};
+
+static void
+ahci_mv_regret_config(struct ahci_controller *ctlr)
+{
+
+   /*
+* Enable the regret bit to allow the SATA unit to regret
+* a request that didn't receive an acknowledge
+* and a avoid deadlock
+*/
+   ATA_OUTL(ctlr->r_mem, AHCI_VENDOR_SPECIFIC_0_ADDR, 0x4);
+   ATA_OUTL(ctlr->r_mem, AHCI_VENDOR_SPECIFIC_0_DATA, 0x80);
+}
+
+static int
+ahci_mv_fdt_probe(device_t dev)
+{
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_search_compatible(dev, compatible_data)->ocd_data)
+   return (ENXIO);
+
+   device_set_desc(dev, AHCI_HC_DEVSTR);
+
+   return (BUS_PROBE_DEFAULT);
+}
+
+static int
+ahci_mv_fdt_attach(device_t dev)
+{
+   struct ahci_controller *ctlr;
+   int rc;
+
+   ctlr = device_get_softc(dev);
+   ctlr->dev = dev;
+   ctlr->r_rid = 0;
+   ctlr->quirks = AHCI_Q_2CH;
+   ctlr->numirqs = 1;
+
+ 

svn commit: r312748 - head/sys/dev/ahci

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:32:57 2017
New Revision: 312748
URL: https://svnweb.freebsd.org/changeset/base/312748

Log:
  Enable optional soft reset in AHCI
  
  It occurred that some Marvell integrated controllers
  require additional time after soft reset to work properly.
  Introduce new quirk (AHCI_Q_MRVL_SR_DEL), that enable
  such operation.
  
  Submitted by:  Konrad Adamczyk 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   mav
  Differential revision: https://reviews.freebsd.org/D9221

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

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cWed Jan 25 10:31:16 2017(r312747)
+++ head/sys/dev/ahci/ahci.cWed Jan 25 10:32:57 2017(r312748)
@@ -1598,6 +1598,14 @@ ahci_execute_transaction(struct ahci_slo
}
 
/*
+* Some Marvell controllers require additional time
+* after soft reset to work properly. Setup delay
+* to 50ms after soft reset.
+*/
+   if (ch->quirks & AHCI_Q_MRVL_SR_DEL)
+   DELAY(5);
+
+   /*
 * Marvell HBAs with non-RAID firmware do not wait for
 * readiness after soft reset, so we have to wait here.
 * Marvell RAIDs do not have this problem, but instead

Modified: head/sys/dev/ahci/ahci.h
==
--- head/sys/dev/ahci/ahci.hWed Jan 25 10:31:16 2017(r312747)
+++ head/sys/dev/ahci/ahci.hWed Jan 25 10:32:57 2017(r312748)
@@ -598,6 +598,7 @@ enum ahci_err_type {
 #define AHCI_Q_FORCE_PI0x0004
 #define AHCI_Q_RESTORE_CAP 0x0008
 #define AHCI_Q_NOMSIX  0x0010
+#define AHCI_Q_MRVL_SR_DEL 0x0020
 
 #define AHCI_Q_BIT_STRING  \
"\020"  \
___
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: r312747 - head/sys/arm/mv

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:31:16 2017
New Revision: 312747
URL: https://svnweb.freebsd.org/changeset/base/312747

Log:
  Setup decoding windows for ARMADA38X
  
  It is necesarry to open memory windows on internal bus for
  AHCI driver to work correctly.
  
  Submitted by:  Konrad Adamczyk 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   zbb
  Differential revision: https://reviews.freebsd.org/D9220

Modified:
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mvwin.h

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Wed Jan 25 10:29:46 2017(r312746)
+++ head/sys/arm/mv/mv_common.c Wed Jan 25 10:31:16 2017(r312747)
@@ -98,6 +98,7 @@ static void decode_win_usb_setup(u_long)
 static void decode_win_usb3_setup(u_long);
 static void decode_win_eth_setup(u_long);
 static void decode_win_sata_setup(u_long);
+static void decode_win_ahci_setup(u_long);
 
 static void decode_win_idma_setup(u_long);
 static void decode_win_xor_setup(u_long);
@@ -107,6 +108,7 @@ static void decode_win_usb3_dump(u_long)
 static void decode_win_eth_dump(u_long base);
 static void decode_win_idma_dump(u_long base);
 static void decode_win_xor_dump(u_long base);
+static void decode_win_sata_dump(u_long base);
 
 static int fdt_get_ranges(const char *, void *, int, int *, int *);
 #ifdef SOC_MV_ARMADA38X
@@ -139,6 +141,7 @@ static struct soc_node_spec soc_nodes[] 
{ "mrvl,ge", _win_eth_setup, _win_eth_dump },
{ "mrvl,usb-ehci", _win_usb_setup, _win_usb_dump },
{ "marvell,armada-380-xhci", _win_usb3_setup, 
_win_usb3_dump },
+   { "marvell,armada-380-ahci", _win_ahci_setup, 
_win_sata_dump },
{ "mrvl,sata", _win_sata_setup, NULL },
{ "mrvl,xor", _win_xor_setup, _win_xor_dump },
{ "mrvl,idma", _win_idma_setup, _win_idma_dump },
@@ -660,6 +663,11 @@ WIN_REG_BASE_IDX_RD(win_sata, cr, MV_WIN
 WIN_REG_BASE_IDX_RD(win_sata, br, MV_WIN_SATA_BASE);
 WIN_REG_BASE_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL);
 WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN_SATA_BASE);
+#if defined(SOC_MV_ARMADA38X)
+WIN_REG_BASE_IDX_RD(win_sata, sz, MV_WIN_SATA_SIZE);
+WIN_REG_BASE_IDX_WR(win_sata, sz, MV_WIN_SATA_SIZE);
+#endif
+
 #ifndef SOC_MV_DOVE
 WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE)
 WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE)
@@ -1999,6 +2007,55 @@ decode_win_sata_setup(u_long base)
}
 }
 
+static void
+decode_win_ahci_setup(u_long base)
+{
+   uint32_t br, cr, sz;
+   int i, j;
+
+   for (i = 0; i < MV_WIN_SATA_MAX; i++) {
+   win_sata_cr_write(base, i, 0);
+   win_sata_br_write(base, i, 0);
+   win_sata_sz_write(base, i, 0);
+   }
+
+   for (i = 0; i < MV_WIN_DDR_MAX; i++) {
+   if (ddr_is_active(i)) {
+   cr = (ddr_attr(i) << IO_WIN_ATTR_SHIFT) |
+   (ddr_target(i) << IO_WIN_TGT_SHIFT) |
+   IO_WIN_ENA_MASK;
+   br = ddr_base(i);
+   sz = (ddr_size(i) - 1) &
+   (IO_WIN_SIZE_MASK << IO_WIN_SIZE_SHIFT);
+
+   /* Use first available SATA window */
+   for (j = 0; j < MV_WIN_SATA_MAX; j++) {
+   if (win_sata_cr_read(base, j) & IO_WIN_ENA_MASK)
+   continue;
+
+   /* BASE is set to DRAM base (0x) */
+   win_sata_br_write(base, j, br);
+   /* CTRL targets DRAM ctrl with 0x0E or 0x0D */
+   win_sata_cr_write(base, j, cr);
+   /* SIZE is set to 16MB - max value */
+   win_sata_sz_write(base, j, sz);
+   break;
+   }
+   }
+   }
+}
+
+static void
+decode_win_sata_dump(u_long base)
+{
+   int i;
+
+   for (i = 0; i < MV_WIN_SATA_MAX; i++)
+   printf("SATA window#%d: cr 0x%08x, br 0x%08x, sz 0x%08x\n", i,
+   win_sata_cr_read(base, i), win_sata_br_read(base, i),
+   win_sata_sz_read(base,i));
+}
+
 static int
 decode_win_sata_valid(void)
 {

Modified: head/sys/arm/mv/mvwin.h
==
--- head/sys/arm/mv/mvwin.h Wed Jan 25 10:29:46 2017(r312746)
+++ head/sys/arm/mv/mvwin.h Wed Jan 25 10:31:16 2017(r312747)
@@ -324,9 +324,16 @@
 #define MV_PCIE_CONTROL(0x1a00)
 #define MV_PCIE_ROOT_CMPLX (1 << 1)
 
+#if defined(SOC_MV_ARMADA38X)
+#defineMV_WIN_SATA_CTRL(n) (0x10 * (n) + 0x60)
+#defineMV_WIN_SATA_BASE(n) (0x10 * (n) + 0x64)
+#define 

svn commit: r312746 - head/sys/arm/mv

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:29:46 2017
New Revision: 312746
URL: https://svnweb.freebsd.org/changeset/base/312746

Log:
  Fix node detection for MBUS windows configuration
  
  Configure decoding windows only for devices with
  enabled nodes in FDT.
  
  Submitted by:  Konrad Adamczyk 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   zbb
  Differential revision: https://reviews.freebsd.org/D9219

Modified:
  head/sys/arm/mv/mv_common.c

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Wed Jan 25 10:28:21 2017(r312745)
+++ head/sys/arm/mv/mv_common.c Wed Jan 25 10:29:46 2017(r312746)
@@ -2172,6 +2172,10 @@ fdt_win_setup(void)
 
soc_node = _nodes[i];
 
+   /* Setup only for enabled devices */
+   if (ofw_bus_node_status_okay(child) == 0)
+   continue;
+
if (!ofw_bus_node_is_compatible(child,soc_node->compat))
continue;
 
___
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: r312745 - head/sys/dev/ofw

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:28:21 2017
New Revision: 312745
URL: https://svnweb.freebsd.org/changeset/base/312745

Log:
  Expand OpenFirmware API with ofw_bus_node_status_okay
   method
  
  Method could be used before we can access device_t structure.
  As per simple phandle_t handle we can access FDT to check
  if specified node has been enabled.
  It will be used in Marvell's common configuration code.
  
  Submitted by:  Konrad Adamczyk 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   zbb, meloun-miracle-cz
  Differential revision: https://reviews.freebsd.org/D9218

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Wed Jan 25 10:25:59 2017
(r312744)
+++ head/sys/dev/ofw/ofw_bus_subr.c Wed Jan 25 10:28:21 2017
(r312745)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include "ofw_bus_if.h"
 
 #defineOFW_COMPAT_LEN  255
+#defineOFW_STATUS_LEN  16
 
 int
 ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *obd, phandle_t node)
@@ -179,6 +180,24 @@ ofw_bus_status_okay(device_t dev)
return (0);
 }
 
+int
+ofw_bus_node_status_okay(phandle_t node)
+{
+   char status[OFW_STATUS_LEN];
+   int len;
+
+   len = OF_getproplen(node, "status");
+   if (len <= 0)
+   return (1);
+
+   OF_getprop(node, "status", status, OFW_STATUS_LEN);
+   if ((len == 5 && (bcmp(status, "okay", len) == 0)) ||
+   (len == 3 && (bcmp(status, "ok", len
+   return (1);
+
+   return (0);
+}
+
 static int
 ofw_bus_node_is_compatible_int(const char *compat, int len,
 const char *onecompat)

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==
--- head/sys/dev/ofw/ofw_bus_subr.h Wed Jan 25 10:25:59 2017
(r312744)
+++ head/sys/dev/ofw/ofw_bus_subr.h Wed Jan 25 10:28:21 2017
(r312745)
@@ -100,6 +100,7 @@ int ofw_bus_intr_by_rid(device_t, phandl
 /* Helper to get device status property */
 const char *ofw_bus_get_status(device_t dev);
 int ofw_bus_status_okay(device_t dev);
+int ofw_bus_node_status_okay(phandle_t node);
 
 /* Helper to get node's interrupt parent */
 phandle_t ofw_bus_find_iparent(phandle_t);
___
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: r312744 - head/sys/dev/cesa

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:25:59 2017
New Revision: 312744
URL: https://svnweb.freebsd.org/changeset/base/312744

Log:
  Fix SHA256 usage on older CESA versions
  
  Adding SHA256 support to Marvell crypto driver resulted in regression
  for older SoC's, not capable of handling this mode in hardware.
  
  Submitted by:  Emeric Poupon 
  Obtained from: Stormshield
  Sponsored by:  Stormshield
  Reviewed by:   zbb
  Differential revision: https://reviews.freebsd.org/D9215

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

Modified: head/sys/dev/cesa/cesa.c
==
--- head/sys/dev/cesa/cesa.cWed Jan 25 10:22:07 2017(r312743)
+++ head/sys/dev/cesa/cesa.cWed Jan 25 10:25:59 2017(r312744)
@@ -1242,7 +1242,10 @@ cesa_attach(device_t dev)
crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
-   crypto_register(sc->sc_cid, CRYPTO_SHA2_256_HMAC, 0, 0);
+   if (sc->sc_soc_id == MV_DEV_88F6828 ||
+   sc->sc_soc_id == MV_DEV_88F6820 ||
+   sc->sc_soc_id == MV_DEV_88F6810)
+   crypto_register(sc->sc_cid, CRYPTO_SHA2_256_HMAC, 0, 0);
 
return (0);
 err8:
___
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: r312743 - head/sys/dev/cesa

2017-01-25 Thread Wojciech Macek
Author: wma
Date: Wed Jan 25 10:22:07 2017
New Revision: 312743
URL: https://svnweb.freebsd.org/changeset/base/312743

Log:
  Use SoC ID - based detection in CESA
  
  This commit introduces following changes in order to get rid of
  ifdef's from all around the driver.
  * Introduce sc_soc_id field in cesa_softc structure - this value is
obtained in cesa_attach() anyway, so make use of it.
  * Replace ifdefs with SoC ID checks.
  * Perform PM control status only for relevant SoC's.
  
  Submitted by:  Marcin Wojtas 
  Obtained from: Semihalf
  Sponsored by:  Stormshield
  Reviewed by:   zbb
  Differential revision: https://reviews.freebsd.org/D9247

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

Modified: head/sys/dev/cesa/cesa.c
==
--- head/sys/dev/cesa/cesa.cWed Jan 25 07:51:53 2017(r312742)
+++ head/sys/dev/cesa/cesa.cWed Jan 25 10:22:07 2017(r312743)
@@ -953,11 +953,13 @@ cesa_execute(struct cesa_softc *sc)
ctd = STAILQ_FIRST(>cr_tdesc);
 
CESA_TDMA_WRITE(sc, CESA_TDMA_ND, ctd->ctd_cthd_paddr);
-#if defined (SOC_MV_ARMADA38X)
-   CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE | CESA_SA_CMD_SHA2);
-#else
-   CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE);
-#endif
+
+   if (sc->sc_soc_id == MV_DEV_88F6828 ||
+   sc->sc_soc_id == MV_DEV_88F6820 ||
+   sc->sc_soc_id == MV_DEV_88F6810)
+   CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE | 
CESA_SA_CMD_SHA2);
+   else
+   CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE);
 
CESA_UNLOCK(sc, requests);
 }
@@ -968,6 +970,7 @@ cesa_setup_sram(struct cesa_softc *sc)
phandle_t sram_node;
ihandle_t sram_ihandle;
pcell_t sram_handle, sram_reg[2];
+   void *sram_va;
int rv;
 
rv = OF_getencprop(ofw_bus_get_node(sc->sc_dev), "sram-handle",
@@ -986,15 +989,17 @@ cesa_setup_sram(struct cesa_softc *sc)
/* Store SRAM size to be able to unmap in detach() */
sc->sc_sram_size = sram_reg[1];
 
-#if defined(SOC_MV_ARMADA38X)
-   void *sram_va;
+   if (sc->sc_soc_id != MV_DEV_88F6828 &&
+   sc->sc_soc_id != MV_DEV_88F6820 &&
+   sc->sc_soc_id != MV_DEV_88F6810)
+   return (0);
 
/* SRAM memory was not mapped in platform_sram_devmap(), map it now */
sram_va = pmap_mapdev(sc->sc_sram_base_pa, sc->sc_sram_size);
if (sram_va == NULL)
return (ENOMEM);
sc->sc_sram_base_va = (vm_offset_t)sram_va;
-#endif
+
return (0);
 }
 
@@ -1018,7 +1023,7 @@ static int
 cesa_attach(device_t dev)
 {
struct cesa_softc *sc;
-   uint32_t d, r;
+   uint32_t d, r, val;
int error;
int i;
 
@@ -1027,23 +1032,19 @@ cesa_attach(device_t dev)
sc->sc_error = 0;
sc->sc_dev = dev;
 
-   /* Check if CESA peripheral device has power turned on */
-#if defined(SOC_MV_KIRKWOOD)
-   if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) == CPU_PM_CTRL_CRYPTO) {
-   device_printf(dev, "not powered on\n");
-   return (ENXIO);
-   }
-#else
-   if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) != CPU_PM_CTRL_CRYPTO) {
-   device_printf(dev, "not powered on\n");
-   return (ENXIO);
-   }
-#endif
soc_id(, );
 
switch (d) {
case MV_DEV_88F6281:
case MV_DEV_88F6282:
+   /* Check if CESA peripheral device has power turned on */
+   if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) ==
+   CPU_PM_CTRL_CRYPTO) {
+   device_printf(dev, "not powered on\n");
+   return (ENXIO);
+   }
+   sc->sc_tperr = 0;
+   break;
case MV_DEV_88F6828:
case MV_DEV_88F6820:
case MV_DEV_88F6810:
@@ -1051,12 +1052,20 @@ cesa_attach(device_t dev)
break;
case MV_DEV_MV78100:
case MV_DEV_MV78100_Z0:
+   /* Check if CESA peripheral device has power turned on */
+   if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) !=
+   CPU_PM_CTRL_CRYPTO) {
+   device_printf(dev, "not powered on\n");
+   return (ENXIO);
+   }
sc->sc_tperr = CESA_ICR_TPERR;
break;
default:
return (ENXIO);
}
 
+   sc->sc_soc_id = d;
+
/* Initialize mutexes */
mtx_init(>sc_sc_lock, device_get_nameunit(dev),
"CESA Shared Data", MTX_DEF);
@@ -1191,12 +1200,15 @@ cesa_attach(device_t dev)
 * - Outstanding reads enabled,
 * - No byte-swap.
 */
-   CESA_TDMA_WRITE(sc, CESA_TDMA_CR, CESA_TDMA_CR_DBL128 |
-   CESA_TDMA_CR_SBL128 | CESA_TDMA_CR_ORDEN | CESA_TDMA_CR_NBS |
-#if