Re: svn commit: r281164 - head/sys/netpfil/pf
On 04/06/15 21:05, Kristof Provost wrote: Author: kp Date: Mon Apr 6 19:05:00 2015 New Revision: 281164 URL: https://svnweb.freebsd.org/changeset/base/281164 Log: pf: Skip firewall for refragmented ip6 packets In cases where we scrub (fragment reassemble) on both input and output we risk ending up in infinite loops when forwarding packets. Fragmented packets come in and get collected until we can defragment. At that point the defragmented packet is handed back to the ip stack (at the pfil point in ip6_input(). Normal processing continues. Eventually we figure out that the packet has to be forwarded and we end up at the pfil hook in ip6_forward(). After doing the inspection on the defragmented packet we see that the packet has been defragmented and because we're forwarding we have to refragment it. In pf_refragment6() we split the packet up again and then ip6_forward() the individual fragments. Those fragments hit the pfil hook on the way out, so they're collected until we can reconstruct the full packet, at which point we're right back where we left off and things continue until we run out of stack. Break that loop by marking the fragments generated by pf_refragment6() as M_SKIP_FIREWALL. There's no point in processing those packets in the firewall anyway. We've already filtered on the full packet. Differential Revision: https://reviews.freebsd.org/D2197 Reviewed by: glebius, gnn Approved by: gnn (mentor) Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c == --- head/sys/netpfil/pf/pf_norm.c Mon Apr 6 18:56:02 2015 (r281163) +++ head/sys/netpfil/pf/pf_norm.c Mon Apr 6 19:05:00 2015 (r281164) @@ -1152,6 +1152,7 @@ pf_refragment6(struct ifnet *ifp, struct for (t = m; m; m = t) { t = m-m_nextpkt; m-m_nextpkt = NULL; + m-m_flags |= M_SKIP_FIREWALL; memset(pd, 0, sizeof(pd)); pd.pf_mtag = pf_find_mtag(m); if (error == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org Hi, Is there any chance that this commit and your previous pf and inet6 related changes will get MFC'd to 10.1-STABLE. Is it safe or even possible to incorporate these changes myself? Kind regards, Hans ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281194 - stable/10/sys/kern
Author: kib Date: Tue Apr 7 07:08:35 2015 New Revision: 281194 URL: https://svnweb.freebsd.org/changeset/base/281194 Log: MFC r281071: Remove useless initialization. Modified: stable/10/sys/kern/sysv_shm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sysv_shm.c == --- stable/10/sys/kern/sysv_shm.c Tue Apr 7 06:25:29 2015 (r281193) +++ stable/10/sys/kern/sysv_shm.c Tue Apr 7 07:08:35 2015 (r281194) @@ -327,7 +327,7 @@ kern_shmat_locked(struct thread *td, int { struct proc *p = td-td_proc; struct shmid_kernel *shmseg; - struct shmmap_state *shmmap_s = NULL; + struct shmmap_state *shmmap_s; vm_offset_t attach_va; vm_prot_t prot; vm_size_t size; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281164 - head/sys/netpfil/pf
On 2015-04-07 08:33:17 (+0200), Hans Ottevanger h...@beastielabs.net wrote: On 04/06/15 21:05, Kristof Provost wrote: Author: kp Date: Mon Apr 6 19:05:00 2015 New Revision: 281164 URL: https://svnweb.freebsd.org/changeset/base/281164 Log: pf: Skip firewall for refragmented ip6 packets Is there any chance that this commit and your previous pf and inet6 related changes will get MFC'd to 10.1-STABLE. Is it safe or even possible to incorporate these changes myself? I have no immediate plans to MFC this. There's still a bit of work to be done and a little more testing as well before I'd be comfortable merging this back. For example, I still need to commit https://reviews.freebsd.org/D1815 (although that'll happen soon). I also think there's at least one other bug, but I'll need some more time to investigate that. That said, it is fairly straightforwards to merge these patches back to 10.1. I'm running two stable/10 systems with these patches and I've not seen any issues yet. Regards, Kristof ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281192 - head/sys/contrib/ipfilter/netinet
Author: glebius Date: Tue Apr 7 06:22:22 2015 New Revision: 281192 URL: https://svnweb.freebsd.org/changeset/base/281192 Log: In ipfilter(4) there is the ipftest(1) program, that compiles half of the ipfilter code as userland application. To reduce kernel structure knowledge include if_var.h only if a file is compiled with _KERNEL defined. In !_KERNEL case, provide our own definition of struct ifnet, that will satisfy ipftest(1). This was already done earlier to struct ifaddr in r279029. Protect the definition with _NET_IF_VAR_H_, since kernel part of ipfilter may include if_var.h and ip_compat.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h == --- head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Apr 7 06:17:34 2015(r281191) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Apr 7 06:22:22 2015(r281192) @@ -153,7 +153,8 @@ struct ether_addr { # include sys/rwlock.h # define KMUTEX_Tstruct mtx # define KRWLOCK_T struct rwlock -# ifdef _KERNEL + +#ifdef _KERNEL #defineREAD_ENTER(x) rw_rlock((x)-ipf_lk) #defineWRITE_ENTER(x) rw_wlock((x)-ipf_lk) #defineMUTEX_DOWNGRADE(x) rw_downgrade((x)-ipf_lk) @@ -165,16 +166,7 @@ struct ether_addr { else \ rw_runlock((x)-ipf_lk); \ } while (0) -# endif - # include net/if_var.h -# define IFNAME(x) ((struct ifnet *)x)-if_xname -# define COPYIFNAME(v, x, b) \ - (void) strncpy(b, \ - ((struct ifnet *)x)-if_xname, \ - LIFNAMSIZ) - -# ifdef _KERNEL # define GETKTIME(x) microtime((struct timeval *)x) # include netinet/in_systm.h @@ -216,8 +208,28 @@ struct ether_addr { # define M_DUP(m)m_dup(m, M_NOWAIT) # define IPF_PANIC(x,y) if (x) { printf y; panic(ipf_panic); } typedef struct mbuf mb_t; -# endif /* _KERNEL */ +#else /* !_KERNEL */ +#ifndef _NET_IF_VAR_H_ +/* + * Userland emulation of struct ifnet. + */ +struct route; +struct mbuf; +struct ifnet { + charif_xname[IFNAMSIZ]; + TAILQ_HEAD(, ifaddr)if_addrlist; + int (*if_output)(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); +}; +#endif /* _NET_IF_VAR_H_ */ +#endif /* _KERNEL */ + +# define IFNAME(x) ((struct ifnet *)x)-if_xname +# define COPYIFNAME(v, x, b) \ + (void) strncpy(b, \ + ((struct ifnet *)x)-if_xname, \ + LIFNAMSIZ) typedefu_long ioctlcmd_t; typedefstruct uio uio_t; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281195 - stable/10/sys/kern
Author: kib Date: Tue Apr 7 07:10:44 2015 New Revision: 281195 URL: https://svnweb.freebsd.org/changeset/base/281195 Log: MFC r281094: Restore proper error from oshmctl(2), broken by r280323. Modified: stable/10/sys/kern/sysv_shm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sysv_shm.c == --- stable/10/sys/kern/sysv_shm.c Tue Apr 7 07:08:35 2015 (r281194) +++ stable/10/sys/kern/sysv_shm.c Tue Apr 7 07:10:44 2015 (r281195) @@ -971,7 +971,7 @@ oshmctl(struct thread *td, struct oshmct shmseg = shm_find_segment(uap-shmid, true); if (shmseg == NULL) { SYSVSHM_UNLOCK(); - return (error); + return (EINVAL); } switch (uap-cmd) { case IPC_STAT: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281196 - head/sys/opencrypto
Author: jmg Date: Tue Apr 7 09:00:03 2015 New Revision: 281196 URL: https://svnweb.freebsd.org/changeset/base/281196 Log: add the define to properly guard this header.. Sponsored by: Netflix, Inc. Modified: head/sys/opencrypto/gmac.h Modified: head/sys/opencrypto/gmac.h == --- head/sys/opencrypto/gmac.h Tue Apr 7 07:10:44 2015(r281195) +++ head/sys/opencrypto/gmac.h Tue Apr 7 09:00:03 2015(r281196) @@ -31,6 +31,7 @@ */ #ifndef _GMAC_H_ +#define _GMAC_H_ #include gfmult.h #include crypto/rijndael/rijndael.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281197 - in head: lib/libc lib/libc/aarch64 lib/libc/aarch64/gen lib/libc/aarch64/sys lib/libc/gen lib/libc/xdr lib/libstand share/mk
Author: andrew Date: Tue Apr 7 09:52:14 2015 New Revision: 281197 URL: https://svnweb.freebsd.org/changeset/base/281197 Log: Add the start of libc and libstand for arm64. Not all of the machine dependent functions have been implemented, but this is enough for world. Differential Revision:https://reviews.freebsd.org/D2132 Reviewed by: emaste Sponsored by: The FreeBSD Foundation Added: head/lib/libc/aarch64/SYS.h (contents, props changed) head/lib/libc/aarch64/Symbol.map (contents, props changed) head/lib/libc/aarch64/_fpmath.h (contents, props changed) head/lib/libc/aarch64/arith.h (contents, props changed) head/lib/libc/aarch64/gd_qnan.h (contents, props changed) head/lib/libc/aarch64/gen/ head/lib/libc/aarch64/gen/Makefile.inc (contents, props changed) head/lib/libc/aarch64/gen/_set_tp.c (contents, props changed) head/lib/libc/aarch64/gen/_setjmp.S (contents, props changed) head/lib/libc/aarch64/gen/flt_rounds.c (contents, props changed) head/lib/libc/aarch64/gen/setjmp.S (contents, props changed) head/lib/libc/aarch64/gen/sigsetjmp.S (contents, props changed) head/lib/libc/aarch64/sys/ head/lib/libc/aarch64/sys/Makefile.inc (contents, props changed) head/lib/libc/aarch64/sys/brk.S (contents, props changed) head/lib/libc/aarch64/sys/cerror.S (contents, props changed) head/lib/libc/aarch64/sys/pipe.S (contents, props changed) head/lib/libc/aarch64/sys/sbrk.S (contents, props changed) head/lib/libc/aarch64/sys/shmat.S (contents, props changed) head/lib/libc/aarch64/sys/sigreturn.S (contents, props changed) head/lib/libc/aarch64/sys/syscall.S (contents, props changed) head/lib/libc/aarch64/sys/vfork.S (contents, props changed) Modified: head/lib/libc/Makefile head/lib/libc/aarch64/Makefile.inc head/lib/libc/gen/tls.c head/lib/libc/xdr/xdr_float.c head/lib/libstand/Makefile head/share/mk/src.opts.mk Modified: head/lib/libc/Makefile == --- head/lib/libc/Makefile Tue Apr 7 09:00:03 2015(r281196) +++ head/lib/libc/Makefile Tue Apr 7 09:52:14 2015(r281197) @@ -79,7 +79,8 @@ NOASM= .include ${LIBC_SRCTOP}/net/Makefile.inc .include ${LIBC_SRCTOP}/nls/Makefile.inc .include ${LIBC_SRCTOP}/posix1e/Makefile.inc -.if ${LIBC_ARCH} != amd64 \ +.if ${LIBC_ARCH} != aarch64 \ +${LIBC_ARCH} != amd64 \ ${LIBC_ARCH} != powerpc64 \ ${LIBC_ARCH} != sparc64 \ ${MACHINE_ARCH:Mmipsn32*} == \ Modified: head/lib/libc/aarch64/Makefile.inc == --- head/lib/libc/aarch64/Makefile.inc Tue Apr 7 09:00:03 2015 (r281196) +++ head/lib/libc/aarch64/Makefile.inc Tue Apr 7 09:52:14 2015 (r281197) @@ -3,3 +3,7 @@ # Machine dependent definitions for the arm 64-bit architecture. # +# Long double is quad precision +GDTOASRCS+=strtorQ.c +MDSRCS+=machdep_ldisQ.c +SYM_MAPS+=${LIBC_SRCTOP}/aarch64/Symbol.map Added: head/lib/libc/aarch64/SYS.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/aarch64/SYS.h Tue Apr 7 09:52:14 2015(r281197) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. + * + * 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. + * + * $FreeBSD$ + */ + +#include sys/syscall.h +#include machine/asm.h + +#define_SYSCALL(name)
svn commit: r281198 - in head/sys/netgraph/bluetooth: hci include l2cap socket
Author: takawata Date: Tue Apr 7 10:22:56 2015 New Revision: 281198 URL: https://svnweb.freebsd.org/changeset/base/281198 Log: Initial Bluetooth LE support. Note that sockaddr_l2cap structure is changed , check socket address to initialize new structure member and define L2CAP_SOCKET_CHECKED before including ng_btsocket.h Differential Revision:https://reviews.freebsd.org/D2021 Reviewed by:emax Modified: head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c head/sys/netgraph/bluetooth/hci/ng_hci_main.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.h head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c head/sys/netgraph/bluetooth/hci/ng_hci_var.h head/sys/netgraph/bluetooth/include/ng_btsocket.h head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h head/sys/netgraph/bluetooth/include/ng_hci.h head/sys/netgraph/bluetooth/include/ng_l2cap.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Modified: head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c == --- head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Tue Apr 7 09:52:14 2015(r281197) +++ head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Tue Apr 7 10:22:56 2015(r281198) @@ -71,11 +71,15 @@ static int process_status_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *); static int process_testing_params (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *); +static int process_le_params + (ng_hci_unit_p, u_int16_t, struct mbuf *, struct mbuf *); static int process_link_control_status (ng_hci_unit_p, ng_hci_command_status_ep *, struct mbuf *); static int process_link_policy_status (ng_hci_unit_p, ng_hci_command_status_ep *, struct mbuf *); +static int process_le_status + (ng_hci_unit_p, ng_hci_command_status_ep *, struct mbuf *); /* * Send HCI command to the driver. @@ -222,7 +226,10 @@ ng_hci_process_command_complete(ng_hci_u error = process_testing_params(unit, NG_HCI_OCF(ep-opcode), cp, e); break; - + case NG_HCI_OGF_LE: + error = process_le_params(unit, + NG_HCI_OCF(ep-opcode), cp, e); + break; case NG_HCI_OGF_BT_LOGO: case NG_HCI_OGF_VENDOR: NG_FREE_M(cp); @@ -294,7 +301,9 @@ ng_hci_process_command_status(ng_hci_uni case NG_HCI_OGF_LINK_POLICY: error = process_link_policy_status(unit, ep, cp); break; - + case NG_HCI_OGF_LE: + error = process_le_status(unit, ep, cp); + break; case NG_HCI_OGF_BT_LOGO: case NG_HCI_OGF_VENDOR: NG_FREE_M(cp); @@ -604,6 +613,8 @@ process_hc_baseband_params(ng_hci_unit_p case NG_HCI_OCF_READ_LOCAL_NAME: case NG_HCI_OCF_READ_UNIT_CLASS: case NG_HCI_OCF_WRITE_UNIT_CLASS: + case NG_HCI_OCF_READ_LE_HOST_SUPPORTED: + case NG_HCI_OCF_WRITE_LE_HOST_SUPPORTED: /* These do not need post processing */ break; @@ -796,6 +807,132 @@ process_testing_params(ng_hci_unit_p uni return (error); } /* process_testing_params */ +/* + * Process LE command return parameters + */ + +static int +process_le_params(ng_hci_unit_p unit, u_int16_t ocf, + struct mbuf *mcp, struct mbuf *mrp) +{ + int error = 0; + + switch (ocf){ + case NG_HCI_OCF_LE_SET_EVENT_MASK: + case NG_HCI_OCF_LE_READ_BUFFER_SIZE: + case NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES: + case NG_HCI_OCF_LE_SET_RANDOM_ADDRESS: + case NG_HCI_OCF_LE_SET_ADVERTISING_PARAMETERS: + case NG_HCI_OCF_LE_READ_ADVERTISING_CHANNEL_TX_POWER: + case NG_HCI_OCF_LE_SET_ADVERTISING_DATA: + case NG_HCI_OCF_LE_SET_SCAN_RESPONSE_DATA: + case NG_HCI_OCF_LE_SET_ADVERTISE_ENABLE: + case NG_HCI_OCF_LE_SET_SCAN_PARAMETERS: + case NG_HCI_OCF_LE_SET_SCAN_ENABLE: + case NG_HCI_OCF_LE_CREATE_CONNECTION_CANCEL: + case NG_HCI_OCF_LE_CLEAR_WHITE_LIST: + case NG_HCI_OCF_LE_READ_WHITE_LIST_SIZE: + case
svn commit: r281199 - in head: sys/rpc usr.sbin/nfsd
Author: mav Date: Tue Apr 7 10:25:27 2015 New Revision: 281199 URL: https://svnweb.freebsd.org/changeset/base/281199 Log: Remove hard limits on number of accepting NFS connections. Limits of 5 connections set long ago creates problems for SPEC benchmark. Make the NFS follow system-wide maximum. MFC after:1 week Modified: head/sys/rpc/svc_generic.c head/sys/rpc/svc_vc.c head/usr.sbin/nfsd/nfsd.c Modified: head/sys/rpc/svc_generic.c == --- head/sys/rpc/svc_generic.c Tue Apr 7 10:22:56 2015(r281198) +++ head/sys/rpc/svc_generic.c Tue Apr 7 10:25:27 2015(r281199) @@ -168,7 +168,7 @@ svc_tp_create( taddr = uaddr2taddr(nconf, uaddr); bind.addr = *taddr; free(taddr, M_RPC); - bind.qlen = SOMAXCONN; + bind.qlen = -1; xprt = svc_tli_create(pool, NULL, nconf, bind, 0, 0); free(bind.addr.buf, M_RPC); } else { @@ -256,7 +256,7 @@ svc_tli_create( goto freedata; } } - solisten(so, SOMAXCONN, curthread); + solisten(so, -1, curthread); } else { if (bindresvport(so, (struct sockaddr *)bindaddr-addr.buf)) { Modified: head/sys/rpc/svc_vc.c == --- head/sys/rpc/svc_vc.c Tue Apr 7 10:22:56 2015(r281198) +++ head/sys/rpc/svc_vc.c Tue Apr 7 10:25:27 2015(r281199) @@ -177,7 +177,7 @@ svc_vc_create(SVCPOOL *pool, struct sock xprt_register(xprt); - solisten(so, SOMAXCONN, curthread); + solisten(so, -1, curthread); SOCKBUF_LOCK(so-so_rcv); xprt-xp_upcallset = 1; Modified: head/usr.sbin/nfsd/nfsd.c == --- head/usr.sbin/nfsd/nfsd.c Tue Apr 7 10:22:56 2015(r281198) +++ head/usr.sbin/nfsd/nfsd.c Tue Apr 7 10:25:27 2015(r281199) @@ -626,7 +626,7 @@ main(int argc, char **argv) bindhost[i]); nfsd_exit(1); } - if (listen(tcpsock, 5) 0) { + if (listen(tcpsock, -1) 0) { syslog(LOG_ERR, listen failed); nfsd_exit(1); } @@ -701,7 +701,7 @@ main(int argc, char **argv) bindhost[i]); nfsd_exit(1); } - if (listen(tcp6sock, 5) 0) { + if (listen(tcp6sock, -1) 0) { syslog(LOG_ERR, listen failed); nfsd_exit(1); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281198 - in head/sys/netgraph/bluetooth: hci include l2cap socket
On 07 Apr 2015, at 10:22 , Takanori Watanabe takaw...@freebsd.org wrote: Author: takawata Date: Tue Apr 7 10:22:56 2015 New Revision: 281198 URL: https://svnweb.freebsd.org/changeset/base/281198 Log: Initial Bluetooth LE support. Note that sockaddr_l2cap structure is changed , check socket address to initialize new structure member and define L2CAP_SOCKET_CHECKED before including ng_btsocket.h Differential Revision:https://reviews.freebsd.org/D2021 Reviewed by:emax I see a lot of: /scratch/tmp/bz/head.svn/lib/libbluetooth/../../sys/netgraph/bluetooth/include/ng_btsocket.h:246:2: error: #warning Make sure new member of socket address initialized when trying to build kernels. Is this expected? Modified: head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c head/sys/netgraph/bluetooth/hci/ng_hci_main.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.h head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c head/sys/netgraph/bluetooth/hci/ng_hci_var.h head/sys/netgraph/bluetooth/include/ng_btsocket.h head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h head/sys/netgraph/bluetooth/include/ng_hci.h head/sys/netgraph/bluetooth/include/ng_l2cap.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c — Bjoern A. Zeeb Charles Haddon Spurgeon: Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281200 - head/sys/dev/uart
Author: andrew Date: Tue Apr 7 12:42:06 2015 New Revision: 281200 URL: https://svnweb.freebsd.org/changeset/base/281200 Log: Fix uart_fdt_get_clock. It should have beed using the cell variable passed in, not value on the stack. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c == --- head/sys/dev/uart/uart_bus_fdt.cTue Apr 7 10:25:27 2015 (r281199) +++ head/sys/dev/uart/uart_bus_fdt.cTue Apr 7 12:42:06 2015 (r281200) @@ -66,19 +66,16 @@ static driver_t uart_fdt_driver = { int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { - pcell_t clock; /* clock-frequency is a FreeBSD-only extention. */ - if ((OF_getencprop(node, clock-frequency, clock, - sizeof(clock))) = 0) - clock = 0; - - if (clock == 0) + if ((OF_getencprop(node, clock-frequency, cell, + sizeof(*cell))) = 0) { /* Try to retrieve parent 'bus-frequency' */ /* XXX this should go to simple-bus fixup or so */ - if ((OF_getencprop(OF_parent(node), bus-frequency, clock, - sizeof(clock))) = 0) - clock = 0; + if ((OF_getencprop(OF_parent(node), bus-frequency, cell, + sizeof(*cell))) = 0) + *cell = 0; + } return (0); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281178 - head/sys/boot/forth
On Mon, 2015-04-06 at 18:42 -0700, Devin Teske wrote: On Apr 6, 2015, at 6:34 PM, Alexey Dokuchaev da...@freebsd.org wrote: On Mon, Apr 06, 2015 at 11:16:04PM +, Devin Teske wrote: New Revision: 281178 URL: https://svnweb.freebsd.org/changeset/base/281178 Log: Partially revert r280975: Back to previous mode-endings based on feedback Reported by: lattera $ finger latt...@freebsd.org [freebsd.org] Trying 8.8.178.110... finger: lattera: no such user ./danfe Yeah, realized the person was in #bsdcode (vs other) after commit. — Devin lattera = Shawn Webb from HardenedBSD = me ;) Thanks, Shawn signature.asc Description: This is a digitally signed message part
svn commit: r281201 - head/sys/arm64/include
Author: andrew Date: Tue Apr 7 13:17:28 2015 New Revision: 281201 URL: https://svnweb.freebsd.org/changeset/base/281201 Log: We will have fueword on arm64, mark as such in machine/param.h. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/param.h Modified: head/sys/arm64/include/param.h == --- head/sys/arm64/include/param.h Tue Apr 7 12:42:06 2015 (r281200) +++ head/sys/arm64/include/param.h Tue Apr 7 13:17:28 2015 (r281201) @@ -118,8 +118,4 @@ #definepgtok(x)((unsigned long)(x) * (PAGE_SIZE / 1024)) -#ifdef _KERNEL -#defineNO_FUEWORD 1 -#endif - #endif /* !_MACHINE_PARAM_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281204 - head/sys/dev/uart
Author: andrew Date: Tue Apr 7 15:12:03 2015 New Revision: 281204 URL: https://svnweb.freebsd.org/changeset/base/281204 Log: Get the fdt uart driver working on arm64, there is no machine/fdt.h, and the default shift should be 2 for the SoCs we support. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c == --- head/sys/dev/uart/uart_bus_fdt.cTue Apr 7 14:47:27 2015 (r281203) +++ head/sys/dev/uart/uart_bus_fdt.cTue Apr 7 15:12:03 2015 (r281204) @@ -83,10 +83,16 @@ uart_fdt_get_clock(phandle_t node, pcell int uart_fdt_get_shift(phandle_t node, pcell_t *cell) { +#ifdef __aarch64__ +#define DEFAULT_SHIFT 2 +#else +#define DEFAULT_SHIFT 0 +#endif if ((OF_getencprop(node, reg-shift, cell, sizeof(*cell))) = 0) - *cell = 0; + *cell = DEFAULT_SHIFT; return (0); +#undef DEFAULT_SHIFT } static uintptr_t Modified: head/sys/dev/uart/uart_cpu_fdt.c == --- head/sys/dev/uart/uart_cpu_fdt.cTue Apr 7 14:47:27 2015 (r281203) +++ head/sys/dev/uart/uart_cpu_fdt.cTue Apr 7 15:12:03 2015 (r281204) @@ -42,7 +42,9 @@ __FBSDID($FreeBSD$); #include vm/pmap.h #include machine/bus.h +#ifndef __aarch64__ #include machine/fdt.h +#endif #include dev/fdt/fdt_common.h #include dev/ofw/ofw_bus.h @@ -52,6 +54,10 @@ __FBSDID($FreeBSD$); #include dev/uart/uart_cpu.h #include dev/uart/uart_cpu_fdt.h +#ifdef __aarch64__ +extern bus_space_tag_t fdtbus_bs_tag; +#endif + /* * UART console routines. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281203 - head/sys/sys
Author: pfg Date: Tue Apr 7 14:47:27 2015 New Revision: 281203 URL: https://svnweb.freebsd.org/changeset/base/281203 Log: Make use of allocation attributes in system headers. Start using 'alloc_size' attribute in the allocator functions. This is useful as it helps the compiler generate warnings on suspicious code and can also enable some small optimizations. This is based on r281130, which brought similar enhnacements to the standard libc headers. Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h == --- head/sys/sys/malloc.h Tue Apr 7 14:33:03 2015(r281202) +++ head/sys/sys/malloc.h Tue Apr 7 14:47:27 2015(r281203) @@ -173,9 +173,11 @@ typedef void malloc_type_list_func_t(str void contigfree(void *addr, unsigned long size, struct malloc_type *type); void *contigmalloc(unsigned long size, struct malloc_type *type, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, - vm_paddr_t boundary) __malloc_like; + vm_paddr_t boundary) __malloc_like __result_use_check + __alloc_size(1); void free(void *addr, struct malloc_type *type); -void *malloc(unsigned long size, struct malloc_type *type, int flags) __malloc_like; +void *malloc(unsigned long size, struct malloc_type *type, int flags) + __malloc_like __result_use_check __alloc_size(1); void malloc_init(void *); intmalloc_last_fail(void); void malloc_type_allocated(struct malloc_type *type, unsigned long size); @@ -183,9 +185,9 @@ voidmalloc_type_freed(struct malloc_typ void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); void *realloc(void *addr, unsigned long size, struct malloc_type *type, - int flags); + int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, unsigned long size, struct malloc_type *type, - int flags); + int flags) __alloc_size(2); struct malloc_type *malloc_desc2type(const char *desc); #endif /* _KERNEL */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281181 - head/usr.bin/sort
On 04/06/15 23:26, Eitan Adler wrote: On 6 April 2015 at 21:17, Pedro F. Giffuni p...@freebsd.org wrote: Author: pfg Date: Tue Apr 7 01:17:29 2015 New Revision: 281181 URL: https://svnweb.freebsd.org/changeset/base/281181 Log: sort(1): Cleanups and a small memory leak. Remove useless check for leading blanks in the month name. The code didn't adjust len after stripping blanks so even if a month *did* start with a blank we'd end up copying garbage at the end. Also convert a malloc + memcpy to strdup and fix a memory leak in the wide char version if mbstowcs() fails. Originally from Andre Smagin. Obtained from: OpenBSD (CVS rev. 1.2, 1.3) MFC after:1 week Thanks for porting all these cleanups! I am not over, but they have started doing many unnecessary changes that I have no interest in. I am also wondering if we should give up the GNU behavior our sort(1) adopted. Pedro. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281202 - head/usr.bin/sockstat
Author: tuexen Date: Tue Apr 7 14:33:03 2015 New Revision: 281202 URL: https://svnweb.freebsd.org/changeset/base/281202 Log: The code says or, not either or. So fix the documentation. MFC after: 1 week Modified: head/usr.bin/sockstat/sockstat.1 Modified: head/usr.bin/sockstat/sockstat.1 == --- head/usr.bin/sockstat/sockstat.1Tue Apr 7 13:17:28 2015 (r281201) +++ head/usr.bin/sockstat/sockstat.1Tue Apr 7 14:33:03 2015 (r281202) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd May 16, 2012 +.Dd April 7, 2015 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -69,7 +69,7 @@ or do not contain the IPv6 loopback addr .It Fl l Show listening sockets. .It Fl p Ar ports -Only show Internet sockets if either the local or foreign port number +Only show Internet sockets if the local or foreign port number is on the specified list. The .Ar ports ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281205 - stable/10/share/man/man4
Author: brueffer Date: Tue Apr 7 15:24:37 2015 New Revision: 281205 URL: https://svnweb.freebsd.org/changeset/base/281205 Log: MFH: r280765 Mention support for 16h family processors, added in r263169. PR: 198933 Submitted by: i...@kapsi.fi Modified: stable/10/share/man/man4/amdtemp.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/amdtemp.4 == --- stable/10/share/man/man4/amdtemp.4 Tue Apr 7 15:12:03 2015 (r281204) +++ stable/10/share/man/man4/amdtemp.4 Tue Apr 7 15:24:37 2015 (r281205) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 23, 2012 +.Dd March 27, 2015 .Dt AMDTEMP 4 .Os .Sh NAME @@ -53,7 +53,7 @@ The driver provides support for the on-die digital thermal sensor present in .Tn AMD -Family 0Fh, 10h, 11h, 12h, 14h, and 15h processors. +Family 0Fh, 10h, 11h, 12h, 14h, 15h, and 16h processors. .Pp For Family 0Fh processors, the .Nm @@ -64,7 +64,7 @@ The driver also creates in the corresponding CPU device's sysctl tree, displaying the maximum temperature of the two sensors located in each CPU core. .Pp -For Family 10h, 11h, 12h, 14h, and 15h processors, the driver reports each +For Family 10h, 11h, 12h, 14h, 15h and 16h processors, the driver reports each package's temperature through a sysctl node, named .Va dev.amdtemp.%d.core0.sensor0 . The driver also creates ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281209 - in head/usr.bin: jot lam rs
Author: allanjude (doc committer) Date: Tue Apr 7 15:56:08 2015 New Revision: 281209 URL: https://svnweb.freebsd.org/changeset/base/281209 Log: Fix missing AUTHOR section for jot(1), rs(1), and lam(1) PR: 196786 Differential Revision:https://reviews.freebsd.org/D2115 Submitted by: John A. Kunze (Author) Approved by: wblock (mentor) MFC after:1 week Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/jot/jot.1 head/usr.bin/lam/lam.1 head/usr.bin/rs/rs.1 Modified: head/usr.bin/jot/jot.1 == --- head/usr.bin/jot/jot.1 Tue Apr 7 15:34:34 2015(r281208) +++ head/usr.bin/jot/jot.1 Tue Apr 7 15:56:08 2015(r281209) @@ -28,7 +28,7 @@ .\@(#)jot.1 8.1 (Berkeley) 6/6/93 .\ $FreeBSD$ .\ -.Dd June 2, 2010 +.Dd April 7, 2015 .Dt JOT 1 .Os .Sh NAME @@ -324,3 +324,5 @@ The .Nm utility first appeared in .Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze Modified: head/usr.bin/lam/lam.1 == --- head/usr.bin/lam/lam.1 Tue Apr 7 15:34:34 2015(r281208) +++ head/usr.bin/lam/lam.1 Tue Apr 7 15:56:08 2015(r281209) @@ -28,7 +28,7 @@ .\@(#)lam.1 8.1 (Berkeley) 6/6/93 .\ $FreeBSD$ .\ -.Dd August 12, 2004 +.Dd April 7, 2015 .Dt LAM 1 .Os .Sh NAME @@ -136,6 +136,8 @@ The .Nm utility first appeared in .Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze .Sh BUGS The .Nm Modified: head/usr.bin/rs/rs.1 == --- head/usr.bin/rs/rs.1Tue Apr 7 15:34:34 2015(r281208) +++ head/usr.bin/rs/rs.1Tue Apr 7 15:56:08 2015(r281209) @@ -28,7 +28,7 @@ .\@(#)rs.18.2 (Berkeley) 12/30/93 .\ $FreeBSD$ .\ -.Dd February 25, 2011 +.Dd April 7, 2015 .Dt RS 1 .Os .Sh NAME @@ -222,6 +222,8 @@ The .Nm utility first appeared in .Bx 4.2 . +.Sh AUTHORS +.An John A. Kunze .Sh BUGS .Bl -item .It ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281210 - in head: lib/libbluetooth lib/libsdp usr.bin/bluetooth/bthost usr.bin/bluetooth/btsockstat usr.bin/bluetooth/rfcomm_sppd usr.sbin/bluetooth/bthidcontrol usr.sbin/bluetooth/bth...
Author: takawata Date: Tue Apr 7 16:48:23 2015 New Revision: 281210 URL: https://svnweb.freebsd.org/changeset/base/281210 Log: Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED This will fix build. Modified: head/lib/libbluetooth/bluetooth.c head/lib/libbluetooth/dev.c head/lib/libbluetooth/hci.c head/lib/libsdp/search.c head/lib/libsdp/service.c head/lib/libsdp/session.c head/lib/libsdp/util.c head/usr.bin/bluetooth/bthost/bthost.c head/usr.bin/bluetooth/btsockstat/btsockstat.c head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c head/usr.sbin/bluetooth/bthidcontrol/hid.c head/usr.sbin/bluetooth/bthidcontrol/sdp.c head/usr.sbin/bluetooth/bthidd/bthidd.c head/usr.sbin/bluetooth/bthidd/client.c head/usr.sbin/bluetooth/bthidd/hid.c head/usr.sbin/bluetooth/bthidd/kbd.c head/usr.sbin/bluetooth/bthidd/lexer.l head/usr.sbin/bluetooth/bthidd/parser.y head/usr.sbin/bluetooth/bthidd/server.c head/usr.sbin/bluetooth/bthidd/session.c head/usr.sbin/bluetooth/btpand/bnep.c head/usr.sbin/bluetooth/btpand/btpand.c head/usr.sbin/bluetooth/btpand/channel.c head/usr.sbin/bluetooth/btpand/client.c head/usr.sbin/bluetooth/btpand/event.c head/usr.sbin/bluetooth/btpand/packet.c head/usr.sbin/bluetooth/btpand/sdp.c head/usr.sbin/bluetooth/btpand/server.c head/usr.sbin/bluetooth/btpand/tap.c head/usr.sbin/bluetooth/hccontrol/hccontrol.c head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c head/usr.sbin/bluetooth/hccontrol/info.c head/usr.sbin/bluetooth/hccontrol/link_control.c head/usr.sbin/bluetooth/hccontrol/link_policy.c head/usr.sbin/bluetooth/hccontrol/node.c head/usr.sbin/bluetooth/hccontrol/util.c head/usr.sbin/bluetooth/hcsecd/hcsecd.c head/usr.sbin/bluetooth/hcsecd/parser.y head/usr.sbin/bluetooth/l2control/l2cap.c head/usr.sbin/bluetooth/l2control/l2control.c head/usr.sbin/bluetooth/l2ping/l2ping.c head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c head/usr.sbin/bluetooth/sdpcontrol/search.c head/usr.sbin/bluetooth/sdpd/bgd.c head/usr.sbin/bluetooth/sdpd/dun.c head/usr.sbin/bluetooth/sdpd/ftrn.c head/usr.sbin/bluetooth/sdpd/gn.c head/usr.sbin/bluetooth/sdpd/irmc.c head/usr.sbin/bluetooth/sdpd/irmc_command.c head/usr.sbin/bluetooth/sdpd/lan.c head/usr.sbin/bluetooth/sdpd/main.c head/usr.sbin/bluetooth/sdpd/nap.c head/usr.sbin/bluetooth/sdpd/opush.c head/usr.sbin/bluetooth/sdpd/panu.c head/usr.sbin/bluetooth/sdpd/profile.c head/usr.sbin/bluetooth/sdpd/provider.c head/usr.sbin/bluetooth/sdpd/sar.c head/usr.sbin/bluetooth/sdpd/scr.c head/usr.sbin/bluetooth/sdpd/sd.c head/usr.sbin/bluetooth/sdpd/server.c head/usr.sbin/bluetooth/sdpd/sp.c head/usr.sbin/bluetooth/sdpd/srr.c head/usr.sbin/bluetooth/sdpd/ssar.c head/usr.sbin/bluetooth/sdpd/ssr.c head/usr.sbin/bluetooth/sdpd/sur.c head/usr.sbin/bluetooth/sdpd/uuid.c Modified: head/lib/libbluetooth/bluetooth.c == --- head/lib/libbluetooth/bluetooth.c Tue Apr 7 15:56:08 2015 (r281209) +++ head/lib/libbluetooth/bluetooth.c Tue Apr 7 16:48:23 2015 (r281210) @@ -30,7 +30,7 @@ * $Id: bluetooth.c,v 1.3 2003/05/20 23:04:30 max Exp $ * $FreeBSD$ */ - +#define L2CAP_SOCKET_CHECKED #include bluetooth.h #include stdio.h #include stdlib.h Modified: head/lib/libbluetooth/dev.c == --- head/lib/libbluetooth/dev.c Tue Apr 7 15:56:08 2015(r281209) +++ head/lib/libbluetooth/dev.c Tue Apr 7 16:48:23 2015(r281210) @@ -30,6 +30,7 @@ * $FreeBSD$ */ +#define L2CAP_SOCKET_CHECKED #include bluetooth.h #include stdio.h #include string.h Modified: head/lib/libbluetooth/hci.c == --- head/lib/libbluetooth/hci.c Tue Apr 7 15:56:08 2015(r281209) +++ head/lib/libbluetooth/hci.c Tue Apr 7 16:48:23 2015(r281210) @@ -31,6 +31,7 @@ */ #include assert.h +#define L2CAP_SOCKET_CHECKED #include bluetooth.h #include inttypes.h #include stdio.h Modified: head/lib/libsdp/search.c == --- head/lib/libsdp/search.cTue Apr 7 15:56:08 2015(r281209) +++ head/lib/libsdp/search.cTue Apr 7 16:48:23 2015(r281210) @@ -32,6 +32,7 @@ #include sys/uio.h #include netinet/in.h #include arpa/inet.h +#define L2CAP_SOCKET_CHECKED #include bluetooth.h #include errno.h #include stdio.h Modified: head/lib/libsdp/service.c == --- head/lib/libsdp/service.c Tue Apr 7 15:56:08 2015(r281209) +++ head/lib/libsdp/service.c Tue Apr 7
Re: svn commit: r281024 - head/share/man/man4
Hans, 4 days ago I asked you to back this out, and my request was ignored. Can you please back this out now? Yes, it is an interesting stuff, but doesn't belong to the documentation. If you strongly disagree with me, I'd suggest to advocate Mike Silbersack, who is author of the code. If he agrees that additional information on covert channels is important, the text can be put back. On Fri, Apr 03, 2015 at 02:00:09PM +, Hans Petter Selasky wrote: H Author: hselasky H Date: Fri Apr 3 14:00:08 2015 H New Revision: 281024 H URL: https://svnweb.freebsd.org/changeset/base/281024 H H Log: H Add more documentation about the net.inet.ip.random_id sysctl knob H and how it can affect information flow between observers. H H MFC after: 1 week H H Modified: H head/share/man/man4/inet.4 H H Modified: head/share/man/man4/inet.4 H == H --- head/share/man/man4/inet.4 Fri Apr 3 13:57:14 2015 (r281023) H +++ head/share/man/man4/inet.4 Fri Apr 3 14:00:08 2015 (r281024) H @@ -28,7 +28,7 @@ H .\ From: @(#)inet.48.1 (Berkeley) 6/5/93 H .\ $FreeBSD$ H .\ H -.Dd April 2, 2015 H +.Dd April 3, 2015 H .Dt INET 4 H .Os H .Sh NAME H @@ -244,10 +244,22 @@ IP datagrams (or all IP datagrams, if H .Va ip.rfc6864 H is disabled) to be randomized instead of incremented by 1 with each packet H generated. H -This closes a minor information leak which allows remote observers to H +This prevents information exchange between any combination of two or H +more inside and/or outside observers using packet frequency H +modulation, PFM. H +An outside observer can ping the outside facing port at a fixed rate H +sampling the returned counter. H +An inside observer can ping the inside facing port sampling the same H +counter. H +Even though packets don't flow directly between any of the observers H +any single observer can influence the data rate the other observer(s) H +is or are sampling. H +This is done by sending more or less ping packets towards the gateway H +per measured interval. H +Setting this sysctl also prevents the remote and internal observers to H determine the rate of packet generation on the machine by watching the H counter. H -In the same time, on high-speed links, it can decrease the ID reuse H +At the same time, on high-speed links, it can decrease the ID reuse H cycle greatly. H Default is 0 (sequential IP IDs). H IPv6 flow IDs and fragment IDs are always random. H -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281198 - in head/sys/netgraph/bluetooth: hci include l2cap socket
On 07 Apr 2015, at 13:36, Bjoern A. Zeeb b...@freebsd.org wrote: On 07 Apr 2015, at 10:22 , Takanori Watanabe takaw...@freebsd.org wrote: Author: takawata Date: Tue Apr 7 10:22:56 2015 New Revision: 281198 URL: https://svnweb.freebsd.org/changeset/base/281198 Log: Initial Bluetooth LE support. Note that sockaddr_l2cap structure is changed , check socket address to initialize new structure member and define L2CAP_SOCKET_CHECKED before including ng_btsocket.h Differential Revision:https://reviews.freebsd.org/D2021 Reviewed by:emax I see a lot of: /scratch/tmp/bz/head.svn/lib/libbluetooth/../../sys/netgraph/bluetooth/include/ng_btsocket.h:246:2: error: #warning Make sure new member of socket address initialized I also do see at least two instances of it breaking the compilation: --- all_subdir_libbluetooth --- --- bluetooth.So --- In file included from /usr/home/tuexen/head/lib/libbluetooth/bluetooth.c:34: In file included from /usr/home/tuexen/head/lib/libbluetooth/bluetooth.h:49: /usr/home/tuexen/head/lib/libbluetooth/../../sys/netgraph/bluetooth/include/ng_btsocket.h:246:2: error: Make sure new member of socket address initialized [-Werror,-W#warnings] #warning Make sure new member of socket address initialized ^ 1 error generated. --- dev.So --- In file included from /usr/home/tuexen/head/lib/libbluetooth/dev.c:33: In file included from /usr/home/tuexen/head/lib/libbluetooth/bluetooth.h:49: /usr/home/tuexen/head/lib/libbluetooth/../../sys/netgraph/bluetooth/include/ng_btsocket.h:246:2: error: Make sure new member of socket address initialized [-Werror,-W#warnings] #warning Make sure new member of socket address initialized ^ 1 error generated. --- bluetooth.So --- *** [bluetooth.So] Error code 1 make[5]: stopped in /usr/home/tuexen/head/lib/libbluetooth Best regards Michael when trying to build kernels. Is this expected? Modified: head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c head/sys/netgraph/bluetooth/hci/ng_hci_main.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.h head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c head/sys/netgraph/bluetooth/hci/ng_hci_var.h head/sys/netgraph/bluetooth/include/ng_btsocket.h head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h head/sys/netgraph/bluetooth/include/ng_hci.h head/sys/netgraph/bluetooth/include/ng_l2cap.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c — Bjoern A. Zeeb Charles Haddon Spurgeon: Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281208 - stable/10/share/man/man4
Author: brueffer Date: Tue Apr 7 15:34:34 2015 New Revision: 281208 URL: https://svnweb.freebsd.org/changeset/base/281208 Log: MFH: r281206 Add a missing comma. Modified: stable/10/share/man/man4/amdtemp.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/amdtemp.4 == --- stable/10/share/man/man4/amdtemp.4 Tue Apr 7 15:32:43 2015 (r281207) +++ stable/10/share/man/man4/amdtemp.4 Tue Apr 7 15:34:34 2015 (r281208) @@ -64,7 +64,7 @@ The driver also creates in the corresponding CPU device's sysctl tree, displaying the maximum temperature of the two sensors located in each CPU core. .Pp -For Family 10h, 11h, 12h, 14h, 15h and 16h processors, the driver reports each +For Family 10h, 11h, 12h, 14h, 15h, and 16h processors, the driver reports each package's temperature through a sysctl node, named .Va dev.amdtemp.%d.core0.sensor0 . The driver also creates ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281211 - in stable/10/sys/dev/cxgbe: . tom
Author: np Date: Tue Apr 7 17:07:30 2015 New Revision: 281211 URL: https://svnweb.freebsd.org/changeset/base/281211 Log: MFC r275733: Move KTR_CXGBE from t4_tom.h to adapter.h so that the base if_cxgbe code can use it too. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h == --- stable/10/sys/dev/cxgbe/adapter.h Tue Apr 7 16:48:23 2015 (r281210) +++ stable/10/sys/dev/cxgbe/adapter.h Tue Apr 7 17:07:30 2015 (r281211) @@ -51,6 +51,7 @@ #include common/t4_msg.h #include firmware/t4fw_interface.h +#define KTR_CXGBE KTR_SPARE3 MALLOC_DECLARE(M_CXGBE); #define CXGBE_UNIMPLEMENTED(s) \ panic(%s (%s, line %d) not implemented yet., s, __FILE__, __LINE__) Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.h == --- stable/10/sys/dev/cxgbe/tom/t4_tom.hTue Apr 7 16:48:23 2015 (r281210) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.hTue Apr 7 17:07:30 2015 (r281211) @@ -31,7 +31,6 @@ #ifndef __T4_TOM_H__ #define __T4_TOM_H__ -#define KTR_CXGBE KTR_SPARE3 #define LISTEN_HASH_SIZE 32 /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281205 - stable/10/share/man/man4
On Tue, Apr 07, 2015 at 03:24:38PM +, Christian Brueffer wrote: New Revision: 281205 URL: https://svnweb.freebsd.org/changeset/base/281205 [...] -Family 0Fh, 10h, 11h, 12h, 14h, and 15h processors. +Family 0Fh, 10h, 11h, 12h, 14h, 15h, and 16h processors. Note that Oxford comma is (correctly) retained here... -For Family 10h, 11h, 12h, 14h, and 15h processors, the driver reports each +For Family 10h, 11h, 12h, 14h, 15h and 16h processors, the driver reports each ... but not here. ./danfe ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281207 - in stable/10/sys/dev/cxgbe: . common
Author: np Date: Tue Apr 7 15:32:43 2015 New Revision: 281207 URL: https://svnweb.freebsd.org/changeset/base/281207 Log: MFC r274456: Fix some bad interaction between cxgbe(4) and lacp lagg(4) that could leave a port permanently disabled when a copper cable is unplugged and then plugged right back in. lacp_linkstate goes looking for the current ifmedia on a link state change and it could get stale information from cxgbe(4) on a module unplug followed by replug. The fix is to process module events before link-state events within the driver, and to always rebuild the ifmedia list on a module change event (instead of rebuilding it lazily). Thanks to asomers@ for the problem report and detailed analysis to go with it. Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c == --- stable/10/sys/dev/cxgbe/common/t4_hw.c Tue Apr 7 15:32:25 2015 (r281206) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Tue Apr 7 15:32:43 2015 (r281207) @@ -5417,6 +5417,10 @@ int t4_handle_fw_rpl(struct adapter *ada } lc = pi-link_cfg; + if (mod != pi-mod_type) { + pi-mod_type = mod; + t4_os_portmod_changed(adap, i); + } if (link_ok != lc-link_ok || speed != lc-speed || fc != lc-fc) {/* something changed */ int reason; @@ -5432,10 +5436,6 @@ int t4_handle_fw_rpl(struct adapter *ada lc-supported = ntohs(p-u.info.pcap); t4_os_link_changed(adap, i, link_ok, reason); } - if (mod != pi-mod_type) { - pi-mod_type = mod; - t4_os_portmod_changed(adap, i); - } } else { CH_WARN_RATELIMIT(adap, Unknown firmware reply 0x%x (0x%x)\n, opcode, action); Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 7 15:32:25 2015 (r281206) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 7 15:32:43 2015 (r281207) @@ -1483,7 +1483,9 @@ cxgbe_media_status(struct ifnet *ifp, st struct ifmedia *media = NULL; struct ifmedia_entry *cur; int speed = pi-link_cfg.speed; +#ifdef INVARIANTS int data = (pi-port_type 8) | pi-mod_type; +#endif if (ifp == pi-ifp) media = pi-media; @@ -1494,10 +1496,7 @@ cxgbe_media_status(struct ifnet *ifp, st MPASS(media != NULL); cur = media-ifm_cur; - if (cur-ifm_data != data) { - build_medialist(pi, media); - cur = media-ifm_cur; - } + MPASS(cur-ifm_data == data); ifmr-ifm_status = IFM_AVALID; if (!pi-link_cfg.link_ok) @@ -7903,6 +7902,11 @@ t4_os_portmod_changed(const struct adapt NULL, LR, SR, ER, TWINAX, active TWINAX, LRM }; + build_medialist(pi, pi-media); +#ifdef DEV_NETMAP + build_medialist(pi, pi-nm_media); +#endif + if (pi-mod_type == FW_PORT_MOD_TYPE_NONE) if_printf(pi-ifp, transceiver unplugged.\n); else if (pi-mod_type == FW_PORT_MOD_TYPE_UNKNOWN) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281206 - head/share/man/man4
Author: brueffer Date: Tue Apr 7 15:32:25 2015 New Revision: 281206 URL: https://svnweb.freebsd.org/changeset/base/281206 Log: Add a missing comma. Submitted by: danfe Modified: head/share/man/man4/amdtemp.4 Modified: head/share/man/man4/amdtemp.4 == --- head/share/man/man4/amdtemp.4 Tue Apr 7 15:24:37 2015 (r281205) +++ head/share/man/man4/amdtemp.4 Tue Apr 7 15:32:25 2015 (r281206) @@ -64,7 +64,7 @@ The driver also creates in the corresponding CPU device's sysctl tree, displaying the maximum temperature of the two sensors located in each CPU core. .Pp -For Family 10h, 11h, 12h, 14h, 15h and 16h processors, the driver reports each +For Family 10h, 11h, 12h, 14h, 15h, and 16h processors, the driver reports each package's temperature through a sysctl node, named .Va dev.amdtemp.%d.core0.sensor0 . The driver also creates ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281213 - stable/10/sys/dev/cxgbe/tom
Author: np Date: Tue Apr 7 17:33:51 2015 New Revision: 281213 URL: https://svnweb.freebsd.org/changeset/base/281213 Log: MFC r276570: cxgbe/tom: log some more details in send_flowc_wr. Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c == --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 7 17:21:30 2015 (r281212) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 7 17:33:51 2015 (r281213) @@ -111,8 +111,6 @@ send_flowc_wr(struct toepcb *toep, struc KASSERT(!(toep-flags TPF_FLOWC_WR_SENT), (%s: flowc for tid %u sent already, __func__, toep-tid)); - CTR2(KTR_CXGBE, %s: tid %u, __func__, toep-tid); - flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); wr = alloc_wrqe(roundup2(flowclen, 16), toep-ofld_txq); @@ -147,11 +145,18 @@ send_flowc_wr(struct toepcb *toep, struc flowc-mnemval[6].val = htobe32(sndbuf); flowc-mnemval[7].mnemonic = FW_FLOWC_MNEM_MSS; flowc-mnemval[7].val = htobe32(ftxp-mss); + + CTR6(KTR_CXGBE, + %s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt 0x%x, + __func__, toep-tid, ftxp-mss, sndbuf, ftxp-snd_nxt, + ftxp-rcv_nxt); } else { flowc-mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; flowc-mnemval[4].val = htobe32(512); flowc-mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; flowc-mnemval[5].val = htobe32(512); + + CTR2(KTR_CXGBE, %s: tid %u, __func__, toep-tid); } txsd-tx_credits = howmany(flowclen, 16); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281219 - stable/7/sys/dev/bxe
Author: davidcs Date: Tue Apr 7 18:14:01 2015 New Revision: 281219 URL: https://svnweb.freebsd.org/changeset/base/281219 Log: MFC r281006 When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread Modified: stable/7/sys/dev/bxe/bxe.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c == --- stable/7/sys/dev/bxe/bxe.c Tue Apr 7 18:10:58 2015(r281218) +++ stable/7/sys/dev/bxe/bxe.c Tue Apr 7 18:14:01 2015(r281219) @@ -3257,7 +3257,7 @@ bxe_rxeof(struct bxe_softc*sc, uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons; uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod; int rx_pkts = 0; -int rc; +int rc = 0; BXE_FP_RX_LOCK(fp); @@ -3399,6 +3399,10 @@ bxe_rxeof(struct bxe_softc*sc, (sc-max_rx_bufs != RX_BD_USABLE) ? bd_prod : bd_cons); if (rc != 0) { + +/* we simply reuse the received mbuf and don't post it to the stack */ +m = NULL; + BLOGE(sc, mbuf alloc fail for fp[%02d] rx chain (%d)\n, fp-index, rc); fp-eth_q_stats.rx_soft_errors++; @@ -3487,6 +3491,9 @@ next_cqe: sw_cq_cons = RCQ_NEXT(sw_cq_cons); /* limit spinning on the queue */ +if (rc != 0) +break; + if (rx_pkts == sc-rx_budget) { fp-eth_q_stats.rx_budget_reached++; break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281212 - stable/10/sys/dev/cxgbe
Author: np Date: Tue Apr 7 17:21:30 2015 New Revision: 281212 URL: https://svnweb.freebsd.org/changeset/base/281212 Log: MFC r275539, r275554. r275539: cxgbe(4): Allow for different pad and pack boundaries for different adapters. Set the pack boundary for T5 cards to be the same as the PCIe max payload size. The chip likes it this way. In this revision the driver allocate rx buffers that align on both boundaries. This is not a strict requirement and a followup commit will switch the driver to a more relaxed allocation strategy. r275554: cxgbe(4): allow the driver to use rx buffers that do not end on a pack boundary. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h == --- stable/10/sys/dev/cxgbe/adapter.h Tue Apr 7 17:07:30 2015 (r281211) +++ stable/10/sys/dev/cxgbe/adapter.h Tue Apr 7 17:21:30 2015 (r281212) @@ -687,6 +687,7 @@ struct sge { struct sge_iq **iqmap; /* iq-cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq-cntxt_id to eq mapping */ + int pad_boundary; int pack_boundary; int8_t safe_hwidx1; /* may not have room for metadata */ int8_t safe_hwidx2; /* with room for metadata and maybe more */ Modified: stable/10/sys/dev/cxgbe/t4_sge.c == --- stable/10/sys/dev/cxgbe/t4_sge.cTue Apr 7 17:07:30 2015 (r281211) +++ stable/10/sys/dev/cxgbe/t4_sge.cTue Apr 7 17:21:30 2015 (r281212) @@ -119,19 +119,10 @@ TUNABLE_INT(hw.cxgbe.buffer_packing, /* * Start next frame in a packed buffer at this boundary. * -1: driver should figure out a good value. - * T4: - * --- - * if fl_pad != 0 - * value specified here will be overridden by fl_pad. - * else - * power of 2 from 32 to 4096 (both inclusive) is a valid value here. - * T5: - * --- - * 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. + * T4: driver will ignore this and use the same value as fl_pad above. + * T5: 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. */ static int fl_pack = -1; -static int t4_fl_pack; -static int t5_fl_pack; TUNABLE_INT(hw.cxgbe.fl_pack, fl_pack); /* @@ -174,8 +165,7 @@ static int service_iq(struct sge_iq *, i static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); -static inline void init_fl(struct adapter *, struct sge_fl *, int, int, int, -char *); +static inline void init_fl(struct adapter *, struct sge_fl *, int, int, char *); static inline void init_eq(struct sge_eq *, int, int, uint8_t, uint16_t, char *); static int alloc_ring(struct adapter *, size_t, bus_dma_tag_t *, bus_dmamap_t *, @@ -263,15 +253,6 @@ static counter_u64_t extfree_rels; void t4_sge_modload(void) { - int pad; - - /* set pad to a reasonable powerof2 between 16 and 4096 (inclusive) */ -#if defined(__i386__) || defined(__amd64__) - pad = max(cpu_clflush_line_size, 16); -#else - pad = max(CACHE_LINE_SIZE, 16); -#endif - pad = min(pad, 4096); if (fl_pktshift 0 || fl_pktshift 7) { printf(Invalid hw.cxgbe.fl_pktshift value (%d), @@ -279,35 +260,6 @@ t4_sge_modload(void) fl_pktshift = 2; } - if (fl_pad != 0 - (fl_pad 32 || fl_pad 4096 || !powerof2(fl_pad))) { - - if (fl_pad != -1) { - printf(Invalid hw.cxgbe.fl_pad value (%d), -using %d instead.\n, fl_pad, max(pad, 32)); - } - fl_pad = max(pad, 32); - } - - /* -* T4 has the same pad and pack boundary. If a pad boundary is set, -* pack boundary must be set to the same value. Otherwise take the -* specified value or auto-calculate something reasonable. -*/ - if (fl_pad) - t4_fl_pack = fl_pad; - else if (fl_pack 32 || fl_pack 4096 || !powerof2(fl_pack)) - t4_fl_pack = max(pad, 32); - else - t4_fl_pack = fl_pack; - - /* T5's pack boundary is independent of the pad boundary. */ - if (fl_pack 16 || fl_pack == 32 || fl_pack 4096 || - !powerof2(fl_pack)) - t5_fl_pack = max(pad, CACHE_LINE_SIZE); - else - t5_fl_pack = fl_pack; - if (spg_len != 64 spg_len != 128) { int len; @@ -365,6 +317,71 @@ t4_init_sge_cpl_handlers(struct adapter t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); } +static inline void
svn commit: r281216 - head/usr.bin/patch
Author: pfg Date: Tue Apr 7 18:06:46 2015 New Revision: 281216 URL: https://svnweb.freebsd.org/changeset/base/281216 Log: patch: Bring small updates from OpenBSD Prevent null pointer dereference on empty input files when diff requires a specific version. Fix division by zero for files with long lines ( 1024) in Plan B mode by supporting arbitrarily long lines. Obtained from:OpenBSD (CVS Rev 1.41, 1.42) MFC after:1 week Modified: head/usr.bin/patch/inp.c Modified: head/usr.bin/patch/inp.c == --- head/usr.bin/patch/inp.cTue Apr 7 18:04:18 2015(r281215) +++ head/usr.bin/patch/inp.cTue Apr 7 18:06:46 2015(r281216) @@ -57,8 +57,9 @@ static char empty_line[] = { '\0' }; static int tifd = -1; /* plan b virtual string array */ static char*tibuf[2]; /* plan b buffers */ static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ -static LINENUM lines_per_buf; /* how many lines per buffer */ -static int tireclen; /* length of records in tmp file */ +static size_t lines_per_buf; /* how many lines per buffer */ +static size_t tibuflen; /* plan b buffer length */ +static size_t tireclen; /* length of records in tmp file */ static boolrev_in_string(const char *); static boolreallocate_lines(size_t *); @@ -319,7 +320,7 @@ plan_a(const char *filename) /* now check for revision, if any */ if (revision != NULL) { - if (!rev_in_string(i_womp)) { + if (i_womp == NULL || !rev_in_string(i_womp)) { if (force) { if (verbose) say(Warning: this file doesn't appear @@ -349,8 +350,8 @@ static void plan_b(const char *filename) { FILE*ifp; - size_t i = 0, j, maxlen = 1; - char*p; + size_t i = 0, j, len, maxlen = 1; + char*lbuf = NULL, *p; boolfound_revision = (revision == NULL); using_plan_a = false; @@ -359,15 +360,28 @@ plan_b(const char *filename) unlink(TMPINNAME); if ((tifd = open(TMPINNAME, O_EXCL | O_CREAT | O_WRONLY, 0666)) 0) pfatal(can't open file %s, TMPINNAME); - while (fgets(buf, buf_size, ifp) != NULL) { - if (revision != NULL !found_revision rev_in_string(buf)) + while ((p = fgetln(ifp, len)) != NULL) { + if (p[len - 1] == '\n') + p[len - 1] = '\0'; + else { + /* EOF without EOL, copy and add the NUL */ + if ((lbuf = malloc(len + 1)) == NULL) + fatal(out of memory\n); + memcpy(lbuf, p, len); + lbuf[len] = '\0'; + p = lbuf; + + last_line_missing_eol = true; + len++; + } + if (revision != NULL !found_revision rev_in_string(p)) found_revision = true; - if ((i = strlen(buf)) maxlen) - maxlen = i; /* find longest line */ + if (len maxlen) + maxlen = len; /* find longest line */ } - last_line_missing_eol = i 0 buf[i - 1] != '\n'; - if (last_line_missing_eol maxlen == i) - maxlen++; + free(lbuf); + if (ferror(ifp)) + pfatal(can't read file %s, filename); if (revision != NULL) { if (!found_revision) { @@ -392,23 +406,26 @@ plan_b(const char *filename) revision); } fseek(ifp, 0L, SEEK_SET); /* rewind file */ - lines_per_buf = BUFFERSIZE / maxlen; tireclen = maxlen; - tibuf[0] = malloc(BUFFERSIZE + 1); + tibuflen = maxlen BUFFERSIZE ? maxlen : BUFFERSIZE; + lines_per_buf = tibuflen / maxlen; + tibuf[0] = malloc(tibuflen + 1); if (tibuf[0] == NULL) fatal(out of memory\n); - tibuf[1] = malloc(BUFFERSIZE + 1); + tibuf[1] = malloc(tibuflen + 1); if (tibuf[1] == NULL) fatal(out of memory\n); for (i = 1;; i++) { p = tibuf[0] + maxlen * (i % lines_per_buf); if (i % lines_per_buf == 0) /* new block */ - if (write(tifd, tibuf[0], BUFFERSIZE) BUFFERSIZE) + if (write(tifd, tibuf[0], tibuflen) != + (ssize_t) tibuflen) pfatal(can't write temp file); if (fgets(p, maxlen + 1, ifp) == NULL) { input_lines = i - 1; if (i % lines_per_buf != 0) - if (write(tifd, tibuf[0], BUFFERSIZE) BUFFERSIZE) + if
svn commit: r281220 - head/share/man/man4
Author: hselasky Date: Tue Apr 7 18:52:00 2015 New Revision: 281220 URL: https://svnweb.freebsd.org/changeset/base/281220 Log: Just briefly mention about the dangers of non-random IP IDs. A full in depth explanation belongs somewhere else. Suggested by: gleb @ MFC after:1 week Modified: head/share/man/man4/inet.4 Modified: head/share/man/man4/inet.4 == --- head/share/man/man4/inet.4 Tue Apr 7 18:14:01 2015(r281219) +++ head/share/man/man4/inet.4 Tue Apr 7 18:52:00 2015(r281220) @@ -28,7 +28,7 @@ .\ From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\ $FreeBSD$ .\ -.Dd April 3, 2015 +.Dd April 7, 2015 .Dt INET 4 .Os .Sh NAME @@ -244,21 +244,9 @@ IP datagrams (or all IP datagrams, if .Va ip.rfc6864 is disabled) to be randomized instead of incremented by 1 with each packet generated. -This prevents information exchange between any combination of two or -more inside and/or outside observers using packet frequency -modulation, PFM. -An outside observer can ping the outside facing port at a fixed rate -sampling the returned counter. -An inside observer can ping the inside facing port sampling the same -counter. -Even though packets don't flow directly between any of the observers -any single observer can influence the data rate the other observer(s) -is or are sampling. -This is done by sending more or less ping packets towards the gateway -per measured interval. -Setting this sysctl also prevents the remote and internal observers to -determine the rate of packet generation on the machine by watching the -counter. +This prevents IP IDs being abused as a covert channel and also closes +a minor information leak which allows remote observers to determine +the rate of packet generation on the machine by watching the counter. At the same time, on high-speed links, it can decrease the ID reuse cycle greatly. Default is 0 (sequential IP IDs). ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281214 - stable/10/sys/dev/cxgbe/tom
Author: np Date: Tue Apr 7 17:40:35 2015 New Revision: 281214 URL: https://svnweb.freebsd.org/changeset/base/281214 Log: MFC r276574: cxgbe/tom: fix the MSS calculation for IPv6 connections handled by the TOE. Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c == --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 7 17:33:51 2015 (r281213) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 7 17:40:35 2015 (r281214) @@ -44,6 +44,7 @@ __FBSDID($FreeBSD$); #include netinet/in.h #include netinet/in_pcb.h #include netinet/ip.h +#include netinet/ip6.h #include netinet/tcp_var.h #define TCPSTATES #include netinet/tcp_fsm.h @@ -236,11 +237,20 @@ static void assign_rxopt(struct tcpcb *tp, unsigned int opt) { struct toepcb *toep = tp-t_toe; + struct inpcb *inp = tp-t_inpcb; struct adapter *sc = td_adapter(toep-td); + int n; + + INP_LOCK_ASSERT(inp); - INP_LOCK_ASSERT(tp-t_inpcb); + if (inp-inp_inc.inc_flags INC_ISIPV6) + n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + else + n = sizeof(struct ip) + sizeof(struct tcphdr); + tp-t_maxseg = tp-t_maxopd = sc-params.mtus[G_TCPOPT_MSS(opt)] - n; - tp-t_maxseg = tp-t_maxopd = sc-params.mtus[G_TCPOPT_MSS(opt)] - 40; + CTR4(KTR_CXGBE, %s: tid %d, mtu_idx %u (%u), __func__, toep-tid, + G_TCPOPT_MSS(opt), sc-params.mtus[G_TCPOPT_MSS(opt)]); if (G_TCPOPT_TSTAMP(opt)) { tp-t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281218 - stable/8/sys/dev/bxe
Author: davidcs Date: Tue Apr 7 18:10:58 2015 New Revision: 281218 URL: https://svnweb.freebsd.org/changeset/base/281218 Log: MFC r281006 When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c == --- stable/8/sys/dev/bxe/bxe.c Tue Apr 7 18:07:16 2015(r281217) +++ stable/8/sys/dev/bxe/bxe.c Tue Apr 7 18:10:58 2015(r281218) @@ -3257,7 +3257,7 @@ bxe_rxeof(struct bxe_softc*sc, uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons; uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod; int rx_pkts = 0; -int rc; +int rc = 0; BXE_FP_RX_LOCK(fp); @@ -3399,6 +3399,10 @@ bxe_rxeof(struct bxe_softc*sc, (sc-max_rx_bufs != RX_BD_USABLE) ? bd_prod : bd_cons); if (rc != 0) { + +/* we simply reuse the received mbuf and don't post it to the stack */ +m = NULL; + BLOGE(sc, mbuf alloc fail for fp[%02d] rx chain (%d)\n, fp-index, rc); fp-eth_q_stats.rx_soft_errors++; @@ -3487,6 +3491,9 @@ next_cqe: sw_cq_cons = RCQ_NEXT(sw_cq_cons); /* limit spinning on the queue */ +if (rc != 0) +break; + if (rx_pkts == sc-rx_budget) { fp-eth_q_stats.rx_budget_reached++; break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281217 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Apr 7 18:07:16 2015 New Revision: 281217 URL: https://svnweb.freebsd.org/changeset/base/281217 Log: MFC r281006 When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Apr 7 18:06:46 2015(r281216) +++ stable/9/sys/dev/bxe/bxe.c Tue Apr 7 18:07:16 2015(r281217) @@ -3257,7 +3257,7 @@ bxe_rxeof(struct bxe_softc*sc, uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons; uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod; int rx_pkts = 0; -int rc; +int rc = 0; BXE_FP_RX_LOCK(fp); @@ -3399,6 +3399,10 @@ bxe_rxeof(struct bxe_softc*sc, (sc-max_rx_bufs != RX_BD_USABLE) ? bd_prod : bd_cons); if (rc != 0) { + +/* we simply reuse the received mbuf and don't post it to the stack */ +m = NULL; + BLOGE(sc, mbuf alloc fail for fp[%02d] rx chain (%d)\n, fp-index, rc); fp-eth_q_stats.rx_soft_errors++; @@ -3487,6 +3491,9 @@ next_cqe: sw_cq_cons = RCQ_NEXT(sw_cq_cons); /* limit spinning on the queue */ +if (rc != 0) +break; + if (rx_pkts == sc-rx_budget) { fp-eth_q_stats.rx_budget_reached++; break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281215 - stable/10/sys/dev/bxe
Author: davidcs Date: Tue Apr 7 18:04:18 2015 New Revision: 281215 URL: https://svnweb.freebsd.org/changeset/base/281215 Log: MFC r281006 When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c == --- stable/10/sys/dev/bxe/bxe.c Tue Apr 7 17:40:35 2015(r281214) +++ stable/10/sys/dev/bxe/bxe.c Tue Apr 7 18:04:18 2015(r281215) @@ -3257,7 +3257,7 @@ bxe_rxeof(struct bxe_softc*sc, uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons; uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod; int rx_pkts = 0; -int rc; +int rc = 0; BXE_FP_RX_LOCK(fp); @@ -3399,6 +3399,10 @@ bxe_rxeof(struct bxe_softc*sc, (sc-max_rx_bufs != RX_BD_USABLE) ? bd_prod : bd_cons); if (rc != 0) { + +/* we simply reuse the received mbuf and don't post it to the stack */ +m = NULL; + BLOGE(sc, mbuf alloc fail for fp[%02d] rx chain (%d)\n, fp-index, rc); fp-eth_q_stats.rx_soft_errors++; @@ -3487,6 +3491,9 @@ next_cqe: sw_cq_cons = RCQ_NEXT(sw_cq_cons); /* limit spinning on the queue */ +if (rc != 0) +break; + if (rx_pkts == sc-rx_budget) { fp-eth_q_stats.rx_budget_reached++; break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281024 - head/share/man/man4
On 04/07/15 18:42, Gleb Smirnoff wrote: Hans, 4 days ago I asked you to back this out, and my request was ignored. Can you please back this out now? Yes, it is an interesting stuff, but doesn't belong to the documentation. If you strongly disagree with me, I'd suggest to advocate Mike Silbersack, who is author of the code. If he agrees that additional information on covert channels is important, the text can be put back. Hi Gleb, I was busy with other stuff. Sorry for not responding. Yes, I agree that the text does not have to be that lengthy. I'll cut it down. --HPS ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r281220 - head/share/man/man4
On Tue, Apr 07, 2015 at 06:52:00PM +, Hans Petter Selasky wrote: H Author: hselasky H Date: Tue Apr 7 18:52:00 2015 H New Revision: 281220 H URL: https://svnweb.freebsd.org/changeset/base/281220 H H Log: H Just briefly mention about the dangers of non-random IP IDs. H A full in depth explanation belongs somewhere else. H H Suggested by: gleb @ H MFC after: 1 week Can you please just bring the page to the state before r281024? If you want any changes to the text, get them reviewed first. -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281221 - in head: contrib/compiler-rt/lib/builtins lib/libcompiler_rt
Author: emaste Date: Tue Apr 7 19:28:53 2015 New Revision: 281221 URL: https://svnweb.freebsd.org/changeset/base/281221 Log: compiler-rt: Implement multc3 - quad-precision complex multiplication This may be reworked based on upstream discussion. This version is here to support arm64 world builds. Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D2173 Added: head/contrib/compiler-rt/lib/builtins/multc3.c (contents, props changed) Modified: head/lib/libcompiler_rt/Makefile Added: head/contrib/compiler-rt/lib/builtins/multc3.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/multc3.c Tue Apr 7 19:28:53 2015(r281221) @@ -0,0 +1,73 @@ +/* ===-- multc3.c - Implement __multc3 -=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===--=== + * + * This file implements __multc3 for the compiler_rt library. + * + * ===--=== + */ + +#include int_lib.h +#include int_math.h + +/* Returns: the product of a + ib and c + id */ + +COMPILER_RT_ABI long double _Complex +__multc3(long double __a, long double __b, long double __c, long double __d) +{ +long double __ac = __a * __c; +long double __bd = __b * __d; +long double __ad = __a * __d; +long double __bc = __b * __c; +long double _Complex z; +__real__ z = __ac - __bd; +__imag__ z = __ad + __bc; +if (crt_isnan(__real__ z) crt_isnan(__imag__ z)) +{ +int __recalc = 0; +if (crt_isinf(__a) || crt_isinf(__b)) +{ +__a = crt_copysignl(crt_isinf(__a) ? 1 : 0, __a); +__b = crt_copysignl(crt_isinf(__b) ? 1 : 0, __b); +if (crt_isnan(__c)) +__c = crt_copysignl(0, __c); +if (crt_isnan(__d)) +__d = crt_copysignl(0, __d); +__recalc = 1; +} +if (crt_isinf(__c) || crt_isinf(__d)) +{ +__c = crt_copysignl(crt_isinf(__c) ? 1 : 0, __c); +__d = crt_copysignl(crt_isinf(__d) ? 1 : 0, __d); +if (crt_isnan(__a)) +__a = crt_copysignl(0, __a); +if (crt_isnan(__b)) +__b = crt_copysignl(0, __b); +__recalc = 1; +} +if (!__recalc (crt_isinf(__ac) || crt_isinf(__bd) || + crt_isinf(__ad) || crt_isinf(__bc))) +{ +if (crt_isnan(__a)) +__a = crt_copysignl(0, __a); +if (crt_isnan(__b)) +__b = crt_copysignl(0, __b); +if (crt_isnan(__c)) +__c = crt_copysignl(0, __c); +if (crt_isnan(__d)) +__d = crt_copysignl(0, __d); +__recalc = 1; +} +if (__recalc) +{ +__real__ z = CRT_INFINITY * (__a * __c - __b * __d); +__imag__ z = CRT_INFINITY * (__a * __d + __b * __c); +} +} +return z; +} Modified: head/lib/libcompiler_rt/Makefile == --- head/lib/libcompiler_rt/MakefileTue Apr 7 18:52:00 2015 (r281220) +++ head/lib/libcompiler_rt/MakefileTue Apr 7 19:28:53 2015 (r281221) @@ -108,6 +108,7 @@ SRCF= absvdi2 \ mulvdi3 \ mulvsi3 \ mulvti3 \ + multc3 \ mulxc3 \ negdf2 \ negdi2 \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281226 - head/share/man/man4
Author: hselasky Date: Tue Apr 7 19:39:23 2015 New Revision: 281226 URL: https://svnweb.freebsd.org/changeset/base/281226 Log: Revert r281220 and r281024, so that the new content added and its wording can be more properly discussed. Spelling fix made is kept. Suggested by: gleb @ MFC after:1 week Modified: head/share/man/man4/inet.4 Modified: head/share/man/man4/inet.4 == --- head/share/man/man4/inet.4 Tue Apr 7 19:37:49 2015(r281225) +++ head/share/man/man4/inet.4 Tue Apr 7 19:39:23 2015(r281226) @@ -244,9 +244,9 @@ IP datagrams (or all IP datagrams, if .Va ip.rfc6864 is disabled) to be randomized instead of incremented by 1 with each packet generated. -This prevents IP IDs being abused as a covert channel and also closes -a minor information leak which allows remote observers to determine -the rate of packet generation on the machine by watching the counter. +This closes a minor information leak which allows remote observers to +determine the rate of packet generation on the machine by watching the +counter. At the same time, on high-speed links, it can decrease the ID reuse cycle greatly. Default is 0 (sequential IP IDs). ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281234 - head/sys/netinet6
Author: kp Date: Tue Apr 7 20:29:03 2015 New Revision: 281234 URL: https://svnweb.freebsd.org/changeset/base/281234 Log: Evaluate packet size after the firewall had its chance Defer the packet size check until after the firewall has had a look at it. This means that the firewall now has the opportunity to (re-)fragment an oversized packet. Differential Revision:https://reviews.freebsd.org/D1815 Reviewed by: ae Approved by: gnn (mentor) Modified: head/sys/netinet6/ip6_forward.c Modified: head/sys/netinet6/ip6_forward.c == --- head/sys/netinet6/ip6_forward.c Tue Apr 7 20:21:23 2015 (r281233) +++ head/sys/netinet6/ip6_forward.c Tue Apr 7 20:29:03 2015 (r281234) @@ -413,39 +413,6 @@ again2: goto bad; } - if (m-m_pkthdr.len IN6_LINKMTU(rt-rt_ifp)) { - in6_ifstat_inc(rt-rt_ifp, ifs6_in_toobig); - if (mcopy) { - u_long mtu; -#ifdef IPSEC - size_t ipsechdrsiz; -#endif /* IPSEC */ - - mtu = IN6_LINKMTU(rt-rt_ifp); -#ifdef IPSEC - /* -* When we do IPsec tunnel ingress, we need to play -* with the link value (decrement IPsec header size -* from mtu value). The code is much simpler than v4 -* case, as we have the outgoing interface for -* encapsulated packet as rt-rt_ifp. -*/ - ipsechdrsiz = ipsec_hdrsiz(mcopy, IPSEC_DIR_OUTBOUND, - NULL); - if (ipsechdrsiz mtu) - mtu -= ipsechdrsiz; - /* -* if mtu becomes less than minimum MTU, -* tell minimum MTU (and I'll need to fragment it). -*/ - if (mtu IPV6_MMTU) - mtu = IPV6_MMTU; -#endif /* IPSEC */ - icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0, mtu); - } - goto bad; - } - if (rt-rt_flags RTF_GATEWAY) dst = (struct sockaddr_in6 *)rt-rt_gateway; @@ -571,6 +538,40 @@ again2: } pass: + /* See if the size was changed by the packet filter. */ + if (m-m_pkthdr.len IN6_LINKMTU(rt-rt_ifp)) { + in6_ifstat_inc(rt-rt_ifp, ifs6_in_toobig); + if (mcopy) { + u_long mtu; +#ifdef IPSEC + size_t ipsechdrsiz; +#endif /* IPSEC */ + + mtu = IN6_LINKMTU(rt-rt_ifp); +#ifdef IPSEC + /* +* When we do IPsec tunnel ingress, we need to play +* with the link value (decrement IPsec header size +* from mtu value). The code is much simpler than v4 +* case, as we have the outgoing interface for +* encapsulated packet as rt-rt_ifp. +*/ + ipsechdrsiz = ipsec_hdrsiz(mcopy, IPSEC_DIR_OUTBOUND, + NULL); + if (ipsechdrsiz mtu) + mtu -= ipsechdrsiz; + /* +* if mtu becomes less than minimum MTU, +* tell minimum MTU (and I'll need to fragment it). +*/ + if (mtu IPV6_MMTU) + mtu = IPV6_MMTU; +#endif /* IPSEC */ + icmp6_error(mcopy, ICMP6_PACKET_TOO_BIG, 0, mtu); + } + goto bad; + } + error = nd6_output(rt-rt_ifp, origifp, m, dst, rt); if (error) { in6_ifstat_inc(rt-rt_ifp, ifs6_out_discard); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281223 - in head: contrib/compiler-rt/lib/builtins lib/libcompiler_rt
Author: emaste Date: Tue Apr 7 19:31:29 2015 New Revision: 281223 URL: https://svnweb.freebsd.org/changeset/base/281223 Log: compiler-rt: add floatditf and floatunditf These are long integer (di_int/du_int) to quad precision floating point conversions. They may be reworked based on upstream discussion. These versions are here to support arm64 world builds. Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D2174 Added: head/contrib/compiler-rt/lib/builtins/floatditf.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/floatunditf.c (contents, props changed) Modified: head/lib/libcompiler_rt/Makefile Added: head/contrib/compiler-rt/lib/builtins/floatditf.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/floatditf.c Tue Apr 7 19:31:29 2015(r281223) @@ -0,0 +1,52 @@ +//===-- lib/floatditf.c - integer - quad-precision conversion *- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// +// +// This file implements di_int to quad-precision conversion for the +// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even +// mode. +// +//===--===// + +#define QUAD_PRECISION +#include fp_lib.h + +#if defined(CRT_HAS_128BIT) defined(CRT_LDBL_128BIT) +COMPILER_RT_ABI fp_t __floatditf(di_int a) { + +const int aWidth = sizeof a * CHAR_BIT; + +// Handle zero as a special case to protect clz +if (a == 0) +return fromRep(0); + +// All other cases begin by extracting the sign and absolute value of a +rep_t sign = 0; +unsigned aAbs = (unsigned)a; +if (a 0) { +sign = signBit; +aAbs += 0x8000; +} + +// Exponent of (fp_t)a is the width of abs(a). +const int exponent = (aWidth - 1) - __builtin_clz(a); +rep_t result; + +// Shift a into the significand field and clear the implicit bit. Extra +// cast to unsigned int is necessary to get the correct behavior for +// the input INT_MIN. +const int shift = significandBits - exponent; +result = (rep_t)aAbs shift ^ implicitBit; + +// Insert the exponent +result += (rep_t)(exponent + exponentBias) significandBits; +// Insert the sign bit and return +return fromRep(result | sign); +} + +#endif Added: head/contrib/compiler-rt/lib/builtins/floatunditf.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/floatunditf.c Tue Apr 7 19:31:29 2015(r281223) @@ -0,0 +1,40 @@ +//===-- lib/floatunditf.c - uint - quad-precision conversion -*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// +// +// This file implements du_int to quad-precision conversion for the +// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even +// mode. +// +//===--===// + +#define QUAD_PRECISION +#include fp_lib.h + +#if defined(CRT_HAS_128BIT) defined(CRT_LDBL_128BIT) +COMPILER_RT_ABI fp_t __floatunditf(du_int a) { + +const int aWidth = sizeof a * CHAR_BIT; + +// Handle zero as a special case to protect clz +if (a == 0) return fromRep(0); + +// Exponent of (fp_t)a is the width of abs(a). +const int exponent = (aWidth - 1) - __builtin_clz(a); +rep_t result; + +// Shift a into the significand field and clear the implicit bit. +const int shift = significandBits - exponent; +result = (rep_t)a shift ^ implicitBit; + +// Insert the exponent +result += (rep_t)(exponent + exponentBias) significandBits; +return fromRep(result); +} + +#endif Modified: head/lib/libcompiler_rt/Makefile == --- head/lib/libcompiler_rt/MakefileTue Apr 7 19:30:54 2015 (r281222) +++ head/lib/libcompiler_rt/MakefileTue Apr 7 19:31:29 2015 (r281223) @@ -78,6 +78,7 @@ SRCF= absvdi2 \ fixxfti \ floatdidf \ floatdisf \ + floatditf \ floatdixf \ floatsitf \ floattidf \ @@ -85,6 +86,7 @@ SRCF= absvdi2 \ floattixf \ floatundidf \ floatundisf \ + floatunditf \
svn commit: r281233 - in releng: 8.4 8.4/contrib/ntp/ntpd 8.4/sys/conf 8.4/sys/netinet 8.4/sys/netinet6 9.3 9.3/contrib/ntp/ntpd 9.3/sys/conf 9.3/sys/netinet 9.3/sys/netinet6
Author: delphij Date: Tue Apr 7 20:21:23 2015 New Revision: 281233 URL: https://svnweb.freebsd.org/changeset/base/281233 Log: Improve patch for SA-15:04.igmp to solve a potential buffer overflow. Fix multiple vulnerabilities of ntp. [SA-15:07] Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] Approved by: so Modified: releng/8.4/UPDATING releng/8.4/contrib/ntp/ntpd/ntp_crypto.c releng/8.4/contrib/ntp/ntpd/ntp_proto.c releng/8.4/sys/conf/newvers.sh releng/8.4/sys/netinet/igmp.c releng/8.4/sys/netinet6/nd6_rtr.c releng/9.3/UPDATING releng/9.3/contrib/ntp/ntpd/ntp_crypto.c releng/9.3/contrib/ntp/ntpd/ntp_proto.c releng/9.3/sys/conf/newvers.sh releng/9.3/sys/netinet/igmp.c releng/9.3/sys/netinet6/nd6_rtr.c Modified: releng/8.4/UPDATING == --- releng/8.4/UPDATING Tue Apr 7 20:21:01 2015(r281232) +++ releng/8.4/UPDATING Tue Apr 7 20:21:23 2015(r281233) @@ -15,6 +15,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20150407: p27 FreeBSD-SA-15:04.igmp [revised] + FreeBSD-SA-15:07.ntp + FreeBSD-SA-15:09.ipv6 + + Improved patch for SA-15:04.igmp. + + Fix multiple vulnerabilities of ntp. [SA-15:07] + + Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] + 20150320: p26 Fix patch for SA-15:06.openssl. Modified: releng/8.4/contrib/ntp/ntpd/ntp_crypto.c == --- releng/8.4/contrib/ntp/ntpd/ntp_crypto.cTue Apr 7 20:21:01 2015 (r281232) +++ releng/8.4/contrib/ntp/ntpd/ntp_crypto.cTue Apr 7 20:21:23 2015 (r281233) @@ -93,6 +93,7 @@ #define TAI_1972 10 /* initial TAI offset (s) */ #define MAX_LEAP 100 /* max UTC leapseconds (s) */ #define VALUE_LEN (6 * 4) /* min response field length */ +#define MAX_VALLEN (65535 - VALUE_LEN) #define YEAR (60 * 60 * 24 * 365) /* seconds in year */ /* @@ -137,8 +138,8 @@ static u_int ident_scheme = 0; /* server */ static int crypto_verify P((struct exten *, struct value *, struct peer *)); -static int crypto_encrypt P((struct exten *, struct value *, - keyid_t *)); +static int crypto_encrypt P((const u_char *, u_int, keyid_t *, + struct value *)); static int crypto_aliceP((struct peer *, struct value *)); static int crypto_alice2 P((struct peer *, struct value *)); static int crypto_alice3 P((struct peer *, struct value *)); @@ -446,6 +447,12 @@ crypto_recv( tstamp = ntohl(ep-tstamp); fstamp = ntohl(ep-fstamp); vallen = ntohl(ep-vallen); + /* +* Bug 2761: I hope this isn't too early... +*/ + if ( vallen == 0 + || len - VALUE_LEN vallen) + return XEVNT_LEN; } switch (code) { @@ -488,7 +495,7 @@ crypto_recv( break; if (vallen == 0 || vallen MAXHOSTNAME || - len VALUE_LEN + vallen) { + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; } @@ -1250,7 +1257,8 @@ crypto_xmit( vallen = ntohl(ep-vallen); if (vallen == 8) { strcpy(certname, sys_hostname); - } else if (vallen == 0 || vallen MAXHOSTNAME) { + } else if (vallen == 0 || vallen MAXHOSTNAME || + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; @@ -1407,7 +1415,10 @@ crypto_xmit( * anything goes wrong. */ case CRYPTO_COOK | CRYPTO_RESP: - if ((opcode 0x) VALUE_LEN) { + vallen = ntohl(ep-vallen); /* Must be 64k */ + if ( vallen == 0 + || (vallen = MAX_VALLEN) + || (opcode 0x) VALUE_LEN + vallen) { rval = XEVNT_LEN; break; } @@ -1420,10 +1431,11 @@ crypto_xmit( } tcookie = peer-pcookie; } - if ((rval = crypto_encrypt(ep, vtemp, tcookie)) == - XEVNT_OK) + if ((rval = crypto_encrypt((const u_char *)ep-pkt, vallen, tcookie, vtemp)) + == XEVNT_OK
svn commit: r281225 - head/sys/sys
Author: markj Date: Tue Apr 7 19:37:49 2015 New Revision: 281225 URL: https://svnweb.freebsd.org/changeset/base/281225 Log: Add B_KVAALLOC and B_UNMAPPED to the buf flag name list. Differential Revision:https://reviews.freebsd.org/D1895 Submitted by: Conrad Meyer MFC after:1 week Modified: head/sys/sys/buf.h Modified: head/sys/sys/buf.h == --- head/sys/sys/buf.h Tue Apr 7 19:33:07 2015(r281224) +++ head/sys/sys/buf.h Tue Apr 7 19:37:49 2015(r281225) @@ -231,8 +231,8 @@ struct buf { #define PRINT_BUF_FLAGS \20\40remfree\37cluster\36vmio\35ram\34managed \ \33paging\32infreecnt\31nocopy\30b23\27relbuf\26dirty\25b20 \ \24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval \ - \15b12\14b11\13eintr\12done\11persist\10delwri\7validsuspwrt \ - \6cache\5deferred\4direct\3async\2needcommit\1age + \15kvaalloc\14unmapped\13eintr\12done\11persist\10delwri \ + \7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age /* * These flags are kept in b_xflags. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281228 - head/sys/netinet
Author: delphij Date: Tue Apr 7 20:20:03 2015 New Revision: 281228 URL: https://svnweb.freebsd.org/changeset/base/281228 Log: Improve patch for SA-15:04.igmp to solve a potential buffer overflow. Reported by: bde Submitted by: oshogbo Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c == --- head/sys/netinet/igmp.c Tue Apr 7 19:46:18 2015(r281227) +++ head/sys/netinet/igmp.c Tue Apr 7 20:20:03 2015(r281228) @@ -1540,7 +1540,6 @@ igmp_input(struct mbuf **mp, int *offp, struct igmpv3 *igmpv3; uint16_t igmpv3len; uint16_t nsrc; - int srclen; IGMPSTAT_INC(igps_rcv_v3_queries); igmpv3 = (struct igmpv3 *)igmp; @@ -1548,8 +1547,8 @@ igmp_input(struct mbuf **mp, int *offp, * Validate length based on source count. */ nsrc = ntohs(igmpv3-igmp_numsrc); - srclen = sizeof(struct in_addr) * nsrc; - if (nsrc * sizeof(in_addr_t) srclen) { + if (nsrc * sizeof(in_addr_t) + UINT16_MAX - iphlen - IGMP_V3_QUERY_MINLEN) { IGMPSTAT_INC(igps_rcv_tooshort); return (IPPROTO_DONE); } @@ -1558,7 +1557,7 @@ igmp_input(struct mbuf **mp, int *offp, * this scope. */ igmpv3len = iphlen + IGMP_V3_QUERY_MINLEN + - srclen; + sizeof(struct in_addr) * nsrc; if ((!M_WRITABLE(m) || m-m_len igmpv3len) (m = m_pullup(m, igmpv3len)) == NULL) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281229 - head/sys/netinet6
Author: delphij Date: Tue Apr 7 20:20:09 2015 New Revision: 281229 URL: https://svnweb.freebsd.org/changeset/base/281229 Log: Mitigate Local Denial of Service with IPv6 Router Advertisements and log attack attempts. Submitted by: hrs Security: FreeBSD-SA-15:09.nd6 Security: CVE-2015-2923 Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c == --- head/sys/netinet6/nd6_rtr.c Tue Apr 7 20:20:03 2015(r281228) +++ head/sys/netinet6/nd6_rtr.c Tue Apr 7 20:20:09 2015(r281229) @@ -297,8 +297,16 @@ nd6_ra_input(struct mbuf *m, int off, in } if (nd_ra-nd_ra_retransmit) ndi-retrans = ntohl(nd_ra-nd_ra_retransmit); - if (nd_ra-nd_ra_curhoplimit) - ndi-chlim = nd_ra-nd_ra_curhoplimit; + if (nd_ra-nd_ra_curhoplimit) { + if (ndi-chlim nd_ra-nd_ra_curhoplimit) + ndi-chlim = nd_ra-nd_ra_curhoplimit; + else if (ndi-chlim != nd_ra-nd_ra_curhoplimit) { + log(LOG_ERR, RA with a lower CurHopLimit sent from + %s on %s (current = %d, received = %d). + Ignored.\n, ip6_sprintf(ip6bufs, ip6-ip6_src), + if_name(ifp), ndi-chlim, nd_ra-nd_ra_curhoplimit); + } + } dr = defrtrlist_update(dr0); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281231 - in stable: 8/contrib/ntp/ntpd 8/sys/netinet 8/sys/netinet6 9/contrib/ntp/ntpd 9/sys/netinet 9/sys/netinet6
Author: delphij Date: Tue Apr 7 20:20:44 2015 New Revision: 281231 URL: https://svnweb.freebsd.org/changeset/base/281231 Log: Improve patch for SA-15:04.igmp to solve a potential buffer overflow. Fix multiple vulnerabilities of ntp. [SA-15:07] Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] Modified: stable/8/contrib/ntp/ntpd/ntp_crypto.c stable/8/contrib/ntp/ntpd/ntp_proto.c stable/8/sys/netinet/igmp.c stable/8/sys/netinet6/nd6_rtr.c Changes in other areas also in this revision: Modified: stable/9/contrib/ntp/ntpd/ntp_crypto.c stable/9/contrib/ntp/ntpd/ntp_proto.c stable/9/sys/netinet/igmp.c stable/9/sys/netinet6/nd6_rtr.c Modified: stable/8/contrib/ntp/ntpd/ntp_crypto.c == --- stable/8/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:24 2015 (r281230) +++ stable/8/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:44 2015 (r281231) @@ -93,6 +93,7 @@ #define TAI_1972 10 /* initial TAI offset (s) */ #define MAX_LEAP 100 /* max UTC leapseconds (s) */ #define VALUE_LEN (6 * 4) /* min response field length */ +#define MAX_VALLEN (65535 - VALUE_LEN) #define YEAR (60 * 60 * 24 * 365) /* seconds in year */ /* @@ -137,8 +138,8 @@ static u_int ident_scheme = 0; /* server */ static int crypto_verify P((struct exten *, struct value *, struct peer *)); -static int crypto_encrypt P((struct exten *, struct value *, - keyid_t *)); +static int crypto_encrypt P((const u_char *, u_int, keyid_t *, + struct value *)); static int crypto_aliceP((struct peer *, struct value *)); static int crypto_alice2 P((struct peer *, struct value *)); static int crypto_alice3 P((struct peer *, struct value *)); @@ -446,6 +447,12 @@ crypto_recv( tstamp = ntohl(ep-tstamp); fstamp = ntohl(ep-fstamp); vallen = ntohl(ep-vallen); + /* +* Bug 2761: I hope this isn't too early... +*/ + if ( vallen == 0 + || len - VALUE_LEN vallen) + return XEVNT_LEN; } switch (code) { @@ -488,7 +495,7 @@ crypto_recv( break; if (vallen == 0 || vallen MAXHOSTNAME || - len VALUE_LEN + vallen) { + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; } @@ -1250,7 +1257,8 @@ crypto_xmit( vallen = ntohl(ep-vallen); if (vallen == 8) { strcpy(certname, sys_hostname); - } else if (vallen == 0 || vallen MAXHOSTNAME) { + } else if (vallen == 0 || vallen MAXHOSTNAME || + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; @@ -1407,7 +1415,10 @@ crypto_xmit( * anything goes wrong. */ case CRYPTO_COOK | CRYPTO_RESP: - if ((opcode 0x) VALUE_LEN) { + vallen = ntohl(ep-vallen); /* Must be 64k */ + if ( vallen == 0 + || (vallen = MAX_VALLEN) + || (opcode 0x) VALUE_LEN + vallen) { rval = XEVNT_LEN; break; } @@ -1420,10 +1431,11 @@ crypto_xmit( } tcookie = peer-pcookie; } - if ((rval = crypto_encrypt(ep, vtemp, tcookie)) == - XEVNT_OK) + if ((rval = crypto_encrypt((const u_char *)ep-pkt, vallen, tcookie, vtemp)) + == XEVNT_OK) { len += crypto_send(fp, vtemp); - value_free(vtemp); + value_free(vtemp); + } break; /* @@ -1558,10 +1570,15 @@ crypto_verify( * are rounded up to the next word. */ vallen = ntohl(ep-vallen); + if ( vallen == 0 + || vallen MAX_VALLEN) + return (XEVNT_LEN); i = (vallen + 3) / 4; siglen = ntohl(ep-pkt[i++]); - if (len VALUE_LEN + ((vallen + 3) / 4) * 4 + ((siglen + 3) / - 4) * 4) + if ( siglen MAX_VALLEN + || len - VALUE_LEN ((vallen + 3) / 4) * 4 + || len - VALUE_LEN - ((vallen + 3) / 4) * 4 + ((siglen + 3) / 4) * 4) return (XEVNT_LEN); /* @@ -1627,6 +1644,7 @@ crypto_verify( * avoid doing the sign exchange. */ EVP_VerifyInit(ctx,
svn commit: r281231 - in stable: 8/contrib/ntp/ntpd 8/sys/netinet 8/sys/netinet6 9/contrib/ntp/ntpd 9/sys/netinet 9/sys/netinet6
Author: delphij Date: Tue Apr 7 20:20:44 2015 New Revision: 281231 URL: https://svnweb.freebsd.org/changeset/base/281231 Log: Improve patch for SA-15:04.igmp to solve a potential buffer overflow. Fix multiple vulnerabilities of ntp. [SA-15:07] Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] Modified: stable/9/contrib/ntp/ntpd/ntp_crypto.c stable/9/contrib/ntp/ntpd/ntp_proto.c stable/9/sys/netinet/igmp.c stable/9/sys/netinet6/nd6_rtr.c Changes in other areas also in this revision: Modified: stable/8/contrib/ntp/ntpd/ntp_crypto.c stable/8/contrib/ntp/ntpd/ntp_proto.c stable/8/sys/netinet/igmp.c stable/8/sys/netinet6/nd6_rtr.c Modified: stable/9/contrib/ntp/ntpd/ntp_crypto.c == --- stable/9/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:24 2015 (r281230) +++ stable/9/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:44 2015 (r281231) @@ -93,6 +93,7 @@ #define TAI_1972 10 /* initial TAI offset (s) */ #define MAX_LEAP 100 /* max UTC leapseconds (s) */ #define VALUE_LEN (6 * 4) /* min response field length */ +#define MAX_VALLEN (65535 - VALUE_LEN) #define YEAR (60 * 60 * 24 * 365) /* seconds in year */ /* @@ -137,8 +138,8 @@ static u_int ident_scheme = 0; /* server */ static int crypto_verify P((struct exten *, struct value *, struct peer *)); -static int crypto_encrypt P((struct exten *, struct value *, - keyid_t *)); +static int crypto_encrypt P((const u_char *, u_int, keyid_t *, + struct value *)); static int crypto_aliceP((struct peer *, struct value *)); static int crypto_alice2 P((struct peer *, struct value *)); static int crypto_alice3 P((struct peer *, struct value *)); @@ -446,6 +447,12 @@ crypto_recv( tstamp = ntohl(ep-tstamp); fstamp = ntohl(ep-fstamp); vallen = ntohl(ep-vallen); + /* +* Bug 2761: I hope this isn't too early... +*/ + if ( vallen == 0 + || len - VALUE_LEN vallen) + return XEVNT_LEN; } switch (code) { @@ -488,7 +495,7 @@ crypto_recv( break; if (vallen == 0 || vallen MAXHOSTNAME || - len VALUE_LEN + vallen) { + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; } @@ -1250,7 +1257,8 @@ crypto_xmit( vallen = ntohl(ep-vallen); if (vallen == 8) { strcpy(certname, sys_hostname); - } else if (vallen == 0 || vallen MAXHOSTNAME) { + } else if (vallen == 0 || vallen MAXHOSTNAME || + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; @@ -1407,7 +1415,10 @@ crypto_xmit( * anything goes wrong. */ case CRYPTO_COOK | CRYPTO_RESP: - if ((opcode 0x) VALUE_LEN) { + vallen = ntohl(ep-vallen); /* Must be 64k */ + if ( vallen == 0 + || (vallen = MAX_VALLEN) + || (opcode 0x) VALUE_LEN + vallen) { rval = XEVNT_LEN; break; } @@ -1420,10 +1431,11 @@ crypto_xmit( } tcookie = peer-pcookie; } - if ((rval = crypto_encrypt(ep, vtemp, tcookie)) == - XEVNT_OK) + if ((rval = crypto_encrypt((const u_char *)ep-pkt, vallen, tcookie, vtemp)) + == XEVNT_OK) { len += crypto_send(fp, vtemp); - value_free(vtemp); + value_free(vtemp); + } break; /* @@ -1558,10 +1570,15 @@ crypto_verify( * are rounded up to the next word. */ vallen = ntohl(ep-vallen); + if ( vallen == 0 + || vallen MAX_VALLEN) + return (XEVNT_LEN); i = (vallen + 3) / 4; siglen = ntohl(ep-pkt[i++]); - if (len VALUE_LEN + ((vallen + 3) / 4) * 4 + ((siglen + 3) / - 4) * 4) + if ( siglen MAX_VALLEN + || len - VALUE_LEN ((vallen + 3) / 4) * 4 + || len - VALUE_LEN - ((vallen + 3) / 4) * 4 + ((siglen + 3) / 4) * 4) return (XEVNT_LEN); /* @@ -1627,6 +1644,7 @@ crypto_verify( * avoid doing the sign exchange. */ EVP_VerifyInit(ctx,
svn commit: r281230 - in stable/10: contrib/ntp/ntpd sys/netinet sys/netinet6 usr.sbin/bsdinstall/scripts
Author: delphij Date: Tue Apr 7 20:20:24 2015 New Revision: 281230 URL: https://svnweb.freebsd.org/changeset/base/281230 Log: Improve patch for SA-15:04.igmp to solve a potential buffer overflow. Fix multiple vulnerabilities of ntp. [SA-15:07] Fix bsdinstall(8) insecure default GELI keyfile permissions. [SA-15:08] Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] Modified: stable/10/contrib/ntp/ntpd/ntp_crypto.c stable/10/contrib/ntp/ntpd/ntp_proto.c stable/10/sys/netinet/igmp.c stable/10/sys/netinet6/nd6_rtr.c stable/10/usr.sbin/bsdinstall/scripts/zfsboot Modified: stable/10/contrib/ntp/ntpd/ntp_crypto.c == --- stable/10/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:09 2015 (r281229) +++ stable/10/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:24 2015 (r281230) @@ -93,6 +93,7 @@ #define TAI_1972 10 /* initial TAI offset (s) */ #define MAX_LEAP 100 /* max UTC leapseconds (s) */ #define VALUE_LEN (6 * 4) /* min response field length */ +#define MAX_VALLEN (65535 - VALUE_LEN) #define YEAR (60 * 60 * 24 * 365) /* seconds in year */ /* @@ -137,8 +138,8 @@ static u_int ident_scheme = 0; /* server */ static int crypto_verify P((struct exten *, struct value *, struct peer *)); -static int crypto_encrypt P((struct exten *, struct value *, - keyid_t *)); +static int crypto_encrypt P((const u_char *, u_int, keyid_t *, + struct value *)); static int crypto_aliceP((struct peer *, struct value *)); static int crypto_alice2 P((struct peer *, struct value *)); static int crypto_alice3 P((struct peer *, struct value *)); @@ -446,6 +447,12 @@ crypto_recv( tstamp = ntohl(ep-tstamp); fstamp = ntohl(ep-fstamp); vallen = ntohl(ep-vallen); + /* +* Bug 2761: I hope this isn't too early... +*/ + if ( vallen == 0 + || len - VALUE_LEN vallen) + return XEVNT_LEN; } switch (code) { @@ -488,7 +495,7 @@ crypto_recv( break; if (vallen == 0 || vallen MAXHOSTNAME || - len VALUE_LEN + vallen) { + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; } @@ -1250,7 +1257,8 @@ crypto_xmit( vallen = ntohl(ep-vallen); if (vallen == 8) { strcpy(certname, sys_hostname); - } else if (vallen == 0 || vallen MAXHOSTNAME) { + } else if (vallen == 0 || vallen MAXHOSTNAME || + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; @@ -1407,7 +1415,10 @@ crypto_xmit( * anything goes wrong. */ case CRYPTO_COOK | CRYPTO_RESP: - if ((opcode 0x) VALUE_LEN) { + vallen = ntohl(ep-vallen); /* Must be 64k */ + if ( vallen == 0 + || (vallen = MAX_VALLEN) + || (opcode 0x) VALUE_LEN + vallen) { rval = XEVNT_LEN; break; } @@ -1420,10 +1431,11 @@ crypto_xmit( } tcookie = peer-pcookie; } - if ((rval = crypto_encrypt(ep, vtemp, tcookie)) == - XEVNT_OK) + if ((rval = crypto_encrypt((const u_char *)ep-pkt, vallen, tcookie, vtemp)) + == XEVNT_OK) { len += crypto_send(fp, vtemp); - value_free(vtemp); + value_free(vtemp); + } break; /* @@ -1558,10 +1570,15 @@ crypto_verify( * are rounded up to the next word. */ vallen = ntohl(ep-vallen); + if ( vallen == 0 + || vallen MAX_VALLEN) + return (XEVNT_LEN); i = (vallen + 3) / 4; siglen = ntohl(ep-pkt[i++]); - if (len VALUE_LEN + ((vallen + 3) / 4) * 4 + ((siglen + 3) / - 4) * 4) + if ( siglen MAX_VALLEN + || len - VALUE_LEN ((vallen + 3) / 4) * 4 + || len - VALUE_LEN - ((vallen + 3) / 4) * 4 + ((siglen + 3) / 4) * 4) return (XEVNT_LEN); /* @@ -1627,6 +1644,7 @@ crypto_verify( * avoid doing the sign exchange. */ EVP_VerifyInit(ctx, peer-digest); + /* XXX: the + 12 needs to be at least
svn commit: r281232 - in releng/10.1: . contrib/ntp/ntpd sys/conf sys/netinet sys/netinet6 usr.sbin/bsdinstall/scripts
Author: delphij Date: Tue Apr 7 20:21:01 2015 New Revision: 281232 URL: https://svnweb.freebsd.org/changeset/base/281232 Log: Improve patch for SA-15:04.igmp to solve a potential buffer overflow. Fix multiple vulnerabilities of ntp. [SA-15:07] Fix bsdinstall(8) insecure default GELI keyfile permissions. [SA-15:08] Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] Approved by: so Modified: releng/10.1/UPDATING releng/10.1/contrib/ntp/ntpd/ntp_crypto.c releng/10.1/contrib/ntp/ntpd/ntp_proto.c releng/10.1/sys/conf/newvers.sh releng/10.1/sys/netinet/igmp.c releng/10.1/sys/netinet6/nd6_rtr.c releng/10.1/usr.sbin/bsdinstall/scripts/zfsboot Modified: releng/10.1/UPDATING == --- releng/10.1/UPDATINGTue Apr 7 20:20:44 2015(r281231) +++ releng/10.1/UPDATINGTue Apr 7 20:21:01 2015(r281232) @@ -16,6 +16,19 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20150407: p9 FreeBSD-SA-15:04.igmp [revised] + FreeBSD-SA-15:07.ntp + FreeBSD-SA-15:08.bsdinstall + FreeBSD-SA-15:09.ipv6 + + Improved patch for SA-15:04.igmp. + + Fix multiple vulnerabilities of ntp. [SA-15:07] + + Fix bsdinstall(8) insecure default GELI keyfile permissions. [SA-15:08] + + Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09] + 20150320: p8 Fix patch for SA-15:06.openssl. Modified: releng/10.1/contrib/ntp/ntpd/ntp_crypto.c == --- releng/10.1/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:20:44 2015 (r281231) +++ releng/10.1/contrib/ntp/ntpd/ntp_crypto.c Tue Apr 7 20:21:01 2015 (r281232) @@ -93,6 +93,7 @@ #define TAI_1972 10 /* initial TAI offset (s) */ #define MAX_LEAP 100 /* max UTC leapseconds (s) */ #define VALUE_LEN (6 * 4) /* min response field length */ +#define MAX_VALLEN (65535 - VALUE_LEN) #define YEAR (60 * 60 * 24 * 365) /* seconds in year */ /* @@ -137,8 +138,8 @@ static u_int ident_scheme = 0; /* server */ static int crypto_verify P((struct exten *, struct value *, struct peer *)); -static int crypto_encrypt P((struct exten *, struct value *, - keyid_t *)); +static int crypto_encrypt P((const u_char *, u_int, keyid_t *, + struct value *)); static int crypto_aliceP((struct peer *, struct value *)); static int crypto_alice2 P((struct peer *, struct value *)); static int crypto_alice3 P((struct peer *, struct value *)); @@ -446,6 +447,12 @@ crypto_recv( tstamp = ntohl(ep-tstamp); fstamp = ntohl(ep-fstamp); vallen = ntohl(ep-vallen); + /* +* Bug 2761: I hope this isn't too early... +*/ + if ( vallen == 0 + || len - VALUE_LEN vallen) + return XEVNT_LEN; } switch (code) { @@ -488,7 +495,7 @@ crypto_recv( break; if (vallen == 0 || vallen MAXHOSTNAME || - len VALUE_LEN + vallen) { + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; } @@ -1250,7 +1257,8 @@ crypto_xmit( vallen = ntohl(ep-vallen); if (vallen == 8) { strcpy(certname, sys_hostname); - } else if (vallen == 0 || vallen MAXHOSTNAME) { + } else if (vallen == 0 || vallen MAXHOSTNAME || + len - VALUE_LEN vallen) { rval = XEVNT_LEN; break; @@ -1407,7 +1415,10 @@ crypto_xmit( * anything goes wrong. */ case CRYPTO_COOK | CRYPTO_RESP: - if ((opcode 0x) VALUE_LEN) { + vallen = ntohl(ep-vallen); /* Must be 64k */ + if ( vallen == 0 + || (vallen = MAX_VALLEN) + || (opcode 0x) VALUE_LEN + vallen) { rval = XEVNT_LEN; break; } @@ -1420,10 +1431,11 @@ crypto_xmit( } tcookie = peer-pcookie; } - if ((rval = crypto_encrypt(ep, vtemp, tcookie)) == - XEVNT_OK) + if ((rval = crypto_encrypt((const u_char *)ep-pkt
svn commit: r281236 - in head: sbin/ifconfig sys/net sys/sys
Author: erj Date: Tue Apr 7 21:31:17 2015 New Revision: 281236 URL: https://svnweb.freebsd.org/changeset/base/281236 Log: ifmedia changes: - Extend the number of available subtypes for Ethernet media by using some of the ifmedia word's option bits to help denote subtypes. As a result, the number of possible Ethernet subtype values increases from 31 to 511. - Use some of those new values to define new media types. - lacp_compose_key() recgonizes the new Ethernet media types added. (Change made as required by a comment in if_media.h) - New ioctl, SIOGIFXMEDIA, to handle getting the new extended media types. SIOCGIFMEDIA is retained for backwards compatibility. - Changes to ifconfig to allow it to handle the new extended media types. Submitted by: m...@karels.net (original), hselasky Reviewed by: jfvogel, gnn, hselasky Approved by: jfvogel (mentor), gnn (mentor) Differential Revision: http://reviews.freebsd.org/D1965 Modified: head/sbin/ifconfig/ifmedia.c head/sys/net/ieee8023ad_lacp.c head/sys/net/if.c head/sys/net/if_media.c head/sys/net/if_media.h head/sys/sys/sockio.h Modified: head/sbin/ifconfig/ifmedia.c == --- head/sbin/ifconfig/ifmedia.cTue Apr 7 21:05:52 2015 (r281235) +++ head/sbin/ifconfig/ifmedia.cTue Apr 7 21:31:17 2015 (r281236) @@ -109,11 +109,17 @@ media_status(int s) { struct ifmediareq ifmr; int *media_list, i; + int xmedia = 1; (void) memset(ifmr, 0, sizeof(ifmr)); (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) { + /* +* Check if interface supports extended media types. +*/ + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) 0) + xmedia = 0; + if (xmedia == 0 ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) { /* * Interface doesn't support SIOC{G,S}IFMEDIA. */ @@ -130,8 +136,13 @@ media_status(int s) err(1, malloc); ifmr.ifm_ulist = media_list; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) - err(1, SIOCGIFMEDIA); + if (xmedia) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) 0) + err(1, SIOCGIFXMEDIA); + } else { + if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) + err(1, SIOCGIFMEDIA); + } printf(\tmedia: ); print_media_word(ifmr.ifm_current, 1); @@ -194,6 +205,7 @@ ifmedia_getstate(int s) { static struct ifmediareq *ifmr = NULL; int *mwords; + int xmedia = 1; if (ifmr == NULL) { ifmr = (struct ifmediareq *)malloc(sizeof(struct ifmediareq)); @@ -213,7 +225,10 @@ ifmedia_getstate(int s) * the current media type and the top-level type. */ - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) 0) { + xmedia = 0; + } + if (xmedia == 0 ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) { err(1, SIOCGIFMEDIA); } @@ -225,8 +240,13 @@ ifmedia_getstate(int s) err(1, malloc); ifmr-ifm_ulist = mwords; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) - err(1, SIOCGIFMEDIA); + if (xmedia) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) 0) + err(1, SIOCGIFXMEDIA); + } else { + if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) 0) + err(1, SIOCGIFMEDIA); + } } return ifmr; Modified: head/sys/net/ieee8023ad_lacp.c == --- head/sys/net/ieee8023ad_lacp.c Tue Apr 7 21:05:52 2015 (r281235) +++ head/sys/net/ieee8023ad_lacp.c Tue Apr 7 21:31:17 2015 (r281236) @@ -1066,12 +1066,16 @@ lacp_compose_key(struct lacp_port *lp) case IFM_100_T4: case IFM_100_VG: case IFM_100_T2: + case IFM_100_T: key = IFM_100_TX; break; case IFM_1000_SX: case IFM_1000_LX: case IFM_1000_CX: case IFM_1000_T: + case IFM_1000_KX: + case IFM_1000_SGMII: + case IFM_1000_CX_SGMII: key = IFM_1000_SX; break; case IFM_10G_LR: @@ -1081,15 +1085,53 @@ lacp_compose_key(struct lacp_port *lp) case IFM_10G_TWINAX_LONG: case IFM_10G_LRM: case
svn commit: r281235 - stable/10/usr.sbin/pmcstudy
Author: rrs Date: Tue Apr 7 21:05:52 2015 New Revision: 281235 URL: https://svnweb.freebsd.org/changeset/base/281235 Log: MFC of r280697 and r280698 Sponsored by: Netflix Inc. Added: stable/10/usr.sbin/pmcstudy/pmcstudy.8 - copied, changed from r280697, head/usr.sbin/pmcstudy/pmcstudy.8 Deleted: stable/10/usr.sbin/pmcstudy/pmcstudy.1 Modified: stable/10/usr.sbin/pmcstudy/Makefile stable/10/usr.sbin/pmcstudy/pmcstudy.c Modified: stable/10/usr.sbin/pmcstudy/Makefile == --- stable/10/usr.sbin/pmcstudy/MakefileTue Apr 7 20:29:03 2015 (r281234) +++ stable/10/usr.sbin/pmcstudy/MakefileTue Apr 7 21:05:52 2015 (r281235) @@ -2,6 +2,7 @@ # $FreeBSD$ PROG= pmcstudy +MAN= pmcstudy.8 SRCS= pmcstudy.c eval_expr.c CFLAGS+= -Wall -Werror Copied and modified: stable/10/usr.sbin/pmcstudy/pmcstudy.8 (from r280697, head/usr.sbin/pmcstudy/pmcstudy.8) == --- head/usr.sbin/pmcstudy/pmcstudy.8 Thu Mar 26 15:40:47 2015 (r280697, copy source) +++ stable/10/usr.sbin/pmcstudy/pmcstudy.8 Tue Apr 7 21:05:52 2015 (r281235) @@ -25,7 +25,7 @@ .\ $FreeBSD$ .\ .Dd Mar 26, 2015 -.Dt PMCSTUDY 1 +.Dt PMCSTUDY 8 .Os .Sh NAME .Nm pmcstudy Modified: stable/10/usr.sbin/pmcstudy/pmcstudy.c == --- stable/10/usr.sbin/pmcstudy/pmcstudy.c Tue Apr 7 20:29:03 2015 (r281234) +++ stable/10/usr.sbin/pmcstudy/pmcstudy.c Tue Apr 7 21:05:52 2015 (r281235) @@ -2130,7 +2130,11 @@ test_for_a_pmc(const char *pmc, int out_ printf( ); } } - printf(%s, line[j]); + if (len) { + printf(%s, line[j]); + } else { + printf(\n); + } goto out; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281237 - in head/sys/boot/efi: boot1 loader loader/arch/amd64 loader/arch/arm
Author: emaste Date: Tue Apr 7 21:34:49 2015 New Revision: 281237 URL: https://svnweb.freebsd.org/changeset/base/281237 Log: EFI: use common reloc.c for all architectures Much of this file is common to the architectures we support, so share an implementation by adding a little #ifdef-ery. Differential Revision:https://reviews.freebsd.org/D2241 Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/boot/efi/loader/reloc.c - copied, changed from r281235, head/sys/boot/efi/loader/arch/amd64/reloc.c Deleted: head/sys/boot/efi/loader/arch/amd64/reloc.c head/sys/boot/efi/loader/arch/arm/reloc.c Modified: head/sys/boot/efi/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile == --- head/sys/boot/efi/boot1/MakefileTue Apr 7 21:31:17 2015 (r281236) +++ head/sys/boot/efi/boot1/MakefileTue Apr 7 21:34:49 2015 (r281237) @@ -23,7 +23,9 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/d CFLAGS+= -I${.CURDIR}/../../.. # Always add MI sources and REGULAR efi loader bits -.PATH: ${.CURDIR}/../loader/arch/${MACHINE_CPUARCH} ${.CURDIR}/../../common +.PATH: ${.CURDIR}/../loader/arch/${MACHINE_CPUARCH} +.PATH: ${.CURDIR}/../loader +.PATH: ${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../common FILES= boot1.efi boot1.efifat Copied and modified: head/sys/boot/efi/loader/reloc.c (from r281235, head/sys/boot/efi/loader/arch/amd64/reloc.c) == --- head/sys/boot/efi/loader/arch/amd64/reloc.c Tue Apr 7 21:05:52 2015 (r281235, copy source) +++ head/sys/boot/efi/loader/reloc.cTue Apr 7 21:34:49 2015 (r281237) @@ -32,18 +32,30 @@ __FBSDID($FreeBSD$); #include efi.h #include bootstrap.h -#ifdef __i386__ +#if defined(__arm__) || defined(__i386__) #define ElfW_Rel Elf32_Rel #defineElfW_DynElf32_Dyn #defineELFW_R_TYPE ELF32_R_TYPE -#elif __amd64__ +#elif defined(__amd64__) #define ElfW_Rel Elf64_Rel #defineElfW_DynElf64_Dyn #defineELFW_R_TYPE ELF64_R_TYPE +#else +#error architecture not supported +#endif +#if defined(__amd64__) +#defineRELOC_TYPE_NONE R_X86_64_NONE +#defineRELOC_TYPE_RELATIVE R_X86_64_RELATIVE +#elif defined(__arm__) +#defineRELOC_TYPE_NONE R_ARM_NONE +#defineRELOC_TYPE_RELATIVE R_ARM_RELATIVE +#elif defined(__i386__) +#defineRELOC_TYPE_NONE R_386_NONE +#defineRELOC_TYPE_RELATIVE R_386_RELATIVE #endif /* - * A simple relocator for IA32/AMD64 EFI binaries. + * A simple relocator for EFI binaries. */ EFI_STATUS _reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle, @@ -81,17 +93,14 @@ _reloc(unsigned long ImageBase, ElfW_Dyn /* * Perform the actual relocation. -* XXX: We are reusing code for the amd64 version of this, but -* we must make sure the relocation types are the same. */ - CTASSERT(R_386_NONE == R_X86_64_NONE); - CTASSERT(R_386_RELATIVE == R_X86_64_RELATIVE); for (; relsz 0; relsz -= relent) { switch (ELFW_R_TYPE(rel-r_info)) { - case R_386_NONE: + case RELOC_TYPE_NONE: /* No relocation needs be performed. */ break; - case R_386_RELATIVE: + + case RELOC_TYPE_RELATIVE: /* Address relative to the base address. */ newaddr = (unsigned long *)(ImageBase + rel-r_offset); *newaddr += ImageBase; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281238 - head/sys/boot/efi/boot1
Author: emaste Date: Tue Apr 7 21:41:26 2015 New Revision: 281238 URL: https://svnweb.freebsd.org/changeset/base/281238 Log: Add EFI boot1 for i386 loader.efi still needs work, but boot1.efi now builds. Differential Revision:https://reviews.freebsd.org/D2244 Reviewed by: rpaulo Sponsored by: The FreeBSD Foundation Added: head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu (contents, props changed) Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/generate-fat.sh Modified: head/sys/boot/efi/boot1/Makefile == --- head/sys/boot/efi/boot1/MakefileTue Apr 7 21:34:49 2015 (r281237) +++ head/sys/boot/efi/boot1/MakefileTue Apr 7 21:41:26 2015 (r281238) @@ -38,9 +38,10 @@ LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymboli LDFLAGS+= -Wl,-znocombreloc .endif -.if ${MACHINE_CPUARCH} == arm +.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 # -# Add libstand for the __aeabi_* functions used by the compiler +# Add libstand for the runtime functions used by the compiler - for example +# __aeabi_* (arm) or __divdi3 (i386). # DPADD+=${LIBSTAND} LDADD+=-lstand Added: head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uuTue Apr 7 21:41:26 2015(r281238) @@ -0,0 +1,26 @@ +FAT template boot filesystem created by generate-fat.sh +DO NOT EDIT +$FreeBSD$ +begin 644 fat-i386.tmpl.bz2 +M0EIH.3%!629368LPCP`T#_[ZKJ[_ZN_ZO^J_Z[OJ_OJ^JK_KZNKNNJ +MZNKNZOJ^P`+\``4`15/%`]3U!H:-`:,C0```@:9!H`T`!D@@:9HF1 +MA``R:``:``T,C1DFFFAHT::`8F0TTR-#0,0Q,@TT```!HT,330:-!ID, +M@C$QFF(`#0R-0C1IH!B9#33(T-`Q#$R#30```C0Q--!HT8(F0R +M`:,3$::8%4DDT_(HDQDFC$TR8F31H#0R,@T-!IH`#0R-`:9`TT--C0-,C(R +M--/0C---/28$P:::G.M7$NU9*YMC#26[FI,))$0BU((B(@Y=99)$((0LB) +M:0@0AFL6JA=Y+)+JX9A-W:UXB7H/:9\#3OG;)]#;MZOE^X3DLPXZ:3R. +MJ1C*H@$(=/+'8VBTMO`8MBEXQ##KM0R4I%:M56K5JU:VHI4DHHK5T5I +M*TJU:M6KJY424489-2)**/SFZLBQ8L6+%BQ,FF +MFFZV)***)DTTUUFM/8L6+%BQ8L37TE%%$R:: +M;HNLR]568NF=;_H3.25=S.TN8C:-Q*3(SMM])*T6=89:T3R4HTB33/?:UL +MT;EO'`1RVBN@U%Y'F?@`M7BD0`O=;\FNSTK0`QK-P9;M*C)ZVIAUSMY +M+RXWJ797N#Z7)W*[T]0YDF(D\UI%H:I\KIQ?FW+,N`_U_S`9%EL9H,?D +M+[=S7F7N=K6VVB(EKJ(J71=U(].36-M9]E)+CJ[NMXBUME(921[;4OB +M8E]+[GX-LW+.`OW%#X4I`L0*`H@*982SL)%`M'-HP#B!/4PH$;I)EK +M?`??(!3=]_K])6G70T%+BT8F221O8;!LVT?HV[=-ZWZ_-QW,YL3*[OAV +MEUANWB*H1:7J(DC':.IN-FB,9(U;4KYX3]V595OW!)Q7'I@,%H6)DE$D=U +M)SYX7$29N2,5)S+BI\;YOW`%GE^XCCN2VCF,!JF6C5_VCU)(X.#PK1RK +MX2DAPVA9QW(:]R7*MS6`W#!]A,4Z3`DPI,2_D==K+`;5I:F4DBK,Q` +8(0E`!A6EJ2^21'$?^+N2**$A%F$86` +` +end Modified: head/sys/boot/efi/boot1/generate-fat.sh == --- head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 7 21:34:49 2015 (r281237) +++ head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 7 21:41:26 2015 (r281238) @@ -20,6 +20,7 @@ BOOT1_SIZE=128k # amd64: BOOTx64.efi # aarch64: BOOTaa64.efi # arm: BOOTarm.efi +# i386:BOOTia32.efi # if [ -z $2 ]; then echo Usage: $0 arch boot-filename ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281241 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 00:13:17 2015 New Revision: 281241 URL: https://svnweb.freebsd.org/changeset/base/281241 Log: MFC r276728: cxgbe(4): fix the description of a strange bunch of counters. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 7 23:31:49 2015 (r281240) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 00:13:17 2015 (r281241) @@ -4587,7 +4587,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, ddp_stats, CTLTYPE_STRING | CTLFLAG_RD, sc, 0, - sysctl_ddp_stats, A, DDP statistics); + sysctl_ddp_stats, A, non-TCP DDP statistics); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, devlog, CTLTYPE_STRING | CTLFLAG_RD, sc, 0, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281244 - in stable/10/sys/dev/cxgbe: . tom
Author: np Date: Wed Apr 8 00:35:12 2015 New Revision: 281244 URL: https://svnweb.freebsd.org/changeset/base/281244 Log: MFC r276597: cxgbe/tom: do not engage the TOE's payload chopper for payload 2 MSS or for 10Gbps ports. Modified: stable/10/sys/dev/cxgbe/offload.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/offload.h == --- stable/10/sys/dev/cxgbe/offload.h Wed Apr 8 00:32:39 2015 (r281243) +++ stable/10/sys/dev/cxgbe/offload.h Wed Apr 8 00:35:12 2015 (r281244) @@ -147,6 +147,7 @@ struct tom_tunables { int indsz; int ddp_thres; int rx_coalesce; + int tx_align; }; int t4_register_uld(struct uld_info *); Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 00:32:39 2015 (r281243) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 00:35:12 2015 (r281244) @@ -4689,6 +4689,10 @@ t4_sysctls(struct adapter *sc) sc-tt.rx_coalesce = 1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, rx_coalesce, CTLFLAG_RW, sc-tt.rx_coalesce, 0, receive coalescing); + + sc-tt.tx_align = 1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, tx_align, + CTLFLAG_RW, sc-tt.tx_align, 0, chop and align payload); } #endif Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c == --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Apr 8 00:32:39 2015 (r281243) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Apr 8 00:35:12 2015 (r281244) @@ -491,7 +491,7 @@ max_dsgl_nsegs(int tx_credits) static inline void write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, -unsigned int plen, uint8_t credits, int shove, int ulp_mode) +unsigned int plen, uint8_t credits, int shove, int ulp_mode, int txalign) { struct fw_ofld_tx_data_wr *txwr = dst; unsigned int wr_ulp_mode; @@ -513,6 +513,19 @@ write_tx_wr(void *dst, struct toepcb *to V_FW_OFLD_TX_DATA_WR_URGENT(0) |/* XXX */ V_FW_OFLD_TX_DATA_WR_SHOVE(shove)); txwr-plen = htobe32(plen); + + if (txalign 0) { + struct tcpcb *tp = intotcpcb(toep-inp); + + if (plen 2 * tp-t_maxseg || is_10G_port(toep-port)) + txwr-lsodisable_to_proxy |= + htobe32(F_FW_OFLD_TX_DATA_WR_LSODISABLE); + else + txwr-lsodisable_to_proxy |= + htobe32(F_FW_OFLD_TX_DATA_WR_ALIGNPLD | + (tp-t_flags TF_NODELAY ? 0 : + F_FW_OFLD_TX_DATA_WR_ALIGNPLDSHOVE)); + } } /* @@ -716,7 +729,8 @@ t4_push_frames(struct adapter *sc, struc } txwr = wrtod(wr); credits = howmany(wr-wr_len, 16); - write_tx_wr(txwr, toep, plen, plen, credits, shove, 0); + write_tx_wr(txwr, toep, plen, plen, credits, shove, 0, + sc-tt.tx_align); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -734,7 +748,8 @@ t4_push_frames(struct adapter *sc, struc } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, plen, credits, shove, 0); + write_tx_wr(txwr, toep, 0, plen, credits, shove, 0, + sc-tt.tx_align); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len 0xf) { @@ -890,7 +905,7 @@ t4_ulp_push_frames(struct adapter *sc, s txwr = wrtod(wr); credits = howmany(wr-wr_len, 16); write_tx_wr(txwr, toep, plen, ulp_len, credits, shove, - ulp_mode); + ulp_mode, 0); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); } else { int wr_len; @@ -907,7 +922,7 @@ t4_ulp_push_frames(struct adapter *sc, s txwr = wrtod(wr); credits = howmany(wr_len, 16); write_tx_wr(txwr, toep, 0, ulp_len, credits, shove, - ulp_mode); +
svn commit: r281239 - head/sys/netinet
Author: adrian Date: Tue Apr 7 23:09:34 2015 New Revision: 281239 URL: https://svnweb.freebsd.org/changeset/base/281239 Log: Move the IPv4 reassembly queue locking from a single lock to be per-bucket (global). This significantly improves performance on multi-core servers where there is any kind of IPv4 reassembly going on. glebius@ would like to see the locking moved to be attached to the reassembly bucket, which would make it per-bucket + per-VNET, instead of being global. I decided to keep it global for now as it's the minimal useful change; if people agree / wish to migrate it to be per-bucket / per-VNET then please do feel free to do so. I won't complain. Thanks to Norse Corp for giving me access to much larger servers to test this at across the 4 core boxes I have at home. Differential Revision:https://reviews.freebsd.org/D2095 Reviewed by: glebius (initial comments incorporated into this patch) MFC after:2 weeks Sponsored by: Norse Corp, Inc (hardware) Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c == --- head/sys/netinet/ip_input.c Tue Apr 7 21:41:26 2015(r281238) +++ head/sys/netinet/ip_input.c Tue Apr 7 23:09:34 2015(r281239) @@ -166,15 +166,18 @@ VNET_DEFINE(u_long, in_ifaddrhmask); /* static VNET_DEFINE(uma_zone_t, ipq_zone); static VNET_DEFINE(TAILQ_HEAD(ipqhead, ipq), ipq[IPREASS_NHASH]); -static struct mtx ipqlock; +static struct mtx_padalign ipqlock[IPREASS_NHASH]; #defineV_ipq_zone VNET(ipq_zone) #defineV_ipq VNET(ipq) -#defineIPQ_LOCK() mtx_lock(ipqlock) -#defineIPQ_UNLOCK()mtx_unlock(ipqlock) -#defineIPQ_LOCK_INIT() mtx_init(ipqlock, ipqlock, NULL, MTX_DEF) -#defineIPQ_LOCK_ASSERT() mtx_assert(ipqlock, MA_OWNED) +/* + * The ipqlock array is global, /not/ per-VNET. + */ +#defineIPQ_LOCK(i) mtx_lock(ipqlock[(i)]) +#defineIPQ_UNLOCK(i) mtx_unlock(ipqlock[(i)]) +#defineIPQ_LOCK_INIT(i)mtx_init(ipqlock[(i)], ipqlock, NULL, MTX_DEF) +#defineIPQ_LOCK_ASSERT(i) mtx_assert(ipqlock[(i)], MA_OWNED) static voidmaxnipq_update(void); static voidipq_zone_change(void *); @@ -206,7 +209,7 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, steal IP stealth mode, no TTL decrementation on forwarding); #endif -static voidip_freef(struct ipqhead *, struct ipq *); +static voidip_freef(struct ipqhead *, int, struct ipq *); /* * IP statistics are stored in the array of counter(9)s. @@ -373,7 +376,8 @@ ip_init(void) NULL, EVENTHANDLER_PRI_ANY); /* Initialize various other remaining things. */ - IPQ_LOCK_INIT(); + for (i = 0; i IPREASS_NHASH; i++) + IPQ_LOCK_INIT(i); netisr_register(ip_nh); #ifdef RSS netisr_register(ip_direct_nh); @@ -393,9 +397,7 @@ ip_destroy(void) /* Cleanup in_ifaddr hash table; should be empty. */ hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask); - IPQ_LOCK(); ip_drain_locked(); - IPQ_UNLOCK(); uma_zdestroy(V_ipq_zone); } @@ -856,6 +858,41 @@ SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxf #defineM_IP_FRAG M_PROTO9 /* + * Attempt to purge something from the reassembly queue to make + * room. + * + * Must be called without any IPQ locks held, as it will attempt + * to lock each in turn. + * + * 'skip_bucket' is the bucket with which to skip over, or -1 to + * not skip over anything. + * + * Returns the bucket being freed, or -1 for no action. + */ +static int +ip_reass_purge_element(int skip_bucket) +{ + int i; + struct ipq *r; + + for (i = 0; i IPREASS_NHASH; i++) { + if (skip_bucket -1 i == skip_bucket) + continue; + IPQ_LOCK(i); + r = TAILQ_LAST(V_ipq[i], ipqhead); + if (r) { + IPSTAT_ADD(ips_fragtimeout, + r-ipq_nfrags); + ip_freef(V_ipq[i], i, r); + IPQ_UNLOCK(i); + return (i); + } + IPQ_UNLOCK(i); + } + return (-1); +} + +/* * Take incoming datagram fragment and try to reassemble it into * whole datagram. If the argument is the first fragment or one * in between the function will return NULL and store the mbuf @@ -878,6 +915,7 @@ ip_reass(struct mbuf *m) #ifdef RSS uint32_t rss_hash, rss_type; #endif + int do_purge = 0; /* If maxnipq or maxfragsperpacket are 0, never accept fragments. */ if (V_maxnipq == 0 || V_maxfragsperpacket == 0) { @@ -892,7 +930,7 @@ ip_reass(struct mbuf *m) hash = IPREASS_HASH(ip-ip_src.s_addr, ip-ip_id); head = V_ipq[hash]; - IPQ_LOCK(); +
svn commit: r281242 - head/sys/powerpc/booke
Author: jhibbits Date: Wed Apr 8 00:31:33 2015 New Revision: 281242 URL: https://svnweb.freebsd.org/changeset/base/281242 Log: Unbreak book-e, broken by the trap.c merge (missed this file). Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S == --- head/sys/powerpc/booke/locore.S Wed Apr 8 00:13:17 2015 (r281241) +++ head/sys/powerpc/booke/locore.S Wed Apr 8 00:31:33 2015 (r281242) @@ -722,12 +722,10 @@ setfault: lwz %r4, TD_PCB(%r2) stw %r3, PCB_ONFAULT(%r4) mfcr%r10 - mfctr %r11 - mfxer %r12 stw %r0, 0(%r3) stw %r1, 4(%r3) stw %r2, 8(%r3) - stmw%r10, 12(%r3) /* store CR, CTR, XER, [r13 .. r31] */ + stmw%r13, 12(%r3) /* store CR, CTR, XER, [r13 .. r31] */ li %r3, 0 /* return FALSE */ blr ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281243 - head/lib/libc/powerpc/gen
Author: jhibbits Date: Wed Apr 8 00:32:39 2015 New Revision: 281243 URL: https://svnweb.freebsd.org/changeset/base/281243 Log: Fix powerpc setjmp FPR saving/restoring. X-MFC-With: r279784 Modified: head/lib/libc/powerpc/gen/_setjmp.S head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc/gen/sigsetjmp.S Modified: head/lib/libc/powerpc/gen/_setjmp.S == --- head/lib/libc/powerpc/gen/_setjmp.S Wed Apr 8 00:31:33 2015 (r281242) +++ head/lib/libc/powerpc/gen/_setjmp.S Wed Apr 8 00:32:39 2015 (r281243) @@ -58,24 +58,24 @@ ENTRY(_setjmp) stmw%r9,20(%r3) /* FPRs */ - stfd%f14,92+0*8(%r3) - stfd%f15,92+1*8(%r3) - stfd%f16,92+2*8(%r3) - stfd%f17,92+3*8(%r3) - stfd%f18,92+4*8(%r3) - stfd%f19,92+5*8(%r3) - stfd%f20,92+6*8(%r3) - stfd%f21,92+7*8(%r3) - stfd%f22,92+8*8(%r3) - stfd%f23,92+9*8(%r3) - stfd%f24,92+10*8(%r3) - stfd%f25,92+11*8(%r3) - stfd%f26,92+12*8(%r3) - stfd%f27,92+13*8(%r3) - stfd%f28,93+13*8(%r3) - stfd%f29,93+14*8(%r3) - stfd%f30,93+15*8(%r3) - stfd%f31,93+16*8(%r3) + stfd%f14,112+0*8(%r3) + stfd%f15,112+1*8(%r3) + stfd%f16,112+2*8(%r3) + stfd%f17,112+3*8(%r3) + stfd%f18,112+4*8(%r3) + stfd%f19,112+5*8(%r3) + stfd%f20,112+6*8(%r3) + stfd%f21,112+7*8(%r3) + stfd%f22,112+8*8(%r3) + stfd%f23,112+9*8(%r3) + stfd%f24,112+10*8(%r3) + stfd%f25,112+11*8(%r3) + stfd%f26,112+12*8(%r3) + stfd%f27,112+13*8(%r3) + stfd%f28,112+14*8(%r3) + stfd%f29,112+15*8(%r3) + stfd%f30,112+16*8(%r3) + stfd%f31,112+17*8(%r3) li %r3,0 blr @@ -85,24 +85,24 @@ ENTRY(_longjmp) lmw %r9,20(%r3) /* FPRs */ - lfd %f14,92+0*8(%r3) - lfd %f15,92+1*8(%r3) - lfd %f16,92+2*8(%r3) - lfd %f17,92+3*8(%r3) - lfd %f18,92+4*8(%r3) - lfd %f19,92+5*8(%r3) - lfd %f20,92+6*8(%r3) - lfd %f21,92+7*8(%r3) - lfd %f22,92+8*8(%r3) - lfd %f23,92+9*8(%r3) - lfd %f24,92+10*8(%r3) - lfd %f25,92+11*8(%r3) - lfd %f26,92+12*8(%r3) - lfd %f27,92+13*8(%r3) - lfd %f28,93+13*8(%r3) - lfd %f29,93+14*8(%r3) - lfd %f30,93+15*8(%r3) - lfd %f31,93+16*8(%r3) + lfd %f14,112+0*8(%r3) + lfd %f15,112+1*8(%r3) + lfd %f16,112+2*8(%r3) + lfd %f17,112+3*8(%r3) + lfd %f18,112+4*8(%r3) + lfd %f19,112+5*8(%r3) + lfd %f20,112+6*8(%r3) + lfd %f21,112+7*8(%r3) + lfd %f22,112+8*8(%r3) + lfd %f23,112+9*8(%r3) + lfd %f24,112+10*8(%r3) + lfd %f25,112+11*8(%r3) + lfd %f26,112+12*8(%r3) + lfd %f27,112+13*8(%r3) + lfd %f28,112+14*8(%r3) + lfd %f29,112+15*8(%r3) + lfd %f30,112+16*8(%r3) + lfd %f31,112+17*8(%r3) mtlr%r11 mtcr%r12 Modified: head/lib/libc/powerpc/gen/setjmp.S == --- head/lib/libc/powerpc/gen/setjmp.S Wed Apr 8 00:31:33 2015 (r281242) +++ head/lib/libc/powerpc/gen/setjmp.S Wed Apr 8 00:32:39 2015 (r281243) @@ -68,24 +68,24 @@ ENTRY(setjmp) stmw%r9,20(%r6) /* FPRs */ - stfd%f14,92+0*8(%r6) - stfd%f15,92+1*8(%r6) - stfd%f16,92+2*8(%r6) - stfd%f17,92+3*8(%r6) - stfd%f18,92+4*8(%r6) - stfd%f19,92+5*8(%r6) - stfd%f20,92+6*8(%r6) - stfd%f21,92+7*8(%r6) - stfd%f22,92+8*8(%r6) - stfd%f23,92+9*8(%r6) - stfd%f24,92+10*8(%r6) - stfd%f25,92+11*8(%r6) - stfd%f26,92+12*8(%r6) - stfd%f27,92+13*8(%r6) - stfd%f28,93+13*8(%r6) - stfd%f29,93+14*8(%r6) - stfd%f30,93+15*8(%r6) - stfd%f31,93+16*8(%r6) + stfd%f14,112+0*8(%r6) + stfd%f15,112+1*8(%r6) + stfd%f16,112+2*8(%r6) + stfd%f17,112+3*8(%r6) + stfd%f18,112+4*8(%r6) + stfd%f19,112+5*8(%r6) + stfd%f20,112+6*8(%r6) + stfd%f21,112+7*8(%r6) + stfd%f22,112+8*8(%r6) + stfd%f23,112+9*8(%r6) + stfd%f24,112+10*8(%r6) + stfd%f25,112+11*8(%r6) + stfd%f26,112+12*8(%r6) + stfd%f27,112+13*8(%r6) + stfd%f28,112+14*8(%r6) + stfd%f29,112+15*8(%r6) + stfd%f30,112+16*8(%r6) + stfd%f31,112+17*8(%r6) li %r3,0 /* return (0) */ blr @@ -96,24 +96,24 @@
svn commit: r281246 - stable/10/tools/tools/cxgbetool
Author: np Date: Wed Apr 8 00:52:45 2015 New Revision: 281246 URL: https://svnweb.freebsd.org/changeset/base/281246 Log: MFC r276598, r276607. r276598: Add a manual page for cxgbetool. It is incomplete but definitely better than nothing. r276607: Fix all nits reported by mandoc -Tlint. Added: stable/10/tools/tools/cxgbetool/cxgbetool.8 - copied, changed from r276598, head/tools/tools/cxgbetool/cxgbetool.8 Modified: stable/10/tools/tools/cxgbetool/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/cxgbetool/Makefile == --- stable/10/tools/tools/cxgbetool/MakefileWed Apr 8 00:49:53 2015 (r281245) +++ stable/10/tools/tools/cxgbetool/MakefileWed Apr 8 00:52:45 2015 (r281246) @@ -2,7 +2,7 @@ PROG= cxgbetool SRCS= cxgbetool.c -MAN= +MAN= cxgbetool.8 CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgbe -I${.CURDIR}/../../../sys -I. BINDIR?= /usr/sbin Copied and modified: stable/10/tools/tools/cxgbetool/cxgbetool.8 (from r276598, head/tools/tools/cxgbetool/cxgbetool.8) == --- head/tools/tools/cxgbetool/cxgbetool.8 Sat Jan 3 00:26:21 2015 (r276598, copy source) +++ stable/10/tools/tools/cxgbetool/cxgbetool.8 Wed Apr 8 00:52:45 2015 (r281246) @@ -1,4 +1,4 @@ -. Copyright (c) 2015, Chelsio Inc +.\ Copyright (c) 2015, Chelsio Inc .\ All rights reserved. .\ .\ Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ The rest consists of a command and any p .It Cm clearstats Ar port_id Clear all transmit, receive, and error statistics of all queues associated with a port. -The total number of ports attached to a nexus is listed in +The total number of ports attached to a nexus is listed in .Va dev.t4nex.%d.nports and the 0 based .Ar port_id @@ -407,7 +407,6 @@ Class Weighted Round Robin. .It Sy cl-wrr Channel Rate Limiting. .El -.Pp .It Sy mode Ar scheduler-mode The mode in which the scheduling class is going to operate: .Pp @@ -425,7 +424,6 @@ mode, all of the flows bound to the cl aggregate bandwidth of 10Mb/s; but in .Cm flow mode, each of the flows bound to the scheduling class would be limited to 10Mb/s. -.Pp .It Sy rate-unit Ar scheduler-rate-unit The units of the scheduler rate constraints: .Pp @@ -446,19 +444,14 @@ percent of port rate. .It Sy absolute Kb/s. .El -.Pp .It Sy channel Ar scheduler-channel-index The scheduling channel to which the scheduling class will be bound. -.Pp .It Sy class Ar scheduler-class-index The scheduling class being programmed. -.Pp .It Sy min-rate Ar minimum-rate The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access. -.Pp .It Sy max-rate Ar maximum-rate The maximum rate for a rate-limiting scheduling class hierarchy. -.Pp .It Sy weight Ar round-robin-weight The weight to be used for a weighted-round-robin scheduling hierarchy. .It Sy pkt-size Ar average-packet-size ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281245 - stable/10/sys/dev/cxgbe/tom
Author: np Date: Wed Apr 8 00:49:53 2015 New Revision: 281245 URL: https://svnweb.freebsd.org/changeset/base/281245 Log: MFC r276729, r276775. r276729: cxgbe/tom: use vmem(9) as the DDP page pod allocator. r276775: cxgbe/tom: allocate page pod addresses instead of ppod#. Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c stable/10/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c == --- stable/10/sys/dev/cxgbe/tom/t4_ddp.cWed Apr 8 00:35:12 2015 (r281244) +++ stable/10/sys/dev/cxgbe/tom/t4_ddp.cWed Apr 8 00:49:53 2015 (r281245) @@ -68,7 +68,7 @@ __FBSDID($FreeBSD$); #define PPOD_SZ(n) ((n) * sizeof(struct pagepod)) #define PPOD_SIZE (PPOD_SZ(1)) -/* XXX: must match A_ULP_RX_TDDP_PSZ */ +/* XXX: must match A_ULP_RX_TDDP_PSZ */ static int t4_ddp_pgsz[] = {4096, 4096 2, 4096 4, 4096 6}; #if 0 @@ -98,74 +98,26 @@ t4_dump_tcb(struct adapter *sc, int tid) #define MAX_DDP_BUFFER_SIZE(M_TCB_RX_DDP_BUF0_LEN) static int -alloc_ppods(struct tom_data *td, int n, struct ppod_region *pr) +alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr) { - int ppod; + vmem_addr_t v; + int rc; - KASSERT(n 0, (%s: nonsense allocation (%d), __func__, n)); + MPASS(n 0); - mtx_lock(td-ppod_lock); - if (n td-nppods_free) { - mtx_unlock(td-ppod_lock); - return (-1); - } - - if (td-nppods_free_head = n) { - td-nppods_free_head -= n; - ppod = td-nppods_free_head; - TAILQ_INSERT_HEAD(td-ppods, pr, link); - } else { - struct ppod_region *p; - - ppod = td-nppods_free_head; - TAILQ_FOREACH(p, td-ppods, link) { - ppod += p-used + p-free; - if (n = p-free) { - ppod -= n; - p-free -= n; - TAILQ_INSERT_AFTER(td-ppods, p, pr, link); - goto allocated; - } - } - - if (__predict_false(ppod != td-nppods)) { - panic(%s: ppods TAILQ (%p) corrupt. - At %d instead of %d at the end of the queue., - __func__, td-ppods, ppod, td-nppods); - } + rc = vmem_alloc(td-ppod_arena, PPOD_SZ(n), M_NOWAIT | M_FIRSTFIT, v); + *ppod_addr = (u_int)v; - mtx_unlock(td-ppod_lock); - return (-1); - } - -allocated: - pr-used = n; - pr-free = 0; - td-nppods_free -= n; - mtx_unlock(td-ppod_lock); - - return (ppod); + return (rc); } static void -free_ppods(struct tom_data *td, struct ppod_region *pr) +free_ppods(struct tom_data *td, u_int ppod_addr, int n) { - struct ppod_region *p; - KASSERT(pr-used 0, (%s: nonsense free (%d), __func__, pr-used)); + MPASS(n 0); - mtx_lock(td-ppod_lock); - p = TAILQ_PREV(pr, ppod_head, link); - if (p != NULL) - p-free += pr-used + pr-free; - else - td-nppods_free_head += pr-used + pr-free; - td-nppods_free += pr-used; - KASSERT(td-nppods_free = td-nppods, - (%s: nppods_free (%d) nppods (%d). %d freed this time., - __func__, td-nppods_free, td-nppods, pr-used)); - TAILQ_REMOVE(td-ppods, pr, link); - mtx_unlock(td-ppod_lock); + vmem_free(td-ppod_arena, (vmem_addr_t)ppod_addr, PPOD_SZ(n)); } static inline int @@ -187,7 +139,7 @@ free_ddp_buffer(struct tom_data *td, str free(db-pages, M_CXGBE); if (db-nppods 0) - free_ppods(td, db-ppod_region); + free_ppods(td, db-ppod_addr, db-nppods); free(db, M_CXGBE); } @@ -702,6 +654,7 @@ alloc_ddp_buffer(struct tom_data *td, vm break; } have_pgsz: + MPASS(idx = M_PPOD_PGSZ); db = malloc(sizeof(*db), M_CXGBE, M_NOWAIT); if (db == NULL) { @@ -710,16 +663,13 @@ have_pgsz: } nppods = pages_to_nppods(npages, t4_ddp_pgsz[idx]); - ppod = alloc_ppods(td, nppods, db-ppod_region); - if (ppod 0) { + if (alloc_ppods(td, nppods, db-ppod_addr) != 0) { free(db, M_CXGBE); CTR4(KTR_CXGBE, %s: no pods, nppods %d, resid %d, pgsz %d, __func__, nppods, len, t4_ddp_pgsz[idx]); return (NULL); } - - KASSERT(idx = M_PPOD_PGSZ ppod = M_PPOD_TAG, - (%s: DDP pgsz_idx = %d, ppod = %d, __func__, idx, ppod)); + ppod = (db-ppod_addr - td-ppod_start) / PPOD_SIZE; db-tag = V_PPOD_PGSZ(idx) | V_PPOD_TAG(ppod); db-nppods = nppods; @@ -745,7
svn commit: r281249 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 01:07:51 2015 New Revision: 281249 URL: https://svnweb.freebsd.org/changeset/base/281249 Log: MFC r278371: cxgbe(4): a change to the synchronization rules within the the driver. This is purely cosmetic because the new rules are already followed. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h == --- stable/10/sys/dev/cxgbe/adapter.h Wed Apr 8 01:05:50 2015 (r281248) +++ stable/10/sys/dev/cxgbe/adapter.h Wed Apr 8 01:07:51 2015 (r281249) @@ -803,7 +803,6 @@ struct adapter { #define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert((sc)-sc_lock, MA_OWNED) #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert((sc)-sc_lock, MA_NOTOWNED) -/* XXX: not bulletproof, but much better than nothing */ #define ASSERT_SYNCHRONIZED_OP(sc) \ KASSERT(IS_BUSY(sc) \ (mtx_owned((sc)-sc_lock) || sc-last_op_thr == curthread), \ Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:05:50 2015 (r281248) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:07:51 2015 (r281249) @@ -3049,6 +3049,9 @@ mcfail: return (rc); } +/* + * {begin|end}_synchronized_op must be called from the same thread. + */ int begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags, char *wmesg) @@ -3104,6 +3107,9 @@ done: return (rc); } +/* + * {begin|end}_synchronized_op must be called from the same thread. + */ void end_synchronized_op(struct adapter *sc, int flags) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281251 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 01:16:19 2015 New Revision: 281251 URL: https://svnweb.freebsd.org/changeset/base/281251 Log: MFC r279969: cxgbe(4): fix if_media handling for T520-BT cards. 1Gbps and 100Mbps are valid for this card. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:09:36 2015 (r281250) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:16:19 2015 (r281251) @@ -2807,9 +2807,6 @@ build_medialist(struct port_info *pi, st switch(pi-port_type) { case FW_PORT_TYPE_BT_XFI: - ifmedia_add(media, m | IFM_10G_T, data, NULL); - break; - case FW_PORT_TYPE_BT_XAUI: ifmedia_add(media, m | IFM_10G_T, data, NULL); /* fall through */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281252 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 01:25:26 2015 New Revision: 281252 URL: https://svnweb.freebsd.org/changeset/base/281252 Log: MFC r280403: cxgbe(4): Do not call sbuf_trim on an sbuf with a drain function. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:16:19 2015 (r281251) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:25:26 2015 (r281252) @@ -4951,13 +4951,16 @@ cxgbe_sysctls(struct port_info *pi) static int sysctl_int_array(SYSCTL_HANDLER_ARGS) { - int rc, *i; + int rc, *i, space = 0; struct sbuf sb; sbuf_new(sb, NULL, 32, SBUF_AUTOEXTEND); - for (i = arg1; arg2; arg2 -= sizeof(int), i++) - sbuf_printf(sb, %d , *i); - sbuf_trim(sb); + for (i = arg1; arg2; arg2 -= sizeof(int), i++) { + if (space) + sbuf_printf(sb, ); + sbuf_printf(sb, %d, *i); + space = 1; + } sbuf_finish(sb); rc = sysctl_handle_string(oidp, sbuf_data(sb), sbuf_len(sb), req); sbuf_delete(sb); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281253 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 01:43:29 2015 New Revision: 281253 URL: https://svnweb.freebsd.org/changeset/base/281253 Log: MFC r279243-r279246, r279251, r279691, r279700, and r279701. r279243: cxgbe(4): request an automatic tx update when a netmap txq idles. r279244: cxgbe(4): wait for the hardware to catch up before destroying a netmap txq. r279245: cxgbe(4): do not set the netmap rxq interrupts on a hair-trigger. r279246: cxgbe(4): set up congestion management for netmap rx queues. The hw.cxgbe.cong_drop knob controls the response of the chip when netmap queues are congested. r279251: cxgbe(4): allow tx hardware checksumming on the netmap interface. It is disabled by default but users can set IFCAP_TXCSUM on the netmap ifnet (ifconfig ncxl0 txcsum) to override netmap and force the hardware to calculate and insert proper IP and L4 checksums in outbound frames. r279691: cxgbe(4): provide the correct size of freelists associated with netmap rx queues to the chip. This will fix many problems with native netmap rx on ncxl/ncxgbe interfaces. r279700: cxgbe(4): knobs to experiment with the interrupt coalescing timer for netmap rx queues, and the batchiness of rx updates sent to the chip. These knobs will probably become per-rxq in the near future and will be documented only after their final form is decided. r279701: cxgbe(4): experimental rx packet sink for netmap queues. This is not intended for general use. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_netmap.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h == --- stable/10/sys/dev/cxgbe/adapter.h Wed Apr 8 01:25:26 2015 (r281252) +++ stable/10/sys/dev/cxgbe/adapter.h Wed Apr 8 01:43:29 2015 (r281253) @@ -1022,6 +1022,7 @@ void t4_wrq_tx_locked(struct adapter *, int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); void t4_update_fl_bufsize(struct ifnet *); int can_resume_tx(struct sge_eq *); +int tnl_cong(struct port_info *); /* t4_tracer.c */ struct t4_tracer; Modified: stable/10/sys/dev/cxgbe/t4_netmap.c == --- stable/10/sys/dev/cxgbe/t4_netmap.c Wed Apr 8 01:25:26 2015 (r281252) +++ stable/10/sys/dev/cxgbe/t4_netmap.c Wed Apr 8 01:43:29 2015 (r281253) @@ -58,6 +58,25 @@ extern int fl_pad; /* XXXNM */ extern int spg_len;/* XXXNM */ extern int fl_pktshift;/* XXXNM */ +SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, cxgbe netmap parameters); + +/* + * 0 = normal netmap rx + * 1 = black hole + * 2 = supermassive black hole (buffer packing enabled) + */ +int black_hole = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_black_hole, CTLFLAG_RDTUN, black_hole, 0, +Sink incoming packets.); + +int rx_ndesc = 256; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_rx_ndesc, CTLFLAG_RWTUN, +rx_ndesc, 0, # of rx descriptors after which the hw cidx is updated.); + +int holdoff_tmr_idx = 2; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdoff_tmr_idx, CTLFLAG_RWTUN, +holdoff_tmr_idx, 0, Holdoff timer index for netmap rx queues.); + /* netmap ifnet routines */ static void cxgbe_nm_init(void *); static int cxgbe_nm_ioctl(struct ifnet *, unsigned long, caddr_t); @@ -226,9 +245,9 @@ cxgbe_nm_qflush(struct ifnet *ifp) } static int -alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq) +alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong) { - int rc, cntxt_id; + int rc, cntxt_id, i; __be32 v; struct adapter *sc = pi-adapter; struct netmap_adapter *na = NA(pi-nm_ifp); @@ -267,14 +286,20 @@ alloc_nm_rxq_hwq(struct port_info *pi, s V_FW_IQ_CMD_IQESIZE(ilog2(IQ_ESIZE) - 4)); c.iqsize = htobe16(pi-qsize_rxq); c.iqaddr = htobe64(nm_rxq-iq_ba); + if (cong = 0) { + c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN | + V_FW_IQ_CMD_FL0CNGCHMAP(cong) | F_FW_IQ_CMD_FL0CONGCIF | + F_FW_IQ_CMD_FL0CONGEN); + } c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | F_FW_IQ_CMD_FL0FETCHRO | F_FW_IQ_CMD_FL0DATARO | - (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0)); + (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) | + (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); - c.fl0size = htobe16(na-num_rx_desc + spg_len / EQ_ESIZE); + c.fl0size = htobe16(na-num_rx_desc / 8 + spg_len / EQ_ESIZE); c.fl0addr = htobe64(nm_rxq-fl_ba); rc = -t4_wr_mbox(sc,
svn commit: r281256 - in stable/10/lib/libc: include sys
Author: kib Date: Wed Apr 8 02:21:44 2015 New Revision: 281256 URL: https://svnweb.freebsd.org/changeset/base/281256 Log: MFC r280959: Correctly handle __fcntl_compat symbol for the !SYSCALL_COMPAT case. Modified: stable/10/lib/libc/include/compat.h stable/10/lib/libc/sys/fcntl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/compat.h == --- stable/10/lib/libc/include/compat.h Wed Apr 8 02:15:13 2015 (r281255) +++ stable/10/lib/libc/include/compat.h Wed Apr 8 02:21:44 2015 (r281256) @@ -44,5 +44,14 @@ __sym_compat(shmctl, freebsd7_shmctl, FB #undef __sym_compat +#define__weak_reference(sym,alias) \ + .weak alias;.equ alias,sym + +#ifndef SYSCALL_COMPAT +__weak_reference(__sys_fcntl,__fcntl_compat) +#endif + +#undef __weak_reference + #endif /* __LIBC_COMPAT_H__ */ Modified: stable/10/lib/libc/sys/fcntl.c == --- stable/10/lib/libc/sys/fcntl.c Wed Apr 8 02:15:13 2015 (r281255) +++ stable/10/lib/libc/sys/fcntl.c Wed Apr 8 02:21:44 2015 (r281256) @@ -103,7 +103,4 @@ __fcntl_compat(int fd, int cmd, ...) return (__sys_fcntl(fd, cmd, arg)); } } -#else -__weak_reference(__sys_fcntl, __fcntl_compat); -__weak_reference(__sys_fcntl, __fcntl); #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281248 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 01:05:50 2015 New Revision: 281248 URL: https://svnweb.freebsd.org/changeset/base/281248 Log: MFC r278342: cxgbe(4): fix a test made while enabling TOE. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:02:11 2015 (r281247) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:05:50 2015 (r281248) @@ -8157,7 +8157,12 @@ toe_capability(struct port_info *pi, int return (ENODEV); if (enable) { - if (!(sc-flags FULL_INIT_DONE)) { + /* +* We need the port's queues around so that we're able to send +* and receive CPLs to/from the TOE even if the ifnet for this +* port has never been UP'd administratively. +*/ + if (!(pi-flags PORT_INIT_DONE)) { rc = cxgbe_init_synchronized(pi); if (rc) return (rc); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281255 - stable/10/sys/fs/devfs
Author: kib Date: Wed Apr 8 02:15:13 2015 New Revision: 281255 URL: https://svnweb.freebsd.org/changeset/base/281255 Log: MFC r280308 (by delphij): Disable timestamping on devfs read/write operations by default. MFC r280949: Refine r280308. Use seconds precision for devfs timestamps by default. Modified: stable/10/sys/fs/devfs/devfs_devs.c stable/10/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_devs.c == --- stable/10/sys/fs/devfs/devfs_devs.c Wed Apr 8 01:55:22 2015 (r281254) +++ stable/10/sys/fs/devfs/devfs_devs.c Wed Apr 8 02:15:13 2015 (r281255) @@ -61,7 +61,7 @@ static MALLOC_DEFINE(M_DEVFS2, DEVFS2, static MALLOC_DEFINE(M_DEVFS3, DEVFS3, DEVFS data 3); static MALLOC_DEFINE(M_CDEVP, DEVFS1, DEVFS cdev_priv storage); -static SYSCTL_NODE(_vfs, OID_AUTO, devfs, CTLFLAG_RW, 0, DEVFS filesystem); +SYSCTL_NODE(_vfs, OID_AUTO, devfs, CTLFLAG_RW, 0, DEVFS filesystem); static unsigned devfs_generation; SYSCTL_UINT(_vfs_devfs, OID_AUTO, generation, CTLFLAG_RD, Modified: stable/10/sys/fs/devfs/devfs_vnops.c == --- stable/10/sys/fs/devfs/devfs_vnops.cWed Apr 8 01:55:22 2015 (r281254) +++ stable/10/sys/fs/devfs/devfs_vnops.cWed Apr 8 02:15:13 2015 (r281255) @@ -57,6 +57,7 @@ #include sys/proc.h #include sys/stat.h #include sys/sx.h +#include sys/sysctl.h #include sys/time.h #include sys/ttycom.h #include sys/unistd.h @@ -79,6 +80,32 @@ SX_SYSINIT(clone_drain_lock, clone_drai struct mtx cdevpriv_mtx; MTX_SYSINIT(cdevpriv_mtx, cdevpriv_mtx, cdevpriv lock, MTX_DEF); +SYSCTL_DECL(_vfs_devfs); + +static int devfs_dotimes; +SYSCTL_INT(_vfs_devfs, OID_AUTO, dotimes, CTLFLAG_RW, +devfs_dotimes, 0, Update timestamps on DEVFS with default precision); + +/* + * Update devfs node timestamp. Note that updates are unlocked and + * stat(2) could see partially updated times. + */ +static void +devfs_timestamp(struct timespec *tsp) +{ + time_t ts; + + if (devfs_dotimes) { + vfs_timestamp(tsp); + } else { + ts = time_second; + if (tsp-tv_sec != ts) { + tsp-tv_sec = ts; + tsp-tv_nsec = 0; + } + } +} + static int devfs_fp_check(struct file *fp, struct cdev **devp, struct cdevsw **dswp, int *ref) @@ -1200,7 +1227,7 @@ devfs_read_f(struct file *fp, struct uio foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); error = dsw-d_read(dev, uio, ioflag); if (uio-uio_resid != resid || (error == 0 resid != 0)) - vfs_timestamp(dev-si_atime); + devfs_timestamp(dev-si_atime); td-td_fpop = fpop; dev_relthread(dev, ref); @@ -1679,7 +1706,7 @@ devfs_write_f(struct file *fp, struct ui error = dsw-d_write(dev, uio, ioflag); if (uio-uio_resid != resid || (error == 0 resid != 0)) { - vfs_timestamp(dev-si_ctime); + devfs_timestamp(dev-si_ctime); dev-si_mtime = dev-si_ctime; } td-td_fpop = fpop; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281261 - head/sys/powerpc/powerpc
Author: jhibbits Date: Wed Apr 8 04:35:26 2015 New Revision: 281261 URL: https://svnweb.freebsd.org/changeset/base/281261 Log: Add DTrace support for Book-E PowerPC. Book-E got DTrace support for free with r281096related. This adds the bits to the db_trap_glue() to support FBT. Relnotes: Yes Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c == --- head/sys/powerpc/powerpc/trap.c Wed Apr 8 04:01:02 2015 (r281260) +++ head/sys/powerpc/powerpc/trap.c Wed Apr 8 04:35:26 2015 (r281261) @@ -796,8 +796,12 @@ db_trap_glue(struct trapframe *frame) { if (!(frame-srr1 PSL_PR) (frame-exc == EXC_TRC || frame-exc == EXC_RUNMODETRC +#ifdef AIM || (frame-exc == EXC_PGM (frame-srr1 0x2)) +#else + || (frame-exc == EXC_DEBUG) +#endif || frame-exc == EXC_BPT || frame-exc == EXC_DSI)) { int type = frame-exc; @@ -805,7 +809,11 @@ db_trap_glue(struct trapframe *frame) /* Ignore DTrace traps. */ if (*(uint32_t *)frame-srr0 == EXC_DTRACE) return (0); +#ifdef AIM if (type == EXC_PGM (frame-srr1 0x2)) { +#else + if (frame-cpu.booke.esr ESR_PTR) { +#endif type = T_BREAKPOINT; } return (kdb_trap(type, 0, frame)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281262 - head/sys/powerpc/powerpc
Author: jhibbits Date: Wed Apr 8 04:37:11 2015 New Revision: 281262 URL: https://svnweb.freebsd.org/changeset/base/281262 Log: Clean up printtrap a little. * Sort exceptions * Add printing of ESR on book-e, and only print DSISR on AIM Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c == --- head/sys/powerpc/powerpc/trap.c Wed Apr 8 04:35:26 2015 (r281261) +++ head/sys/powerpc/powerpc/trap.c Wed Apr 8 04:37:11 2015 (r281262) @@ -407,19 +407,25 @@ printtrap(u_int vector, struct trapframe printf(\n); printf( exception = 0x%x (%s)\n, vector, trapname(vector)); switch (vector) { - case EXC_DTMISS: case EXC_DSE: case EXC_DSI: + case EXC_DTMISS: printf( virtual address = 0x% PRIxPTR \n, frame-dar); +#ifdef AIM printf( dsisr = 0x% PRIxPTR \n, frame-cpu.aim.dsisr); +#endif break; - case EXC_ITMISS: case EXC_ISE: case EXC_ISI: + case EXC_ITMISS: printf( virtual address = 0x% PRIxPTR \n, frame-srr0); break; } +#ifdef BOOKE + printf( esr = 0x% PRIxPTR \n, + frame-cpu.booke.esr); +#endif printf( srr0= 0x% PRIxPTR \n, frame-srr0); printf( srr1= 0x% PRIxPTR \n, frame-srr1); printf( lr = 0x% PRIxPTR \n, frame-lr); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281263 - in stable/10/sys: dev/cxgbe modules/cxgbe modules/cxgbe/if_cxl
Author: np Date: Wed Apr 8 04:40:04 2015 New Revision: 281263 URL: https://svnweb.freebsd.org/changeset/base/281263 Log: MFC r278303: cxgbe(4): Add a minimal if_cxl module that pulls in the real driver as a dependency. This ensures ifconfig cxln ... does the right thing even when it's run with no driver loaded. if_cxl.ko is the tiniest module in /boot/kernel. Added: stable/10/sys/dev/cxgbe/if_cxl.c - copied unchanged from r278303, head/sys/dev/cxgbe/if_cxl.c stable/10/sys/modules/cxgbe/if_cxl/ - copied from r278303, head/sys/modules/cxgbe/if_cxl/ Modified: stable/10/sys/modules/cxgbe/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/dev/cxgbe/if_cxl.c (from r278303, head/sys/dev/cxgbe/if_cxl.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/cxgbe/if_cxl.cWed Apr 8 04:40:04 2015 (r281263, copy of r278303, head/sys/dev/cxgbe/if_cxl.c) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2015 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar n...@freebsd.org + * + * 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 sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/param.h +#include sys/kernel.h +#include sys/module.h + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + + return (0); +} +static moduledata_t if_cxl_mod = {if_cxl, mod_event}; +DECLARE_MODULE(if_cxl, if_cxl_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(if_cxl, 1); +MODULE_DEPEND(if_cxl, cxl, 1, 1, 1); Modified: stable/10/sys/modules/cxgbe/Makefile == --- stable/10/sys/modules/cxgbe/MakefileWed Apr 8 04:37:11 2015 (r281262) +++ stable/10/sys/modules/cxgbe/MakefileWed Apr 8 04:40:04 2015 (r281263) @@ -3,6 +3,7 @@ # SUBDIR=if_cxgbe +SUBDIR+= if_cxl SUBDIR+= t4_firmware SUBDIR+= t5_firmware SUBDIR+= ${_tom} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281264 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 05:02:21 2015 New Revision: 281264 URL: https://svnweb.freebsd.org/changeset/base/281264 Log: MFC r279092: cxgbe(4): there is no need to force an unimplemented panic needlessly. The calls to free_nm_txq and free_nm_rxq are made just a few lines prior to the panic. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c == --- stable/10/sys/dev/cxgbe/t4_sge.cWed Apr 8 04:40:04 2015 (r281263) +++ stable/10/sys/dev/cxgbe/t4_sge.cWed Apr 8 05:02:21 2015 (r281264) @@ -1244,9 +1244,6 @@ t4_teardown_port_queues(struct port_info free_ofld_rxq(pi, ofld_rxq); } #endif -#ifdef DEV_NETMAP - CXGBE_UNIMPLEMENTED(__func__); -#endif return (0); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281257 - in head: cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libdtrace sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/d...
Author: markj Date: Wed Apr 8 02:36:37 2015 New Revision: 281257 URL: https://svnweb.freebsd.org/changeset/base/281257 Log: libdtrace: add support for lazyload mode. Passing -x lazyload to dtrace -G during compilation causes dtrace(1) to not link drti.o into the output object file, so the USDT probes are not created during process startup. Instead, dtrace(1) will automatically discover and create probes on the process' behalf when attaching. Differential Revision:https://reviews.freebsd.org/D2203 Reviewed by: rpaulo MFC after:1 month Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c head/cddl/lib/libdtrace/libproc_compat.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/dtrace/dtrace_ioctl.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Wed Apr 8 02:21:44 2015(r281256) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Wed Apr 8 02:36:37 2015(r281257) @@ -147,6 +147,9 @@ dtrace_dof_init(void) dh.dofhp_dof = (uintptr_t)dof; dh.dofhp_addr = elf-e_type == ET_DYN ? (uintptr_t) lmp-l_addr : 0; +#ifdef __FreeBSD__ + dh.dofhp_pid = getpid(); +#endif if (lmid == 0) { (void) snprintf(dh.dofhp_mod, sizeof (dh.dofhp_mod), @@ -184,7 +187,7 @@ dtrace_dof_init(void) else { dprintf(1, DTrace ioctl succeeded for DOF at %p\n, dof); #ifdef __FreeBSD__ - gen = dh.gen; + gen = dh.dofhp_gen; #endif } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cWed Apr 8 02:21:44 2015(r281256) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cWed Apr 8 02:36:37 2015(r281257) @@ -1785,11 +1785,17 @@ dtrace_program_link(dtrace_hdl_t *dtp, d failed to open %s: %s, file, strerror(errno))); } #else - snprintf(tfile, sizeof(tfile), %s.XX, file); - if ((fd = mkstemp(tfile)) == -1) - return (dt_link_error(dtp, NULL, -1, NULL, - failed to create temporary file %s: %s, - tfile, strerror(errno))); + if (dtp-dt_lazyload) { + if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0666)) 0) + return (dt_link_error(dtp, NULL, -1, NULL, + failed to open %s: %s, file, strerror(errno))); + } else { + snprintf(tfile, sizeof(tfile), %s.XX, file); + if ((fd = mkstemp(tfile)) == -1) + return (dt_link_error(dtp, NULL, -1, NULL, + failed to create temporary file %s: %s, + tfile, strerror(errno))); + } #endif /* Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Wed Apr 8 02:21:44 2015(r281256) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Wed Apr 8 02:36:37 2015(r281257) @@ -44,10 +44,15 @@ #include dt_program.h #include dt_pid.h #include dt_string.h +#include dt_module.h + #ifndef illumos +#include sys/sysctl.h +#include unistd.h #include libproc_compat.h +#include libelf.h +#include gelf.h #endif -#include dt_module.h typedef struct dt_pid_probe { dtrace_hdl_t *dpp_dtp; @@ -566,6 +571,12 @@ dt_pid_usdt_mapping(void *data, const pr prsyminfo_t sip; dof_helper_t dh; GElf_Half e_type; +#ifdef __FreeBSD__ + dof_hdr_t hdr; + size_t sz; + uint64_t dofmax; + void *dof; +#endif const char *mname; const char *syms[] = { ___SUNW_dof, __SUNW_dof }; int i, fd = -1; @@ -595,17 +606,61 @@ dt_pid_usdt_mapping(void *data, const pr continue; } - dh.dofhp_dof = sym.st_value; +#ifdef __FreeBSD__ dh.dofhp_addr = (e_type == ET_EXEC) ? 0 : pmp-pr_vaddr; + if (Pread(P, hdr, sizeof (hdr), sym.st_value) != + sizeof (hdr)) { + dt_dprintf(read of DOF header failed\n); + continue; + } + + sz = sizeof(dofmax); + if (sysctlbyname(kern.dtrace.dof_maxsize, dofmax, sz, + NULL, 0) != 0) { +
svn commit: r281258 - head/share/mk
Author: markj Date: Wed Apr 8 02:43:05 2015 New Revision: 281258 URL: https://svnweb.freebsd.org/changeset/base/281258 Log: Add a DTRACEFLAGS variable, which can be used to pass additional variables to dtrace(1) invocations during a build. This change includes -C in the default flags, which has dtrace(1) run input scripts through the preprocessor. While here, sort the definitions of CP and CPP in sys.mk. Differential Revision:https://reviews.freebsd.org/D2204 Reviewed by: imp, rpaulo (previous revision) Modified: head/share/mk/bsd.dep.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkWed Apr 8 02:36:37 2015(r281257) +++ head/share/mk/bsd.dep.mkWed Apr 8 02:43:05 2015(r281258) @@ -128,18 +128,18 @@ CFLAGS+= -I${.OBJDIR} .for _D in ${_DSRC:R} DHDRS+=${_D}.h ${_D}.h: ${_DSRC} - ${DTRACE} -xnolibs -h -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC} SRCS:= ${SRCS:S/^${_DSRC}$//} OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} - ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po ${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} - ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} - ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.ALLSRC} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC} .endif .endfor .endfor Modified: head/share/mk/sys.mk == --- head/share/mk/sys.mkWed Apr 8 02:36:37 2015(r281257) +++ head/share/mk/sys.mkWed Apr 8 02:43:05 2015(r281258) @@ -62,17 +62,18 @@ CFLAGS += -fno-strict-aliasing .endif PO_CFLAGS ?= ${CFLAGS} +# cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle +# read-only files as non-root by passing -f. +CP ?= cp -f + +CPP?= cpp + # C Type Format data is required for DTrace CTFFLAGS ?= -L VERSION CTFCONVERT ?= ctfconvert CTFMERGE ?= ctfmerge -# cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle -# read-only files as non-root by passing -f. -CP ?= cp -f - -DTRACE ?= dtrace .if defined(CFLAGS) (${CFLAGS:M-g} != ) CTFFLAGS += -g .endif @@ -81,7 +82,8 @@ CXX ?= c++ CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition} PO_CXXFLAGS?= ${CXXFLAGS} -CPP?= cpp +DTRACE ?= dtrace +DTRACEFLAGS?= -C -x nolibs .if empty(.MAKEFLAGS:M-s) ECHO ?= echo ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281247 - stable/10/sys/dev/cxgbe/iw_cxgbe
Author: np Date: Wed Apr 8 01:02:11 2015 New Revision: 281247 URL: https://svnweb.freebsd.org/changeset/base/281247 Log: MFC r277102, r277135. r277102: cxgbe/iw_cxgbe: allow any size during the initial MPA exchange. r277135: cxgbe/iw_cxgbe: fix whitespace nit in r277102. Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c == --- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Apr 8 00:52:45 2015 (r281246) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Wed Apr 8 01:02:11 2015 (r281247) @@ -971,18 +971,14 @@ send_mpa_req(struct c4iw_ep *ep) if (mpa_rev_to_use == 2) mpalen += sizeof(struct mpa_v2_conn_params); - if (mpalen MHLEN) - CXGBE_UNIMPLEMENTED(__func__); - - m = m_gethdr(M_NOWAIT, MT_DATA); - if (m == NULL) { + mpa = malloc(mpalen, M_CXGBE, M_NOWAIT); + if (mpa == NULL) { +failed: connect_reply_upcall(ep, -ENOMEM); return; } - mpa = mtod(m, struct mpa_message *); - m-m_len = mpalen; - m-m_pkthdr.len = mpalen; + memset(mpa, 0, mpalen); memcpy(mpa-key, MPA_KEY_REQ, sizeof(mpa-key)); mpa-flags = (crc_enabled ? MPA_CRC : 0) | (markers_enabled ? MPA_MARKERS : 0) | @@ -1029,11 +1025,18 @@ send_mpa_req(struct c4iw_ep *ep) CTR2(KTR_IW_CXGBE, %s:smr7 %p, __func__, ep); } - err = sosend(ep-com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, ep-com.thread); - if (err) { - connect_reply_upcall(ep, -ENOMEM); - return; + m = m_getm(NULL, mpalen, M_NOWAIT, MT_DATA); + if (m == NULL) { + free(mpa, M_CXGBE); + goto failed; } + m_copyback(m, 0, mpalen, (void *)mpa); + free(mpa, M_CXGBE); + + err = sosend(ep-com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, + ep-com.thread); + if (err) + goto failed; START_EP_TIMER(ep); state_set(ep-com, MPA_REQ_SENT); @@ -1060,22 +1063,11 @@ static int send_mpa_reject(struct c4iw_e ep-mpa_attr.version, mpalen); } - if (mpalen MHLEN) - CXGBE_UNIMPLEMENTED(__func__); - - m = m_gethdr(M_NOWAIT, MT_DATA); - if (m == NULL) { - - printf(%s - cannot alloc mbuf!\n, __func__); - CTR2(KTR_IW_CXGBE, %s:smrej2 %p, __func__, ep); + mpa = malloc(mpalen, M_CXGBE, M_NOWAIT); + if (mpa == NULL) return (-ENOMEM); - } - - mpa = mtod(m, struct mpa_message *); - m-m_len = mpalen; - m-m_pkthdr.len = mpalen; - memset(mpa, 0, sizeof(*mpa)); + memset(mpa, 0, mpalen); memcpy(mpa-key, MPA_KEY_REP, sizeof(mpa-key)); mpa-flags = MPA_REJECT; mpa-revision = mpa_rev; @@ -1107,7 +1099,15 @@ static int send_mpa_reject(struct c4iw_e if (plen) memcpy(mpa-private_data, pdata, plen); - err = sosend(ep-com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, ep-com.thread); + m = m_getm(NULL, mpalen, M_NOWAIT, MT_DATA); + if (m == NULL) { + free(mpa, M_CXGBE); + return (-ENOMEM); + } + m_copyback(m, 0, mpalen, (void *)mpa); + free(mpa, M_CXGBE); + + err = -sosend(ep-com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, ep-com.thread); if (!err) ep-snd_seq += mpalen; CTR4(KTR_IW_CXGBE, %s:smrejE %p %u %d, __func__, ep, ep-hwtid, err); @@ -1133,21 +1133,10 @@ static int send_mpa_reply(struct c4iw_ep mpalen += sizeof(struct mpa_v2_conn_params); } - if (mpalen MHLEN) - CXGBE_UNIMPLEMENTED(__func__); - - m = m_gethdr(M_NOWAIT, MT_DATA); - if (m == NULL) { - - CTR2(KTR_IW_CXGBE, %s:smrep2 %p, __func__, ep); - printf(%s - cannot alloc mbuf!\n, __func__); + mpa = malloc(mpalen, M_CXGBE, M_NOWAIT); + if (mpa == NULL) return (-ENOMEM); - } - - mpa = mtod(m, struct mpa_message *); - m-m_len = mpalen; - m-m_pkthdr.len = mpalen; memset(mpa, 0, sizeof(*mpa)); memcpy(mpa-key, MPA_KEY_REP, sizeof(mpa-key)); mpa-flags = (ep-mpa_attr.crc_enabled ? MPA_CRC : 0) | @@ -1198,9 +1187,18 @@ static int send_mpa_reply(struct c4iw_ep if (plen) memcpy(mpa-private_data, pdata, plen); + m = m_getm(NULL, mpalen, M_NOWAIT, MT_DATA); + if (m == NULL) { + free(mpa, M_CXGBE); + return (-ENOMEM); + } + m_copyback(m, 0, mpalen, (void *)mpa); + free(mpa, M_CXGBE); + + state_set(ep-com, MPA_REP_SENT); ep-snd_seq += mpalen; - err =
svn commit: r281250 - stable/10/sys/dev/cxgbe
Author: np Date: Wed Apr 8 01:09:36 2015 New Revision: 281250 URL: https://svnweb.freebsd.org/changeset/base/281250 Log: MFC r278372: cxgbe(4): adapter_full_init is always a synchronized operation. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:07:51 2015 (r281249) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 01:09:36 2015 (r281250) @@ -3317,6 +3317,7 @@ adapter_full_init(struct adapter *sc) { int rc, i; + ASSERT_SYNCHRONIZED_OP(sc); ADAPTER_LOCK_ASSERT_NOTOWNED(sc); KASSERT((sc-flags FULL_INIT_DONE) == 0, (%s: FULL_INIT_DONE already, __func__)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r281254 - head/sys/x86/iommu
Author: kib Date: Wed Apr 8 01:55:22 2015 New Revision: 281254 URL: https://svnweb.freebsd.org/changeset/base/281254 Log: Account for the offset of the page run when allocating the dmar_map_entry. Non-zero offset both increases the required mapping size, which is handled in dmar_bus_dmamap_load_something1(), and makes it possible that allocated range crosses boundary, which needs a check in dmar_gas_match_one(). Reported and tested by: jimharris Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_gas.c Modified: head/sys/x86/iommu/busdma_dmar.c == --- head/sys/x86/iommu/busdma_dmar.cWed Apr 8 01:43:29 2015 (r281253) +++ head/sys/x86/iommu/busdma_dmar.cWed Apr 8 01:55:22 2015 (r281254) @@ -462,6 +462,7 @@ dmar_bus_dmamap_load_something1(struct b bus_size_t buflen1; int error, idx, gas_flags, seg; + KASSERT(offset DMAR_PAGE_SIZE, (offset %d, offset)); if (segs == NULL) segs = tag-segments; ctx = tag-ctx; @@ -476,7 +477,6 @@ dmar_bus_dmamap_load_something1(struct b } buflen1 = buflen tag-common.maxsegsz ? tag-common.maxsegsz : buflen; - buflen -= buflen1; size = round_page(offset + buflen1); /* @@ -487,7 +487,7 @@ dmar_bus_dmamap_load_something1(struct b if (seg + 1 tag-common.nsegments) gas_flags |= DMAR_GM_CANSPLIT; - error = dmar_gas_map(ctx, tag-common, size, + error = dmar_gas_map(ctx, tag-common, size, offset, DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, gas_flags, ma + idx, entry); if (error != 0) @@ -506,6 +506,10 @@ dmar_bus_dmamap_load_something1(struct b (uintmax_t)size, (uintmax_t)entry-start, (uintmax_t)entry-end)); } + if (offset + buflen1 size) + buflen1 = size - offset; + if (buflen1 tag-common.maxsegsz) + buflen1 = tag-common.maxsegsz; KASSERT(((entry-start + offset) (tag-common.alignment - 1)) == 0, @@ -519,15 +523,16 @@ dmar_bus_dmamap_load_something1(struct b (uintmax_t)entry-start, (uintmax_t)entry-end, (uintmax_t)tag-common.lowaddr, (uintmax_t)tag-common.highaddr)); - KASSERT(dmar_test_boundary(entry-start, entry-end - - entry-start, tag-common.boundary), + KASSERT(dmar_test_boundary(entry-start + offset, buflen1, + tag-common.boundary), (boundary failed: ctx %p start 0x%jx end 0x%jx boundary 0x%jx, ctx, (uintmax_t)entry-start, (uintmax_t)entry-end, (uintmax_t)tag-common.boundary)); KASSERT(buflen1 = tag-common.maxsegsz, (segment too large: ctx %p start 0x%jx end 0x%jx - maxsegsz 0x%jx, ctx, (uintmax_t)entry-start, - (uintmax_t)entry-end, (uintmax_t)tag-common.maxsegsz)); + buflen1 0x%jx maxsegsz 0x%jx, ctx, + (uintmax_t)entry-start, (uintmax_t)entry-end, + (uintmax_t)buflen1, (uintmax_t)tag-common.maxsegsz)); DMAR_CTX_LOCK(ctx); TAILQ_INSERT_TAIL(map-map_entries, entry, dmamap_link); @@ -541,6 +546,7 @@ dmar_bus_dmamap_load_something1(struct b idx += OFF_TO_IDX(trunc_page(offset + buflen1)); offset += buflen1; offset = DMAR_PAGE_MASK; + buflen -= buflen1; } if (error == 0) *segp = seg; Modified: head/sys/x86/iommu/intel_dmar.h == --- head/sys/x86/iommu/intel_dmar.h Wed Apr 8 01:43:29 2015 (r281253) +++ head/sys/x86/iommu/intel_dmar.h Wed Apr 8 01:55:22 2015 (r281254) @@ -308,7 +308,7 @@ struct dmar_map_entry *dmar_gas_alloc_en void dmar_gas_free_entry(struct dmar_ctx *ctx, struct dmar_map_entry *entry); void dmar_gas_free_space(struct dmar_ctx *ctx, struct dmar_map_entry *entry); int dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common, -dmar_gaddr_t size, u_int eflags, u_int flags, vm_page_t *ma, +dmar_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma, struct dmar_map_entry **res); void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry); int dmar_gas_map_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry, Modified: head/sys/x86/iommu/intel_gas.c
svn commit: r281259 - in stable/10/sys/dev/cxgbe: . common
Author: np Date: Wed Apr 8 03:55:02 2015 New Revision: 281259 URL: https://svnweb.freebsd.org/changeset/base/281259 Log: MFC r278485: cxgbe(4): allow the SET_FILTER_MODE ioctl to change the mode when it's safe to do so. Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c == --- stable/10/sys/dev/cxgbe/common/t4_hw.c Wed Apr 8 02:43:05 2015 (r281258) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Wed Apr 8 03:55:02 2015 (r281259) @@ -3108,6 +3108,31 @@ void t4_write_rss_pf_mask(struct adapter pfmask, 1, A_TP_RSS_PF_MSK); } +static void refresh_vlan_pri_map(struct adapter *adap) +{ + +t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + adap-params.tp.vlan_pri_map, 1, + A_TP_VLAN_PRI_MAP); + + /* +* Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field +* shift positions of several elements of the Compressed Filter Tuple +* for this adapter which we need frequently ... +*/ + adap-params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); + adap-params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); + adap-params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); + adap-params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); + + /* +* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID +* represents the presense of an Outer VLAN instead of a VNIC ID. +*/ + if ((adap-params.tp.ingress_config F_VNIC) == 0) + adap-params.tp.vnic_shift = -1; +} + /** * t4_set_filter_mode - configure the optional components of filter tuples * @adap: the adapter @@ -3131,6 +3156,8 @@ int t4_set_filter_mode(struct adapter *a return -EINVAL; t4_write_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, mode_map, 1, A_TP_VLAN_PRI_MAP); + refresh_vlan_pri_map(adap); + return 0; } @@ -5615,33 +5642,10 @@ int __devinit t4_init_tp_params(struct a for (chan = 0; chan NCHAN; chan++) adap-params.tp.tx_modq[chan] = chan; - /* -* Cache the adapter's Compressed Filter Mode and global Incress -* Configuration. -*/ -t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, - adap-params.tp.vlan_pri_map, 1, - A_TP_VLAN_PRI_MAP); t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, adap-params.tp.ingress_config, 1, A_TP_INGRESS_CONFIG); - - /* -* Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field -* shift positions of several elements of the Compressed Filter Tuple -* for this adapter which we need frequently ... -*/ - adap-params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); - adap-params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); - adap-params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); - adap-params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); - - /* -* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID -* represents the presense of an Outer VLAN instead of a VNIC ID. -*/ - if ((adap-params.tp.ingress_config F_VNIC) == 0) - adap-params.tp.vnic_shift = -1; + refresh_vlan_pri_map(adap); return 0; } Modified: stable/10/sys/dev/cxgbe/t4_main.c == --- stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 02:43:05 2015 (r281258) +++ stable/10/sys/dev/cxgbe/t4_main.c Wed Apr 8 03:55:02 2015 (r281259) @@ -7056,10 +7056,9 @@ get_filter_mode(struct adapter *sc, uint log(LOG_WARNING, %s: cached filter mode out of sync %x %x.\n, device_get_nameunit(sc-dev), sc-params.tp.vlan_pri_map, fconf); - sc-params.tp.vlan_pri_map = fconf; } - *mode = fconf_to_mode(sc-params.tp.vlan_pri_map); + *mode = fconf_to_mode(fconf); end_synchronized_op(sc, LOCK_HELD); return (0); @@ -7090,14 +7089,7 @@ set_filter_mode(struct adapter *sc, uint } #endif -#ifdef notyet rc = -t4_set_filter_mode(sc, fconf); - if (rc == 0) - sc-filter_mode = fconf; -#else - rc = ENOTSUP; -#endif - done: end_synchronized_op(sc, LOCK_HELD); return (rc); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to
svn commit: r281260 - head/sys/conf
Author: eadler Date: Wed Apr 8 04:01:02 2015 New Revision: 281260 URL: https://svnweb.freebsd.org/changeset/base/281260 Log: newvers.sh: remove 'X' hack from shell script Reviewed by: allanjude, Daniel O'Connor Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shWed Apr 8 03:55:02 2015(r281259) +++ head/sys/conf/newvers.shWed Apr 8 04:01:02 2015(r281260) @@ -33,17 +33,17 @@ TYPE=FreeBSD REVISION=11.0 BRANCH=CURRENT -if [ X${BRANCH_OVERRIDE} != X ]; then +if [ -n ${BRANCH_OVERRIDE} ]; then BRANCH=${BRANCH_OVERRIDE} fi RELEASE=${REVISION}-${BRANCH} VERSION=${TYPE} ${RELEASE} -if [ X${SYSDIR} = X ]; then +if [ -z ${SYSDIR} ]; then SYSDIR=$(dirname $0)/.. fi -if [ X${PARAMFILE} != X ]; then +if [ -n ${PARAMFILE} ]; then RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ ${PARAMFILE}) else @@ -72,7 +72,7 @@ do done # no copyright found, use a dummy -if [ X$COPYRIGHT = X ]; then +if [ -z $COPYRIGHT ]; then COPYRIGHT=/*- * Copyright (c) 1992-$year The FreeBSD Project. * All rights reserved. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org