svn commit: r324050 - head/sys/netinet
Author: sephe Date: Wed Sep 27 05:52:37 2017 New Revision: 324050 URL: https://svnweb.freebsd.org/changeset/base/324050 Log: tcp: Don't "negotiate" MSS. _NO_ OSes actually "negotiate" MSS. RFC 879: "... This Maximum Segment Size (MSS) announcement (often mistakenly called a negotiation) ..." This negotiation behaviour was introduced 11 years ago by r159955 without any explaination about why FreeBSD had to "negotiate" MSS: In syncache_respond() do not reply with a MSS that is larger than what the peer announced to us but make it at least tcp_minmss in size. Sponsored by: TCP/IP Optimization Fundraise 2005 The tcp_minmss behaviour is still kept. Syncookie fix was prodded by tuexen, who also helped to test this patch w/ packetdrill. Reviewed by: tuexen, karels, bz (previous version) MFC after:2 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D12430 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c == --- head/sys/netinet/tcp_syncache.c Wed Sep 27 05:44:50 2017 (r324049) +++ head/sys/netinet/tcp_syncache.c Wed Sep 27 05:52:37 2017 (r324050) @@ -1634,9 +1634,7 @@ syncache_respond(struct syncache *sc, struct syncache_ tlen = hlen + sizeof(struct tcphdr); /* Determine MSS we advertize to other end of connection. */ - mssopt = tcp_mssopt(>sc_inc); - if (sc->sc_peer_mss) - mssopt = max( min(sc->sc_peer_mss, mssopt), V_tcp_minmss); + mssopt = max(tcp_mssopt(>sc_inc), V_tcp_minmss); /* XXX: Assume that the entire packet will fit in a header mbuf. */ KASSERT(max_linkhdr + tlen + TCP_MAXOLEN <= MHLEN, @@ -1985,7 +1983,7 @@ syncookie_mac(struct in_conninfo *inc, tcp_seq irs, ui static tcp_seq syncookie_generate(struct syncache_head *sch, struct syncache *sc) { - u_int i, mss, secbit, wscale; + u_int i, secbit, wscale; uint32_t iss, hash; uint8_t *secbits; union syncookie cookie; @@ -1995,8 +1993,8 @@ syncookie_generate(struct syncache_head *sch, struct s cookie.cookie = 0; /* Map our computed MSS into the 3-bit index. */ - mss = min(tcp_mssopt(>sc_inc), max(sc->sc_peer_mss, V_tcp_minmss)); - for (i = nitems(tcp_sc_msstab) - 1; tcp_sc_msstab[i] > mss && i > 0; + for (i = nitems(tcp_sc_msstab) - 1; +tcp_sc_msstab[i] > sc->sc_peer_mss && i > 0; i--) ; cookie.flags.mss_idx = i; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324049 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Sep 27 05:44:50 2017 New Revision: 324049 URL: https://svnweb.freebsd.org/changeset/base/324049 Log: hyperv/hn: Fix UDP checksum offload issue in Azure. UDP checksum offload does not work in Azure if following conditions are met: - sizeof(IP hdr + UDP hdr + payload) > 1420. - IP_DF is not set in IP hdr Use software checksum for UDP datagrams falling into this category. Add two tunables to disable UDP/IPv4 and UDP/IPv6 checksum offload, in case something unexpected happened. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D12429 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Sep 27 04:42:40 2017 (r324048) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Sep 27 05:44:50 2017 (r324049) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -460,6 +461,35 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostip, CTLFLAG_RDT "Trust ip packet verification on host side, " "when csum info is missing (global setting)"); +/* + * Offload UDP/IPv4 checksum. + */ +static int hn_enable_udp4cs = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, enable_udp4cs, CTLFLAG_RDTUN, +_enable_udp4cs, 0, "Offload UDP/IPv4 checksum"); + +/* + * Offload UDP/IPv6 checksum. + */ +static int hn_enable_udp6cs = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, enable_udp6cs, CTLFLAG_RDTUN, +_enable_udp6cs, 0, "Offload UDP/IPv6 checksum"); + +/* Stats. */ +static counter_u64_t hn_udpcs_fixup; +SYSCTL_COUNTER_U64(_hw_hn, OID_AUTO, udpcs_fixup, CTLFLAG_RW, +_udpcs_fixup, "# of UDP checksum fixup"); + +/* + * See hn_set_hlen(). + * + * This value is for Azure. For Hyper-V, set this above + * 65536 to disable UDP datagram checksum fixup. + */ +static int hn_udpcs_fixup_mtu = 1420; +SYSCTL_INT(_hw_hn, OID_AUTO, udpcs_fixup_mtu, CTLFLAG_RWTUN, +_udpcs_fixup_mtu, 0, "UDP checksum fixup MTU threshold"); + /* Limit TSO burst size */ static int hn_tso_maxlen = IP_MAXPACKET; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, @@ -799,6 +829,27 @@ hn_set_hlen(struct mbuf *m_head) ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; m_head->m_pkthdr.l3hlen = iphlen; + + /* +* UDP checksum offload does not work in Azure, if the +* following conditions meet: +* - sizeof(IP hdr + UDP hdr + payload) > 1420. +* - IP_DF is not set in the IP hdr. +* +* Fallback to software checksum for these UDP datagrams. +*/ + if ((m_head->m_pkthdr.csum_flags & CSUM_IP_UDP) && + m_head->m_pkthdr.len > hn_udpcs_fixup_mtu + ehlen && + (ntohs(ip->ip_off) & IP_DF) == 0) { + uint16_t off = ehlen + iphlen; + + counter_u64_add(hn_udpcs_fixup, 1); + PULLUP_HDR(m_head, off + sizeof(struct udphdr)); + *(uint16_t *)(m_head->m_data + off + +m_head->m_pkthdr.csum_data) = in_cksum_skip( + m_head, m_head->m_pkthdr.len, off); + m_head->m_pkthdr.csum_flags &= ~CSUM_IP_UDP; + } } #endif #if defined(INET6) && defined(INET) @@ -5479,11 +5530,11 @@ hn_fixup_tx_data(struct hn_softc *sc) csum_assist |= CSUM_IP; if (sc->hn_caps & HN_CAP_TCP4CS) csum_assist |= CSUM_IP_TCP; - if (sc->hn_caps & HN_CAP_UDP4CS) + if ((sc->hn_caps & HN_CAP_UDP4CS) && hn_enable_udp4cs) csum_assist |= CSUM_IP_UDP; if (sc->hn_caps & HN_CAP_TCP6CS) csum_assist |= CSUM_IP6_TCP; - if (sc->hn_caps & HN_CAP_UDP6CS) + if ((sc->hn_caps & HN_CAP_UDP6CS) && hn_enable_udp6cs) csum_assist |= CSUM_IP6_UDP; for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist; @@ -7336,6 +7387,8 @@ hn_sysinit(void *arg __unused) { int i; + hn_udpcs_fixup = counter_u64_alloc(M_WAITOK); + #ifdef HN_IFSTART_SUPPORT /* * Don't use ifnet.if_start if transparent VF mode is requested; @@ -7415,5 +7468,7 @@ hn_sysuninit(void *arg __unused) if (hn_vfmap != NULL) free(hn_vfmap, M_DEVBUF); rm_destroy(_vfmap_lock); + + counter_u64_free(hn_udpcs_fixup); } SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe,
svn commit: r324048 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Sep 27 04:42:40 2017 New Revision: 324048 URL: https://svnweb.freebsd.org/changeset/base/324048 Log: hyperv/hn: Set tcp header offset for CSUM/LSO offloading. No observable effect; better safe than sorry. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D12417 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Sep 27 01:47:54 2017 (r324047) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Sep 27 04:42:40 2017 (r324048) @@ -727,6 +727,7 @@ hn_tso_fixup(struct mbuf *m_head) ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; else ehlen = ETHER_HDR_LEN; + m_head->m_pkthdr.l2hlen = ehlen; #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { @@ -736,6 +737,7 @@ hn_tso_fixup(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip)); ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; + m_head->m_pkthdr.l3hlen = iphlen; PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); th = mtodo(m_head, ehlen + iphlen); @@ -759,6 +761,7 @@ hn_tso_fixup(struct mbuf *m_head) m_freem(m_head); return (NULL); } + m_head->m_pkthdr.l3hlen = sizeof(*ip6); PULLUP_HDR(m_head, ehlen + sizeof(*ip6) + sizeof(*th)); th = mtodo(m_head, ehlen + sizeof(*ip6)); @@ -768,41 +771,34 @@ hn_tso_fixup(struct mbuf *m_head) } #endif return (m_head); - } /* * NOTE: If this function failed, the m_head would be freed. */ static __inline struct mbuf * -hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) +hn_set_hlen(struct mbuf *m_head) { const struct ether_vlan_header *evl; - const struct tcphdr *th; int ehlen; - *tcpsyn = 0; - PULLUP_HDR(m_head, sizeof(*evl)); evl = mtod(m_head, const struct ether_vlan_header *); if (evl->evl_encap_proto == ntohs(ETHERTYPE_VLAN)) ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; else ehlen = ETHER_HDR_LEN; + m_head->m_pkthdr.l2hlen = ehlen; #ifdef INET - if (m_head->m_pkthdr.csum_flags & CSUM_IP_TCP) { + if (m_head->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP_UDP)) { const struct ip *ip; int iphlen; PULLUP_HDR(m_head, ehlen + sizeof(*ip)); ip = mtodo(m_head, ehlen); iphlen = ip->ip_hl << 2; - - PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); - th = mtodo(m_head, ehlen + iphlen); - if (th->th_flags & TH_SYN) - *tcpsyn = 1; + m_head->m_pkthdr.l3hlen = iphlen; } #endif #if defined(INET6) && defined(INET) @@ -814,18 +810,36 @@ hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) - return (m_head); - - PULLUP_HDR(m_head, ehlen + sizeof(*ip6) + sizeof(*th)); - th = mtodo(m_head, ehlen + sizeof(*ip6)); - if (th->th_flags & TH_SYN) - *tcpsyn = 1; + if (ip6->ip6_nxt != IPPROTO_TCP) { + m_freem(m_head); + return (NULL); + } + m_head->m_pkthdr.l3hlen = sizeof(*ip6); } #endif return (m_head); } +/* + * NOTE: If this function failed, the m_head would be freed. + */ +static __inline struct mbuf * +hn_check_tcpsyn(struct mbuf *m_head, int *tcpsyn) +{ + const struct tcphdr *th; + int ehlen, iphlen; + + *tcpsyn = 0; + ehlen = m_head->m_pkthdr.l2hlen; + iphlen = m_head->m_pkthdr.l3hlen; + + PULLUP_HDR(m_head, ehlen + iphlen + sizeof(*th)); + th = mtodo(m_head, ehlen + iphlen); + if (th->th_flags & TH_SYN) + *tcpsyn = 1; + return (m_head); +} + #undef PULLUP_HDR #endif /* INET6 || INET */ @@ -3010,7 +3024,8 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st NDIS_LSO2_INFO_SIZE, NDIS_PKTINFO_TYPE_LSO); #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { - *pi_data = NDIS_LSO2_INFO_MAKEIPV4(0, + *pi_data = NDIS_LSO2_INFO_MAKEIPV4( + m_head->m_pkthdr.l2hlen + m_head->m_pkthdr.l3hlen, m_head->m_pkthdr.tso_segsz); } #endif @@ -3019,7 +3034,8 @@ hn_encap(struct ifnet *ifp, struct hn_tx_ring *txr, st
svn commit: r324047 - stable/11/sys/netpfil/ipfw
Author: ae Date: Wed Sep 27 01:47:54 2017 New Revision: 324047 URL: https://svnweb.freebsd.org/changeset/base/324047 Log: MFC r323839: Use in_localip() function instead of unlocked access to addresses hash to determine that an address is our local. PR: 220078 Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c == --- stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Sep 27 01:46:14 2017 (r324046) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Sep 27 01:47:54 2017 (r324047) @@ -1609,10 +1609,7 @@ do { \ case O_IP_SRC_ME: if (is_ipv4) { - struct ifnet *tif; - - INADDR_TO_IFP(src_ip, tif); - match = (tif != NULL); + match = in_localip(src_ip); break; } #ifdef INET6 @@ -1648,10 +1645,7 @@ do { \ case O_IP_DST_ME: if (is_ipv4) { - struct ifnet *tif; - - INADDR_TO_IFP(dst_ip, tif); - match = (tif != NULL); + match = in_localip(dst_ip); break; } #ifdef INET6 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324046 - in stable/11/sys/netpfil/ipfw: . nat64 nptv6
Author: ae Date: Wed Sep 27 01:46:14 2017 New Revision: 324046 URL: https://svnweb.freebsd.org/changeset/base/324046 Log: MFC r323836: Do not acquire IPFW_WLOCK when a named object is created and destroyed. Acquiring of IPFW_WLOCK is requried for cases when we are going to change some data that can be accessed during processing of packets flow. When we create new named object, there are not yet any rules, that references it, thus holding IPFW_UH_WLOCK is enough to safely update needed structures. When we destroy an object, we do this only when its reference counter becomes zero. And it is safe to not acquire IPFW_WLOCK, because noone references it. The another case is when we failed to finish some action and thus we are doing rollback and destroying an object, in this case it is still not referenced by rules and no need to acquire IPFW_WLOCK. This also fixes panic with INVARIANTS due to recursive IPFW_WLOCK acquiring. Sponsored by: Yandex LLC Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c stable/11/sys/netpfil/ipfw/ip_fw_table.c stable/11/sys/netpfil/ipfw/nat64/nat64lsn_control.c stable/11/sys/netpfil/ipfw/nat64/nat64stl_control.c stable/11/sys/netpfil/ipfw/nptv6/nptv6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c == --- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Sep 27 01:31:52 2017 (r324045) +++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Sep 27 01:46:14 2017 (r324046) @@ -418,9 +418,7 @@ dyn_create(struct ip_fw_chain *ch, struct tid_info *ti return (ENOSPC); } ipfw_objhash_add(ni, >no); - IPFW_WLOCK(ch); SRV_OBJECT(ch, obj->no.kidx) = obj; - IPFW_WUNLOCK(ch); obj->no.refcnt++; *pkidx = obj->no.kidx; IPFW_UH_WUNLOCK(ch); @@ -440,10 +438,8 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec no->name, no->etlv, no->kidx, no->refcnt)); DYN_DEBUG("kidx %d", no->kidx); - IPFW_WLOCK(ch); obj = SRV_OBJECT(ch, no->kidx); SRV_OBJECT(ch, no->kidx) = NULL; - IPFW_WUNLOCK(ch); ipfw_objhash_del(CHAIN_TO_SRV(ch), no); ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), no->kidx); Modified: stable/11/sys/netpfil/ipfw/ip_fw_table.c == --- stable/11/sys/netpfil/ipfw/ip_fw_table.cWed Sep 27 01:31:52 2017 (r324045) +++ stable/11/sys/netpfil/ipfw/ip_fw_table.cWed Sep 27 01:46:14 2017 (r324046) @@ -1925,9 +1925,7 @@ create_table_internal(struct ip_fw_chain *ch, struct t tc->no.kidx = kidx; tc->no.etlv = IPFW_TLV_TBL_NAME; - IPFW_WLOCK(ch); link_table(ch, tc); - IPFW_WUNLOCK(ch); } if (compat != 0) @@ -3229,7 +3227,6 @@ link_table(struct ip_fw_chain *ch, struct table_config uint16_t kidx; IPFW_UH_WLOCK_ASSERT(ch); - IPFW_WLOCK_ASSERT(ch); ni = CHAIN_TO_NI(ch); kidx = tc->no.kidx; Modified: stable/11/sys/netpfil/ipfw/nat64/nat64lsn_control.c == --- stable/11/sys/netpfil/ipfw/nat64/nat64lsn_control.c Wed Sep 27 01:31:52 2017(r324045) +++ stable/11/sys/netpfil/ipfw/nat64/nat64lsn_control.c Wed Sep 27 01:46:14 2017(r324046) @@ -208,10 +208,7 @@ nat64lsn_create(struct ip_fw_chain *ch, ip_fw3_opheade ipfw_objhash_add(CHAIN_TO_SRV(ch), >no); /* Okay, let's link data */ - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = cfg; - IPFW_WUNLOCK(ch); - nat64lsn_start_instance(cfg); IPFW_UH_WUNLOCK(ch); @@ -259,10 +256,7 @@ nat64lsn_destroy(struct ip_fw_chain *ch, ip_fw3_ophead return (EBUSY); } - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = NULL; - IPFW_WUNLOCK(ch); - nat64lsn_detach_config(ch, cfg); IPFW_UH_WUNLOCK(ch); Modified: stable/11/sys/netpfil/ipfw/nat64/nat64stl_control.c == --- stable/11/sys/netpfil/ipfw/nat64/nat64stl_control.c Wed Sep 27 01:31:52 2017(r324045) +++ stable/11/sys/netpfil/ipfw/nat64/nat64stl_control.c Wed Sep 27 01:46:14 2017(r324046) @@ -220,10 +220,7 @@ nat64stl_create(struct ip_fw_chain *ch, ip_fw3_opheade error = nat64stl_create_internal(ch, cfg, uc); if (error == 0) { /* Okay, let's link data */ - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = cfg; - IPFW_WUNLOCK(ch); - IPFW_UH_WUNLOCK(ch); return (0); } @@ -342,10 +339,7 @@ nat64stl_destroy(struct ip_fw_chain *ch,
svn commit: r324045 - head/sys/kern
Author: mjg Date: Wed Sep 27 01:31:52 2017 New Revision: 324045 URL: https://svnweb.freebsd.org/changeset/base/324045 Log: sysctl: remove target buffer read/write checks prior to calling the handler Said checks were inherently racy anyway as jokers could unmap target areas before the handler got around to accessing them. This saves time by avoiding locking the address space. MFC after:1 week Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Wed Sep 27 01:27:43 2017(r324044) +++ head/sys/kern/kern_sysctl.c Wed Sep 27 01:31:52 2017(r324045) @@ -2061,16 +2061,9 @@ userland_sysctl(struct thread *td, int *name, u_int na } } req.validlen = req.oldlen; + req.oldptr = old; - if (old) { - if (!useracc(old, req.oldlen, VM_PROT_WRITE)) - return (EFAULT); - req.oldptr= old; - } - if (new != NULL) { - if (!useracc(new, newlen, VM_PROT_READ)) - return (EFAULT); req.newlen = newlen; req.newptr = new; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324044 - head/sys/kern
Author: mjg Date: Wed Sep 27 01:27:43 2017 New Revision: 324044 URL: https://svnweb.freebsd.org/changeset/base/324044 Log: Annotate sysctlmemlock with __exclusive_cache_line. MFC after:1 week Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Wed Sep 27 01:12:47 2017(r324043) +++ head/sys/kern/kern_sysctl.c Wed Sep 27 01:27:43 2017(r324044) @@ -88,7 +88,7 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysctltmp", "sysctl * sysctl requests larger than a single page via an exclusive lock. */ static struct rmlock sysctllock; -static struct sx sysctlmemlock; +static struct sx __exclusive_cache_line sysctlmemlock; #defineSYSCTL_WLOCK() rm_wlock() #defineSYSCTL_WUNLOCK()rm_wunlock() ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324043 - in head: . share/man/man9
Author: mjg Date: Wed Sep 27 01:12:47 2017 New Revision: 324043 URL: https://svnweb.freebsd.org/changeset/base/324043 Log: Remove manpage entries about crshared(9) The function itself was removed years ago in r272546 Submitted by: Paulm MFC after:2 weeks Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/ucred.9 Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Sep 27 01:03:00 2017(r324042) +++ head/ObsoleteFiles.inc Wed Sep 27 01:12:47 2017(r324043) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170927: crshared +OLD_FILES+=usr/share/man/man9/crshared.9.gz # 20170927: procctl OLD_FILES+=usr/share/man/man8/procctl.8.gz OLD_FILES+=usr/sbin/procctl Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileWed Sep 27 01:03:00 2017 (r324042) +++ head/share/man/man9/MakefileWed Sep 27 01:12:47 2017 (r324043) @@ -1929,7 +1929,6 @@ MLINKS+=ucred.9 cred_update_thread.9 \ ucred.9 crget.9 \ ucred.9 crhold.9 \ ucred.9 crsetgroups.9 \ - ucred.9 crshared.9 \ ucred.9 cru2x.9 MLINKS+=uidinfo.9 uifind.9 \ uidinfo.9 uifree.9 \ Modified: head/share/man/man9/ucred.9 == --- head/share/man/man9/ucred.9 Wed Sep 27 01:03:00 2017(r324042) +++ head/share/man/man9/ucred.9 Wed Sep 27 01:12:47 2017(r324043) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2009 +.Dd September 27, 2017 .Dt UCRED 9 .Os .Sh NAME @@ -34,7 +34,6 @@ .Nm crget , .Nm crhold , .Nm crfree , -.Nm crshared , .Nm crcopy , .Nm crdup , .Nm cru2x , @@ -49,8 +48,6 @@ .Fn crhold "struct ucred *cr" .Ft void .Fn crfree "struct ucred *cr" -.Ft int -.Fn crshared "struct ucred *cr" .Ft void .Fn crcopy "struct ucred *dest" "struct ucred *src" .Ft "struct ucred *" @@ -86,12 +83,6 @@ function decreases the reference count on the credenti If the count drops to 0, the storage for the structure is freed. .Pp The -.Fn crshared -function returns true if the credential is shared. -A credential is considered to be shared if its reference -count is greater than one. -.Pp -The .Fn crcopy function copies the contents of the source (template) credential into the destination template. @@ -170,10 +161,6 @@ and all return a pointer to a .Vt ucred structure. -.Pp -.Fn crshared -returns 0 if the credential has a reference count greater than 1; -otherwise, 1 is returned. .Sh USAGE NOTES As of .Fx 5.0 , ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324042 - in head: . share/man/man5 targets/pseudo/userland usr.sbin usr.sbin/procctl
Author: mjg Date: Wed Sep 27 01:03:00 2017 New Revision: 324042 URL: https://svnweb.freebsd.org/changeset/base/324042 Log: Whack procctl(8) It was supposed to provide a recovery mechanism against bugs in procfs's long deprecated tracing capabilities. Remove the tool as a prerequisite to axing the kernel side. The tracing facility to use is ptrace(2). MFC after:2 weeks Deleted: head/usr.sbin/procctl/ Modified: head/ObsoleteFiles.inc head/share/man/man5/procfs.5 head/targets/pseudo/userland/Makefile.depend head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Sep 27 00:57:05 2017(r324041) +++ head/ObsoleteFiles.inc Wed Sep 27 01:03:00 2017(r324042) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20170927: procctl +OLD_FILES+=usr/share/man/man8/procctl.8.gz +OLD_FILES+=usr/sbin/procctl # 20170926: remove unneeded man aliases and locales directory OLD_FILES+=usr/share/man/en.ISO8859-1/man1 OLD_FILES+=usr/share/man/en.ISO8859-1/man2 Modified: head/share/man/man5/procfs.5 == --- head/share/man/man5/procfs.5Wed Sep 27 00:57:05 2017 (r324041) +++ head/share/man/man5/procfs.5Wed Sep 27 01:03:00 2017 (r324042) @@ -196,7 +196,6 @@ file system on .Xr mount 2 , .Xr sigaction 2 , .Xr unmount 2 , -.Xr procctl 8 , .Xr pseudofs 9 .Sh AUTHORS .An -nosplit Modified: head/targets/pseudo/userland/Makefile.depend == --- head/targets/pseudo/userland/Makefile.dependWed Sep 27 00:57:05 2017(r324041) +++ head/targets/pseudo/userland/Makefile.dependWed Sep 27 01:03:00 2017(r324042) @@ -708,7 +708,6 @@ DIRDEPS+= \ usr.sbin/pppctl \ usr.sbin/praliases \ usr.sbin/praudit \ - usr.sbin/procctl \ usr.sbin/prometheus_sysctl_exporter \ usr.sbin/pstat \ usr.sbin/pw \ Modified: head/usr.sbin/Makefile == --- head/usr.sbin/Makefile Wed Sep 27 00:57:05 2017(r324041) +++ head/usr.sbin/Makefile Wed Sep 27 01:03:00 2017(r324042) @@ -61,7 +61,6 @@ SUBDIR= adduser \ pciconf \ periodic \ powerd \ - procctl \ prometheus_sysctl_exporter \ pstat \ pw \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324041 - in head/sys: kern sys
Author: mjg Date: Wed Sep 27 00:57:05 2017 New Revision: 324041 URL: https://svnweb.freebsd.org/changeset/base/324041 Log: mtx: drop the tid argument from _mtx_lock_sleep tid must be equal to curthread and the target routine was already reading it anyway, which is not a problem. Not passing it as a parameter allows for a little bit shorter code in callers. MFC after:1 week Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c == --- head/sys/kern/kern_mutex.c Tue Sep 26 23:42:44 2017(r324040) +++ head/sys/kern/kern_mutex.c Wed Sep 27 00:57:05 2017(r324041) @@ -248,7 +248,7 @@ __mtx_lock_flags(volatile uintptr_t *c, int opts, cons tid = (uintptr_t)curthread; v = MTX_UNOWNED; if (!_mtx_obtain_lock_fetch(m, , tid)) - _mtx_lock_sleep(m, v, tid, opts, file, line); + _mtx_lock_sleep(m, v, opts, file, line); else LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, 0, 0, file, line); @@ -443,15 +443,17 @@ _mtx_trylock_flags_(volatile uintptr_t *c, int opts, c */ #if LOCK_DEBUG > 0 void -__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts, -const char *file, int line) +__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, int opts, const char *file, +int line) #else void -__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid) +__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #endif { + struct thread *td; struct mtx *m; struct turnstile *ts; + uintptr_t tid; #ifdef ADAPTIVE_MUTEXES volatile struct thread *owner; #endif @@ -473,8 +475,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, u #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) int doing_lockprof; #endif - - if (SCHEDULER_STOPPED()) + td = curthread; + tid = (uintptr_t)td; + if (SCHEDULER_STOPPED_TD(td)) return; #if defined(ADAPTIVE_MUTEXES) @@ -486,7 +489,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, u if (__predict_false(v == MTX_UNOWNED)) v = MTX_READ_VALUE(m); - if (__predict_false(lv_mtx_owner(v) == (struct thread *)tid)) { + if (__predict_false(lv_mtx_owner(v) == td)) { KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0 || (opts & MTX_RECURSE) != 0, ("_mtx_lock_sleep: recursed on non-recursive mutex %s @ %s:%d\n", Modified: head/sys/sys/mutex.h == --- head/sys/sys/mutex.hTue Sep 26 23:42:44 2017(r324040) +++ head/sys/sys/mutex.hWed Sep 27 00:57:05 2017(r324041) @@ -99,12 +99,12 @@ int _mtx_trylock_flags_(volatile uintptr_t *c, int opt int line); void mutex_init(void); #if LOCK_DEBUG > 0 -void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - int opts, const char *file, int line); +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, int opts, + const char *file, int line); void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line); #else -void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid); +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v); void __mtx_unlock_sleep(volatile uintptr_t *c); #endif @@ -147,13 +147,13 @@ void thread_lock_flags_(struct thread *, int, const ch #definemtx_trylock_flags_(m, o, f, l) \ _mtx_trylock_flags_(&(m)->mtx_lock, o, f, l) #if LOCK_DEBUG > 0 -#define_mtx_lock_sleep(m, v, t, o, f, l) \ - __mtx_lock_sleep(&(m)->mtx_lock, v, t, o, f, l) +#define_mtx_lock_sleep(m, v, o, f, l) \ + __mtx_lock_sleep(&(m)->mtx_lock, v, o, f, l) #define_mtx_unlock_sleep(m, o, f, l) \ __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) #else -#define_mtx_lock_sleep(m, v, t, o, f, l) \ - __mtx_lock_sleep(&(m)->mtx_lock, v, t) +#define_mtx_lock_sleep(m, v, o, f, l) \ + __mtx_lock_sleep(&(m)->mtx_lock, v) #define_mtx_unlock_sleep(m, o, f, l) \ __mtx_unlock_sleep(&(m)->mtx_lock) #endif @@ -208,7 +208,7 @@ voidthread_lock_flags_(struct thread *, int, const ch \ if (__predict_false(LOCKSTAT_PROFILE_ENABLED(adaptive__acquire) ||\ !_mtx_obtain_lock_fetch((mp), &_v, _tid))) \ - _mtx_lock_sleep((mp), _v, _tid, (opts), (file),
svn commit: r324040 - in head/sys/fs: nfs nfsclient
Author: rmacklem Date: Tue Sep 26 23:42:44 2017 New Revision: 324040 URL: https://svnweb.freebsd.org/changeset/base/324040 Log: Add major and minor version arguments to nfscl_reqstart(). This patch adds "vers" and "minorvers" arguments to nfscl_reqstart(). The patch always passes them in as "0" and that implies no change in semantics. These arguments will be used by a future commit that adds support for the Flexible File Layout. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfscl.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_var.h == --- head/sys/fs/nfs/nfs_var.h Tue Sep 26 23:24:15 2017(r324039) +++ head/sys/fs/nfs/nfs_var.h Tue Sep 26 23:42:44 2017(r324040) @@ -303,7 +303,7 @@ struct ucred *nfsrv_getgrpscred(struct ucred *); void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, struct mbuf **, char **); void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *, -u_int8_t *, int, u_int32_t **, struct nfsclsession *); +u_int8_t *, int, u_int32_t **, struct nfsclsession *, int, int); nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *, vnode_t, int, u_int32_t); Modified: head/sys/fs/nfs/nfscl.h == --- head/sys/fs/nfs/nfscl.h Tue Sep 26 23:24:15 2017(r324039) +++ head/sys/fs/nfs/nfscl.h Tue Sep 26 23:42:44 2017(r324040) @@ -49,7 +49,8 @@ struct nfsv4node { */ #defineNFSCL_REQSTART(n, p, v) \ nfscl_reqstart((n), (p), VFSTONFS((v)->v_mount),\ - VTONFS(v)->n_fhp->nfh_fh, VTONFS(v)->n_fhp->nfh_len, NULL, NULL) + VTONFS(v)->n_fhp->nfh_fh, VTONFS(v)->n_fhp->nfh_len, NULL, \ + NULL, 0, 0) /* * These two macros convert between a lease duration and renew interval. Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c == --- head/sys/fs/nfsclient/nfs_clcomsubs.c Tue Sep 26 23:24:15 2017 (r324039) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Tue Sep 26 23:42:44 2017 (r324040) @@ -131,7 +131,8 @@ static int nfs_bigrequest[NFSV41_NPROCS] = { */ APPLESTATIC void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, -u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep) +u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, +int vers, int minorvers) { struct mbuf *mb; u_int32_t *tl; @@ -142,14 +143,22 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, * First, fill in some of the fields of nd. */ nd->nd_slotseq = NULL; - if (NFSHASNFSV4(nmp)) { + if (vers == NFS_VER4) { nd->nd_flag = ND_NFSV4 | ND_NFSCL; - if (NFSHASNFSV4N(nmp)) + if (minorvers == NFSV41_MINORVERSION) nd->nd_flag |= ND_NFSV41; - } else if (NFSHASNFSV3(nmp)) + } else if (vers == NFS_VER3) nd->nd_flag = ND_NFSV3 | ND_NFSCL; - else - nd->nd_flag = ND_NFSV2 | ND_NFSCL; + else { + if (NFSHASNFSV4(nmp)) { + nd->nd_flag = ND_NFSV4 | ND_NFSCL; + if (NFSHASNFSV4N(nmp)) + nd->nd_flag |= ND_NFSV41; + } else if (NFSHASNFSV3(nmp)) + nd->nd_flag = ND_NFSV3 | ND_NFSCL; + else + nd->nd_flag = ND_NFSV2 | ND_NFSCL; + } nd->nd_procnum = procnum; nd->nd_repstat = 0; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c == --- head/sys/fs/nfsclient/nfs_clrpcops.cTue Sep 26 23:24:15 2017 (r324039) +++ head/sys/fs/nfsclient/nfs_clrpcops.cTue Sep 26 23:42:44 2017 (r324040) @@ -429,7 +429,7 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int dp = *dpp; *dpp = NULL; - nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL); + nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); @@ -785,7 +785,7 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsm int error; nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, - op->nfso_fhlen, NULL, NULL); + op->nfso_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED +
svn commit: r324039 - head/sys/ufs/ffs
Author: jhb Date: Tue Sep 26 23:24:15 2017 New Revision: 324039 URL: https://svnweb.freebsd.org/changeset/base/324039 Log: Don't defer wakeup()s for completed journal workitems. Normally wakeups() are performed for completed softupdates work items in workitem_free() before the underlying memory is free()'d. complete_jseg() was clearing the "wakeup needed" flag in work items to defer the wakeup until the end of each loop iteration. However, this resulted in the item being free'd before it's address was used with wakeup(). As a result, another part of the kernel could allocate this memory from malloc() and use it as a wait channel for a different "event" with a different lock. This triggered an assertion failure when the lock passed to sleepq_add() did not match the existing lock associated with the sleep queue. Fix this by removing the code to defer the wakeup in complete_jseg() allowing the wakeup to occur slightly earlier in workitem_free() before free() is called. The main reason I can think of for deferring a wakeup() would be to avoid waking up a waiter while holding a lock that the waiter would need. However, no locks are dropped in between the wakeup() in workitem_free() and the end of the loop in complete_jseg() as far as I can tell. In general I think it is not safe to do a wakeup() after free() as one cannot control how other parts of the kernel that might reuse the address for a different wait channel will handle spurious wakeups. Reported by: pho Reviewed by: kib MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D12494 Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 26 23:23:58 2017 (r324038) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 26 23:24:15 2017 (r324039) @@ -3596,15 +3596,13 @@ complete_jseg(jseg) { struct worklist *wk; struct jmvref *jmvref; - int waiting; #ifdef INVARIANTS int i = 0; #endif while ((wk = LIST_FIRST(>js_entries)) != NULL) { WORKLIST_REMOVE(wk); - waiting = wk->wk_state & IOWAITING; - wk->wk_state &= ~(INPROGRESS | IOWAITING); + wk->wk_state &= ~INPROGRESS; wk->wk_state |= COMPLETE; KASSERT(i++ < jseg->js_cnt, ("handle_written_jseg: overflow %d >= %d", @@ -3645,8 +3643,6 @@ complete_jseg(jseg) TYPENAME(wk->wk_type)); /* NOTREACHED */ } - if (waiting) - wakeup(wk); } /* Release the self reference so the structure may be freed. */ rele_jseg(jseg); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324038 - in head/sys: dev/bnxt dev/drm dev/drm2/i915 dev/drm2/radeon dev/e1000 net
Author: cem Date: Tue Sep 26 23:23:58 2017 New Revision: 324038 URL: https://svnweb.freebsd.org/changeset/base/324038 Log: Add PNP metadata to more drivers GPUs: radeonkms, i915kms NICs: if_em, if_igb, if_bnxt This metadata isn't used yet, but it will be handy to have later to implement automatic module loading. Reviewed by: imp, mmacy Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D12488 Modified: head/sys/dev/bnxt/if_bnxt.c head/sys/dev/drm/drmP.h head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/e1000/if_em.c head/sys/net/iflib.h Modified: head/sys/dev/bnxt/if_bnxt.c == --- head/sys/dev/bnxt/if_bnxt.c Tue Sep 26 23:12:32 2017(r324037) +++ head/sys/dev/bnxt/if_bnxt.c Tue Sep 26 23:23:58 2017(r324038) @@ -243,6 +243,8 @@ MODULE_DEPEND(bnxt, pci, 1, 1, 1); MODULE_DEPEND(bnxt, ether, 1, 1, 1); MODULE_DEPEND(bnxt, iflib, 1, 1, 1); +IFLIB_PNP_INFO(pci, bnxt, bnxt_vendor_info_array); + static device_method_t bnxt_iflib_methods[] = { DEVMETHOD(ifdi_tx_queues_alloc, bnxt_tx_queues_alloc), DEVMETHOD(ifdi_rx_queues_alloc, bnxt_rx_queues_alloc), Modified: head/sys/dev/drm/drmP.h == --- head/sys/dev/drm/drmP.h Tue Sep 26 23:12:32 2017(r324037) +++ head/sys/dev/drm/drmP.h Tue Sep 26 23:23:58 2017(r324038) @@ -321,7 +321,7 @@ typedef struct drm_pci_id_list { int vendor; int device; - long driver_private; + intptr_t driver_private; char *name; } drm_pci_id_list_t; Modified: head/sys/dev/drm2/i915/i915_drv.c == --- head/sys/dev/drm2/i915/i915_drv.c Tue Sep 26 23:12:32 2017 (r324037) +++ head/sys/dev/drm2/i915/i915_drv.c Tue Sep 26 23:23:58 2017 (r324038) @@ -1236,6 +1236,8 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1); MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); MODULE_DEPEND(i915kms, iic, 1, 1, 1); MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); +MODULE_PNP_INFO("U32:vendor;U32:device;P;D:human", vgapci, i915, pciidlist, +sizeof(pciidlist[0]), nitems(pciidlist)); /* We give fast paths for the really cool registers */ #define NEEDS_FORCE_WAKE(dev_priv, reg) \ Modified: head/sys/dev/drm2/radeon/radeon_drv.c == --- head/sys/dev/drm2/radeon/radeon_drv.c Tue Sep 26 23:12:32 2017 (r324037) +++ head/sys/dev/drm2/radeon/radeon_drv.c Tue Sep 26 23:23:58 2017 (r324038) @@ -401,3 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1); MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); +MODULE_PNP_INFO("U32:vendor;U32:device;P;D:human", vgapci, radeonkms, +pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Tue Sep 26 23:12:32 2017(r324037) +++ head/sys/dev/e1000/if_em.c Tue Sep 26 23:23:58 2017(r324038) @@ -339,6 +339,8 @@ MODULE_DEPEND(em, pci, 1, 1, 1); MODULE_DEPEND(em, ether, 1, 1, 1); MODULE_DEPEND(em, iflib, 1, 1, 1); +IFLIB_PNP_INFO(pci, em, em_vendor_info_array); + static driver_t igb_driver = { "igb", igb_methods, sizeof(struct adapter), }; @@ -350,6 +352,7 @@ MODULE_DEPEND(igb, pci, 1, 1, 1); MODULE_DEPEND(igb, ether, 1, 1, 1); MODULE_DEPEND(igb, iflib, 1, 1, 1); +IFLIB_PNP_INFO(pci, igb, igb_vendor_info_array); static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_attach_pre, em_if_attach_pre), Modified: head/sys/net/iflib.h == --- head/sys/net/iflib.hTue Sep 26 23:12:32 2017(r324037) +++ head/sys/net/iflib.hTue Sep 26 23:23:58 2017(r324038) @@ -173,6 +173,11 @@ typedef struct pci_vendor_info { #define PVID_OEM(vendor, devid, svid, sdevid, revid, name) {vendor, devid, svid, sdevid, revid, 0, name} #define PVID_END {0, 0, 0, 0, 0, 0, NULL} +#define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \ +"U32:revision;U32:class;D:human" +#define IFLIB_PNP_INFO(b, u, t) \ +MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t)) + typedef struct if_txrx { int (*ift_txd_encap) (void *, if_pkt_info_t); void (*ift_txd_flush) (void *, uint16_t, qidx_t pidx); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324037 - in head: share/man/man4 sys/conf sys/crypto/aesni sys/modules/aesni tests/sys/opencrypto
Author: cem Date: Tue Sep 26 23:12:32 2017 New Revision: 324037 URL: https://svnweb.freebsd.org/changeset/base/324037 Log: aesni(4): Add support for x86 SHA intrinsics Some x86 class CPUs have accelerated intrinsics for SHA1 and SHA256. Provide this functionality on CPUs that support it. This implements CRYPTO_SHA1, CRYPTO_SHA1_HMAC, and CRYPTO_SHA2_256_HMAC. Correctness: The cryptotest.py suite in tests/sys/opencrypto has been enhanced to verify SHA1 and SHA256 HMAC using standard NIST test vectors. The test passes on this driver. Additionally, jhb's cryptocheck tool has been used to compare various random inputs against OpenSSL. This test also passes. Rough performance averages on AMD Ryzen 1950X (4kB buffer): aesni: SHA1: ~8300 Mb/sSHA256: ~8000 Mb/s cryptosoft: ~1800 Mb/sSHA256: ~1800 Mb/s So ~4.4-4.6x speedup depending on algorithm choice. This is consistent with the results the Linux folks saw for 4kB buffers. The driver borrows SHA update code from sys/crypto sha1 and sha256. The intrinsic step function comes from Intel under a 3-clause BSDL.[0] The intel_sha_extensions_sha_intrinsic.c files were renamed and lightly modified (added const, resolved a warning or two; included the sha_sse header to declare the functions). [0]: https://software.intel.com/en-us/articles/intel-sha-extensions-implementations Reviewed by: jhb Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D12452 Added: head/sys/crypto/aesni/intel_sha1.c (contents, props changed) head/sys/crypto/aesni/intel_sha256.c (contents, props changed) head/sys/crypto/aesni/sha_sse.h (contents, props changed) Modified: head/share/man/man4/aesni.4 head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/crypto/aesni/aesni.c head/sys/crypto/aesni/aesni.h head/sys/modules/aesni/Makefile head/tests/sys/opencrypto/cryptotest.py Modified: head/share/man/man4/aesni.4 == --- head/share/man/man4/aesni.4 Tue Sep 26 22:32:08 2017(r324036) +++ head/share/man/man4/aesni.4 Tue Sep 26 23:12:32 2017(r324037) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd September 26, 2017 .Dt AESNI 4 .Os .Sh NAME .Nm aesni -.Nd "driver for the AES accelerator on Intel CPUs" +.Nd "driver for the AES and SHA accelerator on x86 CPUs" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -47,8 +47,8 @@ module at boot time, place the following line in aesni_load="YES" .Ed .Sh DESCRIPTION -Starting with some models of Core i5/i7, Intel processors implement -a new set of instructions called AESNI. +Starting with Intel Westmere and AMD Bulldozer, some x86 processors implement a +new set of instructions called AESNI. The set of six instructions accelerates the calculation of the key schedule for key lengths of 128, 192, and 256 of the Advanced Encryption Standard (AES) symmetric cipher, and provides a hardware @@ -56,13 +56,24 @@ implementation of the regular and the last encryption rounds. .Pp The processor capability is reported as AESNI in the Features2 line at boot. +.Pp +Starting with the Intel Goldmont and AMD Ryzen microarchitectures, some x86 +processors implement a new set of SHA instructions. +The set of seven instructions accelerates the calculation of SHA1 and SHA256 +hashes. +.Pp +The processor capability is reported as SHA in the Structured Extended Features +line at boot. +.Pp The .Nm -driver does not attach on systems that lack the required CPU capability. +driver does not attach on systems that lack both CPU capabilities. +On systems that support only one of AESNI or SHA extensions, the driver will +attach and support that one function. .Pp The .Nm -driver registers itself to accelerate AES operations for +driver registers itself to accelerate AES and SHA operations for .Xr crypto 4 . Besides speed, the advantage of using the .Nm @@ -83,13 +94,18 @@ The .Nm driver first appeared in .Fx 9.0 . +SHA support was added in +.Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by -.An Konstantin Belousov Aq Mt k...@freebsd.org . +.An Konstantin Belousov Aq Mt k...@freebsd.org +and +.An Conrad Meyer Aq Mt c...@freebsd.org . The key schedule calculation code was adopted from the sample provided by Intel and used in the analogous .Ox driver. +The hash step intrinsics implementations were supplied by Intel. Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Tue Sep 26 22:32:08 2017(r324036) +++ head/sys/conf/files.amd64 Tue Sep 26 23:12:32 2017(r324037) @@ -182,6 +182,16 @@ aesni_wrap.o optional aesni \ crypto/blowfish/bf_enc.c optionalcrypto |
svn commit: r324036 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 22:32:08 2017 New Revision: 324036 URL: https://svnweb.freebsd.org/changeset/base/324036 Log: MFC r323824 1. ql_hw.c: In ql_hw_send() return EINVAL when TSO framelength exceeds max supported length by HW.(davidcs) 2. ql_os.c: In qla_send() call bus_dmamap_unload before freeing mbuf or recreating dmmamap.(davidcs) In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing mbuf. Submitted by: david.ba...@netapp.com Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 22:29:43 2017 (r324035) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 22:32:08 2017 (r324036) @@ -2324,7 +2324,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in if (total_length > QLA_MAX_TSO_FRAME_SIZE) { device_printf(dev, "%s: total length exceeds maxlen(%d)\n", __func__, total_length); - return (-1); + return (EINVAL); } eh = mtod(mp, struct ether_vlan_header *); Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:29:43 2017 (r324035) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:32:08 2017 (r324036) @@ -1308,6 +1308,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 ha->tx_ring[txr_idx].iscsi_pkt_count++; ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head = m_head; } else { + bus_dmamap_unload(ha->tx_tag, map); if (ret == EINVAL) { if (m_head) m_freem(m_head); @@ -1393,7 +1394,8 @@ qla_fp_taskqueue(void *context, int pending) goto qla_fp_taskqueue_exit; } - while (rx_pkts_left && !ha->stop_rcv) { + while (rx_pkts_left && !ha->stop_rcv && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1436,6 +1438,11 @@ qla_fp_taskqueue(void *context, int pending) drbr_advance(ifp, fp->tx_br); } + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, mp); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; + mp = drbr_peek(ifp, fp->tx_br); } } @@ -1698,16 +1705,24 @@ qla_clear_tx_buf(qla_host_t *ha, qla_tx_buf_t *txb) { QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - if (txb->m_head && txb->map) { + if (txb->m_head) { + bus_dmamap_sync(ha->tx_tag, txb->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ha->tx_tag, txb->map); m_freem(txb->m_head); txb->m_head = NULL; + + bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; } - if (txb->map) + if (txb->map) { + bus_dmamap_unload(ha->tx_tag, txb->map); bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; + } QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324035 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 22:29:43 2017 New Revision: 324035 URL: https://svnweb.freebsd.org/changeset/base/324035 Log: MFC r323782 Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval Modified: stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hTue Sep 26 22:28:00 2017 (r324034) +++ stable/9/sys/dev/qlxgbe/ql_def.hTue Sep 26 22:29:43 2017 (r324035) @@ -239,6 +239,7 @@ struct qla_host { volatile const char *qla_lock; volatile const char *qla_unlock; uint32_tdbg_level; + uint32_tenable_minidump; uint8_t fw_ver_str[32]; Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:28:00 2017 (r324034) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:29:43 2017 (r324035) @@ -185,6 +185,13 @@ qla_add_sysctls(qla_host_t *ha) OID_AUTO, "debug", CTLFLAG_RW, >dbg_level, ha->dbg_level, "Debug Level"); + ha->enable_minidump = 1; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "enable_minidump", CTLFLAG_RW, + >enable_minidump, ha->enable_minidump, + "Minidump retrival is enabled only when this is set"); + ha->std_replenish = QL_STD_REPLENISH_THRES; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2046,7 +2053,8 @@ device_printf(ha->pci_dev, "%s: enter\n", __func__); ha->msg_from_peer = 0; - ql_minidump(ha); + if (ha->enable_minidump) + ql_minidump(ha); (void) ql_init_hw(ha); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324034 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 22:28:00 2017 New Revision: 324034 URL: https://svnweb.freebsd.org/changeset/base/324034 Log: MFC r323781 Update minidump template for version 5.4.66 Modified: stable/9/sys/dev/qlxgbe/ql_minidump.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_minidump.c == --- stable/9/sys/dev/qlxgbe/ql_minidump.c Tue Sep 26 21:54:19 2017 (r324033) +++ stable/9/sys/dev/qlxgbe/ql_minidump.c Tue Sep 26 22:28:00 2017 (r324034) @@ -41,7 +41,7 @@ unsigned int ql83xx_minidump_version_sub = 66; unsigned char ql83xx_minidump[] = { 0x63, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x05, 0x00, 0x00, 0x04, 0x00, 0x02, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x1d, 0x95, 0x7b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x36, 0x87, 0x40, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -49,7 +49,7 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0xdc, 0xfb, 0x07, 0x00, - 0x00, 0x8a, 0x2b, 0x00, 0x80, 0x73, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8a, 0x2b, 0x00, 0x40, 0x6f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x4a, 0x3b, 0x00, 0x00, 0x10, 0x03, 0x08, 0x00, 0x08, 0x31, 0x77, 0x04, 0x08, 0x31, 0x77, 0x08, 0x08, 0x31, 0x77, 0x0c, 0x08, 0x31, 0x77, 0x10, 0x08, 0x31, 0x77, 0x1c, 0x08, 0x31, 0x77, @@ -61,8 +61,8 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, - 0xe0, 0x91, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0x00, 0x93, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x30, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, @@ -2935,10 +2935,26 @@ unsigned char ql83xx_minidump[] = { 0x08, 0xd6, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x18, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0x01, 0x06, 0x00, 0x00, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x06, 0x00, 0x80, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x17, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x14, 0x06, 0xe0, 0x17, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x55, 0x06, 0xe0, 0x1f, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x04, 0xc8, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x04, 0xca, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2946,7 +2962,7 @@ unsigned char ql83xx_minidump[] = { 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x14, 0x00, 0x04, 0xc9, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06,
svn commit: r324033 - head/tools/tools/nanobsd
Author: glebius Date: Tue Sep 26 21:54:19 2017 New Revision: 324033 URL: https://svnweb.freebsd.org/changeset/base/324033 Log: Fix regression from r323855. The EXIT trap now isn't cleared, so upon exit it tried to unmount already unmounted partition, resulting in failure. Modified: head/tools/tools/nanobsd/legacy.sh Modified: head/tools/tools/nanobsd/legacy.sh == --- head/tools/tools/nanobsd/legacy.sh Tue Sep 26 21:18:43 2017 (r324032) +++ head/tools/tools/nanobsd/legacy.sh Tue Sep 26 21:54:19 2017 (r324033) @@ -197,7 +197,7 @@ create_diskimage ( ) ( fi mdconfig -d -u $MD - trap - 1 2 15 + trap - 1 2 15 EXIT ) > ${NANO_LOG}/_.di 2>&1 ) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324032 - stable/10/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 21:18:43 2017 New Revision: 324032 URL: https://svnweb.freebsd.org/changeset/base/324032 Log: MFC r323824 1. ql_hw.c: In ql_hw_send() return EINVAL when TSO framelength exceeds max supported length by HW.(davidcs) 2. ql_os.c: In qla_send() call bus_dmamap_unload before freeing mbuf or recreating dmmamap.(davidcs) In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing mbuf. Submitted by: david.ba...@netapp.com Modified: stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_hw.c == --- stable/10/sys/dev/qlxgbe/ql_hw.cTue Sep 26 21:16:10 2017 (r324031) +++ stable/10/sys/dev/qlxgbe/ql_hw.cTue Sep 26 21:18:43 2017 (r324032) @@ -2324,7 +2324,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in if (total_length > QLA_MAX_TSO_FRAME_SIZE) { device_printf(dev, "%s: total length exceeds maxlen(%d)\n", __func__, total_length); - return (-1); + return (EINVAL); } eh = mtod(mp, struct ether_vlan_header *); Modified: stable/10/sys/dev/qlxgbe/ql_os.c == --- stable/10/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:16:10 2017 (r324031) +++ stable/10/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:18:43 2017 (r324032) @@ -1292,6 +1292,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 ha->tx_ring[txr_idx].iscsi_pkt_count++; ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head = m_head; } else { + bus_dmamap_unload(ha->tx_tag, map); if (ret == EINVAL) { if (m_head) m_freem(m_head); @@ -1377,7 +1378,8 @@ qla_fp_taskqueue(void *context, int pending) goto qla_fp_taskqueue_exit; } - while (rx_pkts_left && !ha->stop_rcv) { + while (rx_pkts_left && !ha->stop_rcv && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1420,6 +1422,11 @@ qla_fp_taskqueue(void *context, int pending) drbr_advance(ifp, fp->tx_br); } + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, mp); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; + mp = drbr_peek(ifp, fp->tx_br); } } @@ -1682,16 +1689,24 @@ qla_clear_tx_buf(qla_host_t *ha, qla_tx_buf_t *txb) { QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - if (txb->m_head && txb->map) { + if (txb->m_head) { + bus_dmamap_sync(ha->tx_tag, txb->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ha->tx_tag, txb->map); m_freem(txb->m_head); txb->m_head = NULL; + + bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; } - if (txb->map) + if (txb->map) { + bus_dmamap_unload(ha->tx_tag, txb->map); bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; + } QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324031 - stable/10/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 21:16:10 2017 New Revision: 324031 URL: https://svnweb.freebsd.org/changeset/base/324031 Log: MFC r323782 Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval Modified: stable/10/sys/dev/qlxgbe/ql_def.h stable/10/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_def.h == --- stable/10/sys/dev/qlxgbe/ql_def.h Tue Sep 26 21:13:58 2017 (r324030) +++ stable/10/sys/dev/qlxgbe/ql_def.h Tue Sep 26 21:16:10 2017 (r324031) @@ -239,6 +239,7 @@ struct qla_host { volatile const char *qla_lock; volatile const char *qla_unlock; uint32_tdbg_level; + uint32_tenable_minidump; uint8_t fw_ver_str[32]; Modified: stable/10/sys/dev/qlxgbe/ql_os.c == --- stable/10/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:13:58 2017 (r324030) +++ stable/10/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:16:10 2017 (r324031) @@ -185,6 +185,13 @@ qla_add_sysctls(qla_host_t *ha) OID_AUTO, "debug", CTLFLAG_RW, >dbg_level, ha->dbg_level, "Debug Level"); + ha->enable_minidump = 1; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "enable_minidump", CTLFLAG_RW, + >enable_minidump, ha->enable_minidump, + "Minidump retrival is enabled only when this is set"); + ha->std_replenish = QL_STD_REPLENISH_THRES; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2030,7 +2037,8 @@ device_printf(ha->pci_dev, "%s: enter\n", __func__); ha->msg_from_peer = 0; - ql_minidump(ha); + if (ha->enable_minidump) + ql_minidump(ha); (void) ql_init_hw(ha); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324030 - stable/10/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 21:13:58 2017 New Revision: 324030 URL: https://svnweb.freebsd.org/changeset/base/324030 Log: MFC r323781 Update minidump template for version 5.4.66 Modified: stable/10/sys/dev/qlxgbe/ql_minidump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_minidump.c == --- stable/10/sys/dev/qlxgbe/ql_minidump.c Tue Sep 26 21:09:21 2017 (r324029) +++ stable/10/sys/dev/qlxgbe/ql_minidump.c Tue Sep 26 21:13:58 2017 (r324030) @@ -41,7 +41,7 @@ unsigned int ql83xx_minidump_version_sub = 66; unsigned char ql83xx_minidump[] = { 0x63, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x05, 0x00, 0x00, 0x04, 0x00, 0x02, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x1d, 0x95, 0x7b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x36, 0x87, 0x40, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -49,7 +49,7 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0xdc, 0xfb, 0x07, 0x00, - 0x00, 0x8a, 0x2b, 0x00, 0x80, 0x73, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8a, 0x2b, 0x00, 0x40, 0x6f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x4a, 0x3b, 0x00, 0x00, 0x10, 0x03, 0x08, 0x00, 0x08, 0x31, 0x77, 0x04, 0x08, 0x31, 0x77, 0x08, 0x08, 0x31, 0x77, 0x0c, 0x08, 0x31, 0x77, 0x10, 0x08, 0x31, 0x77, 0x1c, 0x08, 0x31, 0x77, @@ -61,8 +61,8 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, - 0xe0, 0x91, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0x00, 0x93, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x30, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, @@ -2935,10 +2935,26 @@ unsigned char ql83xx_minidump[] = { 0x08, 0xd6, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x18, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0x01, 0x06, 0x00, 0x00, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x06, 0x00, 0x80, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x17, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x14, 0x06, 0xe0, 0x17, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x55, 0x06, 0xe0, 0x1f, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x04, 0xc8, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x04, 0xca, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2946,7 +2962,7 @@ unsigned char ql83xx_minidump[] = { 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x14, 0x00, 0x04, 0xc9, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00,
svn commit: r324029 - stable/11/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 21:09:21 2017 New Revision: 324029 URL: https://svnweb.freebsd.org/changeset/base/324029 Log: MFC r323824 1. ql_hw.c: In ql_hw_send() return EINVAL when TSO framelength exceeds max supported length by HW.(davidcs) 2. ql_os.c: In qla_send() call bus_dmamap_unload before freeing mbuf or recreating dmmamap.(davidcs) In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing mbuf. Submitted by: david.ba...@netapp.com Modified: stable/11/sys/dev/qlxgbe/ql_hw.c stable/11/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_hw.c == --- stable/11/sys/dev/qlxgbe/ql_hw.cTue Sep 26 21:05:40 2017 (r324028) +++ stable/11/sys/dev/qlxgbe/ql_hw.cTue Sep 26 21:09:21 2017 (r324029) @@ -2324,7 +2324,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in if (total_length > QLA_MAX_TSO_FRAME_SIZE) { device_printf(dev, "%s: total length exceeds maxlen(%d)\n", __func__, total_length); - return (-1); + return (EINVAL); } eh = mtod(mp, struct ether_vlan_header *); Modified: stable/11/sys/dev/qlxgbe/ql_os.c == --- stable/11/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:05:40 2017 (r324028) +++ stable/11/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:09:21 2017 (r324029) @@ -1287,6 +1287,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 ha->tx_ring[txr_idx].iscsi_pkt_count++; ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head = m_head; } else { + bus_dmamap_unload(ha->tx_tag, map); if (ret == EINVAL) { if (m_head) m_freem(m_head); @@ -1372,7 +1373,8 @@ qla_fp_taskqueue(void *context, int pending) goto qla_fp_taskqueue_exit; } - while (rx_pkts_left && !ha->stop_rcv) { + while (rx_pkts_left && !ha->stop_rcv && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1415,6 +1417,11 @@ qla_fp_taskqueue(void *context, int pending) drbr_advance(ifp, fp->tx_br); } + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, mp); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; + mp = drbr_peek(ifp, fp->tx_br); } } @@ -1677,16 +1684,24 @@ qla_clear_tx_buf(qla_host_t *ha, qla_tx_buf_t *txb) { QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - if (txb->m_head && txb->map) { + if (txb->m_head) { + bus_dmamap_sync(ha->tx_tag, txb->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ha->tx_tag, txb->map); m_freem(txb->m_head); txb->m_head = NULL; + + bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; } - if (txb->map) + if (txb->map) { + bus_dmamap_unload(ha->tx_tag, txb->map); bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; + } QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324028 - stable/11/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 21:05:40 2017 New Revision: 324028 URL: https://svnweb.freebsd.org/changeset/base/324028 Log: MFC r323781 Update minidump template for version 5.4.66 Modified: stable/11/sys/dev/qlxgbe/ql_minidump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_minidump.c == --- stable/11/sys/dev/qlxgbe/ql_minidump.c Tue Sep 26 21:02:19 2017 (r324027) +++ stable/11/sys/dev/qlxgbe/ql_minidump.c Tue Sep 26 21:05:40 2017 (r324028) @@ -41,7 +41,7 @@ unsigned int ql83xx_minidump_version_sub = 66; unsigned char ql83xx_minidump[] = { 0x63, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x05, 0x00, 0x00, 0x04, 0x00, 0x02, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x1d, 0x95, 0x7b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x36, 0x87, 0x40, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -49,7 +49,7 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0xdc, 0xfb, 0x07, 0x00, - 0x00, 0x8a, 0x2b, 0x00, 0x80, 0x73, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8a, 0x2b, 0x00, 0x40, 0x6f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x4a, 0x3b, 0x00, 0x00, 0x10, 0x03, 0x08, 0x00, 0x08, 0x31, 0x77, 0x04, 0x08, 0x31, 0x77, 0x08, 0x08, 0x31, 0x77, 0x0c, 0x08, 0x31, 0x77, 0x10, 0x08, 0x31, 0x77, 0x1c, 0x08, 0x31, 0x77, @@ -61,8 +61,8 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, - 0xe0, 0x91, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0x00, 0x93, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x30, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, @@ -2935,10 +2935,26 @@ unsigned char ql83xx_minidump[] = { 0x08, 0xd6, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x18, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0x01, 0x06, 0x00, 0x00, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x06, 0x00, 0x80, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x17, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x14, 0x06, 0xe0, 0x17, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x55, 0x06, 0xe0, 0x1f, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x04, 0xc8, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x04, 0xca, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2946,7 +2962,7 @@ unsigned char ql83xx_minidump[] = { 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x14, 0x00, 0x04, 0xc9, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00,
svn commit: r324027 - stable/11/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 21:02:19 2017 New Revision: 324027 URL: https://svnweb.freebsd.org/changeset/base/324027 Log: MFC r323782 Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval Modified: stable/11/sys/dev/qlxgbe/ql_def.h stable/11/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_def.h == --- stable/11/sys/dev/qlxgbe/ql_def.h Tue Sep 26 20:53:25 2017 (r324026) +++ stable/11/sys/dev/qlxgbe/ql_def.h Tue Sep 26 21:02:19 2017 (r324027) @@ -239,6 +239,7 @@ struct qla_host { volatile const char *qla_lock; volatile const char *qla_unlock; uint32_tdbg_level; + uint32_tenable_minidump; uint8_t fw_ver_str[32]; Modified: stable/11/sys/dev/qlxgbe/ql_os.c == --- stable/11/sys/dev/qlxgbe/ql_os.cTue Sep 26 20:53:25 2017 (r324026) +++ stable/11/sys/dev/qlxgbe/ql_os.cTue Sep 26 21:02:19 2017 (r324027) @@ -185,6 +185,13 @@ qla_add_sysctls(qla_host_t *ha) OID_AUTO, "debug", CTLFLAG_RW, >dbg_level, ha->dbg_level, "Debug Level"); + ha->enable_minidump = 1; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "enable_minidump", CTLFLAG_RW, + >enable_minidump, ha->enable_minidump, + "Minidump retrival is enabled only when this is set"); + ha->std_replenish = QL_STD_REPLENISH_THRES; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2025,7 +2032,8 @@ device_printf(ha->pci_dev, "%s: enter\n", __func__); ha->msg_from_peer = 0; - ql_minidump(ha); + if (ha->enable_minidump) + ql_minidump(ha); (void) ql_init_hw(ha); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324026 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 20:53:25 2017 New Revision: 324026 URL: https://svnweb.freebsd.org/changeset/base/324026 Log: Fix delete all multicast addresses Submitted by:anand.kh...@cavium.com MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_glbl.h == --- head/sys/dev/qlxgbe/ql_glbl.h Tue Sep 26 20:26:48 2017 (r324025) +++ head/sys/dev/qlxgbe/ql_glbl.h Tue Sep 26 20:53:25 2017 (r324026) @@ -75,6 +75,7 @@ extern int ql_hw_check_health(qla_host_t *ha); extern void qla_hw_async_event(qla_host_t *ha); extern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb, uint32_t *num_rcvq); +extern int qla_hw_del_all_mcast(qla_host_t *ha); extern int ql_iscsi_pdu(qla_host_t *ha, struct mbuf *mp); extern void ql_minidump(qla_host_t *ha); Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 20:26:48 2017(r324025) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 20:53:25 2017(r324026) @@ -64,7 +64,6 @@ static int qla_link_event_req(qla_host_t *ha, uint16_t static int qla_tx_tso(qla_host_t *ha, struct mbuf *mp, q80_tx_cmd_t *tx_cmd, uint8_t *hdr); static int qla_hw_add_all_mcast(qla_host_t *ha); -static int qla_hw_del_all_mcast(qla_host_t *ha); static int qla_add_rcv_rings(qla_host_t *ha, uint32_t sds_idx, uint32_t nsds); static int qla_init_nic_func(qla_host_t *ha); @@ -3413,7 +3412,7 @@ qla_hw_add_all_mcast(qla_host_t *ha) return (ret); } -static int +int qla_hw_del_all_mcast(qla_host_t *ha) { int ret; Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue Sep 26 20:26:48 2017(r324025) +++ head/sys/dev/qlxgbe/ql_os.c Tue Sep 26 20:53:25 2017(r324026) @@ -975,7 +975,19 @@ qla_set_multi(qla_host_t *ha, uint32_t add_multi) return (-1); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + + if (!add_multi) { + ret = qla_hw_del_all_mcast(ha); + + if (ret) + device_printf(ha->pci_dev, + "%s: qla_hw_del_all_mcast() failed\n", + __func__); + } + + if (!ret) + ret = ql_hw_set_multi(ha, mta, mcnt, 1); + } QLA_UNLOCK(ha, __func__); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324024 - head/sys/arm/allwinner
Author: manu Date: Tue Sep 26 20:23:09 2017 New Revision: 324024 URL: https://svnweb.freebsd.org/changeset/base/324024 Log: a10_gpio: Enable all needed clocks Do not enable only the first clock, enable them all. Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c == --- head/sys/arm/allwinner/a10_gpio.c Tue Sep 26 19:56:36 2017 (r324023) +++ head/sys/arm/allwinner/a10_gpio.c Tue Sep 26 20:23:09 2017 (r324024) @@ -165,6 +165,11 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0} }; +struct clk_list { + TAILQ_ENTRY(clk_list) next; + clk_t clk; +}; + struct a10_gpio_softc { device_tsc_dev; device_tsc_busdev; @@ -175,6 +180,7 @@ struct a10_gpio_softc { bus_space_handle_t sc_bsh; void * sc_intrhand; const struct allwinner_padconf *padconf; + TAILQ_HEAD(, clk_list) clk_list; }; #defineA10_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) @@ -766,8 +772,10 @@ a10_gpio_attach(device_t dev) int rid, error; phandle_t gpio; struct a10_gpio_softc *sc; + struct clk_list *clkp, *clkp_tmp; clk_t clk; - hwreset_t rst; + hwreset_t rst = NULL; + int off, err; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -811,12 +819,17 @@ a10_gpio_attach(device_t dev) } } - if (clk_get_by_ofw_index(dev, 0, 0, ) == 0) { - error = clk_enable(clk); - if (error != 0) { - device_printf(dev, "could not enable clock\n"); - return (error); + TAILQ_INIT(>clk_list); + for (off = 0; clk_get_by_ofw_index(dev, 0, off, ) == 0; off++) { + err = clk_enable(clk); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(clk)); + goto fail; } + clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp->clk = clk; + TAILQ_INSERT_TAIL(>clk_list, clkp, next); } sc->sc_busdev = gpiobus_attach_bus(dev); @@ -839,6 +852,26 @@ fail: if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); mtx_destroy(>sc_mtx); + + /* Disable clock */ + TAILQ_FOREACH_SAFE(clkp, >clk_list, next, clkp_tmp) { + err = clk_disable(clkp->clk); + if (err != 0) + device_printf(dev, "Could not disable clock %s\n", + clk_get_name(clkp->clk)); + err = clk_release(clkp->clk); + if (err != 0) + device_printf(dev, "Could not release clock %s\n", + clk_get_name(clkp->clk)); + TAILQ_REMOVE(>clk_list, clkp, next); + free(clkp, M_DEVBUF); + } + + /* Assert resets */ + if (rst) { + hwreset_assert(rst); + hwreset_release(rst); + } return (ENXIO); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324022 - head/sys/arm/allwinner
Author: manu Date: Tue Sep 26 19:21:43 2017 New Revision: 324022 URL: https://svnweb.freebsd.org/changeset/base/324022 Log: a10_ehci: Enable all clocks and reset a10_ehci can have multiple clocks and reset, enable them all instead of only the first one. Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c == --- head/sys/arm/allwinner/a10_ehci.c Tue Sep 26 19:20:50 2017 (r324021) +++ head/sys/arm/allwinner/a10_ehci.c Tue Sep 26 19:21:43 2017 (r324022) @@ -88,11 +88,21 @@ __FBSDID("$FreeBSD$"); static device_attach_t a10_ehci_attach; static device_detach_t a10_ehci_detach; +struct clk_list { + TAILQ_ENTRY(clk_list) next; + clk_t clk; +}; + +struct hwrst_list { + TAILQ_ENTRY(hwrst_list) next; + hwreset_t rst; +}; + struct aw_ehci_softc { ehci_softc_tsc; - clk_t clk; - hwreset_t rst; - phy_t phy; + TAILQ_HEAD(, clk_list) clk_list; + TAILQ_HEAD(, hwrst_list)rst_list; + phy_t phy; }; struct aw_ehci_conf { @@ -114,6 +124,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-ehci", (uintptr_t)_ehci_conf }, { "allwinner,sun8i-a83t-ehci", (uintptr_t)_ehci_conf }, { "allwinner,sun8i-h3-ehci",(uintptr_t)_ehci_conf }, + /* { "allwinner,sun50i-a64-ehci", (uintptr_t)_ehci_conf }, */ { NULL, (uintptr_t)NULL } }; @@ -139,8 +150,11 @@ a10_ehci_attach(device_t self) ehci_softc_t *sc = _sc->sc; const struct aw_ehci_conf *conf; bus_space_handle_t bsh; - int err; - int rid; + int err, rid, off; + struct clk_list *clkp; + clk_t clk; + struct hwrst_list *rstp; + hwreset_t rst; uint32_t reg_value = 0; conf = USB_CONF(self); @@ -204,27 +218,33 @@ a10_ehci_attach(device_t self) sc->sc_flags |= EHCI_SCFLG_DONTRESET; + /* Enable clock for USB */ + TAILQ_INIT(_sc->clk_list); + for (off = 0; clk_get_by_ofw_index(self, 0, off, ) == 0; off++) { + err = clk_enable(clk); + if (err != 0) { + device_printf(self, "Could not enable clock %s\n", + clk_get_name(clk)); + goto error; + } + clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp->clk = clk; + TAILQ_INSERT_TAIL(_sc->clk_list, clkp, next); + } + /* De-assert reset */ - if (hwreset_get_by_ofw_idx(self, 0, 0, _sc->rst) == 0) { - err = hwreset_deassert(aw_sc->rst); + TAILQ_INIT(_sc->rst_list); + for (off = 0; hwreset_get_by_ofw_idx(self, 0, off, ) == 0; off++) { + err = hwreset_deassert(rst); if (err != 0) { device_printf(self, "Could not de-assert reset\n"); goto error; } + rstp = malloc(sizeof(*rstp), M_DEVBUF, M_WAITOK | M_ZERO); + rstp->rst = rst; + TAILQ_INSERT_TAIL(_sc->rst_list, rstp, next); } - /* Enable clock for USB */ - err = clk_get_by_ofw_index(self, 0, 0, _sc->clk); - if (err != 0) { - device_printf(self, "Could not get clock\n"); - goto error; - } - err = clk_enable(aw_sc->clk); - if (err != 0) { - device_printf(self, "Could not enable clock\n"); - goto error; - } - /* Enable USB PHY */ if (phy_get_by_ofw_name(self, 0, "usb", _sc->phy) == 0) { err = phy_enable(self, aw_sc->phy); @@ -272,6 +292,8 @@ a10_ehci_detach(device_t self) const struct aw_ehci_conf *conf; int err; uint32_t reg_value = 0; + struct clk_list *clk, *clk_tmp; + struct hwrst_list *rst, *rst_tmp; conf = USB_CONF(self); @@ -319,16 +341,26 @@ a10_ehci_detach(device_t self) reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); - /* Disable clock for USB */ - if (aw_sc->clk != NULL) { - clk_disable(aw_sc->clk); - clk_release(aw_sc->clk); + /* Disable clock */ + TAILQ_FOREACH_SAFE(clk, _sc->clk_list, next, clk_tmp) { + err = clk_disable(clk->clk); + if (err != 0) + device_printf(self, "Could not disable clock %s\n", + clk_get_name(clk->clk)); + err = clk_release(clk->clk); + if (err != 0) + device_printf(self, "Could not release clock %s\n", + clk_get_name(clk->clk)); +
svn commit: r324021 - head/sys/arm/allwinner
Author: manu Date: Tue Sep 26 19:20:50 2017 New Revision: 324021 URL: https://svnweb.freebsd.org/changeset/base/324021 Log: aw_usbphy: Only reroute OTG for phy0 We only need to route OTG port to host mode on phy0 and if no VBUS is present on the port, otherwise leave the port in periperal mode. Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c == --- head/sys/arm/allwinner/aw_usbphy.c Tue Sep 26 19:19:44 2017 (r324020) +++ head/sys/arm/allwinner/aw_usbphy.c Tue Sep 26 19:20:50 2017 (r324021) @@ -160,13 +160,6 @@ awusbphy_configure(device_t dev, int phyno) if (sc->phy_conf->pmu_unk1 == true) CLR4(sc->pmu[phyno], PMU_UNK_H3, PMU_UNK_H3_CLR); - if (sc->phy_conf->phy0_route == true) { - if (phyno == 0) - SET4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); - else - CLR4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); - } - SET4(sc->pmu[phyno], PMU_IRQ_ENABLE, PMU_ULPI_BYPASS | PMU_AHB_INCR8 | PMU_AHB_INCR4 | PMU_AHB_INCRX_ALIGN); } @@ -266,8 +259,11 @@ awusbphy_vbus_detect(device_t dev, int *val) if (sc->vbus_det_valid) { error = gpio_pin_is_active(sc->vbus_det_pin, ); - if (error != 0) + if (error != 0) { + device_printf(dev, "Cannot get status of id pin %d\n", + error); return (error); + } *val = active; return (0); } @@ -300,7 +296,21 @@ awusbphy_phy_enable(device_t dev, intptr_t phy, bool e /* If an external vbus is detected, do not enable phy 0 */ if (phy == 0) { error = awusbphy_vbus_detect(dev, _det); - if (error == 0 && vbus_det == 1) + if (error) + goto out; + + /* Depending on the PHY we need to route OTG to OHCI/EHCI */ + if (sc->phy_conf->phy0_route == true) { + if (vbus_det == 0) + /* Host mode */ + CLR4(sc->phy_ctrl, OTG_PHY_CFG, +OTG_PHY_ROUTE_OTG); + else + /* Peripheral mode */ + SET4(sc->phy_ctrl, OTG_PHY_CFG, +OTG_PHY_ROUTE_OTG); + } + if (vbus_det == 1) return (0); } else error = 0; @@ -308,6 +318,8 @@ awusbphy_phy_enable(device_t dev, intptr_t phy, bool e error = regulator_enable(reg); } else error = regulator_disable(reg); + +out: if (error != 0) { device_printf(dev, "couldn't %s regulator for phy %jd\n", ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324020 - head/sys/arm/allwinner
Author: manu Date: Tue Sep 26 19:19:44 2017 New Revision: 324020 URL: https://svnweb.freebsd.org/changeset/base/324020 Log: aw_usbphy: Fix write of unknown register Some SoC require a write to a unknown register to work corectly. This write should be in the pmu region not in the phy ctrl one. Reported by: Mark Millard (mar...@dsl-only.net) Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c == --- head/sys/arm/allwinner/aw_usbphy.c Tue Sep 26 17:52:52 2017 (r324019) +++ head/sys/arm/allwinner/aw_usbphy.c Tue Sep 26 19:19:44 2017 (r324020) @@ -158,7 +158,7 @@ awusbphy_configure(device_t dev, int phyno) return; if (sc->phy_conf->pmu_unk1 == true) - CLR4(sc->phy_ctrl, PMU_UNK_H3, PMU_UNK_H3_CLR); + CLR4(sc->pmu[phyno], PMU_UNK_H3, PMU_UNK_H3_CLR); if (sc->phy_conf->phy0_route == true) { if (phyno == 0) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324019 - in head/sys: crypto/via opencrypto
Author: cem Date: Tue Sep 26 17:52:52 2017 New Revision: 324019 URL: https://svnweb.freebsd.org/changeset/base/324019 Log: opencrypto: Use C99 initializers for auth_hash instances A misordering in the Via padlock driver really strongly suggested that these should use C99 named initializers. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/via/padlock_hash.c head/sys/opencrypto/xform_md5.c head/sys/opencrypto/xform_null.c head/sys/opencrypto/xform_rmd160.c head/sys/opencrypto/xform_sha1.c head/sys/opencrypto/xform_sha2.c Modified: head/sys/crypto/via/padlock_hash.c == --- head/sys/crypto/via/padlock_hash.c Tue Sep 26 17:35:53 2017 (r324018) +++ head/sys/crypto/via/padlock_hash.c Tue Sep 26 17:52:52 2017 (r324019) @@ -81,21 +81,27 @@ static void padlock_sha1_final(uint8_t *hash, struct p static void padlock_sha256_final(uint8_t *hash, struct padlock_sha_ctx *ctx); static struct auth_hash padlock_hmac_sha1 = { - CRYPTO_SHA1_HMAC, "HMAC-SHA1", - SHA1_HMAC_BLOCK_LEN, SHA1_HASH_LEN, sizeof(struct padlock_sha_ctx), - SHA1_HMAC_BLOCK_LEN, -(void (*)(void *))padlock_sha_init, NULL, NULL, - (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, - (void (*)(uint8_t *, void *))padlock_sha1_final + .type = CRYPTO_SHA1_HMAC, + .name = "HMAC-SHA1", + .keysize = SHA1_HMAC_BLOCK_LEN, + .hashsize = SHA1_HASH_LEN, + .ctxsize = sizeof(struct padlock_sha_ctx), + .blocksize = SHA1_HMAC_BLOCK_LEN, +.Init = (void (*)(void *))padlock_sha_init, + .Update = (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, + .Final = (void (*)(uint8_t *, void *))padlock_sha1_final, }; static struct auth_hash padlock_hmac_sha256 = { - CRYPTO_SHA2_256_HMAC, "HMAC-SHA2-256", - SHA2_256_HMAC_BLOCK_LEN, SHA2_256_HASH_LEN, - sizeof(struct padlock_sha_ctx), SHA2_256_HMAC_BLOCK_LEN, -(void (*)(void *))padlock_sha_init, NULL, NULL, - (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, - (void (*)(uint8_t *, void *))padlock_sha256_final + .type = CRYPTO_SHA2_256_HMAC, + .name = "HMAC-SHA2-256", + .keysize = SHA2_256_HMAC_BLOCK_LEN, + .hashsize = SHA2_256_HASH_LEN, + .ctxsize = sizeof(struct padlock_sha_ctx), + .blocksize = SHA2_256_HMAC_BLOCK_LEN, +.Init = (void (*)(void *))padlock_sha_init, + .Update = (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, + .Final = (void (*)(uint8_t *, void *))padlock_sha256_final, }; MALLOC_DECLARE(M_PADLOCK); Modified: head/sys/opencrypto/xform_md5.c == --- head/sys/opencrypto/xform_md5.c Tue Sep 26 17:35:53 2017 (r324018) +++ head/sys/opencrypto/xform_md5.c Tue Sep 26 17:52:52 2017 (r324019) @@ -57,17 +57,27 @@ static int MD5Update_int(void *, const u_int8_t *, u_i /* Authentication instances */ struct auth_hash auth_hash_hmac_md5 = { - CRYPTO_MD5_HMAC, "HMAC-MD5", - MD5_HMAC_BLOCK_LEN, MD5_HASH_LEN, sizeof(MD5_CTX), MD5_HMAC_BLOCK_LEN, - (void (*) (void *)) MD5Init, NULL, NULL, MD5Update_int, - (void (*) (u_int8_t *, void *)) MD5Final + .type = CRYPTO_MD5_HMAC, + .name = "HMAC-MD5", + .keysize = MD5_HMAC_BLOCK_LEN, + .hashsize = MD5_HASH_LEN, + .ctxsize = sizeof(MD5_CTX), + .blocksize = MD5_HMAC_BLOCK_LEN, + .Init = (void (*) (void *)) MD5Init, + .Update = MD5Update_int, + .Final = (void (*) (u_int8_t *, void *)) MD5Final, }; struct auth_hash auth_hash_key_md5 = { - CRYPTO_MD5_KPDK, "Keyed MD5", - 0, MD5_KPDK_HASH_LEN, sizeof(MD5_CTX), 0, - (void (*)(void *)) MD5Init, NULL, NULL, MD5Update_int, - (void (*)(u_int8_t *, void *)) MD5Final + .type = CRYPTO_MD5_KPDK, + .name = "Keyed MD5", + .keysize = 0, + .hashsize = MD5_KPDK_HASH_LEN, + .ctxsize = sizeof(MD5_CTX), + .blocksize = 0, + .Init = (void (*)(void *)) MD5Init, + .Update = MD5Update_int, + .Final = (void (*)(u_int8_t *, void *)) MD5Final, }; /* Modified: head/sys/opencrypto/xform_null.c == --- head/sys/opencrypto/xform_null.cTue Sep 26 17:35:53 2017 (r324018) +++ head/sys/opencrypto/xform_null.cTue Sep 26 17:52:52 2017 (r324019) @@ -76,10 +76,18 @@ struct enc_xform enc_xform_null = { }; /* Authentication instances */ -struct auth_hash auth_hash_null = {/* NB: context isn't used */ - CRYPTO_NULL_HMAC, "NULL-HMAC", - 0, NULL_HASH_LEN, sizeof(int), NULL_HMAC_BLOCK_LEN, - null_init, null_reinit, null_reinit, null_update, null_final +struct auth_hash auth_hash_null = { +
svn commit: r324018 - releng/10.4/release/doc/en_US.ISO8859-1/relnotes
Author: gjb Date: Tue Sep 26 17:35:53 2017 New Revision: 324018 URL: https://svnweb.freebsd.org/changeset/base/324018 Log: Note pkg(8) is at version 1.10.1. Prune last remaining empty sections. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/10.4/release/doc/en_US.ISO8859-1/relnotes/article.xml == --- releng/10.4/release/doc/en_US.ISO8859-1/relnotes/article.xmlTue Sep 26 16:18:10 2017(r324017) +++ releng/10.4/release/doc/en_US.ISO8859-1/relnotes/article.xmlTue Sep 26 17:35:53 2017(r324018) @@ -495,13 +495,6 @@ - -Boot Loader Changes - -This section covers the boot loader, boot menu, and other - boot-related changes. - - Networking @@ -550,39 +543,8 @@ Packaging Changes - - - - - -Documentation - -This section covers changes to the Documentation - Project sources and toolchain. - - - Documentation Source Changes - - - - - - Documentation Toolchain Changes - - - - - - -Release Engineering and Integration - -This section convers changes that are specific to the - Release Engineering processes. - - - Integration Changes - - + The utility has been updated to version + 1.10.1. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324017 - in head/sys: crypto/via netipsec opencrypto
Author: cem Date: Tue Sep 26 16:18:10 2017 New Revision: 324017 URL: https://svnweb.freebsd.org/changeset/base/324017 Log: opencrypto: Loosen restriction on HMAC key sizes Theoretically, HMACs do not actually have any limit on key sizes. Transforms should compact input keys larger than the HMAC block size by using the transform (hash) on the input key. (Short input keys are padded out with zeros to the HMAC block size.) Still, not all FreeBSD crypto drivers that provide HMAC functionality handle longer-than-blocksize keys appropriately, so enforce a "maximum" key length in the crypto API for auth_hashes that previously expressed a requirement. (The "maximum" is the size of a single HMAC block for the given transform.) Unconstrained auth_hashes are left as-is. I believe the previous hardcoded sizes were committed in the original import of opencrypto from OpenBSD and are due to specific protocol details of IPSec. Note that none of the previous sizes actually matched the appropriate HMAC block size. The previous hardcoded sizes made the SHA tests in cryptotest.py useless for testing FreeBSD crypto drivers; none of the NIST-KAT example inputs had keys sized to the previous expectations. The following drivers were audited to check that they handled keys up to the block size of the HMAC safely: Software HMAC: * padlock(4) * cesa * glxsb * safe(4) * ubsec(4) Hardware accelerated HMAC: * ccr(4) * hifn(4) * sec(4) (Only supports up to 64 byte keys despite claiming to support SHA2 HMACs, but validates input key sizes) * cryptocteon (MIPS) * nlmsec (MIPS) * rmisec (MIPS) (Amusingly, does not appear to use key material at all -- presumed broken) Reviewed by: jhb (previous version), rlibby (previous version) Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D12437 Modified: head/sys/crypto/via/padlock_hash.c head/sys/netipsec/xform_ah.c head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform_md5.c head/sys/opencrypto/xform_null.c head/sys/opencrypto/xform_rmd160.c head/sys/opencrypto/xform_sha1.c head/sys/opencrypto/xform_sha2.c Modified: head/sys/crypto/via/padlock_hash.c == --- head/sys/crypto/via/padlock_hash.c Tue Sep 26 15:38:16 2017 (r324016) +++ head/sys/crypto/via/padlock_hash.c Tue Sep 26 16:18:10 2017 (r324017) @@ -82,7 +82,8 @@ static void padlock_sha256_final(uint8_t *hash, struct static struct auth_hash padlock_hmac_sha1 = { CRYPTO_SHA1_HMAC, "HMAC-SHA1", - 20, SHA1_HASH_LEN, SHA1_HMAC_BLOCK_LEN, sizeof(struct padlock_sha_ctx), + SHA1_HMAC_BLOCK_LEN, SHA1_HASH_LEN, sizeof(struct padlock_sha_ctx), + SHA1_HMAC_BLOCK_LEN, (void (*)(void *))padlock_sha_init, NULL, NULL, (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, (void (*)(uint8_t *, void *))padlock_sha1_final @@ -90,7 +91,8 @@ static struct auth_hash padlock_hmac_sha1 = { static struct auth_hash padlock_hmac_sha256 = { CRYPTO_SHA2_256_HMAC, "HMAC-SHA2-256", - 32, SHA2_256_HASH_LEN, SHA2_256_HMAC_BLOCK_LEN, sizeof(struct padlock_sha_ctx), + SHA2_256_HMAC_BLOCK_LEN, SHA2_256_HASH_LEN, + sizeof(struct padlock_sha_ctx), SHA2_256_HMAC_BLOCK_LEN, (void (*)(void *))padlock_sha_init, NULL, NULL, (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, (void (*)(uint8_t *, void *))padlock_sha256_final Modified: head/sys/netipsec/xform_ah.c == --- head/sys/netipsec/xform_ah.cTue Sep 26 15:38:16 2017 (r324016) +++ head/sys/netipsec/xform_ah.cTue Sep 26 16:18:10 2017 (r324017) @@ -193,9 +193,9 @@ ah_init0(struct secasvar *sav, struct xformsw *xsp, st return EINVAL; } keylen = _KEYLEN(sav->key_auth); - if (keylen != thash->keysize && thash->keysize != 0) { + if (keylen > thash->keysize && thash->keysize != 0) { DPRINTF(("%s: invalid keylength %d, algorithm %s requires " - "keysize %d\n", __func__, + "keysize less than %d\n", __func__, keylen, thash->name, thash->keysize)); return EINVAL; } Modified: head/sys/opencrypto/cryptodev.c == --- head/sys/opencrypto/cryptodev.c Tue Sep 26 15:38:16 2017 (r324016) +++ head/sys/opencrypto/cryptodev.c Tue Sep 26 16:18:10 2017 (r324017) @@ -520,7 +520,8 @@ cryptof_ioctl( if (thash) { cria.cri_alg = thash->type; cria.cri_klen =
svn commit: r324016 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Tue Sep 26 15:38:16 2017 New Revision: 324016 URL: https://svnweb.freebsd.org/changeset/base/324016 Log: fix r324011, MFV of r323535, 8585 improve batching done in zil_commit() I managed to commit an older version of the change. Plus, even the latest version was not ready for userland compilation. Reported by: "O. Hartmann", cy MFC after:1 week X-MFC with: r324011 Modified: head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/compat/opensolaris/sys/time.h == --- head/sys/cddl/compat/opensolaris/sys/time.h Tue Sep 26 12:46:17 2017 (r324015) +++ head/sys/cddl/compat/opensolaris/sys/time.h Tue Sep 26 15:38:16 2017 (r324016) @@ -40,6 +40,9 @@ #defineMSEC2NSEC(m)((hrtime_t)(m) * (NANOSEC / MILLISEC)) #defineNSEC2MSEC(n)((n) / (NANOSEC / MILLISEC)) +#defineUSEC2NSEC(m)((hrtime_t)(m) * (NANOSEC / MICROSEC)) +#defineNSEC2USEC(n)((n) / (NANOSEC / MICROSEC)) + #defineNSEC2SEC(n) ((n) / (NANOSEC / SEC)) #defineSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC)) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Sep 26 12:46:17 2017(r324015) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Sep 26 15:38:16 2017(r324016) @@ -2283,8 +2283,13 @@ zil_commit_waiter(zilog_t *zilog, zil_commit_waiter_t * zil_process_commit_list() function. */ int pct = MAX(zfs_commit_timeout_pct, 1); +#if defined(illumos) || !defined(_KERNEL) hrtime_t sleep = (zilog->zl_last_lwb_latency * pct) / 100; hrtime_t wakeup = gethrtime() + sleep; +#else + sbintime_t sleep = nstosbt((zilog->zl_last_lwb_latency * pct) / 100); + sbintime_t wakeup = getsbinuptime() + sleep; +#endif boolean_t timedout = B_FALSE; while (!zcw->zcw_done) { @@ -2322,7 +2327,7 @@ zil_commit_waiter(zilog_t *zilog, zil_commit_waiter_t * timeout is reached; responsibility (2) from * the comment above this function. */ -#ifdef illumos +#if defined(illumos) || !defined(_KERNEL) clock_t timeleft = cv_timedwait_hires(>zcw_cv, >zcw_lock, wakeup, USEC2NSEC(1), CALLOUT_FLAG_ABSOLUTE); @@ -2331,8 +2336,7 @@ zil_commit_waiter(zilog_t *zilog, zil_commit_waiter_t continue; #else int wait_err = cv_timedwait_sbt(>zcw_cv, - >zcw_lock, wakeup * SBT_1NS, SBT_1NS, - C_ABSOLUTE); + >zcw_lock, wakeup, SBT_1NS, C_ABSOLUTE); if (wait_err != EWOULDBLOCK || zcw->zcw_done) continue; #endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r324011 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/cddl/contrib/opensolaris/uts
On 26/09/2017 16:48, O. Hartmann wrote: > Build world/kernel on r324015 fails due to: > > [...] > ===> lib/libpam/modules/pam_login_access (obj) > --- cddl/lib__L --- > --- zil.o --- > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c:2333:19: > warning: > implicit declaration of function 'cv_timedwait_sbt' is invalid in C99 > [-Wimplicit-function-declaration] int wait_err = > cv_timedwait_sbt(>zcw_cv, > ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c:2335:8: error: > use of undeclared identifier 'C_ABSOLUTE' C_ABSOLUTE); > ^ > --- lib__L --- > --- obj_subdir_lib/libpam/modules/pam_nologin --- > ===> lib/libpam/modules/pam_nologin (obj) > --- cddl/lib__L --- > 1 warning and 1 error generated. Seems like messed up the commit. Not only I managed to somehow commit an older version of what I had in the review request, but I also forget that zil.c is compiled in userland mode as well. A fix is coming shortly. Apologies for the breakage. -- Andriy Gapon ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r324011 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/cddl/contrib/opensolaris/uts
On Tue, 26 Sep 2017 11:04:08 + (UTC) Andriy Gaponwrote: > Author: avg > Date: Tue Sep 26 11:04:08 2017 > New Revision: 324011 > URL: https://svnweb.freebsd.org/changeset/base/324011 > > Log: > MFV r323535: 8585 improve batching done in zil_commit() > > FreeBSD notes: > - this MFV reverts FreeBSD commit r314549 to make the merge easier > - at present our emulation of cv_timedwait_hires is rather poor, > so I elected to use cv_timedwait_sbt directly > Please see the differential revision for details. > Unfortunately, I did not get any positive reviews, so there could be > bugs in the FreeBSD-specific piece of the merge. > Hence, the long MFC timeout. > > illumos/illumos-gate@1271e4b10dfaaed576c08a812f466f6e81370e5e > > https://github.com/illumos/illumos-gate/commit/1271e4b10dfaaed576c08a812f466f6e81370e5e > > https://www.illumos.org/issues/8585 > The current implementation of zil_commit() can introduce significant > latency, beyond what is inherent due to the latency of the underlying > storage. The additional latency comes from two main problems: > 1. When there's outstanding ZIL blocks being written (i.e. there's > already a "writer thread" in progress), then any new calls to > zil_commit() will block waiting for the currently oustanding ZIL > blocks to complete. The blocks written for each "writer thread" is > coined a "batch", and there can only ever be a single "batch" being > written at a time. When a batch is being written, any new ZIL > transactions will have to wait for the next batch to be written, > which won't occur until the current batch finishes. > As a result, the underlying storage may not be used as efficiently > as possible. While "new" threads enter zil_commit() and are blocked > waiting for the next batch, it's possible that the underlying > storage isn't fully utilized by the current batch of ZIL blocks. In > that case, it'd be better to allow these new threads to generate > (and issue) a new ZIL block, such that it could be serviced by the > underlying storage concurrently with the other ZIL blocks that are > being serviced. > 2. Any call to zil_commit() must wait for all ZIL blocks in its "batch" > to complete, prior to zil_commit() returning. The size of any given > batch is proportional to the number of ZIL transaction in the queue > at the time that the batch starts processing the queue; which > doesn't occur until the previous batch completes. Thus, if there's a > lot of transactions in the queue, the batch could be composed of > many ZIL blocks, and each call to zil_commit() will have to wait for > all of these writes to complete (even if the thread calling > zil_commit() only cared about one of the transactions in the batch). > > Reviewed by: Brad Lewis > Reviewed by: Matt Ahrens > Reviewed by: George Wilson > Approved by: Dan McDonald > Author: Prakash Surya > > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D12355 > > Modified: > head/cddl/contrib/opensolaris/cmd/ztest/ztest.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c > head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h > Directory Properties: > head/cddl/contrib/opensolaris/ (props changed) > head/sys/cddl/contrib/opensolaris/ (props changed) > > Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c > == > --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Sep 26 > 09:34:18 2017 (r324010) +++ > head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Sep 26 11:04:08 > 2017 (r324011) @@ -1825,13 +1825,14 @@ ztest_get_done(zgd_t *zgd, int > error) ztest_object_unlock(zd, object); > if (error == 0 && zgd->zgd_bp) > - zil_add_block(zgd->zgd_zilog, zgd->zgd_bp); > + zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); > > umem_free(zgd, sizeof (*zgd)); > } > > static int > -ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio) > +ztest_get_data(void *arg,
Re: svn commit: r324007 - head/usr.sbin/mountd
On Tue, 26 Sep 2017 22:09:53 +1000 (EST) Bruce Evanswrote: > On Tue, 26 Sep 2017, Emmanuel Vadot wrote: > > > On Tue, 26 Sep 2017 13:24:57 +0300 > > Konstantin Belousov wrote: > > > >> On Tue, Sep 26, 2017 at 09:18:18AM +, Emmanuel Vadot wrote: > >>> @@ -1940,14 +1936,16 @@ add_expdir(struct dirlist **dpp, char *cp, int > >>> len) > >>> { > >>> struct dirlist *dp; > >>> > >>> - dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len); > >>> + dp = (struct dirlist *)malloc(sizeof (struct dirlist)); > >> You might remove the unneeded cast as well. > > > > Right, done in 324012. Hi Bruce, > Er, mountd has many similar casts, not just the one fixed, and worse ones > like casting dp to caddr_t before passing it to free() (caddr_t is bogus, > and free() doesn't actually take it -- its prototype converts caddr_t to > void *, just like it would convert dp's type to void *)). Some of these > casts were needed in 1987 for unprototyped pre-StandardC code. caddr_t > was more needed in 1977 before void * existed (free() takes a char * arg > in K). I've fixed this one in 324014 and will probably apply style(9) to the whole file at some point. > But the main hug near here is leaking memory for strdup()). The above > malloc() allocates 2 storage areas together (1 for the string at the > end), and seems to have a corresponding free(). Now there is an extra > separate storage error for the string and no separate free() for it. Yes, sorry for that, this is fixed in 324014 too. > This is not much more than a style bug too. mountd is a long-lived > daemon, so it should avoid leaking memory, but it would probably work > OK for a few thousand mounts with no free()s at all or a few million > with no frees of strings. But it tries to free() most things, so it > is a style bug to not try for some. > > Bruce Thanks, -- Emmanuel Vadot ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324014 - head/usr.sbin/mountd
Author: manu Date: Tue Sep 26 12:15:13 2017 New Revision: 324014 URL: https://svnweb.freebsd.org/changeset/base/324014 Log: mountd: Avoid memory leak by freeing dp_dirp Introduced in r324007, the data alloced by strdup was never free'ed. While here, remove cast to caddr_t when freeing dp. Reported by: bde MFC after:1 week X MFC With: r324007 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c == --- head/usr.sbin/mountd/mountd.c Tue Sep 26 11:16:33 2017 (r324013) +++ head/usr.sbin/mountd/mountd.c Tue Sep 26 12:15:13 2017 (r324014) @@ -2159,7 +2159,8 @@ free_dir(struct dirlist *dp) free_dir(dp->dp_left); free_dir(dp->dp_right); free_host(dp->dp_hosts); - free((caddr_t)dp); + free(dp->dp_dirp); + free(dp); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r324007 - head/usr.sbin/mountd
On Tue, 26 Sep 2017, Emmanuel Vadot wrote: On Tue, 26 Sep 2017 13:24:57 +0300 Konstantin Belousovwrote: On Tue, Sep 26, 2017 at 09:18:18AM +, Emmanuel Vadot wrote: @@ -1940,14 +1936,16 @@ add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; - dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len); + dp = (struct dirlist *)malloc(sizeof (struct dirlist)); You might remove the unneeded cast as well. Right, done in 324012. Er, mountd has many similar casts, not just the one fixed, and worse ones like casting dp to caddr_t before passing it to free() (caddr_t is bogus, and free() doesn't actually take it -- its prototype converts caddr_t to void *, just like it would convert dp's type to void *)). Some of these casts were needed in 1987 for unprototyped pre-StandardC code. caddr_t was more needed in 1977 before void * existed (free() takes a char * arg in K). But the main hug near here is leaking memory for strdup()). The above malloc() allocates 2 storage areas together (1 for the string at the end), and seems to have a corresponding free(). Now there is an extra separate storage error for the string and no separate free() for it. This is not much more than a style bug too. mountd is a long-lived daemon, so it should avoid leaking memory, but it would probably work OK for a few thousand mounts with no free()s at all or a few million with no frees of strings. But it tries to free() most things, so it is a style bug to not try for some. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324013 - head/usr.bin/calendar
Author: bapt Date: Tue Sep 26 11:16:33 2017 New Revision: 324013 URL: https://svnweb.freebsd.org/changeset/base/324013 Log: calendar: replace strcpy/strcat with asprintf Modified: head/usr.bin/calendar/events.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Tue Sep 26 11:11:17 2017 (r324012) +++ head/usr.bin/calendar/events.c Tue Sep 26 11:16:33 2017 (r324013) @@ -86,12 +86,9 @@ event_continue(struct event *e, char *txt) errx(1, "event_continue: cannot allocate memory"); free(e->text); - e->text = (char *)malloc(strlen(text) + strlen(txt) + 3); + asprintf(>text, "%s\n%s", text, txt); if (e->text == NULL) errx(1, "event_continue: cannot allocate memory"); - strcpy(e->text, text); - strcat(e->text, "\n"); - strcat(e->text, txt); free(text); return; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r324007 - head/usr.sbin/mountd
On Tue, 26 Sep 2017 13:24:57 +0300 Konstantin Belousovwrote: > On Tue, Sep 26, 2017 at 09:18:18AM +, Emmanuel Vadot wrote: > > @@ -1940,14 +1936,16 @@ add_expdir(struct dirlist **dpp, char *cp, int len) > > { > > struct dirlist *dp; > > > > - dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len); > > + dp = (struct dirlist *)malloc(sizeof (struct dirlist)); > You might remove the unneeded cast as well. Right, done in 324012. Thanks, -- Emmanuel Vadot ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324012 - head/usr.sbin/mountd
Author: manu Date: Tue Sep 26 11:11:17 2017 New Revision: 324012 URL: https://svnweb.freebsd.org/changeset/base/324012 Log: mountd: Remove unneeded cast Reported by: kib MFC after:1 week X MFC With: r324007 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c == --- head/usr.sbin/mountd/mountd.c Tue Sep 26 11:04:08 2017 (r324011) +++ head/usr.sbin/mountd/mountd.c Tue Sep 26 11:11:17 2017 (r324012) @@ -1936,7 +1936,7 @@ add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; - dp = (struct dirlist *)malloc(sizeof (struct dirlist)); + dp = malloc(sizeof (struct dirlist)); if (dp == (struct dirlist *)NULL) out_of_mem(); dp->dp_left = *dpp; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324011 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/cddl/contrib/opensolaris/uts/...
Author: avg Date: Tue Sep 26 11:04:08 2017 New Revision: 324011 URL: https://svnweb.freebsd.org/changeset/base/324011 Log: MFV r323535: 8585 improve batching done in zil_commit() FreeBSD notes: - this MFV reverts FreeBSD commit r314549 to make the merge easier - at present our emulation of cv_timedwait_hires is rather poor, so I elected to use cv_timedwait_sbt directly Please see the differential revision for details. Unfortunately, I did not get any positive reviews, so there could be bugs in the FreeBSD-specific piece of the merge. Hence, the long MFC timeout. illumos/illumos-gate@1271e4b10dfaaed576c08a812f466f6e81370e5e https://github.com/illumos/illumos-gate/commit/1271e4b10dfaaed576c08a812f466f6e81370e5e https://www.illumos.org/issues/8585 The current implementation of zil_commit() can introduce significant latency, beyond what is inherent due to the latency of the underlying storage. The additional latency comes from two main problems: 1. When there's outstanding ZIL blocks being written (i.e. there's already a "writer thread" in progress), then any new calls to zil_commit() will block waiting for the currently oustanding ZIL blocks to complete. The blocks written for each "writer thread" is coined a "batch", and there can only ever be a single "batch" being written at a time. When a batch is being written, any new ZIL transactions will have to wait for the next batch to be written, which won't occur until the current batch finishes. As a result, the underlying storage may not be used as efficiently as possible. While "new" threads enter zil_commit() and are blocked waiting for the next batch, it's possible that the underlying storage isn't fully utilized by the current batch of ZIL blocks. In that case, it'd be better to allow these new threads to generate (and issue) a new ZIL block, such that it could be serviced by the underlying storage concurrently with the other ZIL blocks that are being serviced. 2. Any call to zil_commit() must wait for all ZIL blocks in its "batch" to complete, prior to zil_commit() returning. The size of any given batch is proportional to the number of ZIL transaction in the queue at the time that the batch starts processing the queue; which doesn't occur until the previous batch completes. Thus, if there's a lot of transactions in the queue, the batch could be composed of many ZIL blocks, and each call to zil_commit() will have to wait for all of these writes to complete (even if the thread calling zil_commit() only cared about one of the transactions in the batch). Reviewed by: Brad LewisReviewed by: Matt Ahrens Reviewed by: George Wilson Approved by: Dan McDonald Author: Prakash Surya MFC after:1 month Differential Revision:https://reviews.freebsd.org/D12355 Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c == --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Sep 26 09:34:18 2017(r324010) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Sep 26 11:04:08 2017(r324011) @@ -1825,13 +1825,14 @@ ztest_get_done(zgd_t *zgd, int error) ztest_object_unlock(zd, object); if (error == 0 && zgd->zgd_bp) - zil_add_block(zgd->zgd_zilog, zgd->zgd_bp); + zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp); umem_free(zgd, sizeof (*zgd)); } static int -ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio) +ztest_get_data(void *arg, lr_write_t *lr, char *buf, struct lwb *lwb, +zio_t *zio) { ztest_ds_t *zd = arg; objset_t *os = zd->zd_os; @@ -1845,6 +1846,10 @@ ztest_get_data(void *arg, lr_write_t *lr, char *buf, z zgd_t *zgd;
Re: svn commit: r324007 - head/usr.sbin/mountd
On Tue, Sep 26, 2017 at 09:18:18AM +, Emmanuel Vadot wrote: > @@ -1940,14 +1936,16 @@ add_expdir(struct dirlist **dpp, char *cp, int len) > { > struct dirlist *dp; > > - dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len); > + dp = (struct dirlist *)malloc(sizeof (struct dirlist)); You might remove the unneeded cast as well. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324010 - in stable/11: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/com...
Author: avg Date: Tue Sep 26 09:34:18 2017 New Revision: 324010 URL: https://svnweb.freebsd.org/changeset/base/324010 Log: MFC r323355: MFV r323107: 8414 Implemented zpool scrub pause/resume illumos/illumos-gate@1702cce751c5cb7ead878d0205a6c90b027e3de8 https://github.com/illumos/illumos-gate/commit/1702cce751c5cb7ead878d0205a6c90b027e3de8 FreeBSD note: rather than merging the zpool.8 update I copied the zpool scrub section from the illumos zpool.1m to FreeBSD zpool.8 almost verbatim. Now that the illumos page uses the mdoc format, it was an easier option. Perhaps the change is not in perfect compliance with the FreeBSD style, but I think that it is acceptible. https://www.illumos.org/issues/8414 This issue tracks the port of scrub pause from ZoL: https://github.com/zfsonlinux/zfs/pull/6167 Currently, there is no way to pause a scrub. Pausing may be useful when the pool is busy with other I/O to preserve bandwidth. Description This patch adds the ability to pause and resume scrubbing. This is achieved by maintaining a persistent on-disk scrub state. While the state is 'paused' we do not scrub any more blocks. We do however perform regular scan housekeeping such as freeing async destroyed and deadlist blocks while paused. Motivation and Context Scrub pausing can be an I/O intensive operation and people have been asking for the ability to pause a scrub for a while. This allows one to preserve scrub progress while freeing up bandwidth for other I/O. Reviewed by: George MelikovReviewed by: Brian Behlendorf Reviewed by: Brad Lewis Reviewed by: Serapheim Dimitropoulos Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Alek Pinchuk Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 == --- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8Tue Sep 26 09:32:29 2017(r324009) +++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8Tue Sep 26 09:34:18 2017(r324010) @@ -19,14 +19,15 @@ .\" information: Portions Copyright [] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs -.\" Copyright (c) 2013 by Delphix. All Rights Reserved. .\" Copyright (c) 2012, Glen Barber +.\" Copyright (c) 2013 by Delphix. All Rights Reserved. +.\" Copyright 2017 Nexenta Systems, Inc. +.\" Copyright (c) 2017 Datto Inc. .\" .\" $FreeBSD$ .\" -.Dd July 26, 2014 +.Dd September 08, 2017 .Dt ZPOOL 8 .Os .Sh NAME @@ -153,7 +154,7 @@ .Op Ar new_device .Nm .Cm scrub -.Op Fl s +.Op Fl s | Fl p .Ar pool ... .Nm .Cm set @@ -1543,42 +1544,53 @@ manner. .It Xo .Nm .Cm scrub -.Op Fl s +.Op Fl s | Fl p .Ar pool ... .Xc .Pp -Begins a scrub. The scrub examines all data in the specified pools to verify -that it checksums correctly. For replicated (mirror or -.No raidz ) -devices, -.Tn ZFS -automatically repairs any damage discovered during the scrub. The -.Qq Nm Cm status +Begins a scrub or resumes a paused scrub. +The scrub examines all data in the specified pools to verify that it checksums +correctly. +For replicated +.Pq mirror or raidz +devices, ZFS automatically repairs any damage discovered during the scrub. +The +.Nm zpool Cm status command reports the progress of the scrub and summarizes the results of the scrub upon completion. .Pp -Scrubbing and resilvering are very similar operations. The difference is that -resilvering only examines data that -.Tn ZFS -knows to be out of date (for example, when attaching a new device to a mirror -or replacing an
svn commit: r324009 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Tue Sep 26 09:32:29 2017 New Revision: 324009 URL: https://svnweb.freebsd.org/changeset/base/324009 Log: MFC r323480: zfs_get_vfs: reference a requested filesystem instead of vfs_busy-ing it Sponsored by: Panzura Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 26 09:31:17 2017(r324008) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 26 09:32:29 2017(r324009) @@ -3040,13 +3040,11 @@ zfs_get_vfs(const char *resource) mtx_lock(_mtx); TAILQ_FOREACH(vfsp, , mnt_list) { if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) { - if (vfs_busy(vfsp, MBF_MNTLSTLOCK) != 0) - vfsp = NULL; + vfs_ref(vfsp); break; } } - if (vfsp == NULL) - mtx_unlock(_mtx); + mtx_unlock(_mtx); return (vfsp); } @@ -3533,7 +3531,9 @@ zfs_unmount_snap(const char *snapname) { vfs_t *vfsp; zfsvfs_t *zfsvfs; +#ifdef illumos int err; +#endif if (strchr(snapname, '@') == NULL) return (0); @@ -3545,23 +3545,19 @@ zfs_unmount_snap(const char *snapname) zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); - err = vn_vfswlock(vfsp->vfs_vnodecovered); #ifdef illumos + err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); -#else - vfs_unbusy(vfsp); -#endif if (err != 0) return (SET_ERROR(err)); +#endif /* * Always force the unmount for snapshots. */ - #ifdef illumos (void) dounmount(vfsp, MS_FORCE, kcred); #else - vfs_ref(vfsp); (void) dounmount(vfsp, MS_FORCE, curthread); #endif return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324008 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Tue Sep 26 09:31:17 2017 New Revision: 324008 URL: https://svnweb.freebsd.org/changeset/base/324008 Log: MFC r323480: zfs_get_vfs: reference a requested filesystem instead of vfs_busy-ing it Sponsored by: Panzura Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 26 09:18:18 2017(r324007) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Sep 26 09:31:17 2017(r324008) @@ -3041,13 +3041,11 @@ zfs_get_vfs(const char *resource) mtx_lock(_mtx); TAILQ_FOREACH(vfsp, , mnt_list) { if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) { - if (vfs_busy(vfsp, MBF_MNTLSTLOCK) != 0) - vfsp = NULL; + vfs_ref(vfsp); break; } } - if (vfsp == NULL) - mtx_unlock(_mtx); + mtx_unlock(_mtx); return (vfsp); } @@ -3537,7 +3535,9 @@ zfs_unmount_snap(const char *snapname) { vfs_t *vfsp; zfsvfs_t *zfsvfs; +#ifdef illumos int err; +#endif if (strchr(snapname, '@') == NULL) return (0); @@ -3549,23 +3549,19 @@ zfs_unmount_snap(const char *snapname) zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); - err = vn_vfswlock(vfsp->vfs_vnodecovered); #ifdef illumos + err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); -#else - vfs_unbusy(vfsp); -#endif if (err != 0) return (SET_ERROR(err)); +#endif /* * Always force the unmount for snapshots. */ - #ifdef illumos (void) dounmount(vfsp, MS_FORCE, kcred); #else - vfs_ref(vfsp); (void) dounmount(vfsp, MS_FORCE, curthread); #endif return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r323873 - head/sys/netgraph
On 26.09.2017 03:59, Gleb Smirnoff wrote: > On Thu, Sep 21, 2017 at 08:16:11PM +, Eugene Grosbein wrote: > E> Author: eugen (ports committer) > E> Date: Thu Sep 21 20:16:10 2017 > E> New Revision: 323873 > E> URL: https://svnweb.freebsd.org/changeset/base/323873 > E> > E> Log: > E> Unprotected modification of ng_iface(4) private data leads to kernel > panic. > E> Fix a race with per-node read-mostly lock and refcounting for a hook. > > The patch is far from ideal. Netgraph already has internal locking, > which guarantess write semantics for "disconnect" and "newhook" > scenarios. As well as read semantics for "rcvdata". > > Since ng_iface is a gate node, that gates data between netgraph and the > big network stack, it of course needs extra locking in the interface > output method. But better piggyback on the netgraph locking, rather than > add your own, IMHO. I'm afraid you have not read the change well enough. It does utilizes generic netgraph locking like NG_HOOK_REF(hook) for entities visible to base netgraph code. And it uses own locking only to protect private ng_iface structures from parallel modifications with another kernel thread runnning same ng_iface code. It uses lightweight rmlock there as that is network hot path and anyway, other netgraph code has nothing to do with node's private data. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324007 - head/usr.sbin/mountd
Author: manu Date: Tue Sep 26 09:18:18 2017 New Revision: 324007 URL: https://svnweb.freebsd.org/changeset/base/324007 Log: mountd: Replace malloc+strcpy to strdup Reviewed by: bapt MFC after:1 week Sponsored by: Gandi.net Differential Revision:https://reviews.freebsd.org/D12503 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c == --- head/usr.sbin/mountd/mountd.c Tue Sep 26 09:01:56 2017 (r324006) +++ head/usr.sbin/mountd/mountd.c Tue Sep 26 09:18:18 2017 (r324007) @@ -101,7 +101,7 @@ struct dirlist { struct dirlist *dp_right; int dp_flag; struct hostlist *dp_hosts; /* List of hosts this dir exported to */ - chardp_dirp[1]; /* Actually malloc'd to size of dir */ + char*dp_dirp; }; /* dp_flag bits */ #defineDP_DEFSET 0x1 @@ -1525,12 +1525,8 @@ get_exportlist_one(void) if (ep == (struct exportlist *)NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; - ep->ex_fsdir = (char *)malloc - (strlen(fsb.f_mntonname) + 1); - if (ep->ex_fsdir) - strcpy(ep->ex_fsdir, - fsb.f_mntonname); - else + ep->ex_fsdir = strdup(fsb.f_mntonname); + if (ep->ex_fsdir == NULL) out_of_mem(); if (debug) warnx( @@ -1940,14 +1936,16 @@ add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; - dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len); + dp = (struct dirlist *)malloc(sizeof (struct dirlist)); if (dp == (struct dirlist *)NULL) out_of_mem(); dp->dp_left = *dpp; dp->dp_right = (struct dirlist *)NULL; dp->dp_flag = 0; dp->dp_hosts = (struct hostlist *)NULL; - strcpy(dp->dp_dirp, cp); + dp->dp_dirp = strndup(cp, len); + if (dp->dp_dirp == NULL) + out_of_mem(); *dpp = dp; return (dp->dp_dirp); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324006 - in stable/11: lib/msun lib/msun/amd64 lib/msun/i387 lib/msun/ld80 lib/msun/man lib/msun/src lib/msun/tests sys/sys
Author: dim Date: Tue Sep 26 09:01:56 2017 New Revision: 324006 URL: https://svnweb.freebsd.org/changeset/base/324006 Log: Synchronize most of libm with head as of r323004. This excludes a few arch-specific updates for powerpcspe, mips and riscv, for which support has not been merged yet. Bump __FreeBSD_version for the addition of cacoshl, cacosl, casinhl, casinl, catanl, catanhl, sincos, sincosf, and sincosl. MFC r305382 (by bde): Add asm versions of fmod(), fmodf() and fmodl() on amd64. Add asm versions of fmodf() amd fmodl() on i387. fmod is similar to remainder, and the C versions are 3 to 9 times slower than the asm versions on x86 for both, but we had the strange mixture of all 6 variants of remainder in asm and only 1 of 6 variants of fmod in asm. MFC r305384 (by bde): Disconnect the "optimized" asm variants of cos(), sin() and tan() from the build on i386. Leave them in the source tree for regression tests. The asm functions were always much less accurate (by a factor of more than 10**18 in the worst case). They were faster on old CPUs. But with each new generation of CPUs they get relatively slower. The double precision C version's average advantage is about a factor of 2 on Haswell. The asm functions were already intentionally avoided in float and long double precision on i386 and in all precisions on amd64. Float precision and amd64 give larger advantages to the C version. The long double precision C code and compilers' understanding of long double precision are not so good, so the i387 is still slightly faster for long double precision, except for the unimportant subcase of huge args where the sub-optimal C code now somehow beats the i387 by about a factor of 2. MFC r305385 (by bde): Oops, the previous i386 version of e_fmodf.S and e_fmodl.S was actually the amd64 version. MFC r306409 (by emaste): libm: fix some unused variable (rcsid) and dangling else warnings s_{fabs,fmax,logb,scalb}{,f,l}.c may be built elsewhere with a higher WARNS setting. Reviewed by:ed Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8061 MFC r306410 (by emaste): libm: simplify i387 subdir logic with make's :S substitution MFC r306527 (by emaste): libm: remove unused variables for LDBL_MANT_DIG != 113 Sponsored by: The FreeBSD Foundation MFC r306709 (by emaste): libm: remove unused variables Sponsored by: The FreeBSD Foundation MFC r307066 (by br): Don't use fmaxl/fminl on platforms with no long double support, use fmax/fmin instead. This fixes fmaxmin test failure on MIPS64. Reviewed by:emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8216 MFC r308172 (by emaste): libm: add braces around initialization of subobjects This cleans up a warning when building libm at higher WARNS levels and makes the intent more clear. By the C standard the values are assigned to subobject members in order so this change introduces no functional change. (6.7.9 20) Reviewed by:kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8333 MFC r313761 (by mmokhi): Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun to improve C11 conformance. PR: 216850 216851 216852 216856 216857 216858 Submitted by: mmokhi Reported by:s...@troutmask.apl.washington.edu Reviewed by:bde, mat, theraven Approved by:bde (src committer), mat (mentor) Differential Revision: https://reviews.freebsd.org/D9491 MFC r313863 (by mmokhi): Fix building of r313761 on platforms that `long double` is alias of `double` (MIPS, etc) PR: 216850 216851 216852 216856 216857 216858 Reported by:emsate Reviewed by:bde emaste hselasky Approved by:bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491 MFC r313864 (by mmokhi): Add documentations related to new APIs of r313761 PR: 216850 216851 216852 216856 216857 216858 Submitted by: s...@troutmask.apl.washington.edu Reported by:s...@troutmask.apl.washington.edu Reviewed by:bde emaste hselasky Approved by:bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491 MFC r314950 (by ngie): Don't expect :test_large_inputs to fail with i386 anymore Recent changes (maybe a side-effect of the ATF-ification in r314649) invalidate the failure expectation. PR: 205446 Sponsored by:
svn commit: r324005 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Author: avg Date: Tue Sep 26 08:45:11 2017 New Revision: 324005 URL: https://svnweb.freebsd.org/changeset/base/324005 Log: MFC r323479,r323491: zfs: tighten debug versions of ZTOV and VTOZ Sponsored by: Panzura Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h == --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 26 08:43:43 2017(r324004) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 26 08:45:11 2017(r324005) @@ -227,7 +227,7 @@ ZTOV(znode_t *zp) { vnode_t *vp = zp->z_vnode; - ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp); + ASSERT(vp != NULL && vp->v_data == zp); return (vp); } static __inline znode_t * @@ -235,7 +235,7 @@ VTOZ(vnode_t *vp) { znode_t *zp = (znode_t *)vp->v_data; - ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp); + ASSERT(zp != NULL && zp->z_vnode == vp); return (zp); } #else Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c == --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Tue Sep 26 08:43:43 2017(r324004) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Tue Sep 26 08:45:11 2017(r324005) @@ -1612,7 +1612,10 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va boolean_t need_chmod = B_TRUE; boolean_t inherited = B_FALSE; - ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); + if ((flag & IS_ROOT_NODE) == 0) + ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); + else + ASSERT(dzp->z_vnode == NULL); bzero(acl_ids, sizeof (zfs_acl_ids_t)); acl_ids->z_mode = MAKEIMODE(vap->va_type, vap->va_mode); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c == --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 26 08:43:43 2017(r324004) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 26 08:45:11 2017(r324005) @@ -143,8 +143,7 @@ zfs_znode_cache_destructor(void *buf, void *arg) znode_t *zp = buf; ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - ASSERT(ZTOV(zp) == NULL); - vn_free(ZTOV(zp)); + ASSERT3P(zp->z_vnode, ==, NULL); ASSERT(!list_link_active(>z_link_node)); mutex_destroy(>z_acl_lock); avl_destroy(>z_range_avl); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r324004 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Author: avg Date: Tue Sep 26 08:43:43 2017 New Revision: 324004 URL: https://svnweb.freebsd.org/changeset/base/324004 Log: MFC r323479,r323491: zfs: tighten debug versions of ZTOV and VTOZ Sponsored by: Panzura Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h == --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 26 05:47:33 2017(r324003) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Sep 26 08:43:43 2017(r324004) @@ -227,7 +227,7 @@ ZTOV(znode_t *zp) { vnode_t *vp = zp->z_vnode; - ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp); + ASSERT(vp != NULL && vp->v_data == zp); return (vp); } static __inline znode_t * @@ -235,7 +235,7 @@ VTOZ(vnode_t *vp) { znode_t *zp = (znode_t *)vp->v_data; - ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp); + ASSERT(zp != NULL && zp->z_vnode == vp); return (zp); } #else Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c == --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Tue Sep 26 05:47:33 2017(r324003) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Tue Sep 26 08:43:43 2017(r324004) @@ -1602,7 +1602,10 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va boolean_t trim = B_FALSE; boolean_t inherited = B_FALSE; - ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); + if ((flag & IS_ROOT_NODE) == 0) + ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); + else + ASSERT(dzp->z_vnode == NULL); bzero(acl_ids, sizeof (zfs_acl_ids_t)); acl_ids->z_mode = MAKEIMODE(vap->va_type, vap->va_mode); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c == --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 26 05:47:33 2017(r324003) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Sep 26 08:43:43 2017(r324004) @@ -143,8 +143,7 @@ zfs_znode_cache_destructor(void *buf, void *arg) znode_t *zp = buf; ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - ASSERT(ZTOV(zp) == NULL); - vn_free(ZTOV(zp)); + ASSERT3P(zp->z_vnode, ==, NULL); ASSERT(!list_link_active(>z_link_node)); mutex_destroy(>z_acl_lock); avl_destroy(>z_range_avl); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"