svn commit: r249884 - head/cddl/contrib/opensolaris/lib/libdtrace/common
Author: avg Date: Thu Apr 25 07:04:56 2013 New Revision: 249884 URL: http://svnweb.freebsd.org/changeset/base/249884 Log: revert r248644 because of the regression for usdt probes USDT probes are advertised to kernel by initialization code with atrribute((constructor))). It seems that on Solaris the .init-ish code of the main object is executed before RD_PREINIT point is hit. On FreeBSD that is not the case. And because on FreeBSD there is no other well-defined point between RD_PREINIT and main() we have to parse a DTrace script when main is hit, for time being. A footnote: currently we actually post RD_POSTINIT event, but that's a bug because the event is triggered by hitting r_debug_state which happens before any init code is executed. Reported by: markj Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cThu Apr 25 06:55:57 2013(r249883) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.cThu Apr 25 07:04:56 2013(r249884) @@ -1130,7 +1130,7 @@ alloc: #if defined(sun) dtp->dt_prcmode = DT_PROC_STOP_PREINIT; #else - dtp->dt_prcmode = DT_PROC_STOP_POSTINIT; + dtp->dt_prcmode = DT_PROC_STOP_MAIN; #endif dtp->dt_linkmode = DT_LINK_KERNEL; dtp->dt_linktype = DT_LTYP_ELF; ___ 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: r249848 - head/sys/netinet
On Wed, Apr 24, 2013 at 06:30:32PM +, Randall Stewart wrote: R> Author: rrs R> Date: Wed Apr 24 18:30:32 2013 R> New Revision: 249848 R> URL: http://svnweb.freebsd.org/changeset/base/249848 R> R> Log: R> This fixes the issue with the "randomly changing" default R> route. What it was is there are two places in ip_output.c R> where we do a goto again. One place was fine, it R> copies out the new address and then resets dst = ro->rt_dst; R> But the other place does *not* do that, which means earlier R> when we found the gateway, we have dst pointing there R> aka dst = ro->rt_gateway is done.. then we do a R> goto again.. bam now we clobber the default route. R> R> The fix is just to move the again so we are always R> doing dst = &ro->rt_dst; in the again loop. R> R> PR: 174749,157796 R> MFC after: 1 week This dst pointing either on stack or into routing table is dangerous. We already have several places where the problem is carefully handled, and now you fixed another one. Nevertheless this is subtle and leaves a place for future bugs. I think we should introduce a pointer to const struct sockaddr_in, which either matches dst or rte->rt_gateway. Patch attached. -- Totus tuus, Glebius. Index: ip_output.c === --- ip_output.c (revision 249884) +++ ip_output.c (working copy) @@ -123,6 +123,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct int n; /* scratchpad */ int error = 0; struct sockaddr_in *dst; + const struct sockaddr_in *gw; struct in_ifaddr *ia; int isbroadcast; uint16_t ip_len, ip_off; @@ -196,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct hlen = ip->ip_hl << 2; } + gw = dst = (struct sockaddr_in *)&ro->ro_dst; again: - dst = (struct sockaddr_in *)&ro->ro_dst; ia = NULL; /* * If there is a cached route, @@ -297,11 +298,11 @@ again: ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rte->rt_gateway; + gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) isbroadcast = (rte->rt_flags & RTF_BROADCAST); else - isbroadcast = in_broadcast(dst->sin_addr, ifp); + isbroadcast = in_broadcast(gw->sin_addr, ifp); } /* * Calculate MTU. If we have a route that is up, use that, @@ -327,12 +328,6 @@ again: if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; /* - * IP destination address is multicast. Make sure "dst" - * still points to the address in "ro". (It may have been - * changed to point to a gateway address, above.) - */ - dst = (struct sockaddr_in *)&ro->ro_dst; - /* * See if the caller provided any multicast options */ if (imo != NULL) { @@ -559,7 +554,6 @@ sendit: /* Or forward to some other address? */ if ((m->m_flags & M_IP_NEXTHOP) && (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { - dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; @@ -628,8 +622,7 @@ passout: * to avoid confusing lower layers. */ m->m_flags &= ~(M_PROTOFLAGS); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro); goto done; } @@ -663,7 +656,7 @@ passout: m->m_flags &= ~(M_PROTOFLAGS); error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + (struct sockaddr *)gw, ro); } else m_freem(m); } ___ 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: r249849 - in head/sys/dev: hptmv mpt
Hi, Maybe I need more coffee, but I don't see a difference between the if and the else statements in the hptmv file. Regards, Ronald. On Wed, 24 Apr 2013 21:00:45 +0200, Alexander Motin wrote: Author: mav Date: Wed Apr 24 19:00:45 2013 New Revision: 249849 URL: http://svnweb.freebsd.org/changeset/base/249849 Log: Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LAST stage of shutdown_post_sync. That should allow CAM to do final cache flush at the SHUTDOWN_PRI_DEFAULT without using polling magic. MFC after: 3 days Modified: head/sys/dev/hptmv/entry.c head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/hptmv/entry.c == --- head/sys/dev/hptmv/entry.c Wed Apr 24 18:30:32 2013(r249848) +++ head/sys/dev/hptmv/entry.c Wed Apr 24 19:00:45 2013(r249849) @@ -2605,9 +2605,11 @@ launch_worker_thread(void) * hpt_worker_thread needs to be suspended after shutdown sync, when fs sync finished. */ #if (__FreeBSD_version < 500043) - EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, hptdaemonproc, SHUTDOWN_PRI_FIRST); + EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, hptdaemonproc, + SHUTDOWN_PRI_LAST); #else - EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, hptdaemonproc, SHUTDOWN_PRI_FIRST); + EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, hptdaemonproc, + SHUTDOWN_PRI_LAST); #endif } /* Modified: head/sys/dev/mpt/mpt_pci.c == --- head/sys/dev/mpt/mpt_pci.c Wed Apr 24 18:30:32 2013(r249848) +++ head/sys/dev/mpt/mpt_pci.c Wed Apr 24 19:00:45 2013(r249849) @@ -563,7 +563,7 @@ mpt_pci_attach(device_t dev) } mpt->eh = EVENTHANDLER_REGISTER(shutdown_post_sync, mpt_pci_shutdown, - dev, SHUTDOWN_PRI_DEFAULT); + dev, SHUTDOWN_PRI_LAST); if (mpt->eh == NULL) { mpt_prt(mpt, "shutdown event registration failed\n"); ___ 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-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: r249849 - in head/sys/dev: hptmv mpt
On 25.04.2013 12:26, Ronald Klop wrote: > Hi, > > Maybe I need more coffee, but I don't see a difference between the if > and the else statements in the hptmv file. shutdown_kproc vs. kproc_shutdown > > Regards, > Ronald. > > On Wed, 24 Apr 2013 21:00:45 +0200, Alexander Motin > wrote: > >> Author: mav >> Date: Wed Apr 24 19:00:45 2013 >> New Revision: 249849 >> URL: http://svnweb.freebsd.org/changeset/base/249849 >> >> Log: >> Move hptmv and mpt drivers shutdown a bit later to the >> SHUTDOWN_PRI_LAST >> stage of shutdown_post_sync. That should allow CAM to do final >> cache flush >> at the SHUTDOWN_PRI_DEFAULT without using polling magic. >> MFC after:3 days >> >> Modified: >> head/sys/dev/hptmv/entry.c >> head/sys/dev/mpt/mpt_pci.c >> >> Modified: head/sys/dev/hptmv/entry.c >> == >> >> --- head/sys/dev/hptmv/entry.cWed Apr 24 18:30:32 2013(r249848) >> +++ head/sys/dev/hptmv/entry.cWed Apr 24 19:00:45 2013(r249849) >> @@ -2605,9 +2605,11 @@ launch_worker_thread(void) >> * hpt_worker_thread needs to be suspended after shutdown sync, >> when fs sync finished. >> */ >> #if (__FreeBSD_version < 500043) >> -EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, >> hptdaemonproc, SHUTDOWN_PRI_FIRST); >> +EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, >> hptdaemonproc, >> +SHUTDOWN_PRI_LAST); >> #else >> -EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, >> hptdaemonproc, SHUTDOWN_PRI_FIRST); >> +EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, >> hptdaemonproc, >> +SHUTDOWN_PRI_LAST); >> #endif >> } >> /* >> >> Modified: head/sys/dev/mpt/mpt_pci.c >> == >> >> --- head/sys/dev/mpt/mpt_pci.cWed Apr 24 18:30:32 2013(r249848) >> +++ head/sys/dev/mpt/mpt_pci.cWed Apr 24 19:00:45 2013(r249849) >> @@ -563,7 +563,7 @@ mpt_pci_attach(device_t dev) >> } >> mpt->eh = EVENTHANDLER_REGISTER(shutdown_post_sync, mpt_pci_shutdown, >> -dev, SHUTDOWN_PRI_DEFAULT); >> +dev, SHUTDOWN_PRI_LAST); >> if (mpt->eh == NULL) { >> mpt_prt(mpt, "shutdown event registration failed\n"); >> ___ >> 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" > -- bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N ___ 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: r249848 - head/sys/netinet
I like the idea Gleb.. I myself had been thinking that it was rather strange that we used dst for both the gateway and destination.. this is a much cleaner (and safer) solution. R On Apr 25, 2013, at 4:24 AM, Gleb Smirnoff wrote: > -- Randall Stewart 803-317-4952 (cell) ___ 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: r249891 - stable/8/sys/netinet
Author: rrs Date: Thu Apr 25 11:24:40 2013 New Revision: 249891 URL: http://svnweb.freebsd.org/changeset/base/249891 Log: MFC of PR r249848. PR: 174749, 157796 Modified: stable/8/sys/netinet/ip_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/ip_output.c == --- stable/8/sys/netinet/ip_output.cThu Apr 25 08:57:15 2013 (r249890) +++ stable/8/sys/netinet/ip_output.cThu Apr 25 11:24:40 2013 (r249891) @@ -197,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip->ip_hl << 2; } - dst = (struct sockaddr_in *)&ro->ro_dst; again: + dst = (struct sockaddr_in *)&ro->ro_dst; /* * If there is a cached route, * check that it is to the same destination ___ 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: r249892 - stable/9/sys/netinet
Author: rrs Date: Thu Apr 25 11:25:24 2013 New Revision: 249892 URL: http://svnweb.freebsd.org/changeset/base/249892 Log: MFC of r249848 PR: 174749, 157796 Modified: stable/9/sys/netinet/ip_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ip_output.c == --- stable/9/sys/netinet/ip_output.cThu Apr 25 11:24:40 2013 (r249891) +++ stable/9/sys/netinet/ip_output.cThu Apr 25 11:25:24 2013 (r249892) @@ -194,8 +194,8 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip->ip_hl << 2; } - dst = (struct sockaddr_in *)&ro->ro_dst; again: + dst = (struct sockaddr_in *)&ro->ro_dst; ia = NULL; /* * If there is a cached route, ___ 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: r249859 - head/lib/libc/sys
On Wed, 24 Apr 2013, Jilles Tjoelker wrote: Log: getdtablesize(2): Describe what this function actually does. getdtablesize() returns the limit on new file descriptors; this says nothing about existing descriptors. It's still quite broken. Modified: head/lib/libc/sys/getdtablesize.2 == --- head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:21:03 2013 (r249858) +++ head/lib/libc/sys/getdtablesize.2 Wed Apr 24 21:24:35 2013 (r249859) @@ -28,12 +28,12 @@ .\" @(#)getdtablesize.28.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 24, 2013 .Dt GETDTABLESIZE 2 .Os .Sh NAME .Nm getdtablesize -.Nd get descriptor table size +.Nd get file descriptor limit Now its name doesn't match its description, and the reason for this is not documented. This function is almost obsolete. In POSIX, it is spelled {OPEN_MAX} or sysconf(__SC_OPEN_MAX). It is sometimes misspelled OPEN_MAX. I prepared to remove the broken definition of OPEN_MAX, but never committed the final step. /usr/src has very few misuses of OPEN_MAX now, so removing the definition wouldn't be too hard. Most uses are in compatibility cruft. E.g., the following from crypto/openssh/openbsd-compat/bsd-closefrom.c which is confused about related things: @ /* @* Fall back on sysconf() or getdtablesize(). We avoid checking @* resource limits since it is possible to open a file descriptor @* and then drop the rlimit such that it is below the open fd. @*/ This is a fallback for when some other compatibility cruft doesn't work. The part about resource limits is mostly wrong:... @ #ifdef HAVE_SYSCONF @ maxfd = sysconf(_SC_OPEN_MAX); @ #else @ maxfd = getdtablesize(); @ #endif /* HAVE_SYSCONF */ ... in 4.4BSD and FreeBSD, both sysconf(_SC_OPEN_MAX) are just wrappers for the resource limit (sysconf() is a libc wrapper and getdtablesize() is a syscall wrapper). Actually, in FreeBSD, getdtablesize() is not even the rlmint -- it is the min() of the rlimit and the global sysctl integer maxfilesperproc. Here the bug is in the rlimit. For the rlimit, maxfilesperproc is only used when the rlimit is set and when it is used in the kernel. But when the rlimit is returned to userland, via getrlimit(), maxfilesperproc is not used, so the rlimit may be wrong if maxfileperproc was lowered after setting the rlimit. @ if (maxfd < 0) @ maxfd = OPEN_MAX; This should be ifdefed. All POSIX systems have sysconf(), and that is ifdefed, but most don't have a constant OPEN_MAX. @ @ for (fd = lowfd; fd < maxfd; fd++) @ (void) close((int) fd); @ } Old code that ends up using {OPEN_MAX} under any correct spelling in loops like this works poorly. On freefall now, {OPEN_MAX} for users is 707112. Syscalls are slow, so a loop like this will take a significant fraction of a second on freefall. So getdtablesize() should never be used for its original purpose of setting an upper limit for loops like this. Better hope that this compatibility cruft is not used. (It is for closefrom(int lowfd), which FreeBSD has in libc. closefrom() is described weirdly as "deleting" file descriptors.) .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -41,18 +41,20 @@ .Ft int .Fn getdtablesize void .Sh DESCRIPTION -Each process has a fixed size descriptor table, Actually, each process has a variable size descriptor table, and getdtablesize() doesn't give the size of this table. -which is guaranteed to have at least 20 slots. Actually, {OPEN_MAX} is guaranteed by POSIX to be at least {_POSIX_OPEN_MAX}, and {_POSIX_OPEN_MAX} is precisely 20. But these guarantees and similar ones for stdio's FOPEN_MAX have always been broken in FreeBSD, since anyone can reduce the rlimit below 20. Privileged users can break the gurantee even more easily by setting maxfilesperproc below 20. When POSIX standardized rlimits, it didn't properly specify the behaviour for the interaction of the rlimit with {OPEN_MAX}, at least initially. The 2001 version breaks its own guarantee by just saying that if the rlimit is reduced to less than {_POSIX_OPEN_MAX}, then "unexpected behaviour may occur". Reductions from 707112 to less than 20 won't occur often in practice. Ones from 707112 to less than the largest currently open fd (+1) are more common in practice and cause similarly unexpected behaviours, but the 2001 version of POSIX is even more underspecified for them. -The entries in -the descriptor table are numbered with small integers starting at 0. Still correct, though not very interesting. The .Fn getdtablesize -system call returns the size of this table. +system call returns the maximum number of file descriptors +that the current process may open. Actually, the process may open more than this number, after raising its (soft) rlimit, if this is possible. +The maximum file descriptor number that the system
svn commit: r249893 - head
Author: bdrewery (ports committer) Date: Thu Apr 25 12:05:17 2013 New Revision: 249893 URL: http://svnweb.freebsd.org/changeset/base/249893 Log: Fix installworld with DB_FROM_SRC after r249807 Approved by: bapt Reported by: Tom Everett Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Apr 25 11:25:24 2013(r249892) +++ head/Makefile.inc1 Thu Apr 25 12:05:17 2013(r249893) @@ -616,6 +616,7 @@ kernel-toolchain: ${TOOLCHAIN_TGTS:N_inc # Checks to be sure system is ready for installworld/installkernel. # installcheck: +installcheck_UGID: # # Require DESTDIR to be set if installing for a different architecture or ___ 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: r249848 - head/sys/netinet
On Thu, Apr 25, 2013 at 05:40:04AM -0400, Randall Stewart wrote: R> I like the idea Gleb.. R> R> I myself had been thinking that it was rather strange that R> we used dst for both the gateway and destination.. R> R> this is a much cleaner (and safer) solution. I'll commit it to head then. I've seen you merged your patch to 8 and 9, that's right, let's have the less disrupting patch merged and a cleaner solution in head. -- 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: r249894 - head/sys/netinet
Author: glebius Date: Thu Apr 25 12:42:09 2013 New Revision: 249894 URL: http://svnweb.freebsd.org/changeset/base/249894 Log: Introduce a pointer to const variable gw, which points either at the same place as dst, or to the sockaddr in the routing table. The const constraint of gw makes us safe from modifing routing table accidentially. And "onstantness" of dst allows us to remove several bandaids, when we switched it back at &ro->ro_dst, now it always points there. Reviewed by: rrs Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c == --- head/sys/netinet/ip_output.cThu Apr 25 12:05:17 2013 (r249893) +++ head/sys/netinet/ip_output.cThu Apr 25 12:42:09 2013 (r249894) @@ -123,6 +123,7 @@ ip_output(struct mbuf *m, struct mbuf *o int n; /* scratchpad */ int error = 0; struct sockaddr_in *dst; + const struct sockaddr_in *gw; struct in_ifaddr *ia; int isbroadcast; uint16_t ip_len, ip_off; @@ -196,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip->ip_hl << 2; } + gw = dst = (struct sockaddr_in *)&ro->ro_dst; again: - dst = (struct sockaddr_in *)&ro->ro_dst; ia = NULL; /* * If there is a cached route, @@ -297,11 +298,11 @@ again: ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rte->rt_gateway; + gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) isbroadcast = (rte->rt_flags & RTF_BROADCAST); else - isbroadcast = in_broadcast(dst->sin_addr, ifp); + isbroadcast = in_broadcast(gw->sin_addr, ifp); } /* * Calculate MTU. If we have a route that is up, use that, @@ -327,12 +328,6 @@ again: if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; /* -* IP destination address is multicast. Make sure "dst" -* still points to the address in "ro". (It may have been -* changed to point to a gateway address, above.) -*/ - dst = (struct sockaddr_in *)&ro->ro_dst; - /* * See if the caller provided any multicast options */ if (imo != NULL) { @@ -559,7 +554,6 @@ sendit: /* Or forward to some other address? */ if ((m->m_flags & M_IP_NEXTHOP) && (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { - dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; @@ -628,8 +622,7 @@ passout: * to avoid confusing lower layers. */ m->m_flags &= ~(M_PROTOFLAGS); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro); goto done; } @@ -663,7 +656,7 @@ passout: m->m_flags &= ~(M_PROTOFLAGS); error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro); + (struct sockaddr *)gw, ro); } else m_freem(m); } ___ 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: r249895 - in head: sbin/camcontrol sys/sys
Author: smh Date: Thu Apr 25 14:11:38 2013 New Revision: 249895 URL: http://svnweb.freebsd.org/changeset/base/249895 Log: Adds Host Protected Area (HPA) support for ATA disks to camcontrol Reviewed by: mav Approved by: pjd (mentor) MFC after:2 weeks Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.8 == --- head/sbin/camcontrol/camcontrol.8 Thu Apr 25 12:42:09 2013 (r249894) +++ head/sbin/camcontrol/camcontrol.8 Thu Apr 25 14:11:38 2013 (r249895) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd April 24, 2013 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -243,6 +243,18 @@ .Op Fl U Ar user|master .Op Fl y .Nm +.Ic hpa +.Op device id +.Op generic args +.Op Fl f +.Op Fl l +.Op Fl P +.Op Fl p Ar pwd +.Op Fl q +.Op Fl s Ar max_sectors +.Op Fl U Ar pwd +.Op Fl y +.Nm .Ic help .Sh DESCRIPTION The @@ -1205,6 +1217,73 @@ password for the specified user the comm .Pp The password in all cases is limited to 32 characters, longer passwords will fail. +.It Ic hpa +Update or report Host Protected Area details. +By default +.Nm +will print out the HPA support and associated settings of the device. +The +.Ic hpa +command takes several optional arguments: +.Bl -tag -width 0n +.It Fl f +.Pp +Freeze the HPA configuration of the specified device. +.Pp +After command completion any other commands that update the HPA configuration +shall be command aborted. +Frozen mode is disabled by power-off or hardware reset. +.It Fl l +.Pp +Lock the HPA configuration of the device until a successful call to unlock or +the next power-on reset occurs. +.It Fl P +.Pp +Make the HPA max sectors persist across power-on reset or a hardware reset. +This must be used in combination with +.Fl s Ar max_sectors +. +.It Fl p Ar pwd +.Pp +Set the HPA configuration password required for unlock calls. +.It Fl q +.Pp +Be quiet, do not print any status messages. +This option will not disable the questions. +To disable questions, use the +.Fl y +argument, below. +.It Fl s Ar max_sectors +.Pp +Configures the maximum user accessible sectors of the device. +This will change the number of sectors the device reports. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Changing the max sectors of a device using this option will make the data on +the device beyond the specified value inaccessible. +.Pp +Only one successful +.Fl s Ar max_sectors +call can be made without a power-on reset or a hardware reset of the device. +.It Fl U Ar pwd +.Pp +Unlock the HPA configuration of the specified device using the given password. +If the password specified doesn't match the password configured via +.Fl p Ar pwd +the command will fail. +.Pp +After 5 failed unlock calls, due to password miss-match, the device will refuse +additional unlock calls until after a power-on reset. +.It Fl y +.Pp +Confirm yes to dangerous options such as +.Fl e +without prompting for confirmation +.Pp +.El +The password for all HPA commands is limited to 32 characters, longer passwords +will fail. .It Ic fwdownload Program firmware of the named SCSI device using the image file provided. .Pp @@ -1397,6 +1476,30 @@ data from the device, so backup your dat .Pp This command can be used used against an SSD drive to restoring it to factory default write performance. +.Pp +.Bd -literal -offset indent +camcontrol hpa ada0 +.Ed +.Pp +Report HPA support and settings for ada0 (also reported via +identify). +.Pp +.Bd -literal -offset indent +camcontrol hpa ada0 -s 10240 +.Ed +.Pp +Enables HPA on ada0 setting the maximum reported sectors to 10240. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +This will +.Em PREVENT ACCESS +to all data on the device beyond this limit until HPA is disabled by setting +HPA to native max sectors of the device, which can only be done after a +power-on or hardware reset! +.Pp +.Em DO NOT +use this on a device which has an active filesystem! .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: head/sbin/camcontrol/camcontrol.c == --- head/sbin/camcontrol/camcontrol.c Thu Apr 25 12:42:09 2013 (r249894) +++ head/sbin/camcontrol/camcontrol.c Thu Apr 25 14:11:38 2013 (r249895) @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef MINIMALISTIC +#include +#include +#endif #include #include @@ -88,7 +92,8 @@ typedef enum { CAM_CMD_SMP_PHYLIST = 0x001a, CAM_CMD_SMP_MANINFO = 0x001b, CAM_CMD_DOWNLOAD_FW = 0x001c, - CAM_CMD_SECURITY= 0x001d + CAM_CMD_SECURITY= 0x001d, + CAM_CMD_HPA = 0x001e } cam_cmdmask; typedef enum { @@ -135,6 +140,29 @@ struct camcontrol_opts { }; #ifndef MINIMALISTIC +struct ata_res_pass16 { + u_int16_
svn commit: r249896 - head/contrib/bsnmp/snmp_mibII
Author: glebius Date: Thu Apr 25 16:23:22 2013 New Revision: 249896 URL: http://svnweb.freebsd.org/changeset/base/249896 Log: Restore the ipNetToMedia MIB, that was broken with new ARP commit in the r186119. Submitted by: Konstantin Kukushkin Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c == --- head/contrib/bsnmp/snmp_mibII/mibII.c Thu Apr 25 14:11:38 2013 (r249895) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Thu Apr 25 16:23:22 2013 (r249896) @@ -934,6 +934,34 @@ mib_find_ifa(struct in_addr addr) } /* + * Process a new ARP entry + */ +static void +process_arp(const struct rt_msghdr *rtm, const struct sockaddr_dl *sdl, +const struct sockaddr_in *sa) +{ + struct mibif *ifp; + struct mibarp *at; + + /* IP arp table entry */ + if (sdl->sdl_alen == 0) + return; + if ((ifp = mib_find_if_sys(sdl->sdl_index)) == NULL) + return; + /* have a valid entry */ + if ((at = mib_find_arp(ifp, sa->sin_addr)) == NULL && + (at = mib_arp_create(ifp, sa->sin_addr, + sdl->sdl_data + sdl->sdl_nlen, sdl->sdl_alen)) == NULL) + return; + + if (rtm->rtm_rmx.rmx_expire == 0) + at->flags |= MIBARP_PERM; + else + at->flags &= ~MIBARP_PERM; + at->flags |= MIBARP_FOUND; +} + +/* * Handle a routing socket message. */ static void @@ -1075,6 +1103,23 @@ handle_rtmsg(struct rt_msghdr *rtm) #endif case RTM_GET: case RTM_ADD: + mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); + if (rtm->rtm_flags & RTF_LLINFO) { + if (addrs[RTAX_DST] == NULL || + addrs[RTAX_GATEWAY] == NULL || + addrs[RTAX_DST]->sa_family != AF_INET || + addrs[RTAX_GATEWAY]->sa_family != AF_LINK) + break; + process_arp(rtm, + (struct sockaddr_dl *)(void *)addrs[RTAX_GATEWAY], + (struct sockaddr_in *)(void *)addrs[RTAX_DST]); + } else { + if (rtm->rtm_errno == 0 && (rtm->rtm_flags & RTF_UP)) + mib_sroute_process(rtm, addrs[RTAX_GATEWAY], + addrs[RTAX_DST], addrs[RTAX_NETMASK]); + } + break; + case RTM_DELETE: mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); ___ 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: r249897 - head/sbin/ifconfig
Author: glebius Date: Thu Apr 25 16:34:04 2013 New Revision: 249897 URL: http://svnweb.freebsd.org/changeset/base/249897 Log: Don't free memory that is going to be used as error string. PR: bin/178121 Submitted by: Garrett Cooper Modified: head/sbin/ifconfig/iflagg.c Modified: head/sbin/ifconfig/iflagg.c == --- head/sbin/ifconfig/iflagg.c Thu Apr 25 16:23:22 2013(r249896) +++ head/sbin/ifconfig/iflagg.c Thu Apr 25 16:34:04 2013(r249897) @@ -98,10 +98,8 @@ setlagghash(const char *val, int d, int rf.rf_flags |= LAGG_F_HASHL3; else if (strcmp(tok, "l4") == 0) rf.rf_flags |= LAGG_F_HASHL4; - else { - free(str); + else errx(1, "Invalid lagghash option: %s", tok); - } } free(str); if (rf.rf_flags == 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: r249898 - stable/9/sys/dev/ciss
Author: sbruno Date: Thu Apr 25 17:02:22 2013 New Revision: 249898 URL: http://svnweb.freebsd.org/changeset/base/249898 Log: MFC r249349 Repair camcontrol output and use CAM defined values for string sizes Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c == --- stable/9/sys/dev/ciss/ciss.cThu Apr 25 16:34:04 2013 (r249897) +++ stable/9/sys/dev/ciss/ciss.cThu Apr 25 17:02:22 2013 (r249898) @@ -3352,9 +3352,14 @@ ciss_cam_complete_fixup(struct ciss_soft cl = &sc->ciss_logical[bus][target]; - padstr(inq->vendor, "COMPAQ", 8); - padstr(inq->product, ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), 8); - padstr(inq->revision, ciss_name_ldrive_status(cl->cl_lstatus->status), 16); + padstr(inq->vendor, "COMPAQ", + SID_VENDOR_SIZE); + padstr(inq->product, + ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), + SID_PRODUCT_SIZE); + padstr(inq->revision, + ciss_name_ldrive_status(cl->cl_lstatus->status), + SID_REVISION_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: r249899 - stable/8/sys/dev/ciss
Author: sbruno Date: Thu Apr 25 17:04:48 2013 New Revision: 249899 URL: http://svnweb.freebsd.org/changeset/base/249899 Log: MFC r249349 Repair camcontrol output and use CAM defined values for string sizes Modified: stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ciss/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c == --- stable/8/sys/dev/ciss/ciss.cThu Apr 25 17:02:22 2013 (r249898) +++ stable/8/sys/dev/ciss/ciss.cThu Apr 25 17:04:48 2013 (r249899) @@ -3347,9 +3347,14 @@ ciss_cam_complete_fixup(struct ciss_soft cl = &sc->ciss_logical[bus][target]; - padstr(inq->vendor, "COMPAQ", 8); - padstr(inq->product, ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), 8); - padstr(inq->revision, ciss_name_ldrive_status(cl->cl_lstatus->status), 16); + padstr(inq->vendor, "COMPAQ", + SID_VENDOR_SIZE); + padstr(inq->product, + ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), + SID_PRODUCT_SIZE); + padstr(inq->revision, + ciss_name_ldrive_status(cl->cl_lstatus->status), + SID_REVISION_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: r249900 - stable/7/sys/dev/ciss
Author: sbruno Date: Thu Apr 25 17:06:07 2013 New Revision: 249900 URL: http://svnweb.freebsd.org/changeset/base/249900 Log: MFC r249349 Repair camcontrol output and use CAM defined values for string sizes Modified: stable/7/sys/dev/ciss/ciss.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/ciss/ciss.c == --- stable/7/sys/dev/ciss/ciss.cThu Apr 25 17:04:48 2013 (r249899) +++ stable/7/sys/dev/ciss/ciss.cThu Apr 25 17:06:07 2013 (r249900) @@ -3044,9 +3044,14 @@ ciss_cam_complete_fixup(struct ciss_soft cl = &sc->ciss_logical[bus][target]; - padstr(inq->vendor, "COMPAQ", 8); - padstr(inq->product, ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), 8); - padstr(inq->revision, ciss_name_ldrive_status(cl->cl_lstatus->status), 16); + padstr(inq->vendor, "COMPAQ", + SID_VENDOR_SIZE); + padstr(inq->product, + ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), + SID_PRODUCT_SIZE); + padstr(inq->revision, + ciss_name_ldrive_status(cl->cl_lstatus->status), + SID_REVISION_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: r249901 - in head/sys/mips: include mips
Author: imp Date: Thu Apr 25 17:23:54 2013 New Revision: 249901 URL: http://svnweb.freebsd.org/changeset/base/249901 Log: Use the offsets from pcb.h rather than regnum.h to store the registers in the pcb. setjmp/longjmp in the kernel also used these values, so continue to use them although their use isn't technically the pcb register array (matching is all that's important for setjmp/longjmp in the kernel). Finally, eliminate the old register names from regnum.h. This is a lexical change only. The non-debug .o files have the same md5. Modified: head/sys/mips/include/regnum.h head/sys/mips/mips/support.S head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/regnum.h == --- head/sys/mips/include/regnum.h Thu Apr 25 17:06:07 2013 (r249900) +++ head/sys/mips/include/regnum.h Thu Apr 25 17:23:54 2013 (r249901) @@ -43,24 +43,6 @@ #define_MACHINE_REGNUM_H_ /* - * This must match the numbers in pcb.h and is used by swtch.S - */ -#define PREG_S00 -#define PREG_S11 -#define PREG_S22 -#define PREG_S33 -#define PREG_S44 -#define PREG_S55 -#define PREG_S66 -#define PREG_S77 -#define PREG_SP8 -#define PREG_S89 -#define PREG_RA10 -#define PREG_SR11 -#define PREG_GP12 -#define PREG_PC13 - -/* * Location of the saved registers relative to ZERO. * This must match struct trapframe defined in frame.h exactly. * This must also match regdef.h. Modified: head/sys/mips/mips/support.S == --- head/sys/mips/mips/support.SThu Apr 25 17:06:07 2013 (r249900) +++ head/sys/mips/mips/support.SThu Apr 25 17:23:54 2013 (r249901) @@ -92,6 +92,7 @@ #include #include #include +#include #include "assym.s" @@ -1079,35 +1080,35 @@ END(breakpoint) LEAF(setjmp) mfc0v0, MIPS_COP_0_STATUS # Later the "real" spl value! - REG_S s0, (SZREG * PREG_S0)(a0) - REG_S s1, (SZREG * PREG_S1)(a0) - REG_S s2, (SZREG * PREG_S2)(a0) - REG_S s3, (SZREG * PREG_S3)(a0) - REG_S s4, (SZREG * PREG_S4)(a0) - REG_S s5, (SZREG * PREG_S5)(a0) - REG_S s6, (SZREG * PREG_S6)(a0) - REG_S s7, (SZREG * PREG_S7)(a0) - REG_S s8, (SZREG * PREG_S8)(a0) - REG_S sp, (SZREG * PREG_SP)(a0) - REG_S ra, (SZREG * PREG_RA)(a0) - REG_S v0, (SZREG * PREG_SR)(a0) + REG_S s0, (SZREG * PCB_REG_S0)(a0) + REG_S s1, (SZREG * PCB_REG_S1)(a0) + REG_S s2, (SZREG * PCB_REG_S2)(a0) + REG_S s3, (SZREG * PCB_REG_S3)(a0) + REG_S s4, (SZREG * PCB_REG_S4)(a0) + REG_S s5, (SZREG * PCB_REG_S5)(a0) + REG_S s6, (SZREG * PCB_REG_S6)(a0) + REG_S s7, (SZREG * PCB_REG_S7)(a0) + REG_S s8, (SZREG * PCB_REG_S8)(a0) + REG_S sp, (SZREG * PCB_REG_SP)(a0) + REG_S ra, (SZREG * PCB_REG_RA)(a0) + REG_S v0, (SZREG * PCB_REG_SR)(a0) jr ra li v0, 0 # setjmp return END(setjmp) LEAF(longjmp) - REG_L v0, (SZREG * PREG_SR)(a0) - REG_L ra, (SZREG * PREG_RA)(a0) - REG_L s0, (SZREG * PREG_S0)(a0) - REG_L s1, (SZREG * PREG_S1)(a0) - REG_L s2, (SZREG * PREG_S2)(a0) - REG_L s3, (SZREG * PREG_S3)(a0) - REG_L s4, (SZREG * PREG_S4)(a0) - REG_L s5, (SZREG * PREG_S5)(a0) - REG_L s6, (SZREG * PREG_S6)(a0) - REG_L s7, (SZREG * PREG_S7)(a0) - REG_L s8, (SZREG * PREG_S8)(a0) - REG_L sp, (SZREG * PREG_SP)(a0) + REG_L v0, (SZREG * PCB_REG_SR)(a0) + REG_L ra, (SZREG * PCB_REG_RA)(a0) + REG_L s0, (SZREG * PCB_REG_S0)(a0) + REG_L s1, (SZREG * PCB_REG_S1)(a0) + REG_L s2, (SZREG * PCB_REG_S2)(a0) + REG_L s3, (SZREG * PCB_REG_S3)(a0) + REG_L s4, (SZREG * PCB_REG_S4)(a0) + REG_L s5, (SZREG * PCB_REG_S5)(a0) + REG_L s6, (SZREG * PCB_REG_S6)(a0) + REG_L s7, (SZREG * PCB_REG_S7)(a0) + REG_L s8, (SZREG * PCB_REG_S8)(a0) + REG_L sp, (SZREG * PCB_REG_SP)(a0) mtc0v0, MIPS_COP_0_STATUS # Later the "real" spl value! ITLBNOPFIX jr ra Modified: head/sys/mips/mips/swtch.S == --- head/sys/mips/mips/swtch.S Thu Apr 25 17:06:07 2013(r249900) +++ head/sys/mips/mips/swtch.S Thu Apr 25 17:23:54 2013(r249901) @@ -62,6 +62,7 @@ #include #include #include +#include #include "assym.s" @@ -173,26 +174,26 @@ END(fork_trampoline) * savectx(struct pcb *pcbp); */ LEAF(savectx) - SAVE_U_PCB_CONTEXT(s0, PREG_S0, a0) - SAVE_U_PCB_CONTEXT(s1, PREG_S1, a0) - SAVE_U_PCB_CONTEXT(s2, PREG_S2, a0) - SAVE_U_
svn commit: r249902 - head/sys/mips/mips
Author: imp Date: Thu Apr 25 17:27:13 2013 New Revision: 249902 URL: http://svnweb.freebsd.org/changeset/base/249902 Log: Minor whitespace nit Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c == --- head/sys/mips/mips/trap.c Thu Apr 25 17:23:54 2013(r249901) +++ head/sys/mips/mips/trap.c Thu Apr 25 17:27:13 2013(r249902) @@ -447,7 +447,7 @@ cpu_fetch_syscall_args(struct thread *td (caddr_t)&arg, sizeof arg); if (error != 0) break; - sa->args[i] = arg; + sa->args[i] = arg; } } else #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: r249903 - head/sys/netinet
Author: glebius Date: Thu Apr 25 17:38:04 2013 New Revision: 249903 URL: http://svnweb.freebsd.org/changeset/base/249903 Log: Fix couple of mbuf leaks in incoming ARP processing. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c == --- head/sys/netinet/if_ether.c Thu Apr 25 17:27:13 2013(r249902) +++ head/sys/netinet/if_ether.c Thu Apr 25 17:38:04 2013(r249903) @@ -558,13 +558,13 @@ in_arpinput(struct mbuf *m) if (ah->ar_pln != sizeof(struct in_addr)) { log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", sizeof(struct in_addr)); - return; + goto drop; } if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { log(LOG_NOTICE, "arp: %*D is multicast\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); - return; + goto drop; } op = ntohs(ah->ar_op); ___ 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: r249903 - head/sys/netinet
.. is it possible to trigger a remote DoS through mbuf exhaustion somehow by exploiting this? Adrian On 25 April 2013 10:38, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Apr 25 17:38:04 2013 > New Revision: 249903 > URL: http://svnweb.freebsd.org/changeset/base/249903 > > Log: > Fix couple of mbuf leaks in incoming ARP processing. > > Modified: > head/sys/netinet/if_ether.c > > Modified: head/sys/netinet/if_ether.c > == > --- head/sys/netinet/if_ether.c Thu Apr 25 17:27:13 2013 (r249902) > +++ head/sys/netinet/if_ether.c Thu Apr 25 17:38:04 2013(r249903) > @@ -558,13 +558,13 @@ in_arpinput(struct mbuf *m) > if (ah->ar_pln != sizeof(struct in_addr)) { > log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", > sizeof(struct in_addr)); > - return; > + goto drop; > } > > if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { > log(LOG_NOTICE, "arp: %*D is multicast\n", > ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); > - return; > + goto drop; > } > > op = ntohs(ah->ar_op); ___ 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: r249904 - head/sbin/camcontrol
Author: joel (doc committer) Date: Thu Apr 25 20:23:22 2013 New Revision: 249904 URL: http://svnweb.freebsd.org/changeset/base/249904 Log: mdoc: remove superfluous paragraph macro. Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 == --- head/sbin/camcontrol/camcontrol.8 Thu Apr 25 17:38:04 2013 (r249903) +++ head/sbin/camcontrol/camcontrol.8 Thu Apr 25 20:23:22 2013 (r249904) @@ -1476,14 +1476,12 @@ data from the device, so backup your dat .Pp This command can be used used against an SSD drive to restoring it to factory default write performance. -.Pp .Bd -literal -offset indent camcontrol hpa ada0 .Ed .Pp Report HPA support and settings for ada0 (also reported via identify). -.Pp .Bd -literal -offset indent camcontrol hpa ada0 -s 10240 .Ed ___ 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: r249905 - head/lib/libvmmapi
Author: neel Date: Thu Apr 25 20:42:21 2013 New Revision: 249905 URL: http://svnweb.freebsd.org/changeset/base/249905 Log: Remove deprecated APIs to get the total and free memory available to vmm.ko. These APIs were relevant when memory for virtual machine allocation was hard partitioned away from the rest of the system but that is no longer the case. The sysctls that provided this information were garbage collected a while back. Obtained from:NetApp Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h Modified: head/lib/libvmmapi/vmmapi.c == --- head/lib/libvmmapi/vmmapi.c Thu Apr 25 20:23:22 2013(r249904) +++ head/lib/libvmmapi/vmmapi.c Thu Apr 25 20:42:21 2013(r249905) @@ -123,30 +123,6 @@ vm_destroy(struct vmctx *vm) free(vm); } -size_t -vmm_get_mem_total(void) -{ - size_t mem_total = 0; - size_t oldlen = sizeof(mem_total); - int error; - error = sysctlbyname("hw.vmm.mem_total", &mem_total, &oldlen, NULL, 0); - if (error) - return -1; - return mem_total; -} - -size_t -vmm_get_mem_free(void) -{ - size_t mem_free = 0; - size_t oldlen = sizeof(mem_free); - int error; - error = sysctlbyname("hw.vmm.mem_free", &mem_free, &oldlen, NULL, 0); - if (error) - return -1; - return mem_free; -} - int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len) { Modified: head/lib/libvmmapi/vmmapi.h == --- head/lib/libvmmapi/vmmapi.h Thu Apr 25 20:23:22 2013(r249904) +++ head/lib/libvmmapi/vmmapi.h Thu Apr 25 20:42:21 2013(r249905) @@ -45,8 +45,6 @@ enum vm_mmap_style { intvm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); -size_t vmm_get_mem_total(void); -size_t vmm_get_mem_free(void); intvm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len); intvm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); ___ 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: r249906 - in head: . usr.sbin/mergemaster
Author: brooks Date: Thu Apr 25 21:19:50 2013 New Revision: 249906 URL: http://svnweb.freebsd.org/changeset/base/249906 Log: Use the system MAKEOBJDIRPREFIX when running make targets in mergemaster. This allows bootstrap verions of tools to be used. Add a note to UPDATING about this change. Discussed with: jhb Sponsored by: DARPA, AFRL MFC after:5 days Modified: head/UPDATING head/usr.sbin/mergemaster/mergemaster.sh Modified: head/UPDATING == --- head/UPDATING Thu Apr 25 20:42:21 2013(r249905) +++ head/UPDATING Thu Apr 25 21:19:50 2013(r249906) @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130425: + The mergemaster command now uses the default MAKEOBJDIRPREFIX + rather than creating it's own in the temporary directory in + order allow access to bootstrapped versions of tools such as + install and mtree. When upgrading from version of FreeBSD where + the install command does not support -l, you will need to + install a new mergemaster command if mergemaster -p is required. + This can be accomplished with the command (cd src/usr.sbin/mergemaster + && make install). + 20130404: Legacy ATA stack, disabled and replaced by new CAM-based one since FreeBSD 9.0, completely removed from the sources. Kernel modules @@ -1757,7 +1767,7 @@ COMMON ITEMS: step. It never hurts to do it all the time. You may need to install a new mergemaster (cd src/usr.sbin/mergemaster && make install) after the buildworld before this step if you last updated - from current before 20020224 or from -stable before 20020408. + from current before 20130425 or from -stable before 20130430. [6] This only deletes old files and directories. Old libraries can be deleted by "make delete-old-libs", but you have to make Modified: head/usr.sbin/mergemaster/mergemaster.sh == --- head/usr.sbin/mergemaster/mergemaster.shThu Apr 25 20:42:21 2013 (r249905) +++ head/usr.sbin/mergemaster/mergemaster.shThu Apr 25 21:19:50 2013 (r249906) @@ -629,11 +629,10 @@ case "${RERUN}" in ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs >/dev/null ;; esac - od=${TEMPROOT}/usr/obj ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || + ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && + ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && + ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || { echo ''; echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to"; echo " the temproot environment"; ___ 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: r249907 - releng/8.4/sys/netinet
Author: rrs Date: Thu Apr 25 21:55:29 2013 New Revision: 249907 URL: http://svnweb.freebsd.org/changeset/base/249907 Log: MFC of r249848: This fixes the issue with the "randomly changing" default route. What it was is there are two places in ip_output.c where we do a goto again. One place was fine, it copies out the new address and then resets dst = ro->rt_dst; But the other place does *not* do that, which means earlier when we found the gateway, we have dst pointing there aka dst = ro->rt_gateway is done.. then we do a goto again.. bam now we clobber the default route. The fix is just to move the again so we are always doing dst = &ro->rt_dst; in the again loop. Approved by: r...@freebsd.org (Josh Paetzel) Modified: releng/8.4/sys/netinet/ip_output.c Directory Properties: releng/8.4/sys/ (props changed) releng/8.4/sys/netinet/ (props changed) Modified: releng/8.4/sys/netinet/ip_output.c == --- releng/8.4/sys/netinet/ip_output.c Thu Apr 25 21:19:50 2013 (r249906) +++ releng/8.4/sys/netinet/ip_output.c Thu Apr 25 21:55:29 2013 (r249907) @@ -197,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *o hlen = ip->ip_hl << 2; } - dst = (struct sockaddr_in *)&ro->ro_dst; again: + dst = (struct sockaddr_in *)&ro->ro_dst; /* * If there is a cached route, * check that it is to the same destination ___ 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: r249908 - head/sys/dev/ciss
Author: sbruno Date: Thu Apr 25 23:10:34 2013 New Revision: 249908 URL: http://svnweb.freebsd.org/changeset/base/249908 Log: In the case where the controller supports an sg_list LESS than our predefined and tuned value, we would advertise the unsupported value to CAM and it would merrily destroy the controller with way too many IO operations. This manifests itself in a Zero Memory RAID configuration for a P410 and possibly other controllers. Obtained from:Yahoo! Inc. MFC after:2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c == --- head/sys/dev/ciss/ciss.cThu Apr 25 21:55:29 2013(r249907) +++ head/sys/dev/ciss/ciss.cThu Apr 25 23:10:34 2013(r249908) @@ -3005,7 +3005,7 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; - cpi->maxio = (CISS_MAX_SG_ELEMENTS - 1) * PAGE_SIZE; + cpi->maxio = (min(CISS_MAX_SG_ELEMENTS, sc->ciss_cfg->max_sg_length) - 1) * PAGE_SIZE; ccb->ccb_h.status = CAM_REQ_CMP; 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: r249910 - stable/9/lib/libc/gen
Author: eadler Date: Fri Apr 26 00:45:00 2013 New Revision: 249910 URL: http://svnweb.freebsd.org/changeset/base/249910 Log: MFC r249801: Switch from K&R prototypes to modern C Modified: stable/9/lib/libc/gen/stringlist.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/stringlist.c == --- stable/9/lib/libc/gen/stringlist.c Fri Apr 26 00:00:14 2013 (r249909) +++ stable/9/lib/libc/gen/stringlist.c Fri Apr 26 00:45:00 2013 (r249910) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); * sl_init(): Initialize a string list */ StringList * -sl_init() +sl_init(void) { StringList *sl; @@ -67,9 +67,7 @@ sl_init() * sl_add(): Add an item to the string list */ int -sl_add(sl, name) - StringList *sl; - char *name; +sl_add(StringList *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { sl->sl_max += _SL_CHUNKSIZE; @@ -86,9 +84,7 @@ sl_add(sl, name) * sl_free(): Free a stringlist */ void -sl_free(sl, all) - StringList *sl; - int all; +sl_free(StringList *sl, int all) { size_t i; @@ -108,9 +104,7 @@ sl_free(sl, all) * sl_find(): Find a name in the string list */ char * -sl_find(sl, name) - StringList *sl; - char *name; +sl_find(StringList *sl, char *name) { size_t i; ___ 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: r249911 - stable/8/lib/libc/gen
Author: eadler Date: Fri Apr 26 00:45:03 2013 New Revision: 249911 URL: http://svnweb.freebsd.org/changeset/base/249911 Log: MFC r249801: Switch from K&R prototypes to modern C Modified: stable/8/lib/libc/gen/stringlist.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/stringlist.c == --- stable/8/lib/libc/gen/stringlist.c Fri Apr 26 00:45:00 2013 (r249910) +++ stable/8/lib/libc/gen/stringlist.c Fri Apr 26 00:45:03 2013 (r249911) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); * sl_init(): Initialize a string list */ StringList * -sl_init() +sl_init(void) { StringList *sl; @@ -67,9 +67,7 @@ sl_init() * sl_add(): Add an item to the string list */ int -sl_add(sl, name) - StringList *sl; - char *name; +sl_add(StringList *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { sl->sl_max += _SL_CHUNKSIZE; @@ -86,9 +84,7 @@ sl_add(sl, name) * sl_free(): Free a stringlist */ void -sl_free(sl, all) - StringList *sl; - int all; +sl_free(StringList *sl, int all) { size_t i; @@ -108,9 +104,7 @@ sl_free(sl, all) * sl_find(): Find a name in the string list */ char * -sl_find(sl, name) - StringList *sl; - char *name; +sl_find(StringList *sl, char *name) { size_t i; ___ 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: r249912 - stable/9/lib/libc/gen
Author: eadler Date: Fri Apr 26 00:47:22 2013 New Revision: 249912 URL: http://svnweb.freebsd.org/changeset/base/249912 Log: MFC r249802: - sl_find does not modify 'name' - make the prototype of sl_find match NetBSD Modified: stable/9/lib/libc/gen/stringlist.3 stable/9/lib/libc/gen/stringlist.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/stringlist.3 == --- stable/9/lib/libc/gen/stringlist.3 Fri Apr 26 00:45:03 2013 (r249911) +++ stable/9/lib/libc/gen/stringlist.3 Fri Apr 26 00:47:22 2013 (r249912) @@ -49,7 +49,7 @@ .Ft void .Fn sl_free "StringList *sl" "int freeall" .Ft char * -.Fn sl_find "StringList *sl" "char *item" +.Fn sl_find "StringList *sl" "const char *item" .Sh DESCRIPTION The .Nm Modified: stable/9/lib/libc/gen/stringlist.c == --- stable/9/lib/libc/gen/stringlist.c Fri Apr 26 00:45:03 2013 (r249911) +++ stable/9/lib/libc/gen/stringlist.c Fri Apr 26 00:47:22 2013 (r249912) @@ -104,7 +104,7 @@ sl_free(StringList *sl, int all) * sl_find(): Find a name in the string list */ char * -sl_find(StringList *sl, char *name) +sl_find(StringList *sl, const char *name) { size_t i; ___ 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: r249913 - stable/8/lib/libc/gen
Author: eadler Date: Fri Apr 26 00:47:28 2013 New Revision: 249913 URL: http://svnweb.freebsd.org/changeset/base/249913 Log: MFC r249802: - sl_find does not modify 'name' - make the prototype of sl_find match NetBSD Modified: stable/8/lib/libc/gen/stringlist.3 stable/8/lib/libc/gen/stringlist.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/stringlist.3 == --- stable/8/lib/libc/gen/stringlist.3 Fri Apr 26 00:47:22 2013 (r249912) +++ stable/8/lib/libc/gen/stringlist.3 Fri Apr 26 00:47:28 2013 (r249913) @@ -56,7 +56,7 @@ .Ft void .Fn sl_free "StringList *sl" "int freeall" .Ft char * -.Fn sl_find "StringList *sl" "char *item" +.Fn sl_find "StringList *sl" "const char *item" .Sh DESCRIPTION The .Nm Modified: stable/8/lib/libc/gen/stringlist.c == --- stable/8/lib/libc/gen/stringlist.c Fri Apr 26 00:47:22 2013 (r249912) +++ stable/8/lib/libc/gen/stringlist.c Fri Apr 26 00:47:28 2013 (r249913) @@ -104,7 +104,7 @@ sl_free(StringList *sl, int all) * sl_find(): Find a name in the string list */ char * -sl_find(StringList *sl, char *name) +sl_find(StringList *sl, const char *name) { size_t i; ___ 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: r249915 - in stable/9/sys: dev/random libkern sys
Author: ache Date: Fri Apr 26 01:56:58 2013 New Revision: 249915 URL: http://svnweb.freebsd.org/changeset/base/249915 Log: MFC r249631 Attempt to mitigate poor initialization of arc4 by one-shot reinitialization from yarrow right after good entropy is harvested. Approved by:secteam (delphij) Modified: stable/9/sys/dev/random/randomdev_soft.c stable/9/sys/libkern/arc4random.c stable/9/sys/sys/libkern.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/random/randomdev_soft.c == --- stable/9/sys/dev/random/randomdev_soft.cFri Apr 26 00:53:34 2013 (r249914) +++ stable/9/sys/dev/random/randomdev_soft.cFri Apr 26 01:56:58 2013 (r249915) @@ -366,6 +366,8 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + (void)atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_NONE, + ARC4_ENTR_HAVE); } static int Modified: stable/9/sys/libkern/arc4random.c == --- stable/9/sys/libkern/arc4random.c Fri Apr 26 00:53:34 2013 (r249914) +++ stable/9/sys/libkern/arc4random.c Fri Apr 26 01:56:58 2013 (r249915) @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD$"); #defineARC4_RESEED_SECONDS 300 #defineARC4_KEYBYTES (256 / 8) +int arc4rand_iniseed_state = ARC4_ENTR_NONE; + static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -130,7 +132,8 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, + ARC4_ENTR_SEED) || reseed || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); Modified: stable/9/sys/sys/libkern.h == --- stable/9/sys/sys/libkern.h Fri Apr 26 00:53:34 2013(r249914) +++ stable/9/sys/sys/libkern.h Fri Apr 26 01:56:58 2013(r249915) @@ -70,6 +70,11 @@ static __inline int abs(int a) { return static __inline long labs(long a) { return (a < 0 ? -a : a); } static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } +#defineARC4_ENTR_NONE 0 /* Don't have entropy yet. */ +#defineARC4_ENTR_HAVE 1 /* Have entropy. */ +#defineARC4_ENTR_SEED 2 /* Reseeding. */ +extern int arc4rand_iniseed_state; + /* Prototypes for non-quad routines. */ struct malloc_type; uint32_t arc4random(void); ___ 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: r249916 - head/usr.sbin/bhyve
Author: neel Date: Fri Apr 26 02:24:50 2013 New Revision: 249916 URL: http://svnweb.freebsd.org/changeset/base/249916 Log: Gripe if some tuple is specified more than once instead of silently overwriting the previous assignment. Gripe if the emulation is not recognized instead of silently ignoring the emulated device. If an error is detected by pci_parse_slot() then exit from the command line parsing loop in main(). Submitted by (initial version): Chris Torek (chris.to...@gmail.com) Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h Modified: head/usr.sbin/bhyve/bhyverun.c == --- head/usr.sbin/bhyve/bhyverun.c Fri Apr 26 01:56:58 2013 (r249915) +++ head/usr.sbin/bhyve/bhyverun.c Fri Apr 26 02:24:50 2013 (r249916) @@ -631,11 +631,15 @@ main(int argc, char *argv[]) guest_tslice = atoi(optarg); break; case 's': - pci_parse_slot(optarg, 0); - break; + if (pci_parse_slot(optarg, 0) != 0) + exit(1); + else + break; case 'S': - pci_parse_slot(optarg, 1); - break; + if (pci_parse_slot(optarg, 1) != 0) + exit(1); + else + break; case 'm': memsize = strtoul(optarg, NULL, 0) * MB; break; Modified: head/usr.sbin/bhyve/pci_emul.c == --- head/usr.sbin/bhyve/pci_emul.c Fri Apr 26 01:56:58 2013 (r249915) +++ head/usr.sbin/bhyve/pci_emul.c Fri Apr 26 02:24:50 2013 (r249916) @@ -100,6 +100,8 @@ static uint64_t pci_emul_membase64; #definePCI_EMUL_MEMBASE64 0xD0UL #definePCI_EMUL_MEMLIMIT64 0xFDUL +static struct pci_devemu *pci_emul_finddev(char *name); + static int pci_emul_devices; /* @@ -123,17 +125,18 @@ static int pci_emul_devices; static void pci_parse_slot_usage(char *aopt) { - printf("Invalid PCI slot info field \"%s\"\n", aopt); - free(aopt); + + fprintf(stderr, "Invalid PCI slot info field \"%s\"\n", aopt); } -void +int pci_parse_slot(char *opt, int legacy) { char *slot, *func, *emul, *config; char *str, *cpy; - int snum, fnum; + int error, snum, fnum; + error = -1; str = cpy = strdup(opt); config = NULL; @@ -152,19 +155,40 @@ pci_parse_slot(char *opt, int legacy) } if (emul == NULL) { - pci_parse_slot_usage(cpy); - return; + pci_parse_slot_usage(opt); + goto done; } snum = atoi(slot); fnum = func ? atoi(func) : 0; + if (snum < 0 || snum >= MAXSLOTS || fnum < 0 || fnum >= MAXFUNCS) { - pci_parse_slot_usage(cpy); - } else { - pci_slotinfo[snum][fnum].si_name = emul; - pci_slotinfo[snum][fnum].si_param = config; - pci_slotinfo[snum][fnum].si_legacy = legacy; + pci_parse_slot_usage(opt); + goto done; } + + if (pci_slotinfo[snum][fnum].si_name != NULL) { + fprintf(stderr, "pci slot %d:%d already occupied!\n", + snum, fnum); + goto done; + } + + if (pci_emul_finddev(emul) == NULL) { + fprintf(stderr, "pci slot %d:%d: unknown device \"%s\"\n", + snum, fnum, emul); + goto done; + } + + error = 0; + pci_slotinfo[snum][fnum].si_name = emul; + pci_slotinfo[snum][fnum].si_param = config; + pci_slotinfo[snum][fnum].si_legacy = legacy; + +done: + if (error) + free(cpy); + + return (error); } static int @@ -988,10 +1012,9 @@ init_pci(struct vmctx *ctx) si = &pci_slotinfo[slot][func]; if (si->si_name != NULL) { pde = pci_emul_finddev(si->si_name); - if (pde != NULL) { - pci_emul_init(ctx, pde, slot, func, - si->si_param); - } + assert(pde != NULL); + pci_emul_init(ctx, pde, slot, func, + si->si_param); } } } Modified: head/usr.sbin/bhyve/pci_emul.h == ---
svn commit: r249917 - head/usr.sbin/bhyve
Author: grehan Date: Fri Apr 26 05:13:48 2013 New Revision: 249917 URL: http://svnweb.freebsd.org/changeset/base/249917 Log: Use a thread for the processing of virtio tx descriptors rather than blocking the vCPU thread. This improves bulk data performance by ~30-40% and doesn't harm req/resp time for stock netperf runs. Future work will use a thread pool rather than a thread per tx queue. Submitted by: Dinakar Medavaram Reviewed by: neel, grehan Obtained from:NetApp Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c == --- head/usr.sbin/bhyve/pci_virtio_net.cFri Apr 26 02:24:50 2013 (r249916) +++ head/usr.sbin/bhyve/pci_virtio_net.cFri Apr 26 05:13:48 2013 (r249917) @@ -46,13 +46,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" #include "mevent.h" #include "virtio.h" -#define VTNET_RINGSZ 256 +#define VTNET_RINGSZ 1024 #define VTNET_MAXSEGS 32 @@ -140,6 +141,8 @@ struct pci_vtnet_softc { int vsc_tapfd; int vsc_rx_ready; int vsc_rxpend; + int tx_in_progress; + int resetting; uint32_tvsc_features; uint8_t vsc_macaddr[6]; @@ -147,6 +150,9 @@ struct pci_vtnet_softc { uint64_tvsc_pfn[VTNET_MAXQ]; struct vring_hqueue vsc_hq[VTNET_MAXQ]; uint16_tvsc_msix_table_idx[VTNET_MAXQ]; + pthread_t tx_tid; + pthread_mutex_t tx_mtx; + pthread_cond_t tx_cond; }; #definevtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) @@ -174,7 +180,7 @@ hq_num_avail(struct vring_hqueue *hq) uint16_t ndesc; /* -* We're just computing (a-b) in GF(216). +* We're just computing (a-b) mod 2^16 * * The only glitch here is that in standard C, * uint16_t promotes to (signed) int when int has @@ -221,9 +227,23 @@ pci_vtnet_update_status(struct pci_vtnet if (value == 0) { DPRINTF(("vtnet: device reset requested !\n")); + + /* Wait for TX thread to complete pending desc processing */ + sc->resetting = 1; + pthread_mutex_lock(&sc->tx_mtx); + + while (sc->tx_in_progress) { + pthread_mutex_unlock(&sc->tx_mtx); + usleep(1); + pthread_mutex_lock(&sc->tx_mtx); + } + + pthread_mutex_unlock(&sc->tx_mtx); + pci_vtnet_ring_reset(sc, VTNET_RXQ); pci_vtnet_ring_reset(sc, VTNET_TXQ); sc->vsc_rx_ready = 0; + sc->resetting = 0; } sc->vsc_status = value; @@ -463,25 +483,12 @@ pci_vtnet_proctx(struct pci_vtnet_softc hq->hq_cur_aidx = aidx + 1; *hq->hq_used_idx = uidx + 1; - /* -* Generate an interrupt if able -*/ - if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { - if (use_msix) { - pci_generate_msix(sc->vsc_pi, - sc->vsc_msix_table_idx[VTNET_TXQ]); - } else { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); - } - } } static void pci_vtnet_ping_txq(struct pci_vtnet_softc *sc) { struct vring_hqueue *hq = &sc->vsc_hq[VTNET_TXQ]; - int i; int ndescs; /* @@ -492,14 +499,82 @@ pci_vtnet_ping_txq(struct pci_vtnet_soft if (ndescs == 0) return; - /* -* Run through all the entries, placing them into iovecs and -* sending when an end-of-packet is found -*/ - for (i = 0; i < ndescs; i++) - pci_vtnet_proctx(sc, hq); + /* Signal the tx thread for processing */ + pthread_mutex_lock(&sc->tx_mtx); + if (sc->tx_in_progress == 0) + pthread_cond_signal(&sc->tx_cond); + pthread_mutex_unlock(&sc->tx_mtx); } +/* + * Thread which will handle processing of TX desc + */ +static void * +pci_vtnet_tx_thread(void *param) +{ + struct pci_vtnet_softc *sc = (struct pci_vtnet_softc *) param; + struct vring_hqueue *hq; + int i, ndescs, needintr,error; + + needintr = 0; + hq = &sc->vsc_hq[VTNET_TXQ]; + + /* +* Let us wait till the tx queue pointers get initialised & +* first tx signaled +*/ + pthread_mutex_lock(&sc->tx_mtx); + error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); + assert(error == 0); + + for (;;) { + pthread_mutex_lock(&sc->tx_mtx); + for
svn commit: r249918 - head/sys/powerpc/aim
Author: jhibbits Date: Fri Apr 26 05:18:18 2013 New Revision: 249918 URL: http://svnweb.freebsd.org/changeset/base/249918 Log: Remove a comment that shouldn't have gone in. X-MFC-with: r249864 Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Fri Apr 26 05:13:48 2013 (r249917) +++ head/sys/powerpc/aim/mmu_oea.c Fri Apr 26 05:18:18 2013 (r249918) @@ -2588,9 +2588,6 @@ moea_dumpsys_map(mmu_t mmu, struct pmap_ return (md->md_vaddr + ofs); } -/* TODO: Run this on minbar, single calls, to check addresses, offsets, and - * sizes. It should be doing more than just single pages. - */ struct pmap_md * moea_scan_md(mmu_t mmu, struct pmap_md *prev) { ___ 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: r249919 - head/sys/mips/cavium
Author: imp Date: Fri Apr 26 05:42:35 2013 New Revision: 249919 URL: http://svnweb.freebsd.org/changeset/base/249919 Log: Octeon 2 (6xxx) and newer CPUs don't use the clock CPU speed for its I/O clock. Thankfully, the simple executive provies a way to querry the proper clock that works on all models. Move to asking for the SCLK via this interface. This gets the serial console working after we start init and open the console and set the divisor (which turned the output from good to bad). I can login on the console now. Modified: head/sys/mips/cavium/uart_dev_oct16550.c Modified: head/sys/mips/cavium/uart_dev_oct16550.c == --- head/sys/mips/cavium/uart_dev_oct16550.cFri Apr 26 05:18:18 2013 (r249918) +++ head/sys/mips/cavium/uart_dev_oct16550.cFri Apr 26 05:42:35 2013 (r249919) @@ -656,7 +656,7 @@ oct16550_bus_probe (struct uart_softc *s int error; bas = &sc->sc_bas; - bas->rclk = uart_oct16550_class.uc_rclk = cvmx_sysinfo_get()->cpu_clock_hz; + bas->rclk = uart_oct16550_class.uc_rclk = cvmx_clock_get_rate(CVMX_CLOCK_SCLK); error = oct16550_probe(bas); if (error) { ___ 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"